Re: Regression in commit 93efdeeb on branch-4.1

Trent Tanchin <[email protected]> Sun, 26 Jul 2026 23:17:36 -0400
Newsgroups gmane.comp.gnu.m4.bugs
Message-ID <CAFoE+9CWV-8=O_ATgvbinCi-DGjHa4OS+vUp=yNZT+ZsB_ehUQ@mail.gmail.com>
--000000000000b8bf3706578f2ae0
Content-Type: multipart/alternative; boundary="000000000000b8bf3506578f2ade"

--000000000000b8bf3506578f2ade
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

It turns out the bug was much simpler. The argc decrement operators got
inverted to increment.

On Sun, Jul 26, 2026 at 9:28=E2=80=AFPM Trent Tanchin <[email protected]> w=
rote:

> Hello,
>
> There appears to be a change in the way the ARG_* macros' processing work=
s
> that causes build failures in some packages that use bison with versions =
of
> m4 starting at commit 93efdeeb.
>
> An example on my custom linux system (loosely based on LinuxFromScratch)
> building glibc-2.43 with gcc-16.1.0:
> gcc /usr/src/glibc-2.43/build/intl/plural.c -c -std=3Dgnu11 -fgnu89-inlin=
e
>  -g -O2 -Wall -Wwrite-strings -Wundef -Wimplicit-fallthrough
> -fmerge-all-constants -frounding-math -ftrapping-math
> -fstack-protector-strong -fno-common -U_FORTIFY_SOURCE -Wstrict-prototype=
s
> -Wold-style-definition -Wfree-labels -Wmissing-parameter-name -fmath-errn=
o
>    -fPIE     -ftls-model=3Dinitial-exec     -I../include
> -I/usr/src/glibc-2.43/build/intl  -I/usr/src/glibc-2.43/build
>  -I../sysdeps/unix/sysv/linux/x86_64/64  -I../sysdeps/x86_64/64/nptl
>  -I../sysdeps/unix/sysv/linux/x86_64/include
> -I../sysdeps/unix/sysv/linux/x86_64
>  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x8=
6
>  -I../sysdeps/x86/nptl  -I../sysdeps/unix/sysv/linux/wordsize-64
>  -I../sysdeps/x86_64/nptl  -I../sysdeps/unix/sysv/linux/include
> -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread
>  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv
>  -I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix
>  -I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch
>  -I../sysdeps/x86_64/fpu  -I../sysdeps/x86/fpu
>  -I../sysdeps/x86_64/multiarch  -I../sysdeps/x86_64
>  -I../sysdeps/x86/include -I../sysdeps/x86  -I../sysdeps/ieee754/float128
>  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96
>  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32
>  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I=
..
> -I../libio -I.  -D_LIBC_REENTRANT -include
> /usr/src/glibc-2.43/build/libc-modules.h -DMODULE_NAME=3Dlibc -include
> ../include/libc-symbols.h  -DPIC     -DTOP_NAMESPACE=3Dglibc
> -D'LOCALEDIR=3D"/usr/share/locale"' -D'LOCALE_ALIAS_PATH=3D"/usr/share/lo=
cale"'
> -Wno-unused-but-set-variable -Wno-implicit-fallthrough -o
> /usr/src/glibc-2.43/build/intl/plural.o -MD -MP -MF
> /usr/src/glibc-2.43/build/intl/plural.o.dt -MT
> /usr/src/glibc-2.43/build/intl/plural.o
> /usr/src/glibc-2.43/build/intl/plural.c:160:17: error: stray =E2=80=98\33=
=E2=80=99 in
> program
>   160 |     YYEOF =3D 0,PU<U+001B><d1><U+0015>V               /* "end of
> file"  */
>       |                 ^~~~~~~~
> /usr/src/glibc-2.43/build/intl/plural.c:160:18: error: stray =E2=80=98\32=
1=E2=80=99 in
> program
>   160 |     YYEOF =3D 0,PU<U+001B><d1><U+0015>V               /* "end of
> file"  */
>       |                         ^~~~
> /usr/src/glibc-2.43/build/intl/plural.c:160:19: error: stray =E2=80=98\25=
=E2=80=99 in
> program
>   160 |     YYEOF =3D 0,PU<U+001B><d1><U+0015>V               /* "end of
> file"  */
>       |                             ^~~~~~~~
> /usr/src/glibc-2.43/build/intl/plural.c:160:20: error: expected =E2=80=98=
,=E2=80=99 or =E2=80=98}=E2=80=99
> before =E2=80=98V=E2=80=99
>   160 |     YYEOF =3D 0,PUV               /* "end of file"  */
>       |                    ^
> /usr/src/glibc-2.43/build/intl/plural.c:161:21: error: stray =E2=80=98\33=
=E2=80=99 in
> program
>   161 |     YYerror =3D 256,PU<U+001B><d1><U+0015>V           /* error  *=
/
>       |                     ^~~~~~~~
> /usr/src/glibc-2.43/build/intl/plural.c:161:22: error: stray =E2=80=98\32=
1=E2=80=99 in
> program
>   161 |     YYerror =3D 256,PU<U+001B><d1><U+0015>V           /* error  *=
/
>       |                             ^~~~
> /usr/src/glibc-2.43/build/intl/plural.c:161:23: error: stray =E2=80=98\25=
=E2=80=99 in
> program
>   161 |     YYerror =3D 256,PU<U+001B><d1><U+0015>V           /* error  *=
/
>       |                                 ^~~~~~~~
> /usr/src/glibc-2.43/build/intl/plural.c:162:21: error: stray =E2=80=98\33=
=E2=80=99 in
> program
>   162 |     YYUNDEF =3D 257,PU<U+001B><d1><U+0015>V           /* "invalid
> token"  */
>       |                     ^~~~~~~~
> /usr/src/glibc-2.43/build/intl/plural.c:162:22: error: stray =E2=80=98\32=
1=E2=80=99 in
> program
>   162 |     YYUNDEF =3D 257,PU<U+001B><d1><U+0015>V           /* "invalid
> token"  */
>       |                             ^~~~
> /usr/src/glibc-2.43/build/intl/plural.c:162:23: error: stray =E2=80=98\25=
=E2=80=99 in
> program
>   162 |     YYUNDEF =3D 257,PU<U+001B><d1><U+0015>V           /* "invalid
> token"  */
>       |                                 ^~~~~~~~
> ...
>
> This is the build command that generates the file:
> bison --yacc --no-lines --name-prefix=3D__gettext --output
> /usr/src/glibc-2.43/build/intl/plural.c plural.y
>
> This byte pattern repeats many times over throughout plural.c, and every
> build produces different random bytes. Reverting 93efdeeb fixes the issue=
,
> although format.c has been edited since that commit, so attached is a pat=
ch
> file for branch-4.1 current HEAD (commit 63e4afd3) effectively reverting
> it. I have tried both the latest release of bison (3.8.2) and the latest
> TOT (3.8.2.75-089c). This also occurs on glibc TOT and flex TOT (although
> not the latest release).
> I am not sure why it does this, but hopefully this provides enough
> information to fix it in a way that also incorporates the purpose of
> commit 93efdeeb.
>
> -Trent Tanchin
>

--000000000000b8bf3506578f2ade
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">It turns out the bug was much simpler. The argc decrement =
operators got inverted to increment.=C2=A0</div><br><div class=3D"gmail_quo=
te gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, Jul=
 26, 2026 at 9:28=E2=80=AFPM Trent Tanchin &lt;<a href=3D"mailto:trent@tanc=
hin.org">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex"><div dir=3D"ltr"><div>Hello,=C2=A0</div><div><br>=
</div><div>There appears to be a change in the way the ARG_* macros&#39; pr=
ocessing works that causes build failures in some packages that use bison w=
ith versions of m4 starting at commit=C2=A093efdeeb.=C2=A0</div><div><br></=
div><div>An example on my custom linux system (loosely based on LinuxFromSc=
ratch) building glibc-2.43 with gcc-16.1.0:</div><div>gcc /usr/src/glibc-2.=
43/build/intl/plural.c -c -std=3Dgnu11 -fgnu89-inline =C2=A0-g -O2 -Wall -W=
write-strings -Wundef -Wimplicit-fallthrough -fmerge-all-constants -froundi=
ng-math -ftrapping-math -fstack-protector-strong -fno-common -U_FORTIFY_SOU=
RCE -Wstrict-prototypes -Wold-style-definition -Wfree-labels -Wmissing-para=
meter-name -fmath-errno =C2=A0 =C2=A0-fPIE =C2=A0 =C2=A0 -ftls-model=3Dinit=
ial-exec =C2=A0 =C2=A0 -I../include -I/usr/src/glibc-2.43/build/intl =C2=A0=
-I/usr/src/glibc-2.43/build =C2=A0-I../sysdeps/unix/sysv/linux/x86_64/64 =
=C2=A0-I../sysdeps/x86_64/64/nptl =C2=A0-I../sysdeps/unix/sysv/linux/x86_64=
/include -I../sysdeps/unix/sysv/linux/x86_64 =C2=A0-I../sysdeps/unix/sysv/l=
inux/x86/include -I../sysdeps/unix/sysv/linux/x86 =C2=A0-I../sysdeps/x86/np=
tl =C2=A0-I../sysdeps/unix/sysv/linux/wordsize-64 =C2=A0-I../sysdeps/x86_64=
/nptl =C2=A0-I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/lin=
ux =C2=A0-I../sysdeps/nptl =C2=A0-I../sysdeps/pthread =C2=A0-I../sysdeps/gn=
u =C2=A0-I../sysdeps/unix/inet =C2=A0-I../sysdeps/unix/sysv =C2=A0-I../sysd=
eps/unix/x86_64 =C2=A0-I../sysdeps/unix =C2=A0-I../sysdeps/posix =C2=A0-I..=
/sysdeps/x86_64/64 =C2=A0-I../sysdeps/x86_64/fpu/multiarch =C2=A0-I../sysde=
ps/x86_64/fpu =C2=A0-I../sysdeps/x86/fpu =C2=A0-I../sysdeps/x86_64/multiarc=
h =C2=A0-I../sysdeps/x86_64 =C2=A0-I../sysdeps/x86/include -I../sysdeps/x86=
 =C2=A0-I../sysdeps/ieee754/float128 =C2=A0-I../sysdeps/ieee754/ldbl-96/inc=
