bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gensub crash


From: arnold
Subject: Re: gensub crash
Date: Mon, 23 Oct 2023 12:00:13 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Thank you for the report.

"Miguel Pineiro Jr." <mpj@pineiro.cc> wrote:

> Hello, everyone. I hope this report finds you well.
>
> While working on ota's gensub, I discovered that gawk's gensub crashes
> when there is no match and the final argument is a string converted
> from the result of a binary arithmetic operation with at least one
> variable operand.
>
> $ git branch --verbose --list master
> * master c2999b43 Another small doc fix.
> $ ./gawk 'BEGIN { x=1; print gensub(/a/, "b", 1, x+1) }'
> gawk: cmd. line:1: fatal error: internal error
> Aborted (core dumped)

Interestingly, this didn't core dump for me, it just produced
garbage. But I got the same valgrind error.

The fix was simple, and is attached.

Arnold

Attachment: gensubfix.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]