From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15555 invoked by alias); 10 Aug 2015 22:53:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36088 Received: (qmail 1474 invoked from network); 10 Aug 2015 22:53:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=e/5pHnD/i26Y8sTc/oTOE4uL1mTdjwUkQcCvq5Xdv9E=; b=AzWYeDIky67vy667PUElPgMxYKY7nzswFdUBlwE4mS72gcloLsjtwFUNWX+wz7helN C79jJHbZeMMFuOTLZpwTOrRS61Feyztpxh7H6mP6YcKlqn0iDU5h//uakO6IA8p96GD+ jCC+Azu7/jWMYO9NfohnB/xK2G7eMlvlG+7y9wJS3F4jdzn5vhezo/bn7KqKQ0Uk7pHd TNh8TK+nxcQJbqI36JCeYqpG3ZgAEs9Ok6vRrAFLBp4itWLIVYYEzPtJjRVXV9FPF6/x h1rftDJS/DGnY8cOXx6sST9UIVH52flAvwvwBZk6Ne+XCX4Qse7HoU3kSN0USOcgqzxb wW3A== X-Received: by 10.60.76.69 with SMTP id i5mr21495851oew.42.1439247221050; Mon, 10 Aug 2015 15:53:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <150803085228.ZM24837@torch.brasslantern.com> <150803135818.ZM24977@torch.brasslantern.com> <150804235400.ZM9958@torch.brasslantern.com> <150805085258.ZM17673@torch.brasslantern.com> <150805115249.ZM7158@torch.brasslantern.com> <150805132014.ZM7746@torch.brasslantern.com> <150805220656.ZM18545@torch.brasslantern.com> <150806085451.ZM402@torch.brasslantern.com> <150806223906.ZM17762@torch.brasslantern.com> <150810123445.ZM1612@torch.brasslantern.com> From: Mathias Fredriksson Date: Tue, 11 Aug 2015 01:53:01 +0300 Message-ID: Subject: Re: Deadlock when receiving kill-signal from child process To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On Tue, Aug 11, 2015 at 12:17 AM, Mathias Fredriksson wrote: } ... On a more serious note, I have not been able to produce } any deadlocks after 36084! I also did not get around to test with } --enable-zsh-mem since it is working just fine. I also tested building } zsh without debugging, no problems there either. Well, scratch that. I went back to my original use case where I'm running commands in a zpty worker and notifying the original zsh pid that the work is done (previously through WINCH, now tested with USR1). There are usually two of these commands that are started at precmd and usually finish either before or shortly after the prompt is rendered. Now if I hold enter at and empty prompt, I can reproduce this deadlock very quickly. #0 0x00007fff8abfe72a in __sigsuspend () #1 0x00000001065013e9 in signal_suspend () #2 0x00000001064d8035 in zwaitjob () #3 0x00000001064d7e80 in waitjobs () #4 0x00000001064b9388 in execpline () #5 0x00000001064b86fb in execlist () #6 0x00000001064df9fc in execif () #7 0x00000001064bf4ce in execcmd () #8 0x00000001064b8fdd in execpline () #9 0x00000001064b8440 in execlist () #10 0x00000001064df9fc in execif () #11 0x00000001064bf4ce in execcmd () #12 0x00000001064b8fdd in execpline () #13 0x00000001064b8440 in execlist () #14 0x00000001064b8266 in execode () #15 0x00000001064bc092 in runshfunc () #16 0x00000001064bbabf in doshfunc () #17 0x00000001064c1fc1 in execshfunc () #18 0x00000001064bfc2b in execcmd () #19 0x00000001064b8fdd in execpline () #20 0x00000001064b8440 in execlist () #21 0x00000001064b8266 in execode () #22 0x00000001064bc092 in runshfunc () #23 0x00000001064bbabf in doshfunc () #24 0x000000010650ff96 in callhookfunc () #25 0x000000010651020f in preprompt () #26 0x00000001064d203e in loop () #27 0x00000001064d501b in zsh_main () #28 0x00007fff8610c5c9 in start () If I try to compile with --enable-zsh-mem I'm flooded with a bunch of these messages (until zsh eventually segfaults): 3: mem.c:1575: MEM: allocation error at brk. 138: mem.c:1514: BUG: attempt to free storage at invalid address 175: mem.c:1514: BUG: attempt to free storage at invalid address ... 8: mem.c:1514: BUG: attempt to free storage at invalid address 8: mem.c:1514: BUG: attempt to free storage at invalid address 12: mem.c:1281: MEM: allocation error at sbrk, size 20480.