texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me...


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me...
Date: Tue, 5 Nov 2002 19:14:41 +0100 (MET)

> >>>>+inline tree::~tree ()
> >>>>+{
> >>>>+    if ((--rep->ref_count)==0) {
> >>>>+        //destroy_tree_rep (rep);
> >>>>+        delete rep;
> >>>>+        rep = NULL;
> >>>>+    }
> >>>>+}
> >>>
> >>>Again, the function destroy_tree_rep explicitly does the "delete rep"
> >>>depending on the kind of tree (string or compound). Indeed, this type
> >>>can be determined as a function of "op", so destroy_tree_rep plays
> >>>the rĂ´le of a virtual destructor *without* the extra space overhead.
> >>>It may still be interesting though to add the line "rep = NULL"
> >>>to destroy_tree_rep.
> >
> >>Nope, it does a wild cast do destruct an object. Correct?
> > 
> > 
> > Well, a cast yes, but not a wild cast, since we *know* the cast to be 
> > correct.
> > 
> 
> Yep.
> 
> Still, yet another path being walked in bug detection...

What is surprising, is that the patch you proposed does seem to eliminate
the bug on your system. Please check well though, because I did notice
some change in the behaviour of TeXmacs. For instance, TeXmacs does not
automatically crash at the first autosave, but only after typing a bit.
You may also try to add a line "rep = NULL" at the end of destroy_tree_rep
in order to check whether this also stabilizes TeXmacs on your system...

In fact, the bug seems to be related to some kind of memory corruption.
Another approach might be to determine which memory location
is corrupted and then try to track down where in the code this happens.
It may be some very dumb compilation error in some not-too-often used routine.
I do not know any debugging tool which allows you to do this though.





reply via email to

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