bug-gawk
[Top][All Lists]
Advanced

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

Re: fatal error: internal error with Gawk 5.2.1


From: arnold
Subject: Re: fatal error: internal error with Gawk 5.2.1
Date: Wed, 25 Jan 2023 11:26:36 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Thanks for the much smaller test case!

Vincent Forest <vincent.forest@meso-star.com> wrote:

> Dear Arnold,
>
> It seems to be the same issue that can be observed using noweb [1] with 
> gawk 5.2.1, and the commit 2848045aed5ccfd7b582808288f7fcc18d319952 
> seems to be one introducing the bug.
>
> Anyway, it seems that the following code, taken from noweb's noidx 
> script [2], is sufficient to reproduce the crash:
>
> awk '
> function tailmatch(string, tail, pos) {
>    pos = length(string) - length(tail) + 1
>    if (pos > 0 && substr(string, pos) == tail) {
>      return 1
>    } else {
>      return 0
>    }
> }
>
> BEGIN { defanchors[0] = 0 }
> /^@defn / { 
>    if(!tailmatch(defanchors["test"], "marker")) {
>      defanchors["test"] = defanchors["test"] "marker"
>    }
> }' << EOF
> @defn test
> EOF
>
> With best regards,
>
> Vincent
>
> [1] https://www.cs.tufts.edu/~nr/noweb/
> [2] https://github.com/nrnrnr/noweb/blob/master/src/awk/noidx
>
> >arnold <arnold@skeeve.com> wrote:
> >
> >Thanks for the report. I will try to find some time to
> >investigate.
> >
> >Arnold
> >
> >Volodymyr Gubarkov <xonixx@gmail.com> wrote:
> >
> >> Hi!
> >>
> >> I beg pardon for a huge test case, but still better than nothing.
> >>
> >> I've prepared a repo with reproducible code:
> >> https://github.com/xonixx/bugreport-1
> >>
> >> So it appears, Gawk 5.2.x crashes on it with:
> >>
> >> $ ./soft/gawk521 -f makesure.awk 27_parameterized_goals_10_errors.sh -l
> >> gawk521: makesure.awk:674:
> >> (FILENAME=tests/27_parameterized_goals_10_errors.sh FNR=23) fatal error:
> >> internal error
> >> Aborted (core dumped)
> >>
> >> Interestingly, if you rewrite line 674 into two lines:
> >>
> >>     gii = goalNameInstantiated SUBSEP i
> >>     Dependencies[gii] = instantiate(dep,newArgs)
> >>
> >> the error changes:
> >>
> >> free(): double free detected in tcache 2
> >> Aborted (core dumped)
> >>
> >> Code works as intended with Gawk 5.1.1 and bwk.
> >>
> >> Just in case:
> >>
> >> $ uname -a ; cat /etc/issue
> >> Linux xonix 5.4.0-136-generic #153-Ubuntu SMP Thu Nov 24 15:56:58 UTC 2022
> >> x86_64 x86_64 x86_64 GNU/Linux
> >> Linux Mint 20.3 Una \n \l
> >>
> >> Though, I'm observing the same problem on macOS as well:
> >> https://github.com/xonixx/makesure/actions/runs/3989059129/jobs/6841018914
> >>
> >> Best regards,
> >> Volodymyr



reply via email to

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