chakra-core / chakra-core/ChakraCore

ASSERTION (this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException()) failed in Js::ScriptContext::RecordException

Open
#6,007 0 comments 0 reactions 1 assignee Claimed by @akroshg View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

###### ChakraCore version:

```
Checked revision: 39f9727ef
Build command: ./build.sh --debug
```

###### OS:

```
Linux-4.15.0-43-generic-x86_64-with-Ubuntu-18.04-bionic
```

###### Test case:

```js
WScript.LoadScriptFile(Error, Symbol.isConcatSpreadable);
```

###### Backtrace:

```text
ASSERTION 11561: (ChakraCore/lib/Runtime/Base/ScriptContext.cpp, line 2816) this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException()
Failure: (this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException())

Thread 1 "ch" received signal SIGILL, Illegal instruction.
0x0000555556e88e86 in Js::ScriptContext::RecordException (this=0x622000000158, exceptionObject=0x7ffff1f46af0, propagateToDebugger=false)
at ChakraCore/lib/Runtime/Base/ScriptContext.cpp:2816
2816 Assert(this->threadContext->GetRecordedException() == nullptr || GetThreadContext()->HasUnhandledException());
(gdb) bt
#0 0x0000555556e88e86 in Js::ScriptContext::RecordException (this=0x622000000158, exceptionObject=0x7ffff1f46af0, propagateToDebugger=false)
at ChakraCore/lib/Runtime/Base/ScriptContext.cpp:2816
#1 0x0000555556719b90 in JsSetException::$_75::operator() (this=0x7fffffff4700, scriptContext=0x622000000158, _actionEntryPopper=...) at ChakraCore/lib/Jsrt/Jsrt.cpp:3245
#2 0x00005555567194f1 in _JsErrorCode ContextAPINoScriptWrapper(JsSetException::$_75, bool, bool)::{lambda(Js::ScriptContext*)#1}::operator()(Js::ScriptContext*) const (
this=0x7fffffff4440, scriptContext=0x622000000158) at ChakraCore/lib/Jsrt/JsrtInternal.h:316
#3 0x0000555556718532 in ContextAPINoScriptWrapper_Core<_JsErrorCode ContextAPINoScriptWrapper(JsSetException::$_75, bool, bool)::{lambda(Js::ScriptContext*)#1}>(_JsErrorCode ContextAPINoScriptWrapper(JsSetException::$_75, bool, bool)::{lambda(Js::ScriptContext*)#1}, bool, bool) (fn=..., allowInObjectBeforeCollectCallback=false,
scriptExceptionAllowed=false) at ChakraCore/lib/Jsrt/JsrtInternal.h:277
#4 0x000055555668e9e3 in ContextAPINoScriptWrapper (fn=..., allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false)
at ChakraCore/lib/Jsrt/JsrtInternal.h:314
#5 0x000055555668e74c in JsSetException (exception=0x7ffff1db0480) at ChakraCore/lib/Jsrt/Jsrt.cpp:3234
#6 0x00005555564697c5 in ChakraRTInterface::JsSetException (exception=0x7ffff1db0480) at ChakraCore/bin/ch/ChakraRtInterface.h:429
#7 0x0000555556452a63 in WScriptJsrt::LoadScriptFileHelper (callee=0x7ffff1de1150, arguments=0x7fffffff51f0, argumentCount=3, isSourceModule=false)
at ChakraCore/bin/ch/WScriptJsrt.cpp:261
#8 0x0000555556452129 in WScriptJsrt::LoadScriptFileCallback (callee=0x7ffff1de1150, isConstructCall=false, arguments=0x7fffffff51f0, argumentCount=3, callbackState=0x0)
at ChakraCore/bin/ch/WScriptJsrt.cpp:201
#9 0x000055555668b771 in JsNativeFunctionWrapper (callee=0x7ffff1de1150, arguments=0x7fffffff51f0, argumentCount=3, info=0x7fffffff4e20, wrapperData=0x7ffff1f45080)
at ChakraCore/lib/Jsrt/Jsrt.cpp:2921
#10 0x0000555558675016 in Js::JavascriptExternalFunction::StdCallExternalFunctionThunk (function=0x7ffff1de1150, callInfo=...)
at ChakraCore/lib/Runtime/Library/JavascriptExternalFunction.cpp:305
#11 0x0000555558ded02e in amd64_CallFunction () at ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#12 0x000055555869c1e3 in Js::JavascriptFunction::CallFunction (function=0x7ffff1de1150,
entryPoint=0x555558674030 , args=..., useLargeArgCount=false)
at ChakraCore/lib/Runtime/Library/JavascriptFunction.cpp:1342
#13 0x000055555811ac57 in Js::InterpreterStackFrame::OP_CallCommon > > __unaligned>(Js::OpLayoutDynamicProfile > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray const*) (
this=0x7fffffffa9a0, playout=0x7ffff1fb30ed, function=0x7ffff1de1150, flags=16, spreadIndices=0x0) at ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3858
#14 0x0000555558119f4e in Js::InterpreterStackFrame::OP_ProfileCallCommon > > __unaligned>(Js::OpLayoutDynamicProfile > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray const*) (this=0x7fffffffa9a0, playout=0x7ffff1fb30ed, function=0x7ffff1de1150, flags=0, profileId=0, inlineCacheIndex=0, spreadIndices=0x0)
at ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3902
#15 0x0000555558042352 in Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex > >(Js::OpLayoutDynamicProfile > > const __unaligned*) (this=0x7fffffffa9a0, playout=0x7ffff1fb30ed)
at ChakraCore/lib/Runtime/./Language/InterpreterStackFrame.h:503
#16 0x0000555557bc1fdd in Js::InterpreterStackFrame::ProcessProfiled (this=0x7fffffffa9a0) at ChakraCore/lib/Runtime/Language/InterpreterHandler.inl:87
#17 0x0000555557a89bf0 in Js::InterpreterStackFrame::Process (this=0x7fffffffa9a0) at ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3357
#18 0x0000555557a86e43 in Js::InterpreterStackFrame::InterpreterHelper (function=0x7ffff1f46690, args=..., returnAddress=0x7ffff1d60fa2, addressOfReturnAddress=0x7fffffffb368, asmJsReturn=0x0)
at ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2051
#19 0x0000555557a84c23 in Js::InterpreterStackFrame::InterpreterThunk (layout=0x7fffffffb380) at ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:1763
#20 0x00007ffff1d60fa2 in ?? ()
#21 0x00007fffffffb390 in ?? ()
#22 0x0000555558ded02e in amd64_CallFunction () at ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
Backtrace stopped: frame did not save the PC
```

Found by [Fuzzinator](http://fuzzinator.readthedocs.io/) with [grammarinator](https://github.com/renatahodovan/grammarinator).

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.