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 libc/4737] fork is not async-signal-safe


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

andysem at mail dot ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andysem at mail dot ru

--- Comment #25 from andysem at mail dot ru ---
I think I've been hit by this problem as well: the program deadlocks if fork()
is called from a signal handler, which is invoked inside malloc(). In our case,
this is a SIGSEGV handler, which forks to execute a process that saves a
backtrace. The deadlock backtrace is as follows:

#0  __lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007f812f30acdb in __malloc_fork_lock_parent () at arena.c:157
#2  0x00007f812f354eba in __libc_fork () at ../sysdeps/nptl/fork.c:131
#3  0x0000557ebd96f7aa in Process::SignalManager::crash_handler (sig=11,
context=<optimized out>, sig_info=<optimized out>) at
src/common/process/signal_manager.cpp:440
#4  <signal handler called>
#5  malloc_consolidate (av=av@entry=0x7f812f656c20 <main_arena>) at
malloc.c:4490
#6  0x00007f812f30a223 in _int_free (have_lock=1, p=<optimized out>,
av=0x7f812f656c20 <main_arena>) at malloc.c:4398
#7  free_check (mem=<optimized out>, caller=<optimized out>) at hooks.c:324
#8  0x00007f812f30b527 in __GI___libc_free (mem=<optimized out>) at
malloc.c:3115
#9  0x00007f813037e6c3 in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#10 0x00007f81304984d2 in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#11 0x00007f81304815c5 in IceProxy::Ice::Object::~Object() () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#12 0x00007f81311be154 in virtual thunk to
IceProxy::XCoder::AudioDecoder::~AudioDecoder() () at
tmp/src/common/skeletons/audiodecoder.cpp:357
#13 0x0000557ebd92e29a in
IceInternal::ProxyHandle<IceProxy::XCoder::AudioDecoder>::~ProxyHandle
(this=0x557ebf825f18, __in_chrg=<optimized out>) at
/home/lastique/xcoder-usr/include/Ice/ProxyHandle.h:169
#14 Coder<IceInternal::ProxyHandle<IceProxy::XCoder::AudioDecoder>,
IceInternal::ProxyHandle<IceProxy::XCoder::VideoDecoder> >::~Coder
(this=0x557ebf825f18, __in_chrg=<optimized out>) at src/app/sip_conf/party.h:27
#15 party::~party (this=0x557ebf825ea0, __in_chrg=<optimized out>) at
src/app/sip_conf/party.cpp:16
#16 0x0000557ebd93ed09 in rtsp_party::~rtsp_party (this=0x557ebf825ea0,
__in_chrg=<optimized out>) at src/app/sip_conf/rtsp_party.h:23
#17 0x00007f81313886e9 in XCoder::PipelineEventListener::___on_pipeline_stopped
() at tmp/src/common/skeletons/pipeline.cpp:4974
#18 0x00007f81303bf8c8 in
IceInternal::Incoming::invoke(IceInternal::Handle<IceInternal::ServantManager>
const&, IceInternal::BasicStream*) () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#19 0x00007f8130387faa in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#20 0x00007f813038c86a in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#21 0x00007f813038f0ed in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#22 0x00007f81304ce8ff in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#23 0x00007f81304cf777 in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIce.so.36
#24 0x00007f8130058532 in ?? () from
/home/lastique/xcoder-usr/lib/x86_64-linux-gnu/libIceUtil.so.36
#25 0x00007f812fe087fc in start_thread (arg=0x7f812c2cb700) at
pthread_create.c:465
#26 0x00007f812f390b5f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:95

This is on glibc 2.26 from Kubuntu 17.10.

-- 
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]