bug-texinfo
[Top][All Lists]
Advanced

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

Re: Texinfo 7.0.93 pretest available


From: Gavin Smith
Subject: Re: Texinfo 7.0.93 pretest available
Date: Sat, 7 Oct 2023 17:26:51 +0100

On Sat, Oct 07, 2023 at 04:00:17PM +0300, Eli Zaretskii wrote:
> > From: Gavin Smith <gavinsmith0123@gmail.com>
> > Date: Sat, 30 Sep 2023 17:16:57 +0100
> > Cc: platform-testers@gnu.org
> > 
> > A pretest distribution for the next Texinfo release (7.1) has been
> > uploaded to
> > 
> > https://alpha.gnu.org/gnu/texinfo/texinfo-7.0.93.tar.xz
> 
> This fails to build on MS-Windows with mingw.org's MinGW.  First, I
> needed to add the missing dTHX in several places; patch below.

I would like to understand why the dTHX is needed now but not before.
I understand it is needed if the function uses malloc/free which explains
why there is a problem in xspara__print_escaped_spaces but not in the
other functions.  (xspara__print_escaped_spaces was only introduced in July
2023 so it was not present in previous releases.)

I've changed xspara__print_escaped_spaces not to use malloc and free,
although adding dTHX should be harmless.

As the program still crashes when the dTHX is inserted, I would like to
find out the cause of this crash before adding the dTHX in, in case the
dTHX itself is responsible for the crash.

It is possible that we have used malloc/free inappropriately in some
place in the code, and if this is the case, we should think about how
we could avoid doing so again in the future (e.g. by adding comments in
appropriate places).

In reset_parser it states

 /* NOTE: Do not call 'malloc' or 'free' in this function or in any function
     called in this file.  Since this file (api.c) includes the Perl headers,
     we get the Perl redefinitions, which we do not want, as we don't use
     them throughout the rest of the program. */

although this comment may be too strong.  reset_parser calls wipe_values
which calls free, but the code in wipe_values dates to 2018 (5 years ago)
and is not problematic.  The comment should probably only refer to 'malloc'
and 'free' inside api.c itself, not any function it calls.

> The crash is inside parsetexi.dll, but I don't know where exactly.
> 
> Any ideas how to debug this?

Try going into the doc directory and replicating the command to build
the manual:

TEXINFO_DEV_SOURCE=1  top_srcdir=".."  top_builddir=".." /d/usr/Perl/bin/perl 
../tp/texi2any -c INFO_SPECIAL_CHARS_WARNING=0  -I . -o texinfo.info  
texinfo.texi

and see if the problem replicates.  More straightforwardly, try

/d/usr/Perl/bin/perl ../tp/texi2any.pl texinfo.texi

(which will output a harmless warning about a node name).

Then you could try with debugging output:

/d/usr/Perl/bin/perl ../tp/texi2any.pl texinfo.texi -c DEBUG=1

or for a smaller file,

/d/usr/Perl/bin/perl ../tp/texi2any.pl info-stnd.texi -c DEBUG=1

to get an idea of where the crash is occurring.



reply via email to

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