Skip to content
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

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

Open
zhangbonian opened this issue Nov 25, 2024 · 1 comment
Open
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@zhangbonian
Copy link

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

@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label Dec 17, 2024
@deepak1556
Copy link
Contributor

Can you share the test case that resulted in crash, it would help to resolve this issue. Thanks!

@deepak1556 deepak1556 added this to the January 2025 milestone Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants