Re: texinfo-7.2.92 pretest available [segfault building gcc docs]

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <aZ3xZ4vy86vUtoVp@orangestar>
On Tue, Feb 24, 2026 at 12:10:56AM +0100, Hilmar Preusse wrote:
> On 17.02.26 Gavin Smith ([email protected]) wrote:
> 
> Hello,
> 
> > The next pretest distribution for the next Texinfo release has been
> > uploaded to
> > 
> > https://alpha.gnu.org/gnu/texinfo/texinfo-7.2.92.tar.xz
> > 
> > Many thanks to all those who have tested earlier pretests and reported
> > the results.  There have not been many changes since the previous pretest,
> > and we hope to release this as Texinfo 7.3 in a few days' time.
> > 
> 
> We packaged the pre-releases in Debian and did some tests build of
> Debian packages using the pretest version to figure, if the new
> version breaks things in the Debian archive.  We found that the
> gcc-12-doc_12.2.0-1 fails to build:
> 
> gcc/ada/gnat_ugn.texi:24453: warning: @emph should not appear in @code
> gcc/ada/gnat_ugn.texi:24473: warning: @emph should not appear in @code
> gcc/ada/gnat_ugn.texi:28375: warning: @emph should not appear in @code
> Segmentation fault (core dumped)
> make[2]: *** [debian/Makefile:116: gnat_ugn.html] Error 139

Thanks for running these tests and reporting this.  We definitely don't
want to be releasing a program that segfaults on input, especially on
gcc documentation.

I've been able to reproduce the segmentation fault.  I tried building
gnat_ugn.texi after downloading manual sources from
https://gcc.gnu.org/onlinedocs/12.2.0/.

I had to use the full command line from your coredumpctl output below,
with the addition of a --force option to account for a missing input file:

perl ../../tta/perl/texi2any.pl -D $'fncpp cpp' -D $'fncppint cppinternals' -D $'fngcc gcc' -D $'fngxx g++' -D $'fngccint gccint' -D $'fngccinstall gccinstall' -D $'fngfortran gfortran' -D $'fntreelang treelang' -D $'fngnatrm gnat_rm' -D $'fngnatrmlong GNAT Reference Manual' -D $'fngnatugn gnat_ugn' -D $'fngnatugnlong GNAT User\'s Guide' -D $'fngnatstyle gnat-style' -D $'fngccgo gccgo' -D $'fngcov gcov' -D $'fngcovtool gcov-tool' -D $'fngcovdump gcov-dump' -D $'fnlibgomp libgomp' -D $'fnlibitm libitm' -D $'fnlibquadmath libquadmath' -D $'fnltodump lto-dump' -D $'BUGURL http://bugs.debian.org/' --no-split -Igcc/doc -Igcc/doc/include --html -o gnat_ugn.html gcc/ada/gnat_ugn.texi --force

Valgrind reports an error:

