This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/19703] Do not run malloc/libio fork handlers in a signal handler


https://sourceware.org/bugzilla/show_bug.cgi?id=19703

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Created attachment 9252
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9252&action=edit
tst-mallocfork2.c

This is a variant of the existing tst-mallocfork test case which shows that the
current and previous fork handlers for malloc are not thread safe.  In my
tests, the process self-deadlocks fairly soon.  On an old glibc (Red Hat
Enterprise Linux 7.2 which does not have the recent changes in this area), the
backtrace looks like this:

#0  0x00007f3995ed1c4c in __lll_lock_wait_private () from /lib64/libc.so.6
#1  0x00007f3995e4ffed in _L_lock_59 () from /lib64/libc.so.6
#2  0x00007f3995e4869c in ptmalloc_lock_all () from /lib64/libc.so.6
#3  0x00007f3995e8b522 in fork () from /lib64/libc.so.6
#4  0x0000000000400e78 in sigusr1_handler (signo=<optimized out>) at
tst-mallocfork2.c:69
#5  <signal handler called>
#6  0x00007f3995e4c705 in _int_malloc () from /lib64/libc.so.6
#7  0x00007f3995e4d8dc in malloc () from /lib64/libc.so.6
#8  0x0000000000400bf6 in main () at tst-mallocfork2.c:163

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]