lude -I../sysdeps/ieee754/ldbl-96 =C2=A0-I../sysdeps/ieee754/dbl-64 =C2=A0-=
I../sysdeps/ieee754/flt-32 =C2=A0-I../sysdeps/wordsize-64 =C2=A0-I../sysdep=
s/ieee754 =C2=A0-I../sysdeps/generic =C2=A0-I.. -I../libio -I. =C2=A0-D_LIB=
C_REENTRANT -include /usr/src/glibc-2.43/build/libc-modules.h -DMODULE_NAME=
=3Dlibc -include ../include/libc-symbols.h =C2=A0-DPIC =C2=A0 =C2=A0 -DTOP_=
NAMESPACE=3Dglibc -D&#39;LOCALEDIR=3D&quot;/usr/share/locale&quot;&#39; -D&=
#39;LOCALE_ALIAS_PATH=3D&quot;/usr/share/locale&quot;&#39; -Wno-unused-but-=
set-variable -Wno-implicit-fallthrough -o /usr/src/glibc-2.43/build/intl/pl=
ural.o -MD -MP -MF /usr/src/glibc-2.43/build/intl/plural.o.dt -MT /usr/src/=
glibc-2.43/build/intl/plural.o<br>/usr/src/glibc-2.43/build/intl/plural.c:1=
60:17: error: stray =E2=80=98\33=E2=80=99 in program<br>=C2=A0 160 | =C2=A0=
 =C2=A0 YYEOF =3D 0,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;end of file&quot; =C2=A0*/<br>=
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ^~~~~~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:160:18: error: stra=
y =E2=80=98\321=E2=80=99 in program<br>=C2=A0 160 | =C2=A0 =C2=A0 YYEOF =3D=
 0,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 /* &quot;end of file&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =
=C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 ^~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:160:19: e=
rror: stray =E2=80=98\25=E2=80=99 in program<br>=C2=A0 160 | =C2=A0 =C2=A0 =
YYEOF =3D 0,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;end of file&quot; =C2=A0*/<br>=C2=A0 =
=C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>/usr/src/glibc-2.43/buil=
d/intl/plural.c:160:20: error: expected =E2=80=98,=E2=80=99 or =E2=80=98}=
=E2=80=99 before =E2=80=98V=E2=80=99<br>=C2=A0 160 | =C2=A0 =C2=A0 YYEOF =
=3D 0,PUV =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;end of =
file&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^<br>/usr/src/glibc-2.43/build/int=
l/plural.c:161:21: error: stray =E2=80=98\33=E2=80=99 in program<br>=C2=A0 =
161 | =C2=A0 =C2=A0 YYerror =3D 256,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt=
;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* error =C2=A0*/<br>=C2=A0 =C2=A0 =
=C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ^~~~~~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:161:22: error: stra=
y =E2=80=98\321=E2=80=99 in program<br>=C2=A0 161 | =C2=A0 =C2=A0 YYerror =
=3D 256,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 /* error =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ^~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:161:23: error: stray =
=E2=80=98\25=E2=80=99 in program<br>=C2=A0 161 | =C2=A0 =C2=A0 YYerror =3D =
256,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 /* error =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 ^~~~~~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:162:21: e=
rror: stray =E2=80=98\33=E2=80=99 in program<br>=C2=A0 162 | =C2=A0 =C2=A0 =
YYUNDEF =3D 257,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 /* &quot;invalid token&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =
=C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ^~~~~~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:162:22: error: stra=
y =E2=80=98\321=E2=80=99 in program<br>=C2=A0 162 | =C2=A0 =C2=A0 YYUNDEF =
=3D 257,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 /* &quot;invalid token&quot; =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 | =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~<br>/usr/src/glibc-2.43/build/intl/plural.c:16=
2:23: error: stray =E2=80=98\25=E2=80=99 in program<br>=C2=A0 162 | =C2=A0 =
=C2=A0 YYUNDEF =3D 257,PU&lt;U+001B&gt;&lt;d1&gt;&lt;U+0015&gt;V =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 /* &quot;invalid token&quot; =C2=A0*/<br>=C2=A0 =
=C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~<br>...</div><=
div><br></div><div>This is the build command that generates the file:=C2=A0=
</div><div>bison --yacc --no-lines --name-prefix=3D__gettext --output /usr/=
src/glibc-2.43/build/intl/plural.c plural.y<br><br></div><div>This byte pat=
tern repeats many times over throughout plural.c, and every build produces =
different random bytes. Reverting=C2=A093efdeeb fixes the issue, although f=
ormat.c has been edited since that commit, so attached is a patch file for =
branch-4.1 current HEAD (commit=C2=A063e4afd3) effectively reverting it. I =
have tried both the latest release of bison (3.8.2) and the latest TOT (3.8=
.2.75-089c). This also occurs on glibc TOT and flex TOT (although not the l=
atest release).=C2=A0</div><div>I am not sure why it does this, but hopeful=
ly this provides enough information to fix it in a way that also incorporat=
es the purpose of commit=C2=A093efdeeb.=C2=A0</div><div><br></div><div>-Tre=
nt Tanchin</div></div>
</blockquote></div>

