From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11484 invoked by alias); 27 Sep 2014 08:05:34 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19171 Received: (qmail 20446 invoked from network); 27 Sep 2014 08:05:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:cc:subject:references :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=h8DAmTbDJcSG8suCotyaU9UkDC4=; b=KFH7WfgApR59/4npan6d Wi1eVj3LoXB6RxT8gVHhPWiDrUn3N7jCOSB/Mii9sRDmHqgvjgWCJxBu849yFapZ TNVXrXGKB116OOp4QQWiAYzdj/pBNx4AU0nulP9wSk9qYeDWStKGSEBXHNYv2VQ1 YY65A3XZw6CbwLCfmUlpmhs= X-Sasl-enc: 0GD9WoBIiRkbjFIQHj5Bo7wF2FkAmUXXwX6nEachSW6n 1411805127 From: Tassilo Horn To: Kurtis Rader Cc: Zsh Users Subject: Re: ZSH history not saved anymore References: <87mw9qdp7s.fsf@thinkpad-t440p.tsdh.org> <20140924200710.2f764272@pws-pc.ntlworld.com> <8738bg2n1v.fsf@thinkpad-t440p.tsdh.org> <140926000448.ZM30835@torch.brasslantern.com> <878ul6lrw9.fsf@thinkpad-t440p.tsdh.org> <87y4t66td0.fsf@thinkpad-t440p.tsdh.org> Date: Sat, 27 Sep 2014 10:05:22 +0200 In-Reply-To: (Kurtis Rader's message of "Fri, 26 Sep 2014 13:34:37 -0700") Message-ID: <871tqxqyil.fsf@thinkpad-t440p.tsdh.org> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Kurtis Rader 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