DragonFly BSD
DragonFly commits List (threaded) for 2013-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: DragonFly_RELEASE_3_2 libc/libthread_xu - Fix segfault caused by libpthread used before initialised


From: Markus Pfeiffer <profmakx@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Mar 2013 15:38:08 -0700 (PDT)

commit 9a7e25f245db99eb681cc9ef06d4a724953758ac
Author: Markus Pfeiffer <markus.pfeiffer@morphism.de>
Date:   Mon Mar 18 21:46:24 2013 +0000

    libc/libthread_xu - Fix segfault caused by libpthread used before initialised
    
    If a binary has libpthread as dependency and is linked against libintl,
    or any other library that uses pthread locking primitives from libc
    without depending on libpthread itself it can happen that functions
    from libpthread are called before libpthread's constructor has been
    called. This leads to a segfault.
    
    This fix adds a weak symbold to libc, namely _pthread_init_early,
    which is called from a libc constructor function and therefore makes
    sure that libpthread is initialised early enough.
    
    Thanks to Simon Schubert, Angelos Oikonomopoulos, and Sascha Wildner
    for the support in debugging this.

Summary of changes:
 lib/libc/gen/_pthread_stubs.c      | 17 +++++++++++++++++
 lib/libthread_xu/thread/thr_init.c | 15 +++++++++++++++
 2 files changed, 32 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9a7e25f245db99eb681cc9ef06d4a724953758ac


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]