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

Re: TRAPINT doesn't work reliably



On Tuesday, September 24, 2019 10:44 AM, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:

> On Tue, 2019-09-17 at 16:47 +0000, Dennis Schwartz wrote:
>
> > I have a function on TRAPINT in my .zshrc like described as in the Zsh manual [1].
> >  
> >      TRAPINT() {
> >          echo "trap: $1"
> >          return $(( 128 + $1 ))
> >      }
> >  
> >  
> > This works unreliably. Usually this works a first few times, but after a while this doesn’t work anymore and throws the following error.
> >  
> > TRAPINT:1: command not found: \M-^A^A
> > TRAPINT:2: command not found: F^\V
>
> This certainly isn't likely to be anything you've done wrong, at least based on
> what you've told us.
>
> It smells of memory management problems, but it's hard to see where the corruption
> would be.
>
> What do you see if you run
>
> functions TRAPINT
>
> after the problem has turned up?

It almost looks like the function gets replaced with random memory.
`functions TRAPINT` just shows random bytes, for example:

$ xxd <(functions TRAPINT)
00000000: 5452 4150 494e 5420 2829 207b 0a09 0701  TRAPINT () {....
00000010: 200a 0950 200a 7d0a                       ..P .}.


I am now more convinced it's a bug in Zsh. Any advice on how to debug this?
And where can I best submit a bug report to?


Dennis



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