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

Bug with long multiline strings?



Hi workers!

I've tried to reproduce

  <https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1070820>


Turns out, I can:

[snip]
i-(6000)-~% echo "asdf
dquote> asdf
dquote> asdf
dquote> asdf
dquote> asdf
dquote> asfd
dquote> asdf
dquote> asdf
dquote> asdf
dquote> asdf
dquote> asdf
dquote> asdf
dquote> asdf
 mem.c:604: BUG: hrealloc() called for non-heap memory.
[1]    2554 segmentation fault (core dumped)  zsh
[snap]

Backtrace:

[snip]
Reading symbols from /usr/local/bin/zsh...done.
[New LWP 2554]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `zsh'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000460225 in hrealloc (p=0x7f1e52779050 "\232asdf\nasdf\nasdf\nasdf\nasdf\nasfd\nasdf\nasdf\nasdf\nasdf\nasdf\nasdf\nasd%_> ", old=64, new=128) at mem.c:605
605	    DPUTS(h->sp && arena(h) + h->sp->used > p,
(gdb) #0  0x0000000000460225 in hrealloc (p=0x7f1e52779050 "\232asdf\nasdf\nasdf\nasdf\nasdf\nasfd\nasdf\nasdf\nasdf\nasdf\nasdf\nasdf\nasd%_> ", old=64, new=128) at mem.c:605
        h = 0x0
        ph = 0x7f1e52772000
#1  0x0000000000456291 in add (c=100) at lex.c:575
        newbsiz = 128
#2  0x00000000004583ea in dquote_parse (endchar=34 '"', sub=0) at lex.c:1576
        pct = 0
        brct = 0
        bct = 0
        intick = 0
        err = 0
        c = 100
        math = 0
        zlemath = 0
#3  0x0000000000457b2a in gettokstr (c=34, sub=0) at lex.c:1371
        act = 15
        e = 34
        inbl = 0
        bct = 0
        pct = 0
        brct = 0
        fdpar = 0
        intpos = 1
        in_brace_param = 0
        peek = 34
        inquote = -1189248448
        unmatched = 0
        ocmdsp = 0
#4  0x0000000000457061 in gettok () at lex.c:993
        c = 34
        d = -1189248128
        peekfd = -1
        peek = 32767
#5  0x0000000000455d73 in zshlex () at lex.c:395
No locals.
#6  0x0000000000479a87 in par_simple (complex=0x7fffb91d8448, nr=0) at parse.c:1678
        redir_var = 0
        oecused = 3
        isnull = 1
        r = 3
        argc = 1
        p = 3
        isfunc = 0
        sr = 0
        c = 0
        nrediradd = 0
        assignments = 0
#7  0x0000000000477857 in par_cmd (complex=0x7fffb91d8448) at parse.c:879
        sr = 0
        r = 3
        nr = 0
#8  0x00000000004772f3 in par_pline (complex=0x7fffb91d8448) at parse.c:728
        p = 2
        line = 1
#9  0x00000000004772ac in par_sublist2 (complex=0x7fffb91d8448) at parse.c:709
        f = 0
#10 0x000000000047713d in par_sublist (complex=0x7fffb91d8470) at parse.c:664
        f = 4545929
        p = 1
        c = 1
#11 0x0000000000476b58 in par_event () at parse.c:477
        r = 0
        p = 0
        c = 0
#12 0x0000000000476ad2 in parse_event () at parse.c:454
No locals.
#13 0x0000000000448f34 in loop (toplevel=1, justonce=0) at init.c:132
        prog = 0x7fffb91d84e0
        err = 0
        non_empty = 0
#14 0x000000000044c6c5 in zsh_main (argc=1, argv=0x7fffb91d8648) at init.c:1567
        t = 0x7fffb91d8650
        runscript = 0x0
        t0 = 158
#15 0x000000000041024c in main (argc=1, argv=0x7fffb91d8648) at ./main.c:93
No locals.
[snap]

Information about this system:

% echo $ZSH_VERSION-$ZSH_PATCHLEVEL
5.0.0-dev-0-1.5699

% uname -srm
Linux 3.2.0-3-amd64 x86_64

% /lib32/libc.so.6
GNU C Library (Debian EGLIBC 2.13-35) stable release version 2.13, by
Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.7.
Compiled on a Linux 3.2.21 system on 2012-07-22.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.



Regards, Frank



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