ddopson / node-segfault-handler

Tool for debugging native Node.js modules and getting stack traces when things go wrong.
BSD 3-Clause "New" or "Revised" License
319 stars 74 forks source link

Handler segfaults itself when using multiple v8 isolates #49

Open laverdet opened 6 years ago

laverdet commented 6 years ago

In segfault-handler.cpp:113 the only check to determine if you're currently in the nodejs isolate is if (Isolate::GetCurrent()) which is not correct in multi-isolate environments (see my project: isolated-vm). So if a segfault is hit while in a different isolate the segfault handler will segfault itself when it tries to call a callback belonging to a different isolate.

It should be simple enough to grab a reference to the current isolate when the module is loaded and then compare against that in the segfault handler.