From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: zsh-workers@zsh.org
Subject: Re: SIGPIPE echoing to fifo exits zsh
Date: Wed, 16 Jan 2013 07:16:54 +0800 [thread overview]
Message-ID: <20130115231654.GB2518@localhost.localdomain> (raw)
In-Reply-To: <87r4lmlae4.fsf@gmail.com>
Looks like the crash occurs at this line in bin_print():
4084 /* Testing EBADF special-cases >&- redirections */
4085 if ((fout != stdout) ? (fclose(fout) != 0) :
4086 (fflush(fout) != 0 && errno != EBADF)) {
On Tue, Jan 15, 2013 at 04:43:31PM +0100, Christian Neukirchen wrote:
> Hi,
>
> I noticed this thing:
>
> shell1% mkfifo /tmp/fifo
> shell1% while :; do head -1 /tmp/fifo; done
>
> shell2% gdb zsh
> (gdb) r -f
> juno% repeat 1000 echo a >/tmp/fifo
>
> Program received signal SIGPIPE, Broken pipe.
> 0x00007ffff71a7100 in __write_nocancel () from /usr/lib/libc.so.6
> (gdb) bt
> #0 0x00007ffff71a7100 in __write_nocancel () from /usr/lib/libc.so.6
> #1 0x00007ffff71410d3 in _IO_new_file_write () from /usr/lib/libc.so.6
> #2 0x00007ffff7140fb2 in new_do_write () from /usr/lib/libc.so.6
> #3 0x00007ffff71422c5 in __GI__IO_do_write () from /usr/lib/libc.so.6
> #4 0x00007ffff7141680 in __GI__IO_file_sync () from /usr/lib/libc.so.6
> #5 0x00007ffff713654b in fflush () from /usr/lib/libc.so.6
> #6 0x000000000041a2dd in bin_print ()
> #7 0x000000000041d117 in execbuiltin ()
> #8 0x000000000042b2d1 in ?? ()
> #9 0x000000000042b866 in ?? ()
> #10 0x000000000042bdaf in ?? ()
> #11 0x000000000042cf5f in execlist ()
> #12 0x000000000044c354 in execfor ()
> #13 0x000000000042a73b in ?? ()
> #14 0x000000000042b866 in ?? ()
> #15 0x000000000042bdaf in ?? ()
> #16 0x000000000042cf5f in execlist ()
> #17 0x000000000042d47d in execode ()
> #18 0x000000000043d972 in loop ()
> #19 0x0000000000440b1e in zsh_main ()
> #20 0x00007ffff70eca15 in __libc_start_main () from /usr/lib/libc.so.6
> #21 0x000000000040f3d1 in _start ()
>
> Using /bin/echo (coreutils 8.20), the code works flawlessy (all lines
> get through the FIFO).
>
> Thanks,
> --
> Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
next prev parent reply other threads:[~2013-01-15 23:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 15:43 Christian Neukirchen
2013-01-15 23:16 ` Han Pingtian [this message]
2013-01-16 2:53 ` Bart Schaefer
2013-01-16 9:30 ` Han Pingtian
2013-01-16 9:44 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130115231654.GB2518@localhost.localdomain \
--to=hanpt@linux.vnet.ibm.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).