MantisBT - NetSurf
View Issue Details
0002491NetSurf[All Projects] Generalpublic2016-12-05 23:532019-09-09 13:05
ReporterChris Young 
Assigned ToDaniel Silverstone 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformAmigaOSAmigaOSOS Version3.5
Product Version 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #3794
URL of problem page
Summary0002491: Memory leaks in libdom
DescriptionI've built the Amiga frontend of NetSurf with clib's memory debugging mode. This logs memory allocations and will note when they haven't been freed.

See bug 2489 for more info.

For libdom, we have the following not freed:
src/core/string.c:101 (0000390:0000016 bytes)
src/core/string.c:105 (various sizes)
Steps To ReproduceThis is a simple open/close NetSurf only viewing about:welcome
Additional InformationRelevant part of log:

[NetSurf] - 16 0x1164D610 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 4 0x1164DE48 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x1164E680 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 6 0x1164EEB8 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x1164F6F0 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 29 0x1164FF28 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x11650760 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 35 0x11650F98 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x116517D0 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 27 0x11652008 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x11652840 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 29 0x11653078 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x116538B0 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 37 0x116540E8 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
[NetSurf] - 16 0x11654920 [allocated at src/core/string.c:101, freed at stdlib_malloc.c:399]
[NetSurf] - 30 0x11655158 [allocated at src/core/string.c:105, freed at stdlib_malloc.c:399]
TagsNo tags attached.
related to 0002489resolved Chris Young Memory leaks 
Attached Files

Notes
(0001455)
Chris Young   
2016-12-06 00:24   
I put this down as a libdom bug, but after a quick look I think libdom is OK, and it's NetSurf not destroying the strings.
(0001466)
Vincent Sanders   
2016-12-31 12:28   
looks like netsurf has some dom strings still referenced.

Right sod to track down without explicit dump code to show what they are.
(0001480)
Michael Drake   
2017-01-06 10:19   
They won't be interned dom strings, or the wapcaplet exit iterator would list them. I'd be tempted to do a quick hack to libdom, to make it intern all strings, run with that, and have the wapcaplet iterator tell us what they are.
(0001791)
Vincent Sanders   
2018-07-29 10:20   
daniel has been looking at several libdom leaks revealed by the sanitizer checks
(0001934)
Daniel Silverstone   
2019-06-05 21:04   
I'd like to know if this is still the case Chris?
(0001939)
Chris Young   
2019-06-05 21:53   
I'll rebuild it when I have time and report back.
(0001952)
Chris Young   
2019-06-09 19:07   
Looks like no change from previous:

 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EF1C10 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 4 0x55EF25B0 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EF3270 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 6 0x55EF3C10 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EF45B0 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 29 0x55EF5270 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EF5C10 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 35 0x55EF65B0 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EC7270 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 27 0x55EC7C10 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EC85B0 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 29 0x55EC9270 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55EC9C10 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 37 0x55ECA5B0 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 16 0x55ECB270 [ allocated at src/core/string.c:101, freed at stdlib_malloc.c:424]
 [Apps:Internet/NetSurf/NetSurf_debug] - 30 0x55ECBC10 [ allocated at src/core/string.c:105, freed at stdlib_malloc.c:424]
(0002088)
Daniel Silverstone   
2019-09-07 14:29   
I can confirm there're definitely some leaked DOM strings if I create a browser window, navigate it to about:welcome, render it, destroy it, and close the browser using Monkey.
(0002089)
Daniel Silverstone   
2019-09-07 14:40   
I've added support for finalising the DOM namespace strings during `netsurf_exit()` so hopefully this is resolved.

Chris: If you can take a look and let me know if we're still leaking stuff?
(0002092)
Chris Young   
2019-09-08 14:19   
All looks good.

Issue History
2016-12-05 23:53Chris YoungNew Issue
2016-12-05 23:53Chris YoungRelationship addedrelated to 0002489
2016-12-06 00:22Chris YoungProjectLibDOM => NetSurf
2016-12-06 00:24Chris YoungNote Added: 0001455
2016-12-31 12:28Vincent SandersNote Added: 0001466
2016-12-31 12:28Vincent SandersStatusnew => acknowledged
2017-01-06 10:19Michael DrakeNote Added: 0001480
2018-07-29 10:20Vincent SandersAssigned To => Daniel Silverstone
2018-07-29 10:20Vincent SandersStatusacknowledged => confirmed
2018-07-29 10:20Vincent SandersNote Added: 0001791
2019-06-05 21:04Daniel SilverstoneNote Added: 0001934
2019-06-05 21:53Chris YoungNote Added: 0001939
2019-06-05 21:53Chris YoungAssigned ToDaniel Silverstone => Chris Young
2019-06-09 19:07Chris YoungNote Added: 0001952
2019-06-09 19:08Chris YoungAssigned ToChris Young => Daniel Silverstone
2019-09-07 14:29Daniel SilverstoneNote Added: 0002088
2019-09-07 14:40Daniel SilverstoneNote Added: 0002089
2019-09-08 14:19Chris YoungNote Added: 0002092
2019-09-09 13:05Daniel SilverstoneStatusconfirmed => resolved
2019-09-09 13:05Daniel SilverstoneResolutionopen => fixed