texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] Re: Debugging memory management in TeXmacs


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] Re: Debugging memory management in TeXmacs
Date: Sun, 22 Oct 2006 22:53:43 +0200
User-agent: Mutt/1.5.9i

On Fri, Oct 20, 2006 at 11:45:27AM +0200, Lionel Elie Mamane wrote:
> >> If found a reproducible way to crash TeXmacs, (...) The error is
> >> that TeXmacs call free() on a pointer that was not returned by
> >> malloc() (...) I wasn't able to get a meaningful backtrace.
> 
> >> I have to recompile Guile in debugging mode then?

In order to get meaningful backtraces for Guile code, do

        Tools -> Test -> Backtrace errors

> > I did that, and indeed I get a real backtrace now. Here's the
> > beginning of it:
> 
> > #4  0x00002ac21c19722e in free () from /lib/libc.so.6
> > #5  0x000000000041935f in operator delete (ptr=0x1261bc8) at 
> > ./Classes/Abstract/basic.cpp:46
> > #6  0x0000000000411304 in ~abstract_struct (this=0x1261bd0) at 
> > Classes/Abstract/basic.hpp:115
> > #7  0x000000000040b88a in ~observer (this=0x7fff8faf9f40) at 
> > Classes/Abstract/observer.hpp:69
> > #8  0x0000000000605a52 in list_observer (address@hidden, address@hidden) at 
> > ./Classes/Atomic/list_observer.cpp:183
> > #9  0x0000000000605a9f in insert_observer (address@hidden, address@hidden) 
> > at ./Classes/Atomic/list_observer.cpp:188
> > #10 0x00000000006d9079 in tree_pointer_rep::set_tree (this=0x10568c0, 
> > address@hidden) at ./Classes/Atomic/tree_pointer.cpp:69

Anyway, the error seems to be in the C++ code.

> I did some investigation at this point and here are my findings:
> 
> (gdb) print t
> $3 = (tree &) @0x7fff8fafa050: {rep = 0x1271bd0, static init = UNINIT}
> (gdb) print t.rep
> $4 = (tree_rep *) 0x1271bd0
> (gdb) print this->ptr
> $11 = (tree_rep *) 0x1271bd0
> 
> So "this" and the argument to set_tree have the same tree_rep
> pointer (whatever that is; maybe "tree representation"?). Is this
> normal and supported?

It could be that the error is indeed due to TeXmacs, especially because
it is in the recently added linking stuff, but it is very hard for me
to debug this type of errors (if they don't come from my own code).
Indeed, if you use some Guile code yourself in your plug-in and especially
the tree modification routines, it may be that you did something wrong there.
Before I take a closer look, I would like to make sure that you are just
using the TeXmacs protocol and nothing else. In that case, it could be
a good idea to run with --debug-io and see at which point things go wrong.

Best wishes, Joris




reply via email to

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