Core Dump in Debug Build Due to Improper HandleScope Usage in PtyFork #732
Open
Description
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