I saw ESRCH problems on one of our applications, which unfortunately
leads to aborts() from within libmicrohttpd under certain circumstances.

Looking at your sample code, I guess that its main problem is the way
you're receiving the thread return value off pthread_join(). Look
carefully at it, you're getting a void * assigned to an integer
(submitted through the void ** supplied to pthread_join())! So that int
shall hold all of a pointer, which formally won't work, and may or may
not work, depending on whether or not you're on a 32 bit architecture.
You are, however, on a amd64 host, so the program isn't correct here.
-f{no-,}stack-protector may change the stack layout, that's why you're
seeing differences in testcase execution.

That said, on success, your index variable (i) is overwritten by the
NULL pointer received from the thread function on success. That's why
you always start with i=0 after a successful pthread_join().

That, unfortunately, invalidates the test case, and I need to continue
to find the root cause of my very own problem. ;-)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1427981

Title:
  pthread_join failure

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1427981/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to