From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18716 invoked from network); 30 Nov 2007 19:36:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Nov 2007 19:36:08 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 68783 invoked from network); 30 Nov 2007 19:36:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Nov 2007 19:36:03 -0000 Received: (qmail 8992 invoked by alias); 30 Nov 2007 19:35:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24133 Received: (qmail 8975 invoked from network); 30 Nov 2007 19:35:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Nov 2007 19:35:58 -0000 Received: (qmail 68377 invoked from network); 30 Nov 2007 19:35:58 -0000 Received: from s-utl01-sjpop.stsn.net (72.254.0.201) by a.mx.sunsite.dk with SMTP; 30 Nov 2007 19:35:52 -0000 Received: from s-utl01-sjpop.stsn.net ([127.0.0.1]) by s-utl01-sjpop.stsn.net (SMSSMTP 4.1.2.20) with SMTP id M2007113011354921833 for ; Fri, 30 Nov 2007 11:35:49 -0800 Received: from localhost.localdomain ([10.67.22.95]) by s-utl01-sjpop.stsn.net for zsh-workers@sunsite.dk; Fri, 30 Nov 2007 11:35:48 -0800 Date: Fri, 30 Nov 2007 20:35:34 +0100 From: Guillaume Chazarain To: zsh-workers@sunsite.dk Subject: deadlock caused by gettext usage in a signal handler Message-ID: <20071130203534.1d1ea29c@inria.fr> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello, I just had a Zsh process (using zsh-4.2.6-6.fc7) deadlock, the backtrace seems to show it is initializing the gettext infrastructure to print "Input/output error" in a signal handler. As a solution, avoiding gettext() in signal handlers seems harder than forcing gettext() initialization before its first usage, but the cost may be prohibitive. (gdb) bt #0 0x0000003c3f0dcf78 in __lll_mutex_lock_wait () from /lib64/libc.so.6 #1 0x0000003c3f074ced in _L_lock_15106 () from /lib64/libc.so.6 #2 0x0000003c3f073d7b in *__GI___libc_realloc (oldmem=0x3c3f34c960, bytes=2048) at malloc.c:3697 #3 0x0000003c3f02d2bc in read_alias_file (fname=, fname_len=) at localealias.c:309 #4 0x0000003c3f02d58e in _nl_expand_alias (name=0x7fff630ad470 "fr_FR.UTF-8") at localealias.c:189 #5 0x0000003c3f02bdf7 in _nl_find_domain ( dirname=0x3c3f11efb0 "/usr/share/locale", locale=0x7fff630ad470 "fr_FR.UTF-8", domainname=0x7fff630ad490 "LC_MESSAGES/libc.mo", domainbinding=0x0) at finddomain.c:120 #6 0x0000003c3f02b64f in __dcigettext (domainname=0x3c3f11b86b "libc", msgid1=0x3c3f11ba3a "Input/output error", msgid2=0x0, plural=0, n=0, category=5) at dcigettext.c:627 #7 0x0000003c3f07713c in *__GI___strerror_r (errnum=5, buf=0x0, buflen=0) at _strerror.c:65 #8 0x0000003c3f076f7e in strerror (errnum=1060424032) at strerror.c:33 #9 0x0000000000474507 in zerrmsg (fmt=, str=0x0, num=5) at utils.c:172 #10 0x0000000000474aab in zerr (fmt=0x3c3f34c960 "\002", str=0x0, num=2064) at utils.c:60 #11 0x000000000043cad8 in update_job (jn=0x892140) at jobs.c:361 #12 0x0000000000465540 in zhandler (sig=17) at signals.c:521 #13 #14 0x0000003c3f030afa in *__GI___sigsuspend (set=0x7fff630adc60) at ../sysdeps/unix/sysv/linux/sigsuspend.c:63 #15 0x0000000000465734 in signal_suspend (sig=17, sig2=0) at signals.c:367 #16 0x000000000043c74c in zwaitjob (job=, sig=0) at jobs.c:1145 #17 0x000000000043c8f8 in waitjobs () at jobs.c:1180 #18 0x0000000000425de2 in execpline (state=, slcode=, how=18, last1=0) at exec.c:1146 #19 0x0000000000426a70 in execlist (state=0x7fff630adfb0, dont_change_job=0, exiting=0) at exec.c:877 #20 0x0000000000426c85 in execode (p=0x2aaaae93b338, dont_change_job=0, exiting=0) at exec.c:777 #21 0x000000000043738f in loop (toplevel=0, justonce=0) at init.c:167 #22 0x000000000043794c in source (s=0x4780af "/etc/zlogout") at init.c:1045 #23 0x000000000040ddb6 in zexit (val=1, from_where=0) at builtin.c:4187 #24 0x0000000000465637 in zhandler (sig=-4) at signals.c:540 #25 #26 0x0000003c3f097642 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:127 #27 0x0000000000421e85 in zfork (tv=0x7fff630aea90) at exec.c:231 #28 0x00000000004239b1 in execcmd (state=0x7fff630afc80, input=0, output=0, how=18, last1=2) at exec.c:2127 #29 0x0000000000425557 in execpline2 (state=0x7fff630afc80, pcode=, how=18, input=0, output=0, last1=0) at exec.c:1285 #30 0x00000000004259ea in execpline (state=0x7fff630afc80, slcode=, how=18, last1=0) at exec.c:1071 #31 0x0000000000426a70 in execlist (state=0x7fff630afc80, dont_change_job=0, exiting=0) at exec.c:877 #32 0x0000000000426c85 in execode (p=0x2aaaae93b1a0, dont_change_job=0, exiting=0) at exec.c:777 #33 0x000000000043738f in loop (toplevel=1, justonce=0) at init.c:167 #34 0x0000000000438051 in zsh_main (argc=, argv=0x7fff630afdf8) at init.c:1280 #35 0x0000003c3f01dab4 in __libc_start_main (main=0x40cca0
, argc=1, ubp_av=0x7fff630afdf8, init=, fini=, rtld_fini=, stack_end=0x7fff630afde8) at libc-start.c:222 #36 0x000000000040cc09 in _start () Thanks. -- Guillaume