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

Re: Bug with long multiline strings?



Hey list,

here's a blast from the past.  Axel Beckert reminded me, that I wanted to
do this more than a year ago... ;)

Frank Terbeck wrote:
> Peter Stephenson wrote:
>> On Wed, 24 Oct 2012 17:10:23 +0100
>> Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
>>> Looks like there's a Mystery Ingredient.
>>
>> The only thing I've been able to think of is that some editor widget is
>> running, and it's doing something which isn't saving and restoring the
>> lexical state properly.  If it's something like that, it wouldn't be too
>> hard, if you can see the problem, to rustle up something that checks if
>> tokstr/bptr or the heap they're part of are being swept away
>> incorrectly.  It's not happening on any of my installations.
>
> Yeah, I cannot reproduce the issue from "zsh -f".  So there's something
> in my setup that helps triggering it. I'll bisect through my
> configuration to see what is causing this. But I won't get to it before
> Sunday in all likeliness.

Turns out, I didn't get to it before *that* particular sunday. :)

Again, here's what triggers the bug:

[snip]
zsh% foo='asdf
quote> asdf
quote> asdf
quote> asdf
quote> asdf
quote> asfd
quote> asdf
quote> asdf
quote> asdf
quote> asdf
quote> asdf
quote> asdf
quote> asdf
 mem.c:604: BUG: hrealloc() called for non-heap memory.
[1]    2554 segmentation fault (core dumped)  zsh
[snap]

From "zsh -f", I can trigger the bug with one of the following
two snippets:

#+BEGIN_SRC shell-script
zle-line-init() {
    for w in a; do : $w; done
}

zle -N zle-line-init
#+END_SRC

...and also:

#+BEGIN_SRC shell-script
zle-line-finish() {
    for w in a; do : $w; done
}

zle -N zle-line-finish
#+END_SRC

I tried to minimise the code further, but I couldn't trigger it without
the loop within the function. But it's enough to define one of the two;
although defining both will trigger it as well.

I did take a look at the code, but I didn't get anywhere.


Regards, Frank



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