Closed Bug 1582382 Opened 6 years ago Closed 4 years ago

Make standalone SpiderMonkey use libxul-like panic and allocation handling

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
92 Branch
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.

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?

Flags: needinfo?(mh+mozilla)
Priority: -- → P1

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.

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.

I'll try to address this next week.

Depends on: 1594998

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?

Bug 1715282 bumped the minimum rust version to 1.51, so we can remove
anything that only applies to older versions.

Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED

This is similar to what was done in bug 1594998 for the panic hook.

It was added in bug 1594998 for use by the mozjs crate, but the mozjs
crate was removed in bug 1694318.

  • 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.
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/72c9c580de92 Simplify rust oom-hook related build script. r=firefox-build-system-reviewers,andi https://hg.mozilla.org/integration/autoland/rev/df2cd26d6b62 Move rust malloc and oom hook to mozglue. r=firefox-build-system-reviewers,andi https://hg.mozilla.org/integration/autoland/rev/1f77635a3256 Remove NO_RUST_PANIC_HOOK. r=firefox-build-system-reviewers,andi https://hg.mozilla.org/integration/autoland/rev/0ecfc2a49233 Enable the new rust hooks in standalone spidermonkey. r=jandem
Flags: needinfo?(mh+mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: