Skip to content

Core Dump in Debug Build Due to Improper HandleScope Usage in PtyFork #732

Open
@zhangbonian

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

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions