chakra-core / chakra-core/ChakraCore

nullptr in VALIDATE_INCOMING_REFERENCE causes a crash

Open
#5,782 1 comment 0 reactions 0 assignees View on GitHub
Needs More Info
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I have the exact same issue as this one: https://github.com/Microsoft/ChakraCore/issues/4532
Which looks like it was closed without resolution.

In my case, we are using the c# library chakracore.net: https://github.com/JohnMasen/ChakraCore.NET
And the issue happens under stress testing. It happens when a js function we have called returns a promise, which we are changing into a Task on the C# side. We call the js function, get back the promise object, and then try to call "then" on it, passing in an onfulfilled and onrejected callback.

Chakracore.net appears to be correctly adding GCHandles to the callback, as well as calling JsAddRef for them before the callbacks are passed in as parameters to the "then" function call.

More specifically, in the VALIDATE_INCOMING_REFERENCE call for the 2nd argument of the function (the 1st will be the 'this' parameter) fails with a nullptr. This can happen after 100's of successful calls.

We are using this in an ASP.NET Core application (with .net core). Context switching for the different threads also appears to be correctly managed by the chakracore.net library.

Any ideas on how to further troubleshoot this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.