--000000000000b8bf3506578f2ade--

--000000000000b8bf3706578f2ae0
Content-Type: text/x-patch; charset="US-ASCII"; name="m4-argc-decrement.patch"
Content-Disposition: attachment; filename="m4-argc-decrement.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_ms2nn5s00>
X-Attachment-Id: f_ms2nn5s00

LS0tIG00L3NyYy9mb3JtYXQuYy5vcmlnCTIwMjYtMDctMjYgMjM6MTQ6MjIuMzI1Njk5MTkyIC0w
NDAwCisrKyBtNC9zcmMvZm9ybWF0LmMJMjAyNi0wNy0yNiAyMzoxNDozMi42MjIzNDk5NDAgLTA0
MDAKQEAgLTExOCwxMSArMTE4LDExIEBACiAKICNkZWZpbmUgQVJHX1NUUihhcmdjLCBhcmd2KSBc
CiAgICgoKGFyZ2MpID09IDApID8gIiIgOiBcCi0gICAoKGFyZ2MpKyssIFRPS0VOX0RBVEFfVEVY
VCAoKihhcmd2KSsrKSkpCisgICAoKGFyZ2MpLS0sIFRPS0VOX0RBVEFfVEVYVCAoKihhcmd2KSsr
KSkpCiAKICNkZWZpbmUgQVJHX0RPVUJMRShhcmdjLCBhcmd2KSBcCiAgICgoKGFyZ2MpID09IDAp
ID8gMCA6IFwKLSAgICgoYXJnYykrKywgYXJnX2RvdWJsZSAoVE9LRU5fREFUQV9URVhUICgqKGFy
Z3YpKyspKSkpCisgICAoKGFyZ2MpLS0sIGFyZ19kb3VibGUgKFRPS0VOX0RBVEFfVEVYVCAoKihh
cmd2KSsrKSkpKQogCiAvKiBQYXJzZSBhIHdpZHRoIG9yIHByZWNpc2lvbiBmcm9tIEZNVCdzIHBy
ZWZpeC4KICAgIElmIEZNVFstMV0gPT0gJy4nIHRoaXMgaXMgYSBwcmVjaXNpb24gaW5zdGVhZCBv
ZiBhIHdpZHRoLgo=
--000000000000b8bf3706578f2ae0--