bug-texinfo
[Top][All Lists]
Advanced

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

Re: texinfo-6.0.91 pretest


From: Eli Zaretskii
Subject: Re: texinfo-6.0.91 pretest
Date: Fri, 01 Jan 2016 23:19:17 +0200

> Date: Fri, 1 Jan 2016 21:10:05 +0000
> From: Gavin Smith <address@hidden>
> Cc: Texinfo <address@hidden>
> 
> On 1 January 2016 at 20:30, Eli Zaretskii <address@hidden> wrote:
> > If Perl uses its own malloc/free, then we cannot pass to Perl memory
> > allocated in XSParagraph that Perl could free, and we cannot free any
> > memory Perl passes to us.  Is such a scenario plausible?  Are we sure
> > that we only ever free memory that we ourselves allocated, and never
> > pass to Perl memory we allocated?
> 
> malloc and free, apparently, given that the right header files have
> been included:
> 
> https://lists.gnu.org/archive/html/texinfo-devel/2015-07/msg00062.html
> 
> No Perl header files are included in text.c.

Why can't we include Perl headers there?

> The only place in the source I can see where this could cause a
> problem is around line 877 of xspara.c, here:
> 
>  free (new_space.text);
> 
> in xspara_add_text. Is the crash still coming from
> XS_Texinfo__Convert__XSParagraph__XSParagraph_new?

No, it's coming from XS_Texinfo__Convert__XSParagraph__XSParagraph_add_text.
Sorry I didn't spot the small difference earlier.  Here's the full
backtrace:

  perl.exe caused an Access Violation at location 66d287c6 in module 
perl520.dll Writing to location 00000000.

  Registers:
  eax=00000000 ebx=04770a38 ecx=00000000 edx=00000000 esi=0186116c edi=01b52b00
  eip=66d287c6 esp=0022fa70 ebp=0022fb08 iopl=0         nv up ei pl nz na po nc
  cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000206

  Call stack:
  66D287C6  perl520.dll:66D287C6  Perl_drand48_r
  68742448  XSParagraph.dll:68742448  
XS_Texinfo__Convert__XSParagraph__XSParagraph_add_text


> I think a simple way to remove the problem, in the call to free here
> at least, is to add a function to text.c which can be called instead
> to avoid using Perl's version of free.

Assuming we cannot call Perl allocator in text.c, yes.

Btw, all the Google hits for the "Free to wrong pool" message talk
about threads.  Do we have threads in texi2any and/or XSParagraph?



reply via email to

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