==2562765== Memcheck, a memory error detector
==2562765== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==2562765== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==2562765== Command: perl ../../tta/perl/texi2any.pl -D fncpp\ cpp -D fncppint\ cppinternals -D fngcc\ gcc -D fngxx\ g++ -D fngccint\ gccint -D fngccinstall\ gccinstall -D fngfortran\ gfortran -D fntreelang\ treelang -D fngnatrm\ gnat_rm -D fngnatrmlong\ GNAT\ Reference\ Manual -D fngnatugn\ gnat_ugn -D fngnatugnlong\ GNAT\ User's\ Guide -D fngnatstyle\ gnat-style -D fngccgo\ gccgo -D fngcov\ gcov -D fngcovtool\ gcov-tool -D fngcovdump\ gcov-dump -D fnlibgomp\ libgomp -D fnlibitm\ libitm -D fnlibquadmath\ libquadmath -D fnltodump\ lto-dump -D BUGURL\ http://bugs.debian.org/ --no-split -Igcc/doc -Igcc/doc/include --html -o gnat_ugn.html gcc/ada/gnat_ugn.texi --force
==2562765== Parent PID: 2440939
==2562765== 
==2562765== Invalid read of size 1
==2562765==    at 0x484F286: __strlen_sse2 (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2562765==    by 0x6A3E5E5: text_append (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo.so.1.0.0)
==2562765==    by 0x6A51259: convert_to_normalized_internal (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo.so.1.0.0)
==2562765==    by 0x6A51572: convert_to_normalized_internal (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo.so.1.0.0)
==2562765==    by 0x6A51618: convert_to_normalized (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo.so.1.0.0)
==2562765==    by 0x6A51AD1: convert_to_identifier (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo.so.1.0.0)
==2562765==    by 0x6A51B65: convert_contents_to_identifier (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo.so.1.0.0)
==2562765==    by 0x6B9B8D2: normalized_sectioning_command_filename (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo-convert.so.1.0.0)
==2562765==    by 0x6BDB7CE: new_sectioning_command_target (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo-convert.so.1.0.0)
==2562765==    by 0x6BDBEF2: set_root_commands_targets_node_files (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo-convert.so.1.0.0)
==2562765==    by 0x6BDCD32: html_prepare_conversion_units_targets (in /home/g/src/texinfo/GIT/tta/C/.libs/libtexinfo-convert.so.1.0.0)
==2562765==    by 0x753F48A: XS_Texinfo__Convert__ConvertXS_html_output (in /home/g/src/texinfo/GIT/tta/perl/XSTexinfo/.libs/ConvertXS.so)
==2562765==  Address 0x255025502550255 is not stack'd, malloc'd or (recently) free'd
==2562765== 


I'm hopeful we can investigate and fix this.

With fewer options, there is not a segfault, but still outputs a large number
of warnings about nesting which I do not believe are correct:

$ perl ../texinfo-7.2.92/tta/perl/texi2any.pl -I gcc/gcc/doc/include/ gcc/gcc/ada/gnat_ugn.texi
gcc/gcc/ada/gnat_ugn.texi:18: warning: @definfoenclose is obsolete
gcc/gcc/ada/gnat_ugn.texi:19: warning: @definfoenclose is obsolete
gcc/gcc/doc/include/gcc-common.texi:11: @include: could not find gcc-vers.texi
gcc/gcc/ada/gnat_ugn.texi:55: warning: undefined flag: version-GCC
gcc/gcc/ada/gnat_ugn.texi:942: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:946: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:950: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1237: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1250: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1263: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1276: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1289: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1300: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1314: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1321: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1329: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1352: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1367: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1378: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1390: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1401: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1422: warning: @emph should not appear in @item
gcc/gcc/ada/gnat_ugn.texi:1463: warning: @emph should not appear in @item

- and it continues.

gcc-vers.texi is not present anywhere in docs-sources.tar.gz that I downloaded
and is presumably responsible for setting the version-GCC flag.

There's nothing wrong with @emph in @item, AFAIK.

When building after configuring with --disable-perl-xs, the error messages
do not occur:

$ perl ../tta/perl/texi2any.pl -I gcc/gcc/doc/include/ gcc/gcc/ada/gnat_ugn.texi
gcc/gcc/ada/gnat_ugn.texi:18: warning: @definfoenclose is obsolete
gcc/gcc/ada/gnat_ugn.texi:19: warning: @definfoenclose is obsolete
gcc/gcc/doc/include//gcc-common.texi:11: @include: could not find gcc-vers.texi
gcc/gcc/ada/gnat_ugn.texi:55: warning: undefined flag: version-GCC

So there is also a bug here that the warnings are not consistent
between XS/pure Perl code, and appear to be incorrect with the XS code.


> the coredumpctl reports:
> 
> root@rasppi3:~# coredumpctl info /run/schroot/mount/arm64-sid-a3802f59-def6-43d6-bfe8-43b535c91509/usr/bin/perl
>            PID: 620253 (makeinfo)
>            UID: 1000 (hille)
>            GID: 1000 (hille)
>         Signal: 11 (SEGV)
>      Timestamp: Mon 2026-02-23 20:14:21 CET (3h 42min ago)
>    Command Line: /usr/bin/perl /usr/bin/makeinfo -D $'fncpp cpp' -D $'fncppint cppinternals' -D $'fngcc gcc' -D $'fngxx g++' -D $'fngccint gccint' -D $'fngccinstall gccinstall' -D $'fngfortran gfortran' -D $'fntreelang treelang' -D $'fngnatrm gnat_rm' -D $'fngnatrmlong GNAT Reference Manual' -D $'fngnatugn gnat_ugn' -D $'fngnatugnlong GNAT User\'s Guide' -D $'fngnatstyle gnat-style' -D $'fngccgo gccgo' -D $'fngcov gcov' -D $'fngcovtool gcov-tool' -D $'fngcovdump gcov-dump' -D $'fnlibgomp libgomp' -D $'fnlibitm libitm' -D $'fnlibquadmath libquadmath' -D $'fnltodump lto-dump' -D $'BUGURL http://bugs.debian.org/' --no-split -Igcc/doc -Igcc/doc/include --html -o gnat_ugn.html gcc/ada/gnat_ugn.texi
>     Executable: /run/schroot/mount/arm64-sid-a3802f59-def6-43d6-bfe8-43b535c91509/usr/bin/perl
> 
> So it is basically the perl compiler, which crashes when executing
> makeinfo. However due to the XS extensions it may be C code from
> TeXInfo too. I'll try to generate backtraces to figure if TeXInfo
> causes the issue.

It's almost certainly a bug in the XS extensions, rather than a segfault
in the Perl interpreter itself.

> 
> I don't see that as showstopper anyway. Keep me in Cc, I'm not
> subscribed.
> 
> Hilmar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.