servo / rust-mozjs

DEPRECATED - moved to servo/mozjs instead.
Mozilla Public License 2.0
293 stars 122 forks source link

Shut down the parent runtime before calling JS_ShutDown #347

Open jdm opened 7 years ago

jdm commented 7 years ago

Right now if you use the debug-mozjs feature, you get a big "YOU ARE LEAKING THE WORLD" warning when JS_ShutDown runs. This is because the implicit parent runtime still exists at program shutdown, but avoiding that is more complicated that manually destroying the runtime. Since it's created on the same thread as the first thread that invokes Runtime::new, it says a TLS with that runtime, and this TLS is invaliated when the runtime for the same thread is destroyed. This manifests as a segfault when destroying the parent runtime.

tschneidereit commented 7 years ago

Depending on how urgent it is to fix this, it might make sense to just leave it be for now: the next smup will bring the current parts of bug 1323066 and change much of how this all works.

jdm commented 7 years ago

I would call this not urgent.