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: Gavin Smith
Subject: Re: texinfo-6.0.91 pretest
Date: Fri, 1 Jan 2016 19:50:18 +0000

On 1 January 2016 at 19:15, Eli Zaretskii <address@hidden> wrote:
>   Call stack:
>   66D287C6  perl520.dll:66D287C6  Perl_drand48_r
>   68741736  XSParagraph.dll:68741736  
> XS_Texinfo__Convert__XSParagraph__XSParagraph_new
>
> There's also an error message printed on stderr:
>
>   Free to wrong pool 3f5d18 not 60e011e at ../tp/Texinfo/Convert/Plaintext.pm 
> line 663.
>
> This seems to be related to some memory problem.  Any suggestions for
> how to track down this one?

There are calls to free in xspara_new, maybe they're the problem? The
following removes them:

Index: Texinfo/Convert/XSParagraph/xspara.c
===================================================================
--- Texinfo/Convert/XSParagraph/xspara.c        (revision 6902)
+++ Texinfo/Convert/XSParagraph/xspara.c        (working copy)
@@ -265,11 +265,14 @@
   dTHX; /* Perl boiler plate */

   /* Avoid leaking the memory used last time. */
-  free (state.space.text);
-  free (state.word.text);
+  TEXT saved_space = state.space, saved_word = state.word;

-  /* Default values for formatter. */
+  /* Default values for formatter, reusing storage. */
   memset (&state, 0, sizeof (state));
+  state.space = saved_space;
+  state.word = saved_word;
+  state.space.end = state.word.end = 0;
+
   state.max = 72;
   state.indent_length_next = -1; /* Special value meaning undefined. */
   state.end_sentence = -2; /* Special value meaning undefined. */


> (Where do we call drand48?)

Probably nowhere. I ran XSParagraph.c through the C preprocessor and
it didn't appear anywhere.

There are calls to 'free' elsewhere in the code as well, but I don't
know if they are problematic or not. The webpages I looked said that
this error ("Free to wrong pool") was to do with threads.

I noticed in none of the functions in text.c is the Perl context
retrieved ("dTHX"). I remember this was a problem with memory
allocation in the previous thread I linked earlier, because Perl has
to do something to malloc. That could be related.



reply via email to

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