Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.12.1] A crash occurs when the protocol stack is destroyed. #325

Open
susuyu opened this issue Apr 29, 2021 · 3 comments
Open

[1.12.1] A crash occurs when the protocol stack is destroyed. #325

susuyu opened this issue Apr 29, 2021 · 3 comments

Comments

@susuyu
Copy link

susuyu commented Apr 29, 2021

When the UPNP protocol is started and the HTTP get request from the control point is received and processed, if the protocol stack is destroyed and resources are destroyed for example in web_server_destroy, the thread that processes the HTTP get instruction crashes when the gWebMutex is used.

@mrjimenez
Copy link
Collaborator

Hi,

Could you please post a running code example of the problem, so that we can objectively deal with it?

Regards,
Marcelo.

@susuyu
Copy link
Author

susuyu commented Apr 30, 2021

This problem occurs occasionally. When a crash occurs, the stack is as follows:
backtrace:

      #00 pc 00054502  bionic/libc.so (abort+166)
      #01 pc 0009d783  bionic/libc.so (__fortify_fatal(char const*, ...)+26)
      #02 pc 0009cf8d  bionic/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+20)
      #03 pc 0009ce79  bionic/libc.so (pthread_mutex_lock+132)
      #04 pc 0001db21  libupnp.so (web_server_callback+2872)

The corresponding functions are web_server_callback() and UpnpFinish().
The location of crash is line 408 of alias_release, the crash code location is as follows:

static void alias_release(
	/*! [in] XML alias object. */
	struct xml_alias_t *alias)
{
	ithread_mutex_lock(&gWebMutex);  ---> crash
	/* ignore invalid alias */
	if (!is_valid_alias(alias)) {
		ithread_mutex_unlock(&gWebMutex);
		return;
	}

@mrjimenez
Copy link
Collaborator

There is not much I can imagine here that could be going wrong like this. The crash suggests that the web mutex is corrupted.

  • Bionic is Ubuntu, right? Is it possible for you to link to 1.14.7 or at least to some 1.14.x release and enable debug symbols?
  • What is the application that is using libupnp?
  • If that is something you have written, is it possible to give us a minimal example that reproduces the crash?

Regards,
Marcelo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants