zsh-users
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Kurtis Rader <krader@skepticism.us>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: ZSH history not saved anymore
Date: Sat, 27 Sep 2014 10:05:22 +0200	[thread overview]
Message-ID: <871tqxqyil.fsf@thinkpad-t440p.tsdh.org> (raw)
In-Reply-To: <CABx2=D-chwqBDZLTk8OqeUDqxvnYUQFFKWbiw7h3ZgUGtSb_CQ@mail.gmail.com> (Kurtis Rader's message of "Fri, 26 Sep 2014 13:34:37 -0700")

Kurtis Rader <krader@skepticism.us> writes:

Hi Kurtis,

> The problem is the SIGPIPE. It's terminating the shell before it has a
> chance to handle the SIGHUP. Notice that the SIGPIPE was sent by the user
> process with pid 4637 running as uid 1000. I'll bet that you'll find that
> user ID is yours

Yes.

> and the pid is the terminal emulator.

Yes.

> If you look earlier in the strace output for the terminal emulator you
> should be able to find the kill syscall that sent the SIGPIPE. I have
> no idea why the emulator feels the need to send SIGPIPE -- that's a
> very peculiar thing to do.

Indeed.  ZSH has pid 2019 in here:

--8<---------------cut here---------------start------------->8---
munmap(0x7f1291b1c000, 7680000)         = 0
close(23)                               = 0
futex(0x25322d8, FUTEX_WAKE, 1)         = 1
close(22)                               = 0
kill(2029, SIGCONT)                     = 0
kill(2029, SIGPIPE)                     = 0
wait4(2029, 0x7fffb1676de4, WNOHANG, NULL) = 0
nanosleep({0, 1000000}, NULL)           = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=2029, si_uid=1000, si_status=SIGPIPE, si_utime=4, si_stime=0} ---
rt_sigreturn()                          = -1 EINTR (Interrupted system call)
wait4(2029, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGPIPE}], WNOHANG, NULL) = 2029
epoll_ctl(3, EPOLL_CTL_DEL, 22, 7fffb1676d80) = -1 EBADF (Bad file descriptor)
[...]
+++ exited with 0 +++
--8<---------------cut here---------------end--------------->8---

> Obviously you can work around the problem by telling zsh to trap that
> signal:
>
> TRAPPIPE() {
>     exit
> }

Yes, that works.  So I'll keep that in my ~/.zshrc for the time being.

Thanks for your help, Kurtis!

Bye,
Tassilo


      reply	other threads:[~2014-09-27  8:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 21:03 Tassilo Horn
2014-09-24 19:07 ` Peter Stephenson
2014-09-25  7:10   ` Tassilo Horn
2014-09-26  7:04     ` Bart Schaefer
2014-09-26  8:15       ` Tassilo Horn
2014-09-26 14:58         ` Kurtis Rader
2014-09-26 20:04           ` Tassilo Horn
2014-09-26 20:34             ` Kurtis Rader
2014-09-27  8:05               ` Tassilo Horn [this message]

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=871tqxqyil.fsf@thinkpad-t440p.tsdh.org \
    --to=tsdh@gnu.org \
    --cc=krader@skepticism.us \
    --cc=zsh-users@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).