Bug 377717

Summary: Fix massive space leak when reading compressed debuginfo sections
Product: [Developer tools] valgrind Reporter: Julian Seward <jseward>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.13 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 303877    
Attachments: Fix

Description Julian Seward 2017-03-17 09:35:21 UTC
Support for compressed debuginfo sections was added in bug 303877.  Although
this works, it uses huge amounts of space, for example more than 15GB memory
for reading from a 580MB libxul.so created with "gcc7 -Og -gz".  Given that
the equivalent non-"-gz" size of the file is about 1.4GB this seems quite
unreasonable.

Furthermore, examination of the bug 303877 fix shows that the changes to
get_slowcase() introduces a tricky invariant which is not documented, which
makes the code hard to understand and hard to reason about.
Comment 1 Julian Seward 2017-03-17 09:42:15 UTC
Created attachment 104607 [details]
Fix

A fix.  Largely rewrites get_slowcase, documents abovementioned invariant,
and adds a bunch of sanity checking for CEnts.
Comment 2 Julian Seward 2017-03-20 21:34:41 UTC
Fixed, r16279.