zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Zoltan Hidvegi <hzoli@ny.frontiercomm.net>
Cc: zsh-workers@math.gatech.edu
Subject: Re: History bug still present in 3.0.3-test5
Date: Sat, 10 May 1997 22:15:15 -0700	[thread overview]
Message-ID: <970510221515.ZM15578@candle.brasslantern.com> (raw)
In-Reply-To: <199705110314.XAA03760@hzoli.home>

On May 10, 11:14pm, Zoltan Hidvegi wrote:
} Subject: Re: History bug still present in 3.0.3-test5
}
} > 	xterm -e zsh -l
} > 
} > and then use the window manager to kill the xterm.  The $HISTFILE file will
} > be truncated to zero size.
} 
} I cannot reproduce this Linux

I'm running my own compile of 2.0.28, dropped into a RedHat 4.0 installation,
on a 100MHz Pentium with SCSI drives.  Just in case you think that matters.

} but from the backtrace you sent earlier it
} seems that the problem is that first zle notices that the input is lost and
} calls zexit(), and while zexit is saving the history, zsh receives the HUP
} signal.  It seems to be a kernel or xterm bug, since HUP should really come
} before the input is lost.  Here is the fix.

I applied this patch and tried the xterm -e test above, and once again got
a truncated-to-zero history file.  So whatever is going on isn't related
to this patch.  And it happens with `zsh -f -l' too, so it's not some odd
thing I'm doing.

Here's a more complete stack trace.  3.0.3-test5 with the patch from your
message applied.  I only see zexit in there once, called from handler(),
so I don't think zsh has seen the EOF yet.

(gdb) where
#0  0x8061120 in savehistfile (s=0x80efee0 "/home/schaefer/.zhistory", err=1, 
    app=0) at ../../zsh-3.0.3-test5/Src/hist.c:1433
#1  0x8050a93 in zexit (val=1, from_signal=1)
    at ../../zsh-3.0.3-test5/Src/builtin.c:4640
#2  0x8070093 in handler (sig=1) at ../../zsh-3.0.3-test5/Src/signals.c:470
#3  0xbffff658 in ?? ()
#4  0x807dc34 in getkey (keytmout=0)
    at ../../zsh-3.0.3-test5/Src/zle_main.c:284
#5  0x807e505 in getkeycmd () at ../../zsh-3.0.3-test5/Src/zle_main.c:520
#6  0x807e153 in zleread (lp=0x80e67d0 "%m[%h] ", rp=0x80e67e0 "%n")
    at ../../zsh-3.0.3-test5/Src/zle_main.c:430
#7  0x8062ed7 in inputline () at ../../zsh-3.0.3-test5/Src/input.c:228
#8  0x8062df5 in ingetc () at ../../zsh-3.0.3-test5/Src/input.c:184
#9  0x805ec79 in hgetc () at ../../zsh-3.0.3-test5/Src/hist.c:118
#10 0x8065331 in gettok () at ../../zsh-3.0.3-test5/Src/lex.c:361
#11 0x8064ea9 in yylex () at ../../zsh-3.0.3-test5/Src/lex.c:176
#12 0x806d99c in parse_event () at ../../zsh-3.0.3-test5/Src/parse.c:59
#13 0x80616ea in loop (toplevel=1) at ../../zsh-3.0.3-test5/Src/init.c:117
#14 0x8061607 in main (argc=2, argv=0xbffff954)
    at ../../zsh-3.0.3-test5/Src/init.c:77
#15 0x80480eb in _start ()
(gdb) p t
$1 = 0x0
(gdb) p ev
5

[There were only 4 events in the history.  Starting from an empty history,
I typed exactly 4 commands before killing the xterm.  Looks like it's
trying to save an event that hasn't happened yet?]


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts        http://www.nbn.com/people/lantern


  reply	other threads:[~1997-05-11  5:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-10 17:40 Bart Schaefer
1997-05-11  3:14 ` Zoltan Hidvegi
1997-05-11  5:15   ` Bart Schaefer [this message]
1997-05-11  6:13     ` Zoltan Hidvegi

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=970510221515.ZM15578@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=hzoli@ny.frontiercomm.net \
    --cc=zsh-workers@math.gatech.edu \
    /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).