wolf2009 / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

stackwalk memory leak when a symbol file contains invalid function lines #462

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Command used:
$ mimidump_stackwalk  a.dmp  /path/to/symbols

I have a 55MB libxul.so.sym symbol file that contains some lines like this:

FUNC 557bb8 aa 0 nsXULAppInfo::QueryInterface(nsID const&, void**)
0 0 0 5076
0 557bb8 0 5076

which causes "basic_source_line_resolver.cc 
BasicSourceLineResolver::Module::LoadMapFromMemory" to fail on the "ParseLine" 
call - which seems to result in libxul.so.sym being loaded over and over again 
(log output below, line 6014 corresponds to the "0 0 0 5076" above).

Due to this leaking memory, my systems 4GB of memory is all used up within 
10-20 seconds.

I cannot attach the symbol file in question - as it's too big (even zipped it's 
11MB).

Note: This is from Komodo - which is a modified version of mozilla/firefox code 
base, using the same tools as Firefox uses for crash report creation and 
processing.

Here is a snippet of the log output that is generated from the above command 
(note how libxul is loaded over and over):

2012-01-19 13:16:36: basic_code_modules.cc:88: INFO: No module at 0x7fecc9f6f180
2012-01-19 13:16:36: basic_code_modules.cc:88: INFO: No module at 0x0
2012-01-19 13:16:36: basic_code_modules.cc:88: INFO: No module at 0x7fed33db43a0
2012-01-19 13:16:37: source_line_resolver_base.cc:220: INFO: Loading symbols 
for module /opt/komodo/Komodo-IDE-7.0.0b1/lib/mozilla/libxul.so from memory 
buffer
2012-01-19 13:16:37: basic_source_line_resolver.cc:137: ERROR: ParseLine failed 
at 6014 for 0
2012-01-19 13:16:37: basic_code_modules.cc:88: INFO: No module at 0x0
2012-01-19 13:16:37: source_line_resolver_base.cc:220: INFO: Loading symbols 
for module /opt/komodo/Komodo-IDE-7.0.0b1/lib/mozilla/libxul.so from memory 
buffer
2012-01-19 13:16:37: basic_source_line_resolver.cc:137: ERROR: ParseLine failed 
at 6014 for 0
2012-01-19 13:16:37: source_line_resolver_base.cc:220: INFO: Loading symbols 
for module /opt/komodo/Komodo-IDE-7.0.0b1/lib/mozilla/libxul.so from memory 
buffer
2012-01-19 13:16:37: basic_source_line_resolver.cc:137: ERROR: ParseLine failed 
at 6014 for 0
2012-01-19 13:16:37: basic_code_modules.cc:88: INFO: No module at 0x7fed05ef1fd0
2012-01-19 13:16:37: source_line_resolver_base.cc:220: INFO: Loading symbols 
for module /opt/komodo/Komodo-IDE-7.0.0b1/lib/mozilla/libxul.so from memory 
buffer
2012-01-19 13:16:37: basic_source_line_resolver.cc:137: ERROR: ParseLine failed 
at 6014 for 0
2012-01-19 13:16:38: source_line_resolver_base.cc:220: INFO: Loading symbols 
for module /opt/komodo/Komodo-IDE-7.0.0b1/lib/mozilla/libxul.so from memory 
buffer
2012-01-19 13:16:38: basic_source_line_resolver.cc:137: ERROR: ParseLine failed 
at 6014 for 0
2012-01-19 13:16:38: basic_code_modules.cc:88: INFO: No module at 0x7fec00000001
2012-01-19 13:16:38: basic_code_modules.cc:88: INFO: No module at 0x7fecd8c37160
2012-01-19 13:16:38: basic_code_modules.cc:88: INFO: No module at 0x7fed05f2aea0
2012-01-19 13:16:38: source_line_resolver_base.cc:220: INFO: Loading symbols 
for module /opt/komodo/Komodo-IDE-7.0.0b1/lib/mozilla/libxul.so from memory 
buffer
2012-01-19 13:16:38: basic_source_line_resolver.cc:137: ERROR: ParseLine failed 
at 6014 for 0

Original issue reported on code.google.com by to...@activestate.com on 19 Jan 2012 at 9:20

GoogleCodeExporter commented 9 years ago
I made a workaround of not returning false when ParseLine failed and just 
ignored the bad line(s) - which then doesn't have the leak - but I don't think 
this is the correct fix.

Original comment by to...@activestate.com on 19 Jan 2012 at 9:22