Re: [scaffold] don't crash on exit
- From: aurelien resus univ-mrs fr
- To: gnome-devtools gnome org
- Subject: Re: [scaffold] don't crash on exit
- Date: Mon, 29 Dec 2003 12:07:01 +0100
Le dim 28/12/2003 à 05:08, John (J5) Palmieri a écrit :
> Aurelien,
>
> I have been going through your patches. The gnome-session patch which
> you say free's the doc variable too soon does not make sense to me. I
> have worked on the code previously. Basicly it looks like it is
> correctly reading the XML file, parsing it and populating a hash. The
> pointer to the XML stucture is then freed with xmlFreeDoc. This is the
> correct behavior as the doc should not be accessed after that.
>
> Your patch holds onto the XML doc structure until the session object is
> destroyed (which is on exit). Right now it is not much of a problem and
> may fix the crash but since unknown plugins can create arbitrarily long
> session groups there is a remote chance of quite a bit of memory being
> waisted (groups are arbitrary XML structures that are not parsed by the
> session manager and are instead passed directly to the plugin that
> created the group).
>
> Please identify the line where the crash is happening and how it is
> related to the in memory XML structure (e.g. the doc variable).
I'm not on my computer for now so I don't have the source and quite a few
time...
so here is a quick answer : in fact the doc is accessed inside xmlNodeFree call,
so if you prefer freeing the doc immediatly, you have to set the 'doc' element
of the node to NULL. Like that xmlNodeFree won't try to use it.
If you have time to do that that's perfect, otherwise I'll resend this patch
after hollidays perhaps with some others :)
> On Sun, 2003-12-21 at 06:42, aurelien naldi wrote:
> > hello,
> >
> > the attached patch prevents scaffold from crashing on exit and remove an
> > unused variable.
> >
> > a xmlDoc was freed too early and its memory reused.
> >
> > happy hollidays to all :)
--
aurelien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]