bug-gawk
[Top][All Lists]
Advanced

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

Re: Clang-built Gawk 5.2.1 regex oddity


From: arnold
Subject: Re: Clang-built Gawk 5.2.1 regex oddity
Date: Fri, 30 Dec 2022 02:13:31 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Thanks for the report.

Although the dfa and regex code changed some between releases,
this smells strongly like a compiler issue and not a gawk issue.

I suggest first that you try compiling with clang but without
optimization. After running configure, edit the top level Makefile *and*
support/Makefile and remove any -O flags.  Then build.

If the bug goes away, it's definitely a clang issue.

In any case, in the gawk repo in helpers/testdfa.c is a program that
may be useful for further isolating the problem, since it extracts
the regex building and matching from the rest of gawk's code. If
the problem persists with that program, it will be of more use
in making a bug report to the clang team.

I hope this helps,

Arnold

Kenton Groombridge <concord@gentoo.org> wrote:

> Hi,
>
> Recently I started observing some strange behavior with gawk 5.2.1 and a
> particular regex pattern found in plymouth[1]. For some reason when I
> build gawk using clang 15.0.6 and try to run plymouth's
> 'plymouth-set-default-theme' script, I see the following error:
>
> awk: cmd. line:3: fatal: invalid character class
>
> This doesn't happen with gawk 5.1.1. Strangely, I can "fix" the above
> error by building gawk using gcc. I've managed to reproduce this
> behavior on 3 different Gentoo systems. Here is a simple test case:
>
> head /dev/zero | awk 'BEGIN { RS="[[][:blank:]]" }'
>
> When I build gawk with clang and run this command, I see the
> aforementioned error. When I build gawk with gcc and run it, there is no
> error and gawk exits cleanly.
>
> ---
> Kenton Groombridge
> Gentoo Linux Developer, SELinux Project
>
> [1] 
> https://gitlab.freedesktop.org/plymouth/plymouth/-/blob/main/scripts/plymouth-set-default-theme.in#L50



reply via email to

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