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

Re: Probabilistic crash on zsh 5.9 on x86_64



> 2023/04/13 23:03、Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>のメール:
> 
> Have a look at this --- it simply marks the prog in the shell function as
> in use earlier and unmarks it later, so the shenanigans within to do
> with traps all come out in the wash.  So, in theory, there's not much
> to go wrong.  But let me know...

> +    marked_prog = shfunc->funcdef;
> +    useeprog(marked_prog);
(snip)
> +    freeeprog(marked_prog);

Even with this, shfunc is still freed, although shfunc->funcdef is not freed.
But doshfunc() continues to use shfunc, at lines 5854, 5954, 5957, etc.
If it doesn't crash, it means the freed memory is not yet used by others.
But I think this is unsafe, and valgrind gives lots of warnings.






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