From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22694 invoked from network); 4 Dec 2007 23:43:14 -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.5 required=5.0 tests=AWL,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; 4 Dec 2007 23:43:14 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 13702 invoked from network); 4 Dec 2007 23:16:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Dec 2007 23:16:30 -0000 Received: (qmail 4878 invoked by alias); 4 Dec 2007 23:16:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24159 Received: (qmail 4852 invoked from network); 4 Dec 2007 23:16:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Dec 2007 23:16:25 -0000 Received: (qmail 13315 invoked from network); 4 Dec 2007 23:16:25 -0000 Received: from smtp3-g19.free.fr (212.27.42.29) by a.mx.sunsite.dk with SMTP; 4 Dec 2007 23:16:18 -0000 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id D63A117B6C4 for ; Wed, 5 Dec 2007 00:16:17 +0100 (CET) Received: from localhost.localdomain (bar06-2-82-224-157-131.fbx.proxad.net [82.224.157.131]) by smtp3-g19.free.fr (Postfix) with ESMTP id 9E0C117B6AD for ; Wed, 5 Dec 2007 00:16:17 +0100 (CET) Date: Wed, 5 Dec 2007 00:09:38 +0100 From: Guillaume Chazarain To: Zsh Hackers' List Subject: Re: deadlock caused by gettext usage in a signal handler Message-ID: <20071205000938.42917559@inria.fr> In-Reply-To: <20071204203017.35a29727.p.w.stephenson@ntlworld.com> References: <20071130203534.1d1ea29c@inria.fr> <20071204203017.35a29727.p.w.stephenson@ntlworld.com> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le Tue, 4 Dec 2007 20:30:17 +0000, Peter Stephenson a =C3=A9crit : > but I'm starting to think the issue is more widespread. Definitely :-( Here is a stack trace without gettext in it: 0x0000003c3f0dcf78 in __lll_mutex_lock_wait () from /lib64/libc.so.6 #0 0x0000003c3f0dcf78 in __lll_mutex_lock_wait () from /lib64/libc.so.6 #1 0x0000003c3f074cb7 in _L_lock_14740 () from /lib64/libc.so.6 #2 0x0000003c3f073b11 in *__GI___libc_free (mem=3D0x3c3f34c960) at malloc.= c:3620 #3 0x0000000000431f02 in savehistfile ( fn=3D0x8a1690 "/user/gchazara/home/.zsh_history", err=3D1,=20 writeflags=3D) at hist.c:2091 #4 0x000000000040dd6d in zexit (val=3D1, from_where=3D) at builtin.c:4181 #5 0x0000000000465637 in zhandler (sig=3D-512) at signals.c:540 #6 #7 0x0000003c3f07006a in _int_free (av=3D0x3c3f34c960, mem=3D0x8b02c0) at malloc.c:4662 #8 0x0000003c3f073b1c in *__GI___libc_free (mem=3D0xb65d60) at malloc.c:36= 22 #9 0x0000000000438965 in ingetc () at input.c:261 #10 0x000000000043338d in ihgetc () at hist.c:241 #11 0x000000000044122b in gettok () at lex.c:631 #12 0x0000000000441a38 in yylex () at lex.c:347 #13 0x000000000045cef7 in parse_event () at parse.c:449 #14 0x0000000000437348 in loop (toplevel=3D1, justonce=3D0) at init.c:128 #15 0x0000000000438051 in zsh_main (argc=3D,=20 argv=3D0x7ffff4980ef8) at init.c:1280 #16 0x0000003c3f01dab4 in __libc_start_main (main=3D0x40cca0
, argc= =3D1,=20 ubp_av=3D0x7ffff4980ef8, init=3D,=20 fini=3D, rtld_fini=3D,=20 stack_end=3D0x7ffff4980ee8) at libc-start.c:222 #17 0x000000000040cc09 in _start () A deadlock with free() this time. Here is more information about how to reproduce these deadlocks: Download a snapshot of gsh: http://repo.or.cz/w/gsh.git?a=3Dsnapshot;h=3D9a90d28f9ad0e64c45202522b26ff6= c13f10f795;sf=3Dtgz Run this loop: while : ; do ./gsh.py --command=3D: localhost localhost localhost; done This assumes that running 'ssh localhost' will lead you to a Zsh instance. This should accumulate deadlocked Zsh processes that you can see with: pstree -a -h -p -u $USER|grep '^zsh,'|cut -d, -f2 I don't think it's the first time I saw hung Zsh processes, but this commit in my gsh software made the problem appears more easily: http://repo.or.cz/w/gsh.git?a=3Dcommitdiff;h=3D9a90d28f9ad0e64c45202522b26f= f6c13f10f795 It replaces builtin echo invocations with actual /bin/echo forkings. Hope that helps. --=20 Guillaume