lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev leaks (was: bug: print vs partial)


From: brian j. pardy
Subject: Re: lynx-dev leaks (was: bug: print vs partial)
Date: Fri, 4 Dec 1998 10:54:22 -0800 (PST)

On Fri, 4 Dec 1998, Klaus Weide wrote:

> On Thu, 3 Dec 1998, brian j. pardy wrote:
> 
> > > Is this a permanent one?
> > 
> > Memory leak detected.
> > Pointer:        0x8167ac0
> > Contains::      <h1>Lynx (2.8.2dev.8), help on <a href="file://loc
> > ByteSize:       297
> > FileName:       ../../../WWW/Library/Implementation/HTString.c
> > LineCount:      349
> 
> Is that from the cookie code?  It is hard to tell.

I'm not sure. I get the impression (well, since it says so :) that this is
from HTString.c. I think it's happening when Lynx creates the cookie jar
page, and thus isn't related to cookie handling itself. This may or may not
be happening upon visiting regular webpages, I'm not sure.

Anyways -- it leaked about 30k of data, and it seemed like it was mostly
nothing more than HTML tags. 

> > Simply starting Lynx and viewing the cookie jar page seems to leak about
> > 30k (I have a lot of cookies when I start up).
> > 
> > I'm not sure exactly how to go about determining if a leak is permanent or
> > non-permanent, and looking back through the cookie code, the leaks I was
> > thinking of before seem to not be a problem. I think they are simply the
> > domain entries for each domain, which are still used (if I free them, we
> > get empty cookies during runtime). These leaks are:
[...]
> > Line 2575 and 2653 are mine, from cookie_add_acceptlist and
> > cookie_add_rejectlist. It looks like the cookie data itself is already
> > being properly free'd (is the '|' a NULL in memory?), only the domain_entry
> > struct (which is 12 bytes) seems to be left at exit. It would indeed look
> > cleaner to have this cleaned out, but I don't think it's a problem.
> 
> >From looking at the code, it seems the domain_entry structures are never
> freed.  At least I didn't find where that happens, but I may have missed it.
> If that is true, they should be freed at least in LYCookieJar_free, which
> is only called at exit:
> 
> .....
>             FREE(de->domain);
>             HTList_delete(de->cookie_list);
>             de->cookie_list = NULL;
>           FREE(dl->object);
>         }
>         dl = dl->next;
> .....
> 
> but I have not tested this.

I tried something similar, and seemed to be getting segfaults when dl->object
was freed. I didn't look into it with gdb or anything, though.

> > Another leak at:
> > 
> > Memory leak detected.
> > Pointer:        0x81381e0
> > Contains::      LYNX_VERSION=2.8.2dev.8|
> > ByteSize:       24
> > FileName:       ./LYMain.c
> > LineCount:      754
> > realloced:      ./LYMain.c
> > LineCount:      755
> 
> That looks "permanent".  Anyway my patch from Sat, 14 Nov put a
>     FREE(lynx_version_putenv_command);
> after the
>     putenv(lynx_version_putenv_command);
> but that seems to not have made it into the devel code.

Ah, I see.

-- 
GPG & PGP public keys: <URL:http://www.psnw.com/~posterkid/keys/> 
PGP fingerprint: 42 57 B3 D2 39 8E 74 C3  5E 4D AC 43 25 D2 26 D4

reply via email to

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