aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorVladimir Nikulichev <v.nikulichev@gmail.com>2013-06-24 17:08:07 -0400
committerCarlos O'Donell <carlos@redhat.com>2013-06-24 17:12:30 -0400
commite1f0b2cfa14b058ab033431b70428ccda8ec6ed0 (patch)
tree080ccd4c1667d7114090db2a747ae7de0cefdbb0 /nptl
parent2f063a6e843c788a05667e6d362d229b3b671920 (diff)
downloadglibc-e1f0b2cfa14b058ab033431b70428ccda8ec6ed0.zip
glibc-e1f0b2cfa14b058ab033431b70428ccda8ec6ed0.tar.gz
glibc-e1f0b2cfa14b058ab033431b70428ccda8ec6ed0.tar.bz2
BZ #12310: pthread_exit in static app. segfaults
Static applications that call pthread_exit on the main thread segfault. This is because after a thread terminates __libc_start_main decrements __nptl_nthreads which is only defined in pthread_create. Therefore the right solution is to add a requirement to pthread_create from pthread_exit. ~~~ nptl/ 2013-06-24 Vladimir Nikulichev <v.nikulichev@gmail.com> [BZ #12310] * pthread_exit.c: Add reference to pthread_create.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/pthread_exit.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 875bdbd..7c03548 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-24 Vladimir Nikulichev <v.nikulichev@gmail.com>
+
+ [BZ #12310]
+ * pthread_exit.c: Add reference to pthread_create.
+
2013-06-22 Joseph Myers <joseph@codesourcery.com>
* pthread_getattr_default_np.c: Include <string.h>.
diff --git a/nptl/pthread_exit.c b/nptl/pthread_exit.c
index 3718081..263e792 100644
--- a/nptl/pthread_exit.c
+++ b/nptl/pthread_exit.c
@@ -29,3 +29,7 @@ __pthread_exit (value)
__do_cancel ();
}
strong_alias (__pthread_exit, pthread_exit)
+
+/* After a thread terminates, __libc_start_main decrements
+ __nptl_nthreads defined in pthread_create.c. */
+PTHREAD_STATIC_FN_REQUIRE (pthread_create)