node-pty
node-pty copied to clipboard
Core Dump in Debug Build Due to Improper HandleScope Usage in PtyFork
trafficstars
Title:
Description: When building this package in debug mode, the vscode pty host crashes with a core dump. The root cause was identified as improper usage of HandleScope in the PtyFork implementation as well as in some others.
Issue Details:
- The current implementation attempts to return a value from HandleScope
- HandleScope-managed objects are automatically destroyed when the function returns
- This leads to accessing destroyed objects, resulting in a core dump
Suggestion: Replace the current HandleScope with Napi::EscapableHandleScope to properly manage object lifetime:
I'm not a node expert. The solution needs futher check by someone.
Thanks
Can you share the test case that resulted in crash, it would help to resolve this issue. Thanks!