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

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <aZ9bAWhuies3FDF9@orangestar>
On Tue, Feb 24, 2026 at 06:43:52PM +0000, Gavin Smith wrote:
> > 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
> 

I've cut it down to a much smaller input file and invocation.  Indeed, it is
related to the strange warnings about the nesting of @emph.

I believe the reason these warnings were issued is because @emph was defined
with @definfoenclose!

The failing gnat_ugn.texi file was generated by Sphinx, which used to use
@definfoenclose in its output to customize the output for @emph and @strong.
(I believe newer releases of Sphinx stopped using @definfoenclose in its
Texinfo output, once we marked the command as deprecated.)

I'd hoped that one day we could remove the @definfoenclose command from Texinfo,
as it adds a lot of complexity to allow definining new Texinfo commands, for
no real benefit.  But if it's baked into the documentation for old gcc releases,
this could be a problem, in case somebody was wanting to use Texinfo to build
this older documentation.

Evidently the HTML output code does not cope well with a @definfoenclose-defined
command on a @subsection line.

--------------------------------------------------------------------
\input texinfo   @c -*-texinfo-*-
@setfilename gnat_ugn.info
@documentencoding UTF-8
@settitle GNAT User's Guide for Native Platforms

@definfoenclose strong,`,'
@definfoenclose emph,`,'

@node Using the next Command in a Function,Stopping When Ada Exceptions Are Raised,Calling User-Defined Subprograms,Running and Debugging Ada Programs
@anchor{gnat_ugn/gnat_and_program_execution id8}@anchor{158}@anchor{gnat_ugn/gnat_and_program_execution using-the-next-command-in-a-function}@anchor{159}
@subsection Using the @emph{next} Command in a Function


When you use the @code{next} command in a function, the current source
location will advance to the next statement as usual. A special case
arises in the case of a @code{return} statement.

@bye
--------------------------------------------------------------------

$ perl ../../tta/perl/texi2any.pl  --html -o fail.html fail.texi --force
fail.texi:6: warning: @definfoenclose is obsolete
fail.texi:7: warning: @definfoenclose is obsolete
fail.texi:11: warning: @emph should not appear on @subsection line
fail.texi:9: Next reference to nonexistent `Stopping When Ada Exceptions Are Raised'
fail.texi:9: Prev reference to nonexistent `Calling User-Defined Subprograms'
fail.texi:9: Up reference to nonexistent `Running and Debugging Ada Programs'
Segmentation fault (core dumped)
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.