Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug in history changes



The latest version of the history code is causing zcalc to crash.  zcalc
now tries to use its own separate history file; it's a bit hacky because
the history interface isn't intended for use like this.  The instruction
that triggers it is setting HISTSIZE to 0.

(gdb) bt
#0  0x3b200 in putoldhistentryontop (keep_going=-3664) at ../../Src/hist.c:937
#1  0x3ce44 in resizehistents () at ../../Src/hist.c:1776
#2  0x5d9c4 in histsizesetfn (pm=0x9b330, v=4294967296)
    at ../../Src/params.c:2915
#3  0x5a728 in setstrvalue (v=0xffbee7f0, val=0xef3a8 "0")
    at ../../Src/params.c:1637
#4  0x5b740 in assignsparam (s=0xbbfe0 "", val=0xef3a8 "0", augment=0)
    at ../../Src/params.c:1991
#5  0x1ef64 in typeset_single (cname=0xbbfd0 "local", 
    pname=0xbbfd8 "HISTSIZE", pm=0x9b330, func=0, on=131072, off=0, roff=0, 
    value=0xbbfe1 "0", altpm=0x0) at ../../Src/builtin.c:1868
#6  0x203f0 in bin_typeset (name=0xbbfd0 "local", argv=0xffbee9bc, 
    ops=0xffbee9d0 "", func=0) at ../../Src/builtin.c:2127
#7  0x1aa04 in execbuiltin (args=0xbbfb0, bn=0x99c50)
    at ../../Src/builtin.c:377
#8  0x2df58 in execcmd (state=0xffbeed80, input=0, output=0, how=2, last1=2)
    at ../../Src/exec.c:2306
#9  0x2b2b4 in execpline2 (state=0xffbeed80, pcode=192, how=2, input=0, 
    output=0, last1=0) at ../../Src/exec.c:1201
#10 0x2a808 in execpline (state=0xffbeed80, slcode=128, how=2, last1=0)
    at ../../Src/exec.c:991
#11 0x2a2a8 in execlist (state=0xffbeed80, dont_change_job=1, exiting=0)
    at ../../Src/exec.c:826
#12 0x29fb0 in execode (p=0xf37c8, dont_change_job=1, exiting=0)
    at ../../Src/exec.c:729
#13 0x2ffac in execautofn (state=0xd5de8, do_exec=0) at ../../Src/exec.c:3245
#14 0x2dd0c in execcmd (state=0xffbef130, input=0, output=0, how=18, last1=2)
    at ../../Src/exec.c:2253
#15 0x2b2b4 in execpline2 (state=0xffbef130, pcode=0, how=18, input=0, 
    output=0, last1=0) at ../../Src/exec.c:1201
#16 0x2a808 in execpline (state=0xffbef130, slcode=96, how=18, last1=0)
    at ../../Src/exec.c:991
#17 0x2a2a8 in execlist (state=0xffbef130, dont_change_job=1, exiting=0)
    at ../../Src/exec.c:826
#18 0x29fb0 in execode (p=0xf32e8, dont_change_job=1, exiting=0)
    at ../../Src/exec.c:729
#19 0x30630 in runshfunc (prog=0xf32e8, wrap=0x0, name=0xbbdf8 "zcalc")
    at ../../Src/exec.c:3492
#20 0x303f4 in doshfunc (name=0xca520 "zcalc", prog=0xf32e8, doshargs=0xef3d0, 
    flags=0, noreturnval=0) at ../../Src/exec.c:3407
#21 0x2ff38 in execshfunc (shf=0xd5de8, args=0xbbdd0) at ../../Src/exec.c:3217
#22 0x2decc in execcmd (state=0xffbef670, input=0, output=0, how=18, last1=2)
    at ../../Src/exec.c:2295
#23 0x2b2b4 in execpline2 (state=0xffbef670, pcode=4, how=18, input=0, 
    output=0, last1=0) at ../../Src/exec.c:1201
#24 0x2a808 in execpline (state=0xffbef670, slcode=96, how=18, last1=0)
    at ../../Src/exec.c:991
#25 0x2a2a8 in execlist (state=0xffbef670, dont_change_job=0, exiting=0)
    at ../../Src/exec.c:826
#26 0x29fb0 in execode (p=0xbbd88, dont_change_job=0, exiting=0)
    at ../../Src/exec.c:729
#27 0x3e3a8 in loop (toplevel=1, justonce=0) at ../../Src/init.c:165
#28 0x40ad0 in zsh_main (argc=1, argv=0x1) at ../../Src/init.c:1214
#29 0x1a220 in main (argc=1, argv=0xffbef844) at ../../Src/main.c:37

    if (he != hist_ring->down) {
=>	he->up->down = he->down;
	he->down->up = he->up;
	he->up = hist_ring;
	he->down = hist_ring->down;
	hist_ring->down = he->down->up = he;
    }

(gdb) p he->up
$1 = 0xffffffff

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author