The FF profiler crashes when tail calls spec application is used
Categories
(Core :: JavaScript: WebAssembly, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox120 | --- | fixed |
People
(Reporter: yury, Assigned: yury)
References
Details
Attachments
(1 file)
Bug 1571998 lands Wasm tail calls proposal. The implementation uses some native stack manipulations that are not understood by profilers or stack unwinders.
It is possible to modify WasmFrameIter to interpret unwind metadata and to rely on CPU registers to provide necessary information about how to reach next frame.
Assignee | ||
Comment 1•1 year ago
|
||
Tail calls are doing some stack data manipulations, and profiler (iterator) needs to know how to find where caller RA and FP stored. A platform now preserves temporary registers used to store FP/RA using collapse frame operations.
Depends on D167158
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
The progress is stalled at https://phabricator.services.mozilla.com/D183269#6098058
I would have expected to see additonal code in static void UseRuleSet (LulMain.cpp) (plus maybe in other places), that computes new values for the new registers as we unwind. And in principle I would expect the same for the other unwinders too. But I didn't see any such changes.
Markus, how I can reproduce and tests this behavior? Can you provide an example of a test to expose the defect?
Comment 3•1 year ago
|
||
(In reply to Yury Delendik (:yury) from comment #2)
Markus, how I can reproduce and tests this behavior?
We don't have a good way to test unwinders in isolation, unfortunately. Here's the best I can suggest:
- Create an HTML + WASM testcase that uses wasm tail calls at a very high rate. Make a loop that runs for a full second or so, which exercises the tricky instruction sequences.
- Record the testcase execution with the Gecko profiler.
- Check that there aren't any broken stacks.
With "broken stacks" I mean stacks for which native unwinding aborted early. Those stacks usually only have a few native frames at the "deep" end of the stack, and fall back to the profiler label stack for the remainder of the stack. These broken stacks can be found in the profiler call tree because they'll be a separate "root"; they'll look different from the stacks that have complete C++ frames at the "bottom".
Comment 5•1 year ago
|
||
bugherder |
Description
•