Symbolication of local Android and Linux builds does not work due to out-of-memory errors
Categories
(Core :: Gecko Profiler, defect, P2)
Tracking
()
People
(Reporter: mstange, Assigned: mstange)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
When profiling local builds for Android or Linux, symbolication of libxul.so often fails. That's because that file is really really big and we try to extract symbols from it using a piece of WebAssembly.
My libxul.so for Android is 1.85GB big. And a libxul.so for Linux is 2.2GB big. The WebAssembly heap is limited to 2GB, so we run out of wasm memory during symbolication.
90% of this size is due to debug information. Stripping out the debug information can work around the problem but needs to be done manually. For example with the following command:
~/.mozbuild/clang/bin/llvm-strip --no-strip-all --strip-debug /Users/mstange/code/obj-m-android-opt/toolkit/library/build/libxul.so
| Assignee | ||
Comment 1•5 years ago
|
||
Bug 1392234 might increase this limitation to 4GB soon. I'll wait for a bit more before I decide what to do here.
| Assignee | ||
Comment 2•5 years ago
|
||
Julian Seward convinced me that I really want to implement a different approach, where we only read the parts of the files that we actually need. That should both be faster and use less memory.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
A potential mozconfig workaround that was suggested by Mike Hommey:
export LDFLAGS=-Wl,--compress-debug-sections=zlib
| Assignee | ||
Comment 4•4 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #2)
where we only read the parts of the files that we actually need.
Implementing this doesn't seem straightforward because the object crate wants a slice to the entire file. This is in contrast to the DWARF information reader which has a Reader abstraction.
Comment 5•4 years ago
|
||
Not really advocating using lots of RAM, and that said: heaps > 2GB are coming but will realistically be operational 2021Q2 at the earliest.
| Assignee | ||
Comment 6•4 years ago
•
|
||
(In reply to Markus Stange [:mstange] from comment #4)
(In reply to Markus Stange [:mstange] from comment #2)
where we only read the parts of the files that we actually need.
Implementing this doesn't seem straightforward because the
objectcrate wants a slice to the entire file. This is in contrast to the DWARF information reader which has aReaderabstraction.
I've filed gimli-rs/object#269 to discuss changing object's API.
| Assignee | ||
Comment 7•4 years ago
|
||
Update: Philip Craig has started implementing the proposed API in the object crate. I have a prototype which makes use of the new API and it looks really promising.
Bug 1711843 shows that this issue may also produce totally wrong garbage.
Comment 10•4 years ago
|
||
Update on our side: 4GB heaps are now a thing in Wasm on 64-bit systems (FF89), so the bug should probably be retitled, but see comment 5.
| Assignee | ||
Comment 11•4 years ago
|
||
So yeah, people are still seeing this despite the 4GB heap size, and I'm not sure why. Anyway, I have the partial-read approach working locally and I'm planning to finish this work soon.
| Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #11)
So yeah, people are still seeing this despite the 4GB heap size, and I'm not sure why. Anyway, I have the partial-read approach working locally and I'm planning to finish this work soon.
Last time we looked, the unstripped libxul is much bigger than 4GB actually :/
Comment 13•4 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #12)
(In reply to Markus Stange [:mstange] from comment #11)
So yeah, people are still seeing this despite the 4GB heap size, and I'm not sure why. Anyway, I have the partial-read approach working locally and I'm planning to finish this work soon.
Last time we looked, the unstripped libxul is much bigger than 4GB actually :/
On my local linux build it's 2.1GB unstripped, and 227MB stripped. We might be doing multiple string copies.
| Assignee | ||
Comment 14•4 years ago
|
||
| Assignee | ||
Comment 15•4 years ago
|
||
Depends on D117937
Updated•4 years ago
|
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
| bugherder | ||
Comment 18•4 years ago
|
||
🥳🎉
Updated•4 years ago
|
Updated•4 years ago
|
Description
•