From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13976 invoked by alias); 13 Oct 2011 17:53:15 -0000 Received: (qmail 13955 invoked by uid 22791); 13 Oct 2011 17:53:12 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Oct 2011 17:52:56 +0000 From: "llucax at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/4737] fork is not async-signal-safe Date: Thu, 13 Oct 2011 17:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: llucax at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00080.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=4737 --- Comment #20 from Leandro Lucarella 2011-10-13 17:52:35 UTC --- Created attachment 5987 --> http://sourceware.org/bugzilla/attachment.cgi?id=5987 Test case for what could be a related problem I'm having a problem with a rare interaction between fork() and malloc() that looks like it could be related to this issue. The test case attached is the most reduced test case I could came up with. This is based on some trickery done to implement a concurrent garbage collector. The program eventually hangs and this is the backtrace I get: Thread 3 (Thread 0x7ffff7028700 (LWP 10504)): #0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:97 #1 0x00007ffff78a837e in _L_lock_36 () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff78a067c in ptmalloc_lock_all () at arena.c:288 #3 0x00007ffff78d7635 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:95 #4 0x0000000000400c3b in do_fork () #5 0x00007ffff7bc4d8c in start_thread (arg=0x7ffff7028700) at pthread_create.c:304 #6 0x00007ffff791004d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 #7 0x0000000000000000 in ?? () Thread 2 (Thread 0x7ffff7829700 (LWP 10503)): #0 0x00007ffff785e084 in do_sigsuspend (set=) at ../sysdeps/unix/sysv/linux/sigsuspend.c:63 #1 __sigsuspend (set=) at ../sysdeps/unix/sysv/linux/sigsuspend.c:78 #2 0x0000000000400bc1 in signal_handler () #3 #4 0x00007ffff78a222f in _int_free (av=0x7ffff7bb91c0, p=0x603240) at malloc.c:4780 #5 0x00007ffff78a68e3 in __libc_free (mem=) at malloc.c:3738 #6 0x0000000000400d3e in do_malloc () #7 0x00007ffff7bc4d8c in start_thread (arg=0x7ffff7829700) at pthread_create.c:304 #8 0x00007ffff791004d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 #9 0x0000000000000000 in ?? () Thread 1 (Thread 0x7ffff7fd7720 (LWP 10500)): #0 0x00007ffff7bc606d in pthread_join (threadid=140737345918720, thread_return=0x0) at pthread_join.c:89 #1 0x0000000000400f82 in main () Is this related to the same lock that prevents fork() from being async-safe? If this is the case, I think it won't be considered a bug, right? TIA -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.