-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Close specified fd may cause a double free #38365
Comments
I think we should gather all the |
/cc @addaleax I'd flip that a bit @XadillaX ... instead of protecting |
Yeah, #37874 (comment) would be my suggestion here. I'd also suggest closing this and #38377 as duplicates of that issue, there's no real point in tracking the behavior for different file descriptors separately. |
/cc @jasnell I mean we should trace the |
Closing this as a duplicate of #37874. |
What steps will reproduce the bug?
Setup a node instance,
and run the following javascript code.
Then the node instance occurs an abort.
If invoking
fs.closeSync(8)
twice, then a "bad file descriptor" error message would be alert.However, when exiting the process with
process.exit()
, an abort occurs. I'm not sure if any other way to trigger this problem.This issue is almost the same as #37874, but since a double-free may have been triggered, maybe security risk should be considered.
Feel free to close this issue if you think nothing important.
How often does it reproduce? Is there a required condition?
This abort can always be triggered following the steps above.
What is the expected behavior?
If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.
What do you see instead?
Additional information
The text was updated successfully, but these errors were encountered: