One of the biggest leaks that valgrind reports is image structures. I'm attaching logs that show memory being allocated by a_Png_new() and cousins and not being freed. There are also frequent leaks of memory allocated by the image libraries from within the various image callbacks, but I suspect these are just another effect of the Dillo image structures not being freed. Unfortunately I'm having a hard time tracking these leaks down. They regularly appear after long browsing sessions, but I haven't found any single page that reproduces them. I suspect they are caused by some race condition inside the CCC rather than the HTML parser. I am browsing with image loading enabled, and if I understand the code correctly that means that the Web structures in the CCC own all the references to image structures. The fact that image structures are reference counted makes it hard to know when the structures should be freed anyway. Indeed, does Dillo even ensure that image structures are freed? Maybe this is just a symptom of incomplete cleanup at exit rather than a true leak? I've looked over the code and can't see any obvious leaks so I'm rather stuck. Any tips for tracking this down? Even if it's not a true leak it would be good to have a fix that cleaned up the valgrind logs. Regards, Jeremy Henty
On Wed, Feb 04, 2009 at 02:47:51PM +0000, Jeremy Henty wrote:
One of the biggest leaks that valgrind reports is image structures. I'm attaching logs that show memory being allocated by a_Png_new() and cousins and not being freed. There are also frequent leaks of memory allocated by the image libraries from within the various image callbacks, but I suspect these are just another effect of the Dillo image structures not being freed.
Unfortunately I'm having a hard time tracking these leaks down. They regularly appear after long browsing sessions, but I haven't found any single page that reproduces them. I suspect they are caused by some race condition inside the CCC rather than the HTML parser. I am browsing with image loading enabled, and if I understand the code correctly that means that the Web structures in the CCC own all the references to image structures.
The fact that image structures are reference counted makes it hard to know when the structures should be freed anyway. Indeed, does Dillo even ensure that image structures are freed? Maybe this is just a symptom of incomplete cleanup at exit rather than a true leak?
I've looked over the code and can't see any obvious leaks so I'm rather stuck. Any tips for tracking this down? Even if it's not a true leak it would be good to have a fix that cleaned up the valgrind logs.
To me it looks like something akin to an aborted request may be the responsible for the reported leaks. Maybe an image redirection, or something that should be an image but ends actually being HTML content. In this case the process is aborted and probably there's an unref missing. A test case would be really valuable. In trying to build a test case, I'd start checking the above suggested cases. -- Cheers Jorge.-
Probably not related, but occasionally progressive jpegs haven't been displaying some of the later scans. (But it's rare and doesn't repeat itself when I try again.)
On Wed, Feb 04, 2009 at 02:47:51PM +0000, Jeremy Henty wrote:
One of the biggest leaks that valgrind reports is image structures. I'm attaching logs that show memory being allocated by a_Png_new() and cousins and not being freed. There are also frequent leaks of memory allocated by the image libraries from within the various image callbacks, but I suspect these are just another effect of the Dillo image structures not being freed.
Unfortunately I'm having a hard time tracking these leaks down. They regularly appear after long browsing sessions, but I haven't found any single page that reproduces them. I suspect they are caused by some race condition inside the CCC rather than the HTML parser. I am browsing with image loading enabled, and if I understand the code correctly that means that the Web structures in the CCC own all the references to image structures.
The fact that image structures are reference counted makes it hard to know when the structures should be freed anyway. Indeed, does Dillo even ensure that image structures are freed? Maybe this is just a symptom of incomplete cleanup at exit rather than a true leak?
I've looked over the code and can't see any obvious leaks so I'm rather stuck. Any tips for tracking this down? Even if it's not a true leak it would be good to have a fix that cleaned up the valgrind logs.
I guess there is a leak when image loading is off. In that case images are not put in the html->images list and therefore not unrefed when leaving the page. Can you please try attached patch with valgrind and image loading on and off. Regards, Johannes
participants (4)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
onepoint@starurchin.org