Make standalone SpiderMonkey use libxul-like panic and allocation handling
Categories
(Core :: JavaScript Engine, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox92 | --- | fixed |
People
(Reporter: hsivonen, Assigned: glandium)
References
Details
Attachments
(4 files)
From https://phabricator.services.mozilla.com/D41355#1406762 :
some point, jsrust will need to have the panic hook that redirects to MOZ_CRASH and the allocator wrapper.
Comment 1•6 years ago
|
||
I'm afraid I'm still at a bit of a loss. What is this bug about? What work is involved? What does it block?
Comment 2•6 years ago
|
||
This blocks fuzzing of e.g. Cranelift in the JS shell. Currently, any Rust panics in Cranelift go undetected in automation because the panic does not redirect to MOZ_CRASH.
Comment 3•6 years ago
|
||
It seems we could share the code transitively tied to https://searchfox.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#5132 between the JS shell and gkrust, and then not worry about calling the hooks setups twice: each will just replace and properly drop the previous hook, if there was one.
| Assignee | ||
Comment 4•6 years ago
|
||
I'll try to address this next week.
Comment 5•4 years ago
|
||
Because Bug 1594998 is done, should this be re-titled to "Make standalone SpiderMonkey use libxul-style allocation handling"?
What's involved in that, and what problem is being solved there now?
| Assignee | ||
Comment 6•4 years ago
|
||
Bug 1715282 bumped the minimum rust version to 1.51, so we can remove
anything that only applies to older versions.
Updated•4 years ago
|
| Assignee | ||
Comment 7•4 years ago
|
||
This is similar to what was done in bug 1594998 for the panic hook.
| Assignee | ||
Comment 8•4 years ago
|
||
It was added in bug 1594998 for use by the mozjs crate, but the mozjs
crate was removed in bug 1694318.
| Assignee | ||
Comment 9•4 years ago
|
||
- Enable the malloc hook via the moz_memory feature.
- Install the rust oom hook during VM initialization.
- And only install the panic hook when building spidermonkey standalone,
because Gecko already takes care of it otherwise.
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/72c9c580de92
https://hg.mozilla.org/mozilla-central/rev/df2cd26d6b62
https://hg.mozilla.org/mozilla-central/rev/1f77635a3256
https://hg.mozilla.org/mozilla-central/rev/0ecfc2a49233
Updated•3 years ago
|
Description
•