-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spawnSync segfaults when given throwing toString #9820
Comments
This is probably a larger problem and we may need checks for other APIs. I think we should error but avoid segfaulting. |
I discussed this with @addaleax on IRC a while ago. Basically we should provide a way for
Option 1 is the cleaner solution (EDIT: and it is also the one Option 2 is more compatible since we can make Any thoughts on this? |
@TimothyGu I agree, Option 1 sounds better to me. We could also use that to see which Do you want to take that on? If not, I should be able to do it too. |
@TimothyGu With #11952 closed, should we make a note here of the solution now envisioned? |
@Trott Sure. Right now |
fwiw, this fails in v10.x too (as many attempts to fix this seem to have stalled) |
This code sample no longer segfaults as of |
Ok, sounds like we should just close it out then. |
spawnSync will segfault if called with an object that defines a throwing
toString
.Here is a snippet using the high-level
child_process
API:It may be safer to call toString in JS land before calling into the binding
code.
The text was updated successfully, but these errors were encountered: