issue_owner_repo
listlengths
2
2
issue_body
stringlengths
0
261k
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (const i in RegExp) { // RegExp should not be iterated by for-in Object.defineProperty(RegExp, i, { value: i }); RegExp[i] = 2 } ``` ## Execution steps & Output ``` ./ch poc.js ASSERTION 435069: (/home/wjm/ChakraCore/lib/Runtime/Language/CacheOperators.cpp, line 178) Missed updating PropertyValueInfo? Failure: (info->IsNoCache() || object->GetPropertyIndex(propertyId) == Constants::NoSlot) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556a6319f ch`Js::CacheOperators::CachePropertyWrite(object=0x00007ff7e6c51000, isRoot=false, typeWithoutProperty=0x00007ff7e6c50440, propertyId=475, info=0x00007fffffffadc0, requestContext=0x0000555557ee9048) at CacheOperators.cpp:178:17 frame #1: 0x00005555560658f2 ch`int Js::JavascriptOperators::SetPropertyWPCache<int>(receiver=0x00007ff7e6c51000, object=0x00007ff7e6c51000, propertyKey=475, newValue=0x0001000000000002, requestContext=0x0000555557ee9048, propertyOperationFlags=PropertyOperation_None, info=0x00007fffffffadc0) at JavascriptOperators.cpp:2555:21 frame #2: 0x0000555556065c10 ch`bool Js::JavascriptOperators::SetElementIWithCache<true>(receiver=0x00007ff7e6c51000, object=0x00007ff7e6c51000, index=0x00007ff7e6c5a6c0, value=0x0001000000000002, propertyRecordUsageCache=0x00007ff7e6c5a6e0, scriptContext=0x0000555557ee9048, flags=PropertyOperation_None, operationInfo=0x00007fffffffae88) at JavascriptOperators.cpp:4137:16 frame #3: 0x00005555560a12f1 ch`Js::ProfilingHelpers::ProfiledStElem(base=0x00007ff7e6c51000, varIndex=0x00007ff7e6c5a6c0, value=0x0001000000000002, functionBody=0x00007ff7e6c37000, profileId=0, flags=PropertyOperation_None, didArrayAccessHelperCall=false, bailedOutOnArraySpecialization=false) at ProfilingHelpers.cpp:373:13 frame #4: 0x0000555555fc939c ch`void Js::InterpreterStackFrame::OP_ProfiledSetElementI<Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(this=0x00007fffffffbfd0, playout=0x00007ff7e6be5062, flags=PropertyOperation_None)0> > > const __unaligned*, Js::PropertyOperationFlags) at InterpreterStackFrame.cpp:5273:9 frame #5: 0x0000555555eb2ed3 ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffffffbfd0) at InterpreterHandler.inl:288:3 frame #6: 0x0000555555e52112 ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbfd0) at InterpreterStackFrame.cpp:3472:20 frame #7: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc570, returnAddress=0x00007ff7e6bc0fa2, addressOfReturnAddress=0x00007fffffffc5b8, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #8: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc5d0) at InterpreterStackFrame.cpp:1833:16 frame #9: 0x00007ff7e6bc0fa2 frame #10: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #11: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc7d8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #12: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc850, scriptContext=0x0000555557ee9048, inScript=true) at JavascriptFunction.cpp:772:24 frame #13: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee9048, inScript=true) at JavascriptFunction.cpp:717:15 frame #14: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee9048, inScript=true) at JavascriptFunction.cpp:832:16 frame #15: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcc20, scriptContext=0x0000555557ee9048, _actionEntryPopper=0x00007fffffffcc00)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #16: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcbb8, scriptContext=0x0000555557ee9048)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #17: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcbb8)::$_85) at JsrtInternal.h:192:23 frame #18: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcc20)::$_85) at JsrtInternal.h:235:27 frame #19: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e6c34000, script="for (const i in RegExp) {\n Object.defineProperty(RegExp, i, { value: i });\n RegExp[i] = 2\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3346583: (/home/wjm/ChakraCore/lib/Runtime/Language/CacheOperators.cpp, line 178) Missed updating PropertyValueInfo?\n// Failure: (info->IsNoCache() || object->GetPropertyIndex(propertyId) == Constants::NoSlot)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 13 ms\n\n\n/*\n\nTitle: Assertion Failure: (info->IsNoCache() || object->GetPropertyIndex(propertyId) == Constants::NoSlot) in ChakraCore/lib/Runtime/Language/CacheOperators.cpp, line 178\n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\nfor (const i in RegExp) {\n Object.defineProperty(RegExp, i, { value: i });\n RegExp[i] = 2\n}\n```\n\n## Execution"..., cb=1341, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug30_nocache.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #20: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e6c34000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #21: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e6c34000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #22: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e6c34000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #23: 0x0000555555784924 ch`RunScript(fileName="bug30_nocache.js", fileContents="for (const i in RegExp) {\n Object.defineProperty(RegExp, i, { value: i });\n RegExp[i] = 2\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3346583: (/home/wjm/ChakraCore/lib/Runtime/Language/CacheOperators.cpp, line 178) Missed updating PropertyValueInfo?\n// Failure: (info->IsNoCache() || object->GetPropertyIndex(propertyId) == Constants::NoSlot)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 13 ms\n\n\n/*\n\nTitle: Assertion Failure: (info->IsNoCache() || object->GetPropertyIndex(propertyId) == Constants::NoSlot) in ChakraCore/lib/Runtime/Language/CacheOperators.cpp, line 178\n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\nfor (const i in RegExp) {\n Object.defineProperty(RegExp, i, { value: i });\n RegExp[i] = 2\n}\n```\n\n## Execution"..., fileLength=1341, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug30_nocache.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #24: 0x00005555557863f0 ch`ExecuteTest(fileName="bug30_nocache.js") at ch.cpp:917:13 frame #25: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug30_nocache.js") at ch.cpp:967:10 frame #26: 0x0000555555786d7a ch`main(argc=2, c_argv=0x00007fffffffd688) at ch.cpp:1274:20 frame #27: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #28: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: (info->IsNoCache() || object->GetPropertyIndex(propertyId) == Constants::NoSlot) in ChakraCore/lib/Runtime/Language/CacheOperators.cpp, line 178
https://api.github.com/repos/chakra-core/ChakraCore/issues/6915/comments
0
2023-05-13T04:33:37Z
2023-05-13T04:33:37Z
https://github.com/chakra-core/ChakraCore/issues/6915
1,708,429,741
6,915
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` const a = new Proxy({}, {}); __proto__ = a; b = 1 ``` ## Execution steps & Output ``` ./ch poc.js ASSERTION 437234: (/home/wjm/ChakraCore/lib/Runtime/Library/GlobalObject.cpp, line 1963) !(flags & PropertyOperation_Root) Failure: (!(flags & PropertyOperation_Root)) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x00005555561336f1 ch`Js::GlobalObject::SetProperty(this=0x00007ff7e7c74000, propertyId=765, value=0x0001000000000001, flags=PropertyOperation_Root, info=0x00007fffffffa9a0) at GlobalObject.cpp:1963:9 frame #1: 0x00005555560510a9 ch`int Js::JavascriptOperators::SetProperty_Internal<false>(receiver=0x00007ff7e7c74000, object=0x00007ff7e6c2f2a0, isRoot=false, propertyId=765, newValue=0x0001000000000001, info=0x00007fffffffa9a0, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root) at JavascriptOperators.cpp:2826:54 frame #2: 0x000055555602ee9a ch`Js::JavascriptOperators::SetProperty(receiver=0x00007ff7e7c74000, object=0x00007ff7e6c2f2a0, propertyId=765, newValue=0x0001000000000001, info=0x00007fffffffa9a0, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root) at JavascriptOperators.cpp:2675:16 frame #3: 0x000055555603114d ch`Js::JavascriptOperators::SetProperty(instance=0x00007ff7e7c74000, object=0x00007ff7e6c2f2a0, propertyId=765, newValue=0x0001000000000001, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root) at JavascriptOperators.cpp:11413:16 frame #4: 0x00005555563b6fec ch`Js::JavascriptProxy::SetPropertyTrap(this=0x00007ff7e7c71de0, receiver=0x00007ff7e7c74000, setPropertyTrapKind=SetPropertyKind, propertyId=765, newValue=0x0001000000000001, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root, skipPrototypeCheck=NO) at JavascriptProxy.cpp:1869:24 frame #5: 0x000055555602f352 ch`Js::JavascriptOperators::SetAccessorOrNonWritableProperty(receiver=0x00007ff7e7c74000, object=0x00007ff7e7c74000, propertyId=765, newValue=0x0001000000000001, info=0x00007fffffffae60, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root, isRoot=true, allowUndecInConsoleScope=false, result=NO) at JavascriptOperators.cpp:2753:34 frame #6: 0x0000555556050b70 ch`int Js::JavascriptOperators::SetProperty_Internal<false>(receiver=0x00007ff7e7c74000, object=0x00007ff7e7c74000, isRoot=true, propertyId=765, newValue=0x0001000000000001, info=0x00007fffffffae60, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root) at JavascriptOperators.cpp:2787:13 frame #7: 0x000055555602eefc ch`Js::JavascriptOperators::SetRootProperty(instance=0x00007ff7e7c74000, propertyId=765, newValue=0x0001000000000001, info=0x00007fffffffae60, requestContext=0x0000555557ee8e28, propertyOperationFlags=PropertyOperation_Root) at JavascriptOperators.cpp:2680:16 frame #8: 0x0000555556045ab7 ch`Js::JavascriptOperators::PatchPutRootValueNoFastPath(functionBody=0x00007ff7e6c37000, inlineCache=0x00007ff7e84caef0, inlineCacheIndex=4, instance=0x00007ff7e7c74000, propertyId=765, newValue=0x0001000000000001, flags=PropertyOperation_Root) at JavascriptOperators.cpp:8811:14 frame #9: 0x00005555560a73b1 ch`void Js::ProfilingHelpers::ProfiledStFld<true>(instance=0x00007ff7e7c74000, propertyId=765, inlineCache=0x00007ff7e84caef0, inlineCacheIndex=4, value=0x0001000000000001, flags=PropertyOperation_Root, scriptFunction=0x00007ff7e7c766e0, thisInstance=0x00007ff7e7c74000) at ProfilingHelpers.cpp:1267:21 frame #10: 0x0000555555fffe0d ch`void Js::InterpreterStackFrame::ProfiledSetProperty<Js::OpLayoutT_ElementRootCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned, true>(this=0x00007fffffffc080, playout=0x00007ff7e84d40f8, instance=0x00007ff7e7c74000, flags=PropertyOperation_Root)0> > const __unaligned __unaligned*, void*, Js::PropertyOperationFlags) at InterpreterStackFrame.cpp:4697:9 frame #11: 0x0000555555fc84ad ch`void Js::InterpreterStackFrame::OP_ProfiledSetRootProperty<Js::OpLayoutT_ElementRootCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffc080, playout=0x00007ff7e84d40f8)0> > const __unaligned __unaligned*) at InterpreterStackFrame.cpp:4782:9 frame #12: 0x0000555555eb13ca ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffffffc080) at InterpreterHandler.inl:207:3 frame #13: 0x0000555555e52112 ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffc080) at InterpreterStackFrame.cpp:3472:20 frame #14: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc580, returnAddress=0x00007ff7e6bc0fa2, addressOfReturnAddress=0x00007fffffffc5c8, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #15: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc5e0) at InterpreterStackFrame.cpp:1833:16 frame #16: 0x00007ff7e6bc0fa2 frame #17: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #18: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc7e8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #19: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc860, scriptContext=0x0000555557ee8e28, inScript=true) at JavascriptFunction.cpp:772:24 frame #20: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8e28, inScript=true) at JavascriptFunction.cpp:717:15 frame #21: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8e28, inScript=true) at JavascriptFunction.cpp:832:16 frame #22: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcc30, scriptContext=0x0000555557ee8e28, _actionEntryPopper=0x00007fffffffcc10)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #23: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcbc8, scriptContext=0x0000555557ee8e28)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #24: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcbc8)::$_85) at JsrtInternal.h:192:23 frame #25: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcc30)::$_85) at JsrtInternal.h:235:27 frame #26: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e6c34000, script="const a = new Proxy({}, {});\n__proto__ = a;\nb = 1\n\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3268212: (/home/wjm/ChakraCore/lib/Runtime/Library/GlobalObject.cpp, line 1963) !(flags & PropertyOperation_Root)\n// Failure: (!(flags & PropertyOperation_Root))\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 18 ms\n\n\n/*\n\nTitle: Assertion Failure: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\n\n```\n## Backtrace\n```\n\n\n```\n\n*\/\n", cb=810, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug29_root.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #27: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e6c34000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #28: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e6c34000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #29: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e6c34000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #30: 0x0000555555784924 ch`RunScript(fileName="bug29_root.js", fileContents="const a = new Proxy({}, {});\n__proto__ = a;\nb = 1\n\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3268212: (/home/wjm/ChakraCore/lib/Runtime/Library/GlobalObject.cpp, line 1963) !(flags & PropertyOperation_Root)\n// Failure: (!(flags & PropertyOperation_Root))\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 18 ms\n\n\n/*\n\nTitle: Assertion Failure: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\n\n```\n## Backtrace\n```\n\n\n```\n\n*\/\n", fileLength=810, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug29_root.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #31: 0x00005555557863f0 ch`ExecuteTest(fileName="bug29_root.js") at ch.cpp:917:13 frame #32: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug29_root.js") at ch.cpp:967:10 frame #33: 0x0000555555786d7a ch`main(argc=2, c_argv=0x00007fffffffd698) at ch.cpp:1274:20 frame #34: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #35: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: (!(flags & PropertyOperation_Root)) in ChakraCore/lib/Runtime/Library/GlobalObject.cpp, line 1963
https://api.github.com/repos/chakra-core/ChakraCore/issues/6914/comments
0
2023-05-13T04:33:05Z
2023-05-13T04:33:05Z
https://github.com/chakra-core/ChakraCore/issues/6914
1,708,429,649
6,914
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (let i = 0; i < 80; i++) { for (const j in 2) { const arr = [1,2,3]; for (let k = arr; k > -2; k = k ** -2) { arr[4]; } } } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 421717: (/home/wjm/ChakraCore/lib/Backend/GlobOptArrays.cpp, line 504) landingPadValueType.IsSimilar(baseValueType) || (landingPadValueType.IsLikelyNativeArray() && landingPadValueType.Merge(baseValueType).IsSimilar(baseValueType)) || (baseValueType.IsLikelyNativeArray() && baseValueType.Merge(landingPadValueType).IsSimilar(landingPadValueType)) Failure: (landingPadValueType.IsSimilar(baseValueType) || (landingPadValueType.IsLikelyNativeArray() && landingPadValueType.Merge(baseValueType).IsSimilar(baseValueType)) || (baseValueType.IsLikelyNativeArray() && baseValueType.Merge(landingPadValueType).IsSimilar(landingPadValueType))) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556bb6c42 ch`GlobOpt::ArraySrcOpt::CheckLoops(this=0x00007fffffff8098) at GlobOptArrays.cpp:501:13 frame #1: 0x0000555556bc14e4 ch`GlobOpt::ArraySrcOpt::Optimize(this=0x00007fffffff8098) at GlobOptArrays.cpp:1869:9 frame #2: 0x0000555556b5fae3 ch`GlobOpt::OptArraySrc(this=0x00007fffffff9800, instrRef=0x00007fffffff8678, src1Val=0x00007fffffff8510, src2Val=0x00007fffffff8508) at GlobOpt.cpp:13452:17 frame #3: 0x0000555556b49f2e ch`GlobOpt::OptInstr(this=0x00007fffffff9800, instr=0x00007fffffff8678, isInstrRemoved=0x00007fffffff866e) at GlobOpt.cpp:2563:5 frame #4: 0x0000555556b46dce ch`GlobOpt::OptBlock(this=0x00007fffffff9800, block=0x00007ff7e7c08980) at GlobOpt.cpp:521:27 frame #5: 0x0000555556b458a7 ch`GlobOpt::ForwardPass(this=0x00007fffffff9800) at GlobOpt.cpp:402:15 frame #6: 0x0000555556b44ab3 ch`GlobOpt::Optimize(this=0x00007fffffff9800) at GlobOpt.cpp:212:15 frame #7: 0x0000555556b262ab ch`Func::TryCodegen(this=0x00007fffffff9eb0) at Func.cpp:457:21 frame #8: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa470, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb71b8, scriptContextInfo=0x0000555557ee9138, outputData=0x00007fffffffa8b0, epInfo=0x00007ff7e7c64200, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3f3c0, codeGenAllocators=0x0000555557ef5dd8, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #9: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea908, pageAllocator=0x0000555557eb7540, workItemData=0x0000555557ef5c50, jitWriteData=0x00007fffffffa8b0, foreground=true, epInfo=0x00007ff7e7c64200) at NativeCodeGenerator.cpp:890:9 frame #10: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea908, pageAllocator=0x0000555557eb7540, workItem=0x0000555557ef5c28, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #11: 0x00005555569139a7 ch`NativeCodeGenerator::Process(this=0x0000555557eea908, job=0x0000555557ef5c30, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1895:13 frame #12: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef5c30) at Jobs.cpp:426:36 frame #13: 0x0000555556922bc3 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea908, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:207:36 frame #14: 0x0000555556918804 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea908, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:81:58 frame #15: 0x000055555690d4fc ch`NativeCodeGenerator::GenerateLoopBody(this=0x0000555557eea908, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c77810, entryPoint=0x00007ff7e7c64200, localCount=18, localSlots=0x00007fffffffc0d0) at NativeCodeGenerator.cpp:711:22 frame #16: 0x00005555568157dd ch`GenerateLoopBody(nativeCodeGen=0x0000555557eea908, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c77810, info=0x00007ff7e7c64200, localCount=18, localSlots=0x00007fffffffc0d0) at BackendApi.cpp:88:20 frame #17: 0x0000555555fb220b ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffbf70, loopNumber=1, layoutSize=SmallLayout, doProfileLoopCheck=true, isFirstIteration=false) at InterpreterStackFrame.cpp:6277:17 frame #18: 0x0000555555fb5997 ch`void Js::InterpreterStackFrame::LoopBodyStart<false, true>(this=0x00007fffffffbf70, loopNumber=1, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5994:9 frame #19: 0x0000555556002d38 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbf70, loopId=1) at InterpreterStackFrame.cpp:5902:9 frame #20: 0x0000555555fcd716 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbf70, ip="\xe69") at InterpreterStackFrame.cpp:5774:16 frame #21: 0x0000555555e704b1 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffbf70) at InterpreterHandler.inl:52:3 frame #22: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbf70) at InterpreterStackFrame.cpp:3495:22 frame #23: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c76730, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #24: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #25: 0x00007ff7e7bd0fa2 frame #26: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #27: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #28: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c76730, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee9138, inScript=true) at JavascriptFunction.cpp:772:24 frame #29: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee9138, inScript=true) at JavascriptFunction.cpp:717:15 frame #30: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee9138, inScript=true) at JavascriptFunction.cpp:832:16 frame #31: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee9138, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #32: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee9138)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #33: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #34: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #35: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="for (let i = 0; i < 80; i++) {\n for (const j in 2) {\n const arr = [1,2,3];\n for (let k = arr; k > -2; k = k ** -2) {\n arr[4];\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 603064: (/home/wjm/ChakraCore/lib/Backend/GlobOptArrays.cpp, line 504) landingPadValueType.IsSimilar(baseValueType) || (landingPadValueType.IsLikelyNativeArray() && landingPadValueType.Merge(baseValueType).IsSimilar(baseValueType)) || (baseValueType.IsLikelyNativeArray() && baseValueType.Merge(landingPadValueType).IsSimilar(landingPadValueType))\n// Failure: (landingPadValueType.IsSimilar(baseValueType) || (landingPadValueType.IsLikelyNativeArray() && landingPadValueType.Merge(baseValueType).IsSimilar(baseValueType)) || (baseValueType.IsLikelyNativeArray() && baseValueType.Merge(landingPadValueType).IsSimilar(landingPadValueType)))\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TI"..., cb=1408, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug27_optArray.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #36: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #37: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #38: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #39: 0x0000555555784924 ch`RunScript(fileName="bug27_optArray.js", fileContents="for (let i = 0; i < 80; i++) {\n for (const j in 2) {\n const arr = [1,2,3];\n for (let k = arr; k > -2; k = k ** -2) {\n arr[4];\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 603064: (/home/wjm/ChakraCore/lib/Backend/GlobOptArrays.cpp, line 504) landingPadValueType.IsSimilar(baseValueType) || (landingPadValueType.IsLikelyNativeArray() && landingPadValueType.Merge(baseValueType).IsSimilar(baseValueType)) || (baseValueType.IsLikelyNativeArray() && baseValueType.Merge(landingPadValueType).IsSimilar(landingPadValueType))\n// Failure: (landingPadValueType.IsSimilar(baseValueType) || (landingPadValueType.IsLikelyNativeArray() && landingPadValueType.Merge(baseValueType).IsSimilar(baseValueType)) || (baseValueType.IsLikelyNativeArray() && baseValueType.Merge(landingPadValueType).IsSimilar(landingPadValueType)))\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TI"..., fileLength=1408, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug27_optArray.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #40: 0x00005555557863f0 ch`ExecuteTest(fileName="bug27_optArray.js") at ch.cpp:917:13 frame #41: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug27_optArray.js") at ch.cpp:967:10 frame #42: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #43: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #44: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: landingPadValueType.IsSimilar(baseValueType) in ChakraCore/lib/Backend/GlobOptArrays.cpp::GlobOpt::ArraySrcOpt::CheckLoops, line 504
https://api.github.com/repos/chakra-core/ChakraCore/issues/6913/comments
0
2023-05-13T04:32:27Z
2023-05-13T04:32:27Z
https://github.com/chakra-core/ChakraCore/issues/6913
1,708,429,523
6,913
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (let i = 0; i < 100; i++) { for (let j = 2; j != 2; j = j >>> i) { const m = []; m[i] = 2; for (let k = 0; k < 1; k++) { m[i]; i++; } } } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 420486: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 5257) upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck Failure: (upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556d3e468 ch`BackwardPass::UpdateArrayBailOutKind(this=0x00007fffffff8b90, instr=0x00007ff7e7bb81a8) at BackwardPass.cpp:5257:17 frame #1: 0x0000555556d3dbf8 ch`BackwardPass::DeadStoreImplicitCallBailOut(this=0x00007fffffff8b90, instr=0x00007ff7e7bb81a8, hasLiveFields=false, needsLazyBailOut=false) at BackwardPass.cpp:2414:5 frame #2: 0x0000555556d3733c ch`BackwardPass::ProcessBlock(this=0x00007fffffff8b90, block=0x00007ff7e7c0a030) at BackwardPass.cpp:3767:13 frame #3: 0x0000555556d2f2bb ch`BackwardPass::OptBlock(this=0x00007fffffff8b90, block=0x00007ff7e7c0a030) at BackwardPass.cpp:1711:11 frame #4: 0x0000555556d2ed1f ch`BackwardPass::Optimize(this=0x00007fffffff8b90) at BackwardPass.cpp:430:15 frame #5: 0x0000555556b447a4 ch`GlobOpt::BackwardPass(this=0x00007fffffff9870, tag=DeadStorePhase) at GlobOpt.cpp:160:18 frame #6: 0x0000555556b44ac9 ch`GlobOpt::Optimize(this=0x00007fffffff9870) at GlobOpt.cpp:213:15 frame #7: 0x0000555556b262ab ch`Func::TryCodegen(this=0x00007fffffff9f20) at Func.cpp:457:21 frame #8: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa4e0, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb7098, scriptContextInfo=0x0000555557ee9018, outputData=0x00007fffffffa920, epInfo=0x00007ff7e7c64200, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3f2e0, codeGenAllocators=0x0000555557ef5b28, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #9: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea7e8, pageAllocator=0x0000555557eb7420, workItemData=0x0000555557ef59a0, jitWriteData=0x00007fffffffa920, foreground=true, epInfo=0x00007ff7e7c64200) at NativeCodeGenerator.cpp:890:9 frame #10: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea7e8, pageAllocator=0x0000555557eb7420, workItem=0x0000555557ef5978, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #11: 0x00005555569139a7 ch`NativeCodeGenerator::Process(this=0x0000555557eea7e8, job=0x0000555557ef5980, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1895:13 frame #12: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef5980) at Jobs.cpp:426:36 frame #13: 0x0000555556922bc3 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea7e8, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:207:36 frame #14: 0x0000555556918804 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea7e8, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:81:58 frame #15: 0x000055555690d4fc ch`NativeCodeGenerator::GenerateLoopBody(this=0x0000555557eea7e8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c77810, entryPoint=0x00007ff7e7c64200, localCount=15, localSlots=0x00007fffffffc140) at NativeCodeGenerator.cpp:711:22 frame #16: 0x00005555568157dd ch`GenerateLoopBody(nativeCodeGen=0x0000555557eea7e8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c77810, info=0x00007ff7e7c64200, localCount=15, localSlots=0x00007fffffffc140) at BackendApi.cpp:88:20 frame #17: 0x0000555555fb220b ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffbfe0, loopNumber=1, layoutSize=SmallLayout, doProfileLoopCheck=true, isFirstIteration=false) at InterpreterStackFrame.cpp:6277:17 frame #18: 0x0000555555fb5997 ch`void Js::InterpreterStackFrame::LoopBodyStart<false, true>(this=0x00007fffffffbfe0, loopNumber=1, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5994:9 frame #19: 0x0000555556002d38 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbfe0, loopId=1) at InterpreterStackFrame.cpp:5902:9 frame #20: 0x0000555555fcd716 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbfe0, ip="\r\U00000003") at InterpreterStackFrame.cpp:5774:16 frame #21: 0x0000555555e704b1 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffbfe0) at InterpreterHandler.inl:52:3 frame #22: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbfe0) at InterpreterStackFrame.cpp:3495:22 frame #23: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #24: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #25: 0x00007ff7e7bd0fa2 frame #26: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #27: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #28: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee9018, inScript=true) at JavascriptFunction.cpp:772:24 frame #29: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee9018, inScript=true) at JavascriptFunction.cpp:717:15 frame #30: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee9018, inScript=true) at JavascriptFunction.cpp:832:16 frame #31: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee9018, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #32: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee9018)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #33: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #34: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #35: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="for (let i = 0; i < 100; i++) {\n for (let j = 2; j != 2; j = j >>> i) {\n const m = [];\n m[i] = 2;\n for (let k = 0; k < 1; k++) {\n m[i];\n i++;\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 237371: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 5257) upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck\n// Failure: (upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck)\n// STDOUT:\n// [COV] edge counters initialized. Shared memory: shm_id_2712790_6 with 515228 edges\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 118 ms\n\n\n/*\n\nTitle: Assertion Failure: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./c"..., cb=1123, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug26_bailout.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #36: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #37: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #38: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #39: 0x0000555555784924 ch`RunScript(fileName="bug26_bailout.js", fileContents="for (let i = 0; i < 100; i++) {\n for (let j = 2; j != 2; j = j >>> i) {\n const m = [];\n m[i] = 2;\n for (let k = 0; k < 1; k++) {\n m[i];\n i++;\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 237371: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 5257) upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck\n// Failure: (upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck)\n// STDOUT:\n// [COV] edge counters initialized. Shared memory: shm_id_2712790_6 with 515228 edges\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 118 ms\n\n\n/*\n\nTitle: Assertion Failure: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./c"..., fileLength=1123, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug26_bailout.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #40: 0x00005555557863f0 ch`ExecuteTest(fileName="bug26_bailout.js") at ch.cpp:917:13 frame #41: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug26_bailout.js") at ch.cpp:967:10 frame #42: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #43: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #44: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: upperBoundCheck->GetBailOutKind() == IR::BailOutOnFailedHoistedBoundCheck in ChakraCore/lib/Backend/BackwardPass.cpp, line 5257
https://api.github.com/repos/chakra-core/ChakraCore/issues/6912/comments
0
2023-05-13T04:31:57Z
2023-05-13T04:31:57Z
https://github.com/chakra-core/ChakraCore/issues/6912
1,708,429,412
6,912
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function opt() { function f(a13) { opt = a13; } new Promise(f); opt.__proto__ = Reflect; return opt; } const a = opt(); a[opt] = 2; a.length = 2; ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 419477: (/home/wjm/ChakraCore/lib/Runtime/./Language/CacheOperators.inl, line 367) objectWithProperty->IsWritable(propertyId) || (isRoot && VarTo<RootObjectBase>(objectWithProperty)->IsLetConstGlobal(propertyId)) || JavascriptFunction::IsBuiltinProperty(objectWithProperty, propertyId) Failure: (objectWithProperty->IsWritable(propertyId) || (isRoot && VarTo<RootObjectBase>(objectWithProperty)->IsLetConstGlobal(propertyId)) || JavascriptFunction::IsBuiltinProperty(objectWithProperty, propertyId)) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556a65f48 ch`void Js::CacheOperators::Cache<false, false, true>(isProto=false, objectWithProperty=0x00007ff7e7c62300, isRoot=false, type=0x00007ff7e7c4b7c0, typeWithoutProperty=0x0000000000000000, propertyId=209, propertyIndex=0, isInlineSlot=false, isMissing=false, requiredAuxSlotCapacity=0, info=0x00007fffffffae40, requestContext=0x0000555557ee90e8) at CacheOperators.inl:364:13 frame #1: 0x0000555556a63d88 ch`Js::CacheOperators::CachePropertyWrite(object=0x00007ff7e7c62300, isRoot=false, typeWithoutProperty=0x0000000000000000, propertyId=209, info=0x00007fffffffae40, requestContext=0x0000555557ee90e8) at CacheOperators.cpp:284:13 frame #2: 0x000055555605114f ch`int Js::JavascriptOperators::SetProperty_Internal<false>(receiver=0x00007ff7e7c62300, object=0x00007ff7e7c62300, isRoot=false, propertyId=209, newValue=0x0001000000000002, info=0x00007fffffffae40, requestContext=0x0000555557ee90e8, propertyOperationFlags=PropertyOperation_None) at JavascriptOperators.cpp:2847:21 frame #3: 0x000055555602ee9a ch`Js::JavascriptOperators::SetProperty(receiver=0x00007ff7e7c62300, object=0x00007ff7e7c62300, propertyId=209, newValue=0x0001000000000002, info=0x00007fffffffae40, requestContext=0x0000555557ee90e8, propertyOperationFlags=PropertyOperation_None) at JavascriptOperators.cpp:2675:16 frame #4: 0x000055555602fbfd ch`Js::JavascriptOperators::OP_SetProperty(instance=0x00007ff7e7c62300, propertyId=209, newValue=0x0001000000000002, scriptContext=0x0000555557ee90e8, info=0x00007fffffffae40, flags=PropertyOperation_None, thisInstance=0x00007ff7e7c62300) at JavascriptOperators.cpp:2932:20 frame #5: 0x0000555556070ed6 ch`void Js::JavascriptOperators::PatchPutValueWithThisPtrNoLocalFastPath<false, Js::InlineCache>(functionBody=0x00007ff7e7c47000, inlineCache=0x00007ff7e84caf10, inlineCacheIndex=0, instance=0x00007ff7e7c62300, propertyId=209, newValue=0x0001000000000002, thisInstance=0x00007ff7e7c62300, flags=PropertyOperation_None) at JavascriptOperators.cpp:8712:14 frame #6: 0x0000555556070d12 ch`void Js::JavascriptOperators::PatchPutValueNoLocalFastPath<false, Js::InlineCache>(functionBody=0x00007ff7e7c47000, inlineCache=0x00007ff7e84caf10, inlineCacheIndex=0, instance=0x00007ff7e7c62300, propertyId=209, newValue=0x0001000000000002, flags=PropertyOperation_None) at JavascriptOperators.cpp:8660:9 frame #7: 0x0000555555fff52d ch`void Js::InterpreterStackFrame::DoSetProperty_NoFastPath<Js::OpLayoutT_ElementCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffc030, playout=0x00007ff7e7bf016e, instance=0x00007ff7e7c62300, flags=PropertyOperation_None)0> > const __unaligned __unaligned*, void*, Js::PropertyOperationFlags) at InterpreterStackFrame.cpp:4642:9 frame #8: 0x0000555555fff319 ch`void Js::InterpreterStackFrame::DoSetProperty<Js::OpLayoutT_ElementCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffc030, playout=0x00007ff7e7bf016e, instance=0x00007ff7e7c62300, flags=PropertyOperation_None)0> > const __unaligned __unaligned*, void*, Js::PropertyOperationFlags) at InterpreterStackFrame.cpp:4620:9 frame #9: 0x0000555555fc8364 ch`void Js::InterpreterStackFrame::OP_SetProperty<Js::OpLayoutT_ElementCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffc030, playout=0x00007ff7e7bf016e)0> > const __unaligned __unaligned*) at InterpreterStackFrame.cpp:4728:9 frame #10: 0x0000555555e767cb ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffc030) at InterpreterHandler.inl:202:3 frame #11: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffc030) at InterpreterStackFrame.cpp:3495:22 frame #12: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c76730, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #13: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #14: 0x00007ff7e7bd0fa2 frame #15: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #16: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #17: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c76730, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee90e8, inScript=true) at JavascriptFunction.cpp:772:24 frame #18: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee90e8, inScript=true) at JavascriptFunction.cpp:717:15 frame #19: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee90e8, inScript=true) at JavascriptFunction.cpp:832:16 frame #20: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee90e8, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #21: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee90e8)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #22: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #23: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #24: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="function opt() {\n function f(a13) {\n opt = a13;\n }\n new Promise(f);\n opt.__proto__ = Reflect;\n return opt;\n}\nconst a = opt();\na[opt] = 2;\na.length = 2;\n\n// ASSERTION 1327990: (/home/wjm/ChakraCore/lib/Runtime/./Language/CacheOperators.inl, line 367) objectWithProperty->IsWritable(propertyId) || (isRoot && VarTo<RootObjectBase>(objectWithProperty)->IsLetConstGlobal(propertyId)) || JavascriptFunction::IsBuiltinProperty(objectWithProperty, propertyId)\n// Failure: (objectWithProperty->IsWritable(propertyId) || (isRoot && VarTo<RootObjectBase>(objectWithProperty)->IsLetConstGlobal(propertyId)) || JavascriptFunction::IsBuiltinProperty(objectWithProperty, propertyId))\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 13 ms\n\n\n/*\n\nTitle: Assertion Failure: objectWithProperty->IsWritable(propertyId) in ChakraCore/lib/Runtime/./Language/CacheOperators.inl, line 367\n\n## Version\ncommit id: c3ead3f8a6e"..., cb=1330, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug25_promise.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #25: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #26: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #27: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #28: 0x0000555555784924 ch`RunScript(fileName="bug25_promise.js", fileContents="function opt() {\n function f(a13) {\n opt = a13;\n }\n new Promise(f);\n opt.__proto__ = Reflect;\n return opt;\n}\nconst a = opt();\na[opt] = 2;\na.length = 2;\n\n// ASSERTION 1327990: (/home/wjm/ChakraCore/lib/Runtime/./Language/CacheOperators.inl, line 367) objectWithProperty->IsWritable(propertyId) || (isRoot && VarTo<RootObjectBase>(objectWithProperty)->IsLetConstGlobal(propertyId)) || JavascriptFunction::IsBuiltinProperty(objectWithProperty, propertyId)\n// Failure: (objectWithProperty->IsWritable(propertyId) || (isRoot && VarTo<RootObjectBase>(objectWithProperty)->IsLetConstGlobal(propertyId)) || JavascriptFunction::IsBuiltinProperty(objectWithProperty, propertyId))\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 13 ms\n\n\n/*\n\nTitle: Assertion Failure: objectWithProperty->IsWritable(propertyId) in ChakraCore/lib/Runtime/./Language/CacheOperators.inl, line 367\n\n## Version\ncommit id: c3ead3f8a6e"..., fileLength=1330, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug25_promise.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #29: 0x00005555557863f0 ch`ExecuteTest(fileName="bug25_promise.js") at ch.cpp:917:13 frame #30: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug25_promise.js") at ch.cpp:967:10 frame #31: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #32: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #33: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: objectWithProperty->IsWritable(propertyId) in Js::JavaScriptOperators::SetProperty
https://api.github.com/repos/chakra-core/ChakraCore/issues/6911/comments
0
2023-05-13T04:31:22Z
2023-05-13T04:31:22Z
https://github.com/chakra-core/ChakraCore/issues/6911
1,708,429,302
6,911
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function opt(arg) { opt.__proto__ = Reflect; for (let i = 0; i < 50; i++) { arg[-2] = i; arg.length = arg[opt]; } } opt(opt); ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 393508: (/home/wjm/ChakraCore/lib/Runtime/./Language/InlineCache.inl, line 240) canSetField Failure: (canSetField) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555555fe406b ch`bool Js::InlineCache::TrySetProperty<true, false, false, false>(this=0x00007ff7e84cae90, object=0x00007ff7e7c76730, propertyId=209, propertyValue=0x00007ff7e7c75030, requestContext=0x0000555557ee8f88, operationInfo=0x0000000000000000, propertyOperationFlags=PropertyOperation_None) at InlineCache.inl:240:13 frame #1: 0x0000555555fe359b ch`bool Js::CacheOperators::TrySetProperty<true, false, false, false, false, true, false, false>(object=0x00007ff7e7c76730, isRoot=false, propertyId=209, propertyValue=0x00007ff7e7c75030, requestContext=0x0000555557ee8f88, propertyOperationFlags=PropertyOperation_None, operationInfo=0x0000000000000000, propertyValueInfo=0x00007fffffff9800) at CacheOperators.inl:157:34 frame #2: 0x0000555555fff425 ch`bool Js::InterpreterStackFrame::TrySetPropertyLocalFastPath<Js::OpLayoutT_ElementCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffa8e0, playout=0x00007ff7e84cd494, pid=209, instance=0x00007ff7e7c76730, inlineCache=0x00007fffffff98a8, flags=PropertyOperation_None)0> > const __unaligned __unaligned*, int, Js::RecyclableObject*, Js::InlineCache*&, Js::PropertyOperationFlags) at InterpreterStackFrame.cpp:4586:13 frame #3: 0x0000555555fff2a5 ch`void Js::InterpreterStackFrame::DoSetProperty<Js::OpLayoutT_ElementCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffa8e0, playout=0x00007ff7e84cd494, instance=0x00007ff7e7c76730, flags=PropertyOperation_None)0> > const __unaligned __unaligned*, void*, Js::PropertyOperationFlags) at InterpreterStackFrame.cpp:4606:16 frame #4: 0x0000555555fc8364 ch`void Js::InterpreterStackFrame::OP_SetProperty<Js::OpLayoutT_ElementCP<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned>(this=0x00007fffffffa8e0, playout=0x00007ff7e84cd494)0> > const __unaligned __unaligned*) at InterpreterStackFrame.cpp:4728:9 frame #5: 0x0000555555e767cb ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffa8e0) at InterpreterHandler.inl:202:3 frame #6: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffa8e0) at InterpreterStackFrame.cpp:3495:22 frame #7: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c76730, args=ArgumentReader @ 0x00007fffffffae00, returnAddress=0x00007ff7e7bd0f9a, addressOfReturnAddress=0x00007fffffffae48, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #8: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffae60) at InterpreterStackFrame.cpp:1833:16 frame #9: 0x00007ff7e7bd0f9a frame #10: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #11: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffaf90, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #12: 0x0000555555ffc5fe ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc030, playout=0x00007ff7e84d40eb, function=0x00007ff7e7c76730, flags=16, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3973:21 frame #13: 0x0000555555fcdb05 ch`void Js::InterpreterStackFrame::OP_CallI<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc030, playout=0x00007ff7e84d40eb)0> > > __unaligned const __unaligned*) at InterpreterStackFrame.h:510:72 frame #14: 0x0000555555e71df3 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffc030) at InterpreterHandler.inl:91:3 frame #15: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffc030) at InterpreterStackFrame.cpp:3495:22 frame #16: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #17: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #18: 0x00007ff7e7bd0fa2 frame #19: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #20: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #21: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee8f88, inScript=true) at JavascriptFunction.cpp:772:24 frame #22: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8f88, inScript=true) at JavascriptFunction.cpp:717:15 frame #23: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8f88, inScript=true) at JavascriptFunction.cpp:832:16 frame #24: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee8f88, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #25: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee8f88)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #26: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #27: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #28: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="function opt(arg) {\n opt.__proto__ = Reflect;\n for (let i = 0; i < 50; i++) {\n arg[-2] = i;\n arg.length = arg[opt];\n }\n}\nopt(opt);\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 2488490: (/home/wjm/ChakraCore/lib/Runtime/./Language/InlineCache.inl, line 240) canSetField\n// Failure: (canSetField)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 43 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", cb=871, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug18_canSetField.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #29: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #30: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #31: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #32: 0x0000555555784924 ch`RunScript(fileName="bug18_canSetField.js", fileContents="function opt(arg) {\n opt.__proto__ = Reflect;\n for (let i = 0; i < 50; i++) {\n arg[-2] = i;\n arg.length = arg[opt];\n }\n}\nopt(opt);\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 2488490: (/home/wjm/ChakraCore/lib/Runtime/./Language/InlineCache.inl, line 240) canSetField\n// Failure: (canSetField)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 43 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", fileLength=871, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug18_canSetField.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #33: 0x00005555557863f0 ch`ExecuteTest(fileName="bug18_canSetField.js") at ch.cpp:917:13 frame #34: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug18_canSetField.js") at ch.cpp:967:10 frame #35: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #36: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #37: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: canSetField in ChakraCore/lib/Runtime/./Language/InlineCache.inl, line 240
https://api.github.com/repos/chakra-core/ChakraCore/issues/6910/comments
0
2023-05-13T04:30:23Z
2023-05-13T04:30:23Z
https://github.com/chakra-core/ChakraCore/issues/6910
1,708,429,096
6,910
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function opt(arg) { try { switch (arg) { case 2: try {} catch(e) { break;} default: break; } } catch(e) {} } for (let i = 0; i < 100; i++) { opt(i); } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 392420: (/home/wjm/ChakraCore/lib/Backend/FlowGraph.cpp, line 2078) this->func->IsLoopBodyInTry() Failure: (this->func->IsLoopBodyInTry()) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556b0a45a ch`FlowGraph::PropagateRegionFromPred(this=0x00007ff7e7c06030, block=0x00007ff7e7c069b8, predBlock=0x00007ff7e7c06c10, predRegion=0x00007ff7e7c08e50, tryInstr=0x00007fffffff8c90) at FlowGraph.cpp:2078:17 frame #1: 0x0000555556b00244 ch`FlowGraph::UpdateRegionForBlock(this=0x00007ff7e7c06030, block=0x00007ff7e7c069b8) at FlowGraph.cpp:1936:32 frame #2: 0x0000555556b08949 ch`FlowGraph::Destroy(this=0x00007ff7e7c06030) at FlowGraph.cpp:1722:19 frame #3: 0x0000555556b262f6 ch`Func::TryCodegen(this=0x00007fffffffa020) at Func.cpp:462:25 frame #4: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa5e0, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb5d18, scriptContextInfo=0x0000555557ee8b98, outputData=0x00007fffffffaa20, epInfo=0x00007ff7e7c48090, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3f340, codeGenAllocators=0x0000555557ef54f8, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #5: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea368, pageAllocator=0x0000555557eb60a0, workItemData=0x0000555557ef6a70, jitWriteData=0x00007fffffffaa20, foreground=true, epInfo=0x00007ff7e7c48090) at NativeCodeGenerator.cpp:890:9 frame #6: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea368, pageAllocator=0x0000555557eb60a0, workItem=0x0000555557ef6a48, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #7: 0x0000555556913a24 ch`NativeCodeGenerator::Process(this=0x0000555557eea368, job=0x0000555557ef6a50, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1907:13 frame #8: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef6a50) at Jobs.cpp:426:36 frame #9: 0x0000555556920e29 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea368, holder=0x00007ff7e7c48090, function=0x00007ff7e7c76730) at Jobs.inl:207:36 frame #10: 0x00005555569182e4 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea368, holder=0x00007ff7e7c48090, function=0x00007ff7e7c76730) at Jobs.inl:81:58 frame #11: 0x0000555556912786 ch`NativeCodeGenerator::CheckCodeGen(function=0x00007ff7e7c76730) at NativeCodeGenerator.cpp:1644:37 frame #12: 0x0000555556978bac ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...) at Thunks.S:36 frame #13: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #14: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffaf60, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #15: 0x0000555555ffc5fe ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc000, playout=0x00007ff7e84cd496, function=0x00007ff7e7c76730, flags=16, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3973:21 frame #16: 0x0000555555fcdb05 ch`void Js::InterpreterStackFrame::OP_CallI<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc000, playout=0x00007ff7e84cd496)0> > > __unaligned const __unaligned*) at InterpreterStackFrame.h:510:72 frame #17: 0x0000555555e71df3 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffc000) at InterpreterHandler.inl:91:3 frame #18: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffc000) at InterpreterStackFrame.cpp:3495:22 frame #19: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #20: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #21: 0x00007ff7e7bd0fa2 frame #22: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #23: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #24: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee8b98, inScript=true) at JavascriptFunction.cpp:772:24 frame #25: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8b98, inScript=true) at JavascriptFunction.cpp:717:15 frame #26: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8b98, inScript=true) at JavascriptFunction.cpp:832:16 frame #27: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee8b98, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #28: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee8b98)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #29: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #30: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #31: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="function opt(arg) {\n try {\n switch (arg) {\n case 2:\n try {} catch(e) { break;} \n default:\n break;\n }\n } catch(e) {}\n}\nfor (let i = 0; i < 100; i++) {\n opt(i);\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 1137678: (/home/wjm/ChakraCore/lib/Backend/FlowGraph.cpp, line 1842) Bad region propagation through interior block\n// Failure: (predRegion->IsNonExceptingFinally() || region == predRegion)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 29 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", cb=1023, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug17_flowgraph.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #32: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #33: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #34: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #35: 0x0000555555784924 ch`RunScript(fileName="bug17_flowgraph.js", fileContents="function opt(arg) {\n try {\n switch (arg) {\n case 2:\n try {} catch(e) { break;} \n default:\n break;\n }\n } catch(e) {}\n}\nfor (let i = 0; i < 100; i++) {\n opt(i);\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 1137678: (/home/wjm/ChakraCore/lib/Backend/FlowGraph.cpp, line 1842) Bad region propagation through interior block\n// Failure: (predRegion->IsNonExceptingFinally() || region == predRegion)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 29 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", fileLength=1023, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug17_flowgraph.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #36: 0x00005555557863f0 ch`ExecuteTest(fileName="bug17_flowgraph.js") at ch.cpp:917:13 frame #37: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug17_flowgraph.js") at ch.cpp:967:10 frame #38: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #39: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #40: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: this->func->IsLoopBodyInTry() in ChakraCore/lib/Backend/FlowGraph.cpp, line 1842
https://api.github.com/repos/chakra-core/ChakraCore/issues/6909/comments
0
2023-05-13T04:29:39Z
2023-05-13T04:29:39Z
https://github.com/chakra-core/ChakraCore/issues/6909
1,708,428,475
6,909
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (let i = 0; i < 400; i++) { const obj = {}; obj["a"]; function f() { eval(""); } with (f) { constructor = f; } obj["b"] = 1; } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 389496: (/home/wjm/ChakraCore/lib/Backend/Lower.cpp, line 7222) false Failure: (false) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x00005555568c6e50 ch`Lowerer::MapStFldHelper(this=0x00007fffffff9720, propertySymOpnd=0x00007ff7e7c0d030, helperMethod=0x00007fffffff8004, polymorphicHelperMethod=0x00007fffffff8000) at Lower.cpp:7222:17 frame #1: 0x000055555688867b ch`Lowerer::LowerStFld(this=0x00007fffffff9720, stFldInstr=0x00007ff7e7b9dcd0, helperMethod=HelperOp_InitConstFld, polymorphicHelperMethod=HelperOp_InitConstFld, withInlineCache=false, labelBailOut=0x0000000000000000, isHelper=false, withPutFlags=false, flags=PropertyOperation_None) at Lower.cpp:7102:13 frame #2: 0x0000555556886602 ch`Lowerer::LowerRange(this=0x00007fffffff9720, instrStart=0x00007ff7e7c0b180, instrEnd=0x00007ff7e7c0b1e0, defaultDoFastPath=true, defaultDoLoopFastPath=true) at Lower.cpp:2543:13 frame #3: 0x000055555687bfd1 ch`Lowerer::Lower(this=0x00007fffffff9720) at Lower.cpp:105:11 frame #4: 0x0000555556b2636b ch`Func::TryCodegen(this=0x00007fffffff9f10) at Func.cpp:475:17 frame #5: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa4d0, workItem=0x00007ff7e7bf7030, threadContextInfo=0x0000555557eb7188, scriptContextInfo=0x0000555557ee9108, outputData=0x00007fffffffa910, epInfo=0x00007ff7e7c64180, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7bb7e00, codeGenAllocators=0x0000555557ef9eb8, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #6: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea8d8, pageAllocator=0x0000555557eb7510, workItemData=0x0000555557ef9db0, jitWriteData=0x00007fffffffa910, foreground=true, epInfo=0x00007ff7e7c64180) at NativeCodeGenerator.cpp:890:9 frame #7: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea8d8, pageAllocator=0x0000555557eb7510, workItem=0x0000555557ef9d88, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #8: 0x00005555569139a7 ch`NativeCodeGenerator::Process(this=0x0000555557eea8d8, job=0x0000555557ef9d90, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1895:13 frame #9: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef9d90) at Jobs.cpp:426:36 frame #10: 0x0000555556922bc3 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea8d8, holder=0x00007ff7e7c64180, function=0x0000000000000000) at Jobs.inl:207:36 frame #11: 0x0000555556918804 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea8d8, holder=0x00007ff7e7c64180, function=0x0000000000000000) at Jobs.inl:81:58 frame #12: 0x000055555690d4fc ch`NativeCodeGenerator::GenerateLoopBody(this=0x0000555557eea8d8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c71e70, entryPoint=0x00007ff7e7c64180, localCount=15, localSlots=0x00007fffffffc150) at NativeCodeGenerator.cpp:711:22 frame #13: 0x00005555568157dd ch`GenerateLoopBody(nativeCodeGen=0x0000555557eea8d8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c71e70, info=0x00007ff7e7c64180, localCount=15, localSlots=0x00007fffffffc150) at BackendApi.cpp:88:20 frame #14: 0x0000555555fb220b ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffbff0, loopNumber=0, layoutSize=SmallLayout, doProfileLoopCheck=false, isFirstIteration=false) at InterpreterStackFrame.cpp:6277:17 frame #15: 0x0000555555fb57ee ch`void Js::InterpreterStackFrame::ProfiledLoopBodyStart<false, true>(this=0x00007fffffffbff0, loopNumber=0, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5930:41 frame #16: 0x0000555555ff8a0a ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, true>(this=0x00007fffffffbff0, loopId=0) at InterpreterStackFrame.cpp:5902:9 frame #17: 0x0000555555fc6a96 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, true>(this=0x00007fffffffbff0, ip="\U000000017\U00000001") at InterpreterStackFrame.cpp:5774:16 frame #18: 0x0000555555eaae91 ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffffffbff0) at InterpreterHandler.inl:52:3 frame #19: 0x0000555555e525de ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbff0) at InterpreterStackFrame.cpp:3520:22 frame #20: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c76780, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #21: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #22: 0x00007ff7e7bd0fa2 frame #23: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #24: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76780, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #25: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c76780, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee9108, inScript=true) at JavascriptFunction.cpp:772:24 frame #26: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c76780, args=<unavailable>, scriptContext=0x0000555557ee9108, inScript=true) at JavascriptFunction.cpp:717:15 frame #27: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c76780, args=<unavailable>, scriptContext=0x0000555557ee9108, inScript=true) at JavascriptFunction.cpp:832:16 frame #28: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee9108, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #29: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee9108)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #30: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #31: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #32: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="for (let i = 0; i < 400; i++) {\n const obj = {};\n obj[\"a\"];\n function f() {\n eval(\"\"); \n }\n with (f) {\n constructor = f;\n }\n obj[\"b\"] = 1;\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 824955: (/home/wjm/ChakraCore/lib/Backend/Lower.cpp, line 7222) false\n// Failure: (false)\n// STDOUT:\n// [COV] edge counters initialized. Shared memory: shm_id_2712790_3 with 515228 edges\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 127 ms\n\n\n/*\n\nTitle: Assertion Failure: Invalid helperMethod in ChakraCore/lib/Backend/Lower.cpp::Lowerer::MapStFldHelper, line 7222\n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\nfor (let i = 0; i < 400; i++) {\n const obj = {};\n obj[\"a\"];\n function f() {\n eval(\"\"); \n }\n with (f)"..., cb=1350, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug16_lowerFalse.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #33: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #34: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #35: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #36: 0x0000555555784924 ch`RunScript(fileName="bug16_lowerFalse.js", fileContents="for (let i = 0; i < 400; i++) {\n const obj = {};\n obj[\"a\"];\n function f() {\n eval(\"\"); \n }\n with (f) {\n constructor = f;\n }\n obj[\"b\"] = 1;\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 824955: (/home/wjm/ChakraCore/lib/Backend/Lower.cpp, line 7222) false\n// Failure: (false)\n// STDOUT:\n// [COV] edge counters initialized. Shared memory: shm_id_2712790_3 with 515228 edges\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 127 ms\n\n\n/*\n\nTitle: Assertion Failure: Invalid helperMethod in ChakraCore/lib/Backend/Lower.cpp::Lowerer::MapStFldHelper, line 7222\n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\nfor (let i = 0; i < 400; i++) {\n const obj = {};\n obj[\"a\"];\n function f() {\n eval(\"\"); \n }\n with (f)"..., fileLength=1350, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug16_lowerFalse.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #37: 0x00005555557863f0 ch`ExecuteTest(fileName="bug16_lowerFalse.js") at ch.cpp:917:13 frame #38: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug16_lowerFalse.js") at ch.cpp:967:10 frame #39: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #40: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #41: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: Invalid helperMethod in ChakraCore/lib/Backend/Lower.cpp::Lowerer::MapStFldHelper, line 7222
https://api.github.com/repos/chakra-core/ChakraCore/issues/6908/comments
0
2023-05-13T04:29:03Z
2023-05-13T04:29:03Z
https://github.com/chakra-core/ChakraCore/issues/6908
1,708,428,353
6,908
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function opt(arg) { do {} while (arg !== arg); } for (let i = 0; i < 100; i++) { opt(); } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 388027: (/home/wjm/ChakraCore/lib/Backend/DbCheckPostLower.cpp, line 81) Inconsistency in Helper label annotations Failure: (prevInstr && prevInstr->IsLabelInstr() && !prevInstr->AsLabelInstr()->isOpHelper) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556d657ad ch`DbCheckPostLower::Check(this=0x00007fffffff7200) at DbCheckPostLower.cpp:81:25 frame #1: 0x0000555556b2976d ch`Func::EndPhase(this=0x00007fffffff8370, tag=LowererPhase, dump=true) at Func.cpp:1364:17 frame #2: 0x000055555686e827 ch`AutoCodeGenPhase::~AutoCodeGenPhase(this=0x00007fffffff7b70) at Func.h:1143:19 frame #3: 0x0000555556b263a3 ch`Func::TryCodegen(this=0x00007fffffff8370) at Func.cpp:476:9 frame #4: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffff8930, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb6fc8, scriptContextInfo=0x0000555557ee8f48, outputData=0x00007fffffff8d70, epInfo=0x00007ff7e7c64180, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3f3a0, codeGenAllocators=0x0000555557ef58a8, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #5: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea718, pageAllocator=0x0000555557eb7350, workItemData=0x0000555557efdbf0, jitWriteData=0x00007fffffff8d70, foreground=true, epInfo=0x00007ff7e7c64180) at NativeCodeGenerator.cpp:890:9 frame #6: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea718, pageAllocator=0x0000555557eb7350, workItem=0x0000555557efdbc8, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #7: 0x00005555569139a7 ch`NativeCodeGenerator::Process(this=0x0000555557eea718, job=0x0000555557efdbd0, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1895:13 frame #8: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557efdbd0) at Jobs.cpp:426:36 frame #9: 0x0000555556922bc3 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea718, holder=0x00007ff7e7c64180, function=0x0000000000000000) at Jobs.inl:207:36 frame #10: 0x0000555556918804 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea718, holder=0x00007ff7e7c64180, function=0x0000000000000000) at Jobs.inl:81:58 frame #11: 0x000055555690d4fc ch`NativeCodeGenerator::GenerateLoopBody(this=0x0000555557eea718, fn=0x00007ff7e7c471f0, loopHeader=0x00007ff7e7c71db0, entryPoint=0x00007ff7e7c64180, localCount=3, localSlots=0x00007fffffffa5b0) at NativeCodeGenerator.cpp:711:22 frame #12: 0x00005555568157dd ch`GenerateLoopBody(nativeCodeGen=0x0000555557eea718, fn=0x00007ff7e7c471f0, loopHeader=0x00007ff7e7c71db0, info=0x00007ff7e7c64180, localCount=3, localSlots=0x00007fffffffa5b0) at BackendApi.cpp:88:20 frame #13: 0x0000555555fb220b ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffa450, loopNumber=0, layoutSize=SmallLayout, doProfileLoopCheck=false, isFirstIteration=false) at InterpreterStackFrame.cpp:6277:17 frame #14: 0x0000555555fb57ee ch`void Js::InterpreterStackFrame::ProfiledLoopBodyStart<false, true>(this=0x00007fffffffa450, loopNumber=0, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5930:41 frame #15: 0x0000555555ff8a0a ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, true>(this=0x00007fffffffa450, loopId=0) at InterpreterStackFrame.cpp:5902:9 frame #16: 0x0000555555fc6a96 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, true>(this=0x00007fffffffa450, ip="\U00000015\xf9\xff\U00000002\U00000002\t") at InterpreterStackFrame.cpp:5774:16 frame #17: 0x0000555555eaae91 ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffffffa450) at InterpreterHandler.inl:52:3 frame #18: 0x0000555555e52112 ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffa450) at InterpreterStackFrame.cpp:3472:20 frame #19: 0x000055555681d6c8 ch`BailOutRecord::BailOutHelper(layout=0x00007fffffffae40, functionRef=0x00007fffffffae40, args=0x00007fffffffaaa0, isInlinee=false, bailOutRecord=0x0000555557ef5d78, bailOutOffset=2, returnAddress=0x00007ff7e7bb0197, bailOutKind=BailOnSimpleJitToFullJitLoopBody, registerSaves=0x00007fffffffab50, bailOutReturnValue=0x0000000000000000, pArgumentsObject=0x00007fffffffae28, branchValue=0x0000000000000000, argoutRestoreAddress=0x0000000000000000) at BailOut.cpp:1785:78 frame #20: 0x000055555681bf20 ch`BailOutRecord::BailOutCommonNoCodeGen(layout=0x00007fffffffae40, bailOutRecord=0x0000555557ef5d78, bailOutOffset=2, returnAddress=0x00007ff7e7bb0197, bailOutKind=BailOnSimpleJitToFullJitLoopBody, branchValue=0x0000000000000000, registerSaves=0x00007fffffffab50, bailOutReturnValue=0x0000000000000000, argoutRestoreAddress=0x0000000000000000) at BailOut.cpp:1153:22 frame #21: 0x000055555681b853 ch`BailOutRecord::BailOutCommon(layout=0x00007fffffffae40, bailOutRecord=0x0000555557ef5d78, bailOutOffset=2, returnAddress=0x00007ff7e7bb0197, bailOutKind=BailOnSimpleJitToFullJitLoopBody, savedImplicitCallFlags=ImplicitCall_None, branchValue=0x0000000000000000, bailOutReturnValue=0x0000000000000000, argoutRestoreAddress=0x0000000000000000) at BailOut.cpp:1176:22 frame #22: 0x000055555681b6a3 ch`BailOutRecord::BailOutFromFunction(layout=0x00007fffffffae40, bailOutRecord=0x0000555557ef5d78, returnAddress=0x00007ff7e7bb0197, argoutRestoreAddress=0x0000000000000000, savedImplicitCallFlags=ImplicitCall_None) at BailOut.cpp:1127:12 frame #23: 0x000055555681b341 ch`BailOutRecord::BailOut(bailOutRecord=0x0000555557ef5d78) at BailOut.cpp:1112:12 frame #24: 0x00007ff7e7bb0197 frame #25: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #26: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=0x00007ff7e7bb0000, args=Arguments @ 0x00007fffffffaf70, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #27: 0x0000555555ffc5fe ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc010, playout=0x00007ff7e84cd491, function=0x00007ff7e7c76730, flags=16, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3973:21 frame #28: 0x0000555555fcdb05 ch`void Js::InterpreterStackFrame::OP_CallI<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc010, playout=0x00007ff7e84cd491)0> > > __unaligned const __unaligned*) at InterpreterStackFrame.h:510:72 frame #29: 0x0000555555e71df3 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffc010) at InterpreterHandler.inl:91:3 frame #30: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffc010) at InterpreterStackFrame.cpp:3495:22 frame #31: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #32: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #33: 0x00007ff7e7bd0fa2 frame #34: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #35: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #36: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee8f48, inScript=true) at JavascriptFunction.cpp:772:24 frame #37: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8f48, inScript=true) at JavascriptFunction.cpp:717:15 frame #38: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8f48, inScript=true) at JavascriptFunction.cpp:832:16 frame #39: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee8f48, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #40: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee8f48)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #41: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #42: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #43: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="function opt(arg) {\n do {} while (arg !== arg);\n}\nfor (let i = 0; i < 100; i++) {\n opt();\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3590041: (/home/wjm/ChakraCore/lib/Backend/DbCheckPostLower.cpp, line 81) Inconsistency in Helper label annotations\n// Failure: (prevInstr && prevInstr->IsLabelInstr() && !prevInstr->AsLabelInstr()->isOpHelper)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 18 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", cb=907, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug15_label.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #44: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #45: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #46: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #47: 0x0000555555784924 ch`RunScript(fileName="bug15_label.js", fileContents="function opt(arg) {\n do {} while (arg !== arg);\n}\nfor (let i = 0; i < 100; i++) {\n opt();\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3590041: (/home/wjm/ChakraCore/lib/Backend/DbCheckPostLower.cpp, line 81) Inconsistency in Helper label annotations\n// Failure: (prevInstr && prevInstr->IsLabelInstr() && !prevInstr->AsLabelInstr()->isOpHelper)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 18 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", fileLength=907, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug15_label.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #48: 0x00005555557863f0 ch`ExecuteTest(fileName="bug15_label.js") at ch.cpp:917:13 frame #49: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug15_label.js") at ch.cpp:967:10 frame #50: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #51: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #52: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: Inconsistency in Helper label annotations in ChakraCore/lib/Backend/DbCheckPostLower.cpp, line 81
https://api.github.com/repos/chakra-core/ChakraCore/issues/6907/comments
0
2023-05-13T04:28:06Z
2023-05-13T04:28:06Z
https://github.com/chakra-core/ChakraCore/issues/6907
1,708,428,151
6,907
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` async function f1() { const v7 = await 1301655991; function f8() { return v7; } f8(); for (let v13 = 0; v13 < 10; v13++) { function f14() {} } } for (let v0 = 0; v0 < 100; v0++) { f1(); } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 386721: (/home/wjm/ChakraCore/lib/Backend/amd64/EncoderMD.cpp, line 263) offset != 0 Failure: (offset != 0) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556962c87 ch`EncoderMD::GetMod(this=0x00007fffffffa230, symOpnd=0x00007ff7e7bbbf58, pDispSize=0x00007fffffff8b28, rmReg=0x00007fffffff8b01) at EncoderMD.cpp:263:9 frame #1: 0x0000555556962f7d ch`EncoderMD::EmitModRM(this=0x00007fffffffa230, instr=0x00007ff7e7c0bd90, opnd=0x00007ff7e7bbbf58, reg1='\b') at EncoderMD.cpp:345:21 frame #2: 0x00005555569655a6 ch`EncoderMD::Encode(this=0x00007fffffffa230, instr=0x00007ff7e7c0bd90, pc="\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"..., beginCodeAddress="H\xb8\x90p\xebWUU") at EncoderMD.cpp:898:37 frame #3: 0x0000555556aec202 ch`Encoder::Encode(this=0x00007fffffffa228) at Encoder.cpp:223:33 frame #4: 0x0000555556b26a22 ch`Func::TryCodegen(this=0x00007fffffffb1f0) at Func.cpp:561:17 frame #5: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffb7b0, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb6fe8, scriptContextInfo=0x0000555557ee8f68, outputData=0x00007fffffffbbf0, epInfo=0x00007ff7e7c48240, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7b15fc0, codeGenAllocators=0x0000555557ef8008, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #6: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea738, pageAllocator=0x0000555557eb7370, workItemData=0x0000555557ef7360, jitWriteData=0x00007fffffffbbf0, foreground=true, epInfo=0x00007ff7e7c48240) at NativeCodeGenerator.cpp:890:9 frame #7: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea738, pageAllocator=0x0000555557eb7370, workItem=0x0000555557ef7338, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #8: 0x0000555556913a24 ch`NativeCodeGenerator::Process(this=0x0000555557eea738, job=0x0000555557ef7340, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1907:13 frame #9: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef7340) at Jobs.cpp:426:36 frame #10: 0x0000555556920e29 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea738, holder=0x00007ff7e7c48240, function=0x00007ff7e7c76730) at Jobs.inl:207:36 frame #11: 0x00005555569182e4 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea738, holder=0x00007ff7e7c48240, function=0x00007ff7e7c76730) at Jobs.inl:81:58 frame #12: 0x0000555556912786 ch`NativeCodeGenerator::CheckCodeGen(function=0x00007ff7e7c76730) at NativeCodeGenerator.cpp:1644:37 frame #13: 0x0000555556978bac ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...) at Thunks.S:36 frame #14: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #15: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc100, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #16: 0x00005555561da48f ch`Js::JavascriptGenerator::CallGenerator(this=0x00007ff7e7c442a0, data=0x000100004d95b1b7, resumeKind=Normal) at JavascriptGenerator.cpp:198:26 frame #17: 0x00005555561a8db4 ch`Js::JavascriptAsyncFunction::EntryAsyncSpawnStepNextFunction(function=0x00007ff7e7b1a460, callInfo=(Count = 1, Flags = CallFlags_Value, unused = 0)) at JavascriptAsyncFunction.cpp:93:31 frame #18: 0x00005555561a8f98 ch`Js::JavascriptAsyncFunction::AsyncSpawnStep(stepFunction=0x00007ff7e7b1a460, generator=0x00007ff7e7c442a0, resolve=0x00007ff7e7c4f060, reject=0x00007ff7e7c4f0c0) at JavascriptAsyncFunction.cpp:151:25 frame #19: 0x00005555561a99b6 ch`Js::JavascriptAsyncFunction::EntryAsyncSpawnCallStepFunction(function=0x00007ff7e7c4b4d0, callInfo=(Count = 2, Flags = CallFlags_Value, unused = 0)) at JavascriptAsyncFunction.cpp:130:5 frame #20: 0x00005555563a0164 ch`Js::JavascriptPromise::EntryReactionTaskFunction(function=0x00007ff7e7c65050, callInfo=(Count = 1, Flags = CallFlags_None, unused = 0)) at JavascriptPromise.cpp:1273:37 frame #21: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #22: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c65050, entryPoint=(ch`Js::JavascriptPromise::EntryReactionTaskFunction(Js::RecyclableObject*, Js::CallInfo, ...) at JavascriptPromise.cpp:1236), args=Arguments @ 0x00007fffffffc8b8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #23: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c65050, args=Arguments @ 0x00007fffffffc930, scriptContext=0x0000555557ee8f68, inScript=true) at JavascriptFunction.cpp:772:24 frame #24: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c65050, args=<unavailable>, scriptContext=0x0000555557ee8f68, inScript=true) at JavascriptFunction.cpp:717:15 frame #25: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c65050, args=<unavailable>, scriptContext=0x0000555557ee8f68, inScript=true) at JavascriptFunction.cpp:832:16 frame #26: 0x000055555588add5 ch`JsCallFunction::$_67::operator(this=0x00007fffffffcda0, scriptContext=0x0000555557ee8f68, _actionEntryPopper=0x00007fffffffcd80)(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:2842:41 frame #27: 0x000055555588a764 ch`_JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(this=0x00007fffffffcd38, scriptContext=0x0000555557ee8f68)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #28: 0x000055555588a104 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(JsCallFunction::$_67)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcd38) at JsrtInternal.h:192:23 frame #29: 0x000055555585f1b6 ch`_JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(fn=(anonymous class) @ 0x00007fffffffcda0) at JsrtInternal.h:235:27 frame #30: 0x000055555585f179 ch`::JsCallFunction(function=0x00007ff7e7c65050, args=0x00007fffffffce70, cargs=1, result=0x00007fffffffce68) at Jsrt.cpp:2804:12 frame #31: 0x000055555578bf80 ch`ChakraRTInterface::JsCallFunction(function=0x00007ff7e7c65050, arguments=0x00007fffffffce70, argumentCount=1, result=0x00007fffffffce68) at ChakraRtInterface.h:416:149 frame #32: 0x0000555555797a7a ch`WScriptJsrt::CallbackMessage::CallFunction(this=0x0000555557effbb0, fileName="bug14_offset.js") at WScriptJsrt.cpp:2009:21 frame #33: 0x000055555579795d ch`WScriptJsrt::CallbackMessage::Call(this=0x0000555557effbb0, fileName="bug14_offset.js") at WScriptJsrt.cpp:1980:12 frame #34: 0x00005555557872fe ch`MessageQueue::ProcessAll(this=0x0000555557ef4920, fileName="bug14_offset.js") at MessageQueue.h:256:18 frame #35: 0x000055555578499c ch`RunScript(fileName="bug14_offset.js", fileContents="async function f1() {\n const v7 = await 1301655991;\n function f8() {\n return v7;\n }\n f8();\n for (let v13 = 0; v13 < 10; v13++) {\n function f14() {}\n }\n}\nfor (let v0 = 0; v0 < 100; v0++) {\n f1();\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3167571: (/home/wjm/ChakraCore/lib/Backend/amd64/EncoderMD.cpp, line 263) offset != 0\n// Failure: (offset != 0)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 180 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", fileLength=943, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug14_offset.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:480:17 frame #36: 0x00005555557863f0 ch`ExecuteTest(fileName="bug14_offset.js") at ch.cpp:917:13 frame #37: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug14_offset.js") at ch.cpp:967:10 frame #38: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #39: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #40: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: offset != 0 in ChakraCore/lib/Backend/amd64/EncoderMD.cpp, line 263
https://api.github.com/repos/chakra-core/ChakraCore/issues/6906/comments
0
2023-05-13T04:27:33Z
2023-05-13T04:27:33Z
https://github.com/chakra-core/ChakraCore/issues/6906
1,708,428,062
6,906
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function f14() { try { f14(); } catch(e20) { } ("test")["localeCompare"]("test"); } f14(); ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 384876: (/home/wjm/ChakraCore/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 372) propertyValue && VarIs<T>(propertyValue) Failure: (propertyValue && VarIs<T>(propertyValue)) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) bt 30 * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556a8794b ch`Js::JavascriptString* Js::AssertProperty<Js::JavascriptString>(state=0x00007ff7e7af5880, propertyId=(_value = 525)) at IntlEngineInterfaceExtensionObject.cpp:372:9 frame #1: 0x0000555556a84931 ch`Js::AssertStringProperty(state=0x00007ff7e7af5880, propertyId=(_value = 525)) at IntlEngineInterfaceExtensionObject.cpp:379:16 frame #2: 0x0000555556a7ee6e ch`Js::IntlEngineInterfaceExtensionObject::EntryIntl_LocaleCompare(function=0x00007ff7e7b4a480, callInfo=(Count = 5, Flags = CallFlags_Value, unused = 0)) at IntlEngineInterfaceExtensionObject.cpp:1869:41 frame #3: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #4: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7b4a480, entryPoint=(ch`Js::IntlEngineInterfaceExtensionObject::EntryIntl_LocaleCompare(Js::RecyclableObject*, Js::CallInfo, ...) at IntlEngineInterfaceExtensionObject.cpp:1827), args=Arguments @ 0x00007fffff81a178, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #5: 0x0000555555ffc808 ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffff81b250, playout=0x0000555556f808b5, function=0x00007ff7e7b4a480, flags=2, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3988:54 frame #6: 0x0000555555fcdb05 ch`void Js::InterpreterStackFrame::OP_CallI<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffff81b250, playout=0x0000555556f808b5)0> > > __unaligned const __unaligned*) at InterpreterStackFrame.h:510:72 frame #7: 0x0000555555e71df3 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffff81b250) at InterpreterHandler.inl:91:3 frame #8: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffff81b250) at InterpreterStackFrame.cpp:3495:22 frame #9: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7af4190, args=ArgumentReader @ 0x00007fffff81b7b0, returnAddress=0x00007ff7e7bd0f1a, addressOfReturnAddress=0x00007fffff81b7f8, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #10: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffff81b810) at InterpreterStackFrame.cpp:1833:16 frame #11: 0x00007ff7e7bd0f1a frame #12: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #13: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7af4190, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffff81b8b8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #14: 0x00005555561d0eb7 ch`Js::JavascriptFunction::CallFunction(this=0x00007ff7e7af4190, args=Arguments @ 0x00007fffff81b968) at JavascriptFunction.cpp:1159:16 frame #15: 0x00005555563df8ec ch`Js::JavascriptString::EntryLocaleCompare(function=0x00007ff7e7c4c880, callInfo=(Count = 2, Flags = CallFlags_NotUsed, unused = 0)) at JavascriptString.cpp:1408:38 frame #16: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #17: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c4c880, entryPoint=(ch`Js::JavascriptString::EntryLocaleCompare(Js::RecyclableObject*, Js::CallInfo, ...) at JavascriptString.cpp:1356), args=Arguments @ 0x00007fffff81bb50, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #18: 0x0000555555ffc5fe ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffff81cd10, playout=0x00007ff7e84d40f1, function=0x00007ff7e7c4c880, flags=16, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3973:21 frame #19: 0x0000555555ffc0e1 ch`void Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffff81cd10, playout=0x00007ff7e84d40f1, function=0x00007ff7e7c4c880, flags=0, profileId=1, inlineCacheIndex=0, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:4016:9 frame #20: 0x0000555555fc72a8 ch`void Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(this=0x00007fffff81cd10, playout=0x00007ff7e84d40f1)0> > > const __unaligned*) at InterpreterStackFrame.h:520:115 frame #21: 0x0000555555eac7d3 ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffff81cd10) at InterpreterHandler.inl:91:3 frame #22: 0x0000555555e52112 ch`Js::InterpreterStackFrame::Process(this=0x00007fffff81cd10) at InterpreterStackFrame.cpp:3472:20 frame #23: 0x000055555681d6c8 ch`BailOutRecord::BailOutHelper(layout=0x00007fffff81d930, functionRef=0x00007fffff81d930, args=0x00007fffff81d3a0, isInlinee=false, bailOutRecord=0x0000555557efe0b8, bailOutOffset=3, returnAddress=0x00007ff7e7b90544, bailOutKind=BailOutOnNoProfile, registerSaves=0x00007fffff81d450, bailOutReturnValue=0x0000000000000000, pArgumentsObject=0x00007fffff81d918, branchValue=0x0000000000000000, argoutRestoreAddress=0x0000000000000000) at BailOut.cpp:1785:78 frame #24: 0x000055555681bf20 ch`BailOutRecord::BailOutCommonNoCodeGen(layout=0x00007fffff81d930, bailOutRecord=0x0000555557efe0b8, bailOutOffset=3, returnAddress=0x00007ff7e7b90544, bailOutKind=BailOutOnNoProfile, branchValue=0x0000000000000000, registerSaves=0x00007fffff81d450, bailOutReturnValue=0x0000000000000000, argoutRestoreAddress=0x0000000000000000) at BailOut.cpp:1153:22 frame #25: 0x000055555681b853 ch`BailOutRecord::BailOutCommon(layout=0x00007fffff81d930, bailOutRecord=0x0000555557efe0b8, bailOutOffset=3, returnAddress=0x00007ff7e7b90544, bailOutKind=BailOutOnNoProfile, savedImplicitCallFlags=ImplicitCall_None, branchValue=0x0000000000000000, bailOutReturnValue=0x0000000000000000, argoutRestoreAddress=0x0000000000000000) at BailOut.cpp:1176:22 frame #26: 0x000055555681b6a3 ch`BailOutRecord::BailOutFromFunction(layout=0x00007fffff81d930, bailOutRecord=0x0000555557efe0b8, returnAddress=0x00007ff7e7b90544, argoutRestoreAddress=0x0000000000000000, savedImplicitCallFlags=ImplicitCall_None) at BailOut.cpp:1127:12 frame #27: 0x000055555681b341 ch`BailOutRecord::BailOut(bailOutRecord=0x0000555557efe0b8) at BailOut.cpp:1112:12 frame #28: 0x00007ff7e7b90544 frame #29: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 ```
Assertion Failure: (propertyValue && VarIs<T>(propertyValue)) in ChakraCore/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 372
https://api.github.com/repos/chakra-core/ChakraCore/issues/6905/comments
0
2023-05-13T04:26:46Z
2023-05-13T04:26:46Z
https://github.com/chakra-core/ChakraCore/issues/6905
1,708,427,898
6,905
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (let v0 = 0; v0 < 10; v0++) { async function f1() { function f6() {} for (let v9 = 0; v9 < 100; v9++) { if (v9 == 99) { await f6; } f6(); } } f1(); } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 383298: (/home/wjm/ChakraCore/lib/Runtime/Library/JavascriptAsyncFunction.cpp, line 192) JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject Failure: (JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x00005555561a954b ch`Js::JavascriptAsyncFunction::AsyncSpawnStep(stepFunction=0x00007ff7e7c4d3f0, generator=0x00007ff7e7c442a0, resolve=0x00007ff7e7c67060, reject=0x00007ff7e7c670c0) at JavascriptAsyncFunction.cpp:192:9 frame #1: 0x00005555561a8c76 ch`Js::JavascriptAsyncFunction::BeginAsyncFunctionExecution(generator=0x00007ff7e7c442a0) at JavascriptAsyncFunction.cpp:73:9 frame #2: 0x00005555561a8a92 ch`Js::JavascriptAsyncFunction::EntryAsyncFunctionImplementation(function=0x00007ff7e7c4f980, callInfo=(Count = 1, Flags = CallFlags_NotUsed, unused = 0)) at JavascriptAsyncFunction.cpp:52:12 frame #3: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #4: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c4f980, entryPoint=(ch`Js::JavascriptAsyncFunction::EntryAsyncFunctionImplementation(Js::RecyclableObject*, Js::CallInfo, ...) at JavascriptAsyncFunction.cpp:42), args=Arguments @ 0x00007fffffffaf50, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #5: 0x0000555555ffa37e ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffbff0, playout=0x00007ff7e84d40e9, function=0x00007ff7e7c4f980, flags=16, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3973:21 frame #6: 0x0000555555fcd8d5 ch`void Js::InterpreterStackFrame::OP_CallI<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffbff0, playout=0x00007ff7e84d40e9)0> > > __unaligned const __unaligned*) at InterpreterStackFrame.h:510:72 frame #7: 0x0000555555e71b1f ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffbff0) at InterpreterHandler.inl:87:3 frame #8: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbff0) at InterpreterStackFrame.cpp:3495:22 frame #9: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c76730, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #10: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #11: 0x00007ff7e7bd0fa2 frame #12: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #13: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #14: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c76730, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee9058, inScript=true) at JavascriptFunction.cpp:772:24 frame #15: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee9058, inScript=true) at JavascriptFunction.cpp:717:15 frame #16: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee9058, inScript=true) at JavascriptFunction.cpp:832:16 frame #17: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee9058, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #18: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee9058)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #19: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #20: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #21: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="for (let v0 = 0; v0 < 10; v0++) {\n async function f1() {\n function f6() {}\n for (let v9 = 0; v9 < 100; v9++) {\n if (v9 == 99) {\n await f6;\n }\n f6();\n }\n }\n f1();\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 1837789: (/home/wjm/ChakraCore/lib/Runtime/Library/JavascriptAsyncFunction.cpp, line 192) JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject\n// Failure: (JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 86 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted "..., cb=1068, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug11_awaitObject.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #22: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #23: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #24: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #25: 0x0000555555784924 ch`RunScript(fileName="bug11_awaitObject.js", fileContents="for (let v0 = 0; v0 < 10; v0++) {\n async function f1() {\n function f6() {}\n for (let v9 = 0; v9 < 100; v9++) {\n if (v9 == 99) {\n await f6;\n }\n f6();\n }\n }\n f1();\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 1837789: (/home/wjm/ChakraCore/lib/Runtime/Library/JavascriptAsyncFunction.cpp, line 192) JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject\n// Failure: (JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 86 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted "..., fileLength=1068, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug11_awaitObject.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #26: 0x00005555557863f0 ch`ExecuteTest(fileName="bug11_awaitObject.js") at ch.cpp:917:13 frame #27: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug11_awaitObject.js") at ch.cpp:967:10 frame #28: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #29: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #30: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: (JavascriptOperators::GetTypeId(result) == TypeIds_AwaitObject) in ChakraCore/lib/Runtime/Library/JavascriptAsyncFunction.cpp, line 192
https://api.github.com/repos/chakra-core/ChakraCore/issues/6904/comments
0
2023-05-13T04:26:08Z
2023-05-13T04:26:08Z
https://github.com/chakra-core/ChakraCore/issues/6904
1,708,427,782
6,904
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (let i = 0; i < 10; i++) { for (let j = 0; j < 10; j++) { function opt() { i[1] = 2 } switch (i) { case -3124201329: break; case i: break; } } } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 373997: (/home/wjm/ChakraCore/lib/Backend/ValueInfo.cpp, line 561) IsUninitialized() || IsLikelyInt() || isForLoopBackEdgeCompensation Failure: (IsUninitialized() || IsLikelyInt() || isForLoopBackEdgeCompensation) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556d070df ch`ValueInfo::SpecializeToInt32(this=0x00007ff7e7bb8d40, allocator=0x00007fffffff8d18, isForLoopBackEdgeCompensation=false) at ValueInfo.cpp:561:5 frame #1: 0x0000555556b87ee5 ch`GlobOpt::OptHoistInvariant(this=0x00007fffffff9850, instr=0x00007ff7e7bb96a8, block=0x00007ff7e7c0a288, loop=0x00007ff7e7c0b160, dstVal=0x00007ff7e7bbaa70, src1Val=0x00007ff7e7bbaa70, src2Val=0x0000000000000000, isNotTypeSpecConv=false, lossy=false, bailoutKind=BailOutIntOnly) at GlobOpt.cpp:15538:44 frame #2: 0x0000555556b63748 ch`GlobOpt::TryHoistInvariant(this=0x00007fffffff9850, instr=0x00007ff7e7bb96a8, block=0x00007ff7e7c0a288, dstVal=0x00007ff7e7bbaa70, src1Val=0x00007ff7e7bbaa70, src2Val=0x0000000000000000, isNotTypeSpecConv=false, lossy=false, forceInvariantHoisting=false, bailoutKind=BailOutIntOnly) at GlobOpt.cpp:15601:9 frame #3: 0x0000555556b51049 ch`GlobOpt::ToTypeSpecUse(this=0x00007fffffff9850, instr=0x00007ff7e7bf6eb0, opnd=0x00007ff7e7bb9548, block=0x00007ff7e7c0a288, val=0x00007ff7e7bbaa70, indir=0x0000000000000000, toType=TyInt32, bailOutKind=BailOutIntOnly, lossy=false, insertBeforeInstr=0x00007ff7e7bf6eb0) at GlobOpt.cpp:12048:31 frame #4: 0x0000555556b80455 ch`GlobOpt::ToInt32(this=0x00007fffffff9850, instr=0x00007ff7e7bf6eb0, opnd=0x00007ff7e7bf6e70, block=0x00007ff7e7c0a288, val=0x00007ff7e7bbaa70, indir=0x0000000000000000, lossy=false) at GlobOpt.cpp:11536:18 frame #5: 0x0000555556b7aa6e ch`GlobOpt::OptConstFoldBr(this=0x00007fffffff9850, test=true, instr=0x00007ff7e7bf6eb0, src1Val=0x00007ff7e7bbaa70, src2Val=0x00007ff7e7bbaa70) at GlobOpt.cpp:12605:15 frame #6: 0x0000555556b83df2 ch`GlobOpt::TryOptConstFoldBrEqual(this=0x00007fffffff9850, instr=0x00007ff7e7bf6eb0, branchOnEqual=true, src1Value=0x00007ff7e7bbaa70, min1=-2147483648, max1=2147483647, src2Value=0x00007ff7e7bbaa70, min2=-2147483648, max2=2147483647) at GlobOpt.cpp:10242:9 frame #7: 0x0000555556b752f1 ch`GlobOpt::TypeSpecializeBinary(this=0x00007fffffff9850, pInstr=0x00007fffffff82b8, pSrc1Val=0x00007fffffff8560, pSrc2Val=0x00007fffffff8558, pDstVal=0x00007fffffff8550, src1OriginalVal=0x00007ff7e7bbaa70, src2OriginalVal=0x00007ff7e7bbaa70, redoTypeSpecRef=0x00007fffffff8511) at GlobOpt.cpp:9844:21 frame #8: 0x0000555556b6113b ch`GlobOpt::TypeSpecialization(this=0x00007fffffff9850, instr=0x00007ff7e7bf6eb0, pSrc1Val=0x00007fffffff8560, pSrc2Val=0x00007fffffff8558, pDstVal=0x00007fffffff8550, redoTypeSpecRef=0x00007fffffff8511, forceInvariantHoistingRef=0x00007fffffff8513) at GlobOpt.cpp:6382:35 frame #9: 0x0000555556b4a409 ch`GlobOpt::OptInstr(this=0x00007fffffff9850, instr=0x00007fffffff86c8, isInstrRemoved=0x00007fffffff86be) at GlobOpt.cpp:2633:23 frame #10: 0x0000555556b46dce ch`GlobOpt::OptBlock(this=0x00007fffffff9850, block=0x00007ff7e7c0a288) at GlobOpt.cpp:521:27 frame #11: 0x0000555556b458a7 ch`GlobOpt::ForwardPass(this=0x00007fffffff9850) at GlobOpt.cpp:402:15 frame #12: 0x0000555556b44ab3 ch`GlobOpt::Optimize(this=0x00007fffffff9850) at GlobOpt.cpp:212:15 frame #13: 0x0000555556b262ab ch`Func::TryCodegen(this=0x00007fffffff9f00) at Func.cpp:457:21 frame #14: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa4c0, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb7068, scriptContextInfo=0x0000555557ee8fe8, outputData=0x00007fffffffa900, epInfo=0x00007ff7e7c64200, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3f420, codeGenAllocators=0x0000555557ef5db8, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #15: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea7b8, pageAllocator=0x0000555557eb73f0, workItemData=0x0000555557ef5cb0, jitWriteData=0x00007fffffffa900, foreground=true, epInfo=0x00007ff7e7c64200) at NativeCodeGenerator.cpp:890:9 frame #16: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea7b8, pageAllocator=0x0000555557eb73f0, workItem=0x0000555557ef5c88, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #17: 0x00005555569139a7 ch`NativeCodeGenerator::Process(this=0x0000555557eea7b8, job=0x0000555557ef5c90, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1895:13 frame #18: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef5c90) at Jobs.cpp:426:36 frame #19: 0x0000555556922bc3 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea7b8, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:207:36 frame #20: 0x0000555556918804 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea7b8, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:81:58 frame #21: 0x000055555690d4fc ch`NativeCodeGenerator::GenerateLoopBody(this=0x0000555557eea7b8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c62270, entryPoint=0x00007ff7e7c64200, localCount=15, localSlots=0x00007fffffffc140) at NativeCodeGenerator.cpp:711:22 frame #22: 0x00005555568157dd ch`GenerateLoopBody(nativeCodeGen=0x0000555557eea7b8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c62270, info=0x00007ff7e7c64200, localCount=15, localSlots=0x00007fffffffc140) at BackendApi.cpp:88:20 frame #23: 0x0000555555fb220b ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffbfe0, loopNumber=1, layoutSize=SmallLayout, doProfileLoopCheck=false, isFirstIteration=false) at InterpreterStackFrame.cpp:6277:17 frame #24: 0x0000555555fb57ee ch`void Js::InterpreterStackFrame::ProfiledLoopBodyStart<false, true>(this=0x00007fffffffbfe0, loopNumber=1, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5930:41 frame #25: 0x0000555555ff8a0a ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, true>(this=0x00007fffffffbfe0, loopId=1) at InterpreterStackFrame.cpp:5902:9 frame #26: 0x0000555555fc6a96 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, true>(this=0x00007fffffffbfe0, ip="\U00000012\U00000003") at InterpreterStackFrame.cpp:5774:16 frame #27: 0x0000555555eaae91 ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffffffbfe0) at InterpreterHandler.inl:52:3 frame #28: 0x0000555555e525de ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbfe0) at InterpreterStackFrame.cpp:3520:22 frame #29: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #30: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #31: 0x00007ff7e7bd0fa2 frame #32: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #33: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #34: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee8fe8, inScript=true) at JavascriptFunction.cpp:772:24 frame #35: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8fe8, inScript=true) at JavascriptFunction.cpp:717:15 frame #36: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee8fe8, inScript=true) at JavascriptFunction.cpp:832:16 frame #37: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee8fe8, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #38: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee8fe8)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #39: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #40: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #41: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="for (let i = 0; i < 10; i++) {\n for (let j = 0; j < 10; j++) {\n function opt() {\n i[1] = 2\n }\n switch (i) {\n case -3124201329:\n break;\n case i:\n break;\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 641164: (/home/wjm/ChakraCore/lib/Backend/ValueInfo.cpp, line 561) IsUninitialized() || IsLikelyInt() || isForLoopBackEdgeCompensation\n// Failure: (IsUninitialized() || IsLikelyInt() || isForLoopBackEdgeCompensation)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 25 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAbor"..., cb=1072, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug07_valueInfo.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #42: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #43: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #44: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #45: 0x0000555555784924 ch`RunScript(fileName="bug07_valueInfo.js", fileContents="for (let i = 0; i < 10; i++) {\n for (let j = 0; j < 10; j++) {\n function opt() {\n i[1] = 2\n }\n switch (i) {\n case -3124201329:\n break;\n case i:\n break;\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 641164: (/home/wjm/ChakraCore/lib/Backend/ValueInfo.cpp, line 561) IsUninitialized() || IsLikelyInt() || isForLoopBackEdgeCompensation\n// Failure: (IsUninitialized() || IsLikelyInt() || isForLoopBackEdgeCompensation)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 25 ms\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAbor"..., fileLength=1072, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug07_valueInfo.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #46: 0x00005555557863f0 ch`ExecuteTest(fileName="bug07_valueInfo.js") at ch.cpp:917:13 frame #47: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug07_valueInfo.js") at ch.cpp:967:10 frame #48: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #49: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #50: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: IsUninitialized() || IsLikelyInt() when GlobOpt tries hoist invariant
https://api.github.com/repos/chakra-core/ChakraCore/issues/6903/comments
0
2023-05-13T04:25:29Z
2023-05-13T04:25:29Z
https://github.com/chakra-core/ChakraCore/issues/6903
1,708,427,659
6,903
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function opt(arg) { arg == -1; try { do {} while (arg < 2); } catch(e) {} } for (const i in "ab") { for (let j = 0; j < 100; j++) { opt(); } } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 361628: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 2702) target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource Failure: (target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) run Process 361795 launched: '/home/wjm/ChakraCore/cmake-build-debug/ch' (x86_64) ASSERTION 361795: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 2702) target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource Failure: (target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource) Process 361795 stopped * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand frame #0: 0x0000555556d3bafa ch`BackwardPass::ProcessBailOutInfo(this=0x00007fffffff8ac0, instr=0x00007ff7e7ba4be8, bailOutInfo=0x00007ff7e7ba4ac8) at BackwardPass.cpp:2696:21 2693 if (targetOffset == instr->GetByteCodeOffset() && block != target->GetBasicBlock()) 2694 { 2695 // This can happen if the target is a break or airlock block. -> 2696 Assert( 2697 target->GetBasicBlock()->isAirLockBlock || 2698 target->GetBasicBlock()->isAirLockCompensationBlock || 2699 target->GetBasicBlock()->isBreakBlock || (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556d3bafa ch`BackwardPass::ProcessBailOutInfo(this=0x00007fffffff8ac0, instr=0x00007ff7e7ba4be8, bailOutInfo=0x00007ff7e7ba4ac8) at BackwardPass.cpp:2696:21 frame #1: 0x0000555556d3b6e4 ch`BackwardPass::ProcessBailOutInfo(this=0x00007fffffff8ac0, instr=0x00007ff7e7ba4be8) at BackwardPass.cpp:2195:23 frame #2: 0x0000555556d3685a ch`BackwardPass::ProcessBlock(this=0x00007fffffff8ac0, block=0x00007ff7e7ba3518) at BackwardPass.cpp:3024:96 frame #3: 0x0000555556d2f2bb ch`BackwardPass::OptBlock(this=0x00007fffffff8ac0, block=0x00007ff7e7ba3518) at BackwardPass.cpp:1711:11 frame #4: 0x0000555556d2ed1f ch`BackwardPass::Optimize(this=0x00007fffffff8ac0) at BackwardPass.cpp:430:15 frame #5: 0x0000555556b447a4 ch`GlobOpt::BackwardPass(this=0x00007fffffff97a0, tag=DeadStorePhase) at GlobOpt.cpp:160:18 frame #6: 0x0000555556b44ac9 ch`GlobOpt::Optimize(this=0x00007fffffff97a0) at GlobOpt.cpp:213:15 frame #7: 0x0000555556b262ab ch`Func::TryCodegen(this=0x00007fffffff9e50) at Func.cpp:457:21 frame #8: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa410, workItem=0x00007ff7e7bf5030, threadContextInfo=0x0000555557eb7198, scriptContextInfo=0x0000555557ee9118, outputData=0x00007fffffffa850, epInfo=0x00007ff7e7c48120, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3fa40, codeGenAllocators=0x0000555557ef7ae8, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #9: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea8e8, pageAllocator=0x0000555557eb7520, workItemData=0x0000555557ef6f60, jitWriteData=0x00007fffffffa850, foreground=true, epInfo=0x00007ff7e7c48120) at NativeCodeGenerator.cpp:890:9 frame #10: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea8e8, pageAllocator=0x0000555557eb7520, workItem=0x0000555557ef6f38, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #11: 0x0000555556913a24 ch`NativeCodeGenerator::Process(this=0x0000555557eea8e8, job=0x0000555557ef6f40, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1907:13 frame #12: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef6f40) at Jobs.cpp:426:36 frame #13: 0x0000555556920e29 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea8e8, holder=0x00007ff7e7c48120, function=0x00007ff7e7c76730) at Jobs.inl:207:36 frame #14: 0x00005555569182e4 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea8e8, holder=0x00007ff7e7c48120, function=0x00007ff7e7c76730) at Jobs.inl:81:58 frame #15: 0x0000555556912786 ch`NativeCodeGenerator::CheckCodeGen(function=0x00007ff7e7c76730) at NativeCodeGenerator.cpp:1644:37 frame #16: 0x0000555556978bac ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...) at Thunks.S:36 frame #17: 0x00007ff7e7b704cb frame #18: 0x0000555555fb2977 ch`Js::InterpreterStackFrame::CallLoopBody(this=0x00007fffffffbf90, address=0x00007ff7e7b70400)(Js::RecyclableObject*, Js::CallInfo, ...)) at InterpreterStackFrame.cpp:6362:13 frame #19: 0x0000555555fb1c32 ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffbf90, loopNumber=1, layoutSize=SmallLayout, doProfileLoopCheck=true, isFirstIteration=false) at InterpreterStackFrame.cpp:6162:35 frame #20: 0x0000555555fb5997 ch`void Js::InterpreterStackFrame::LoopBodyStart<false, true>(this=0x00007fffffffbf90, loopNumber=1, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5994:9 frame #21: 0x0000555556002d38 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbf90, loopId=1) at InterpreterStackFrame.cpp:5902:9 frame #22: 0x0000555555fcd716 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbf90, ip="\U00000012\U00000003") at InterpreterStackFrame.cpp:5774:16 frame #23: 0x0000555555e704b1 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffbf90) at InterpreterHandler.inl:52:3 frame #24: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbf90) at InterpreterStackFrame.cpp:3495:22 frame #25: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #26: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #27: 0x00007ff7e7bd0fa2 frame #28: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #29: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #30: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee9118, inScript=true) at JavascriptFunction.cpp:772:24 frame #31: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee9118, inScript=true) at JavascriptFunction.cpp:717:15 frame #32: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee9118, inScript=true) at JavascriptFunction.cpp:832:16 frame #33: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee9118, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #34: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee9118)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #35: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #36: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #37: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="function opt(arg) {\n arg == -1;\n try {\n do {} while (arg < 2);\n } catch(e) {}\n}\nfor (const i in \"ab\") {\n for (let j = 0; j < 100; j++) {\n opt();\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 483591: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 2702) target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource\n// Failure: (target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 23 ms\n\n\n/*\n\nTitle: \n\n## Version"..., cb=1374, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug06_AirLock.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #38: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #39: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #40: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #41: 0x0000555555784924 ch`RunScript(fileName="bug06_AirLock.js", fileContents="function opt(arg) {\n arg == -1;\n try {\n do {} while (arg < 2);\n } catch(e) {}\n}\nfor (const i in \"ab\") {\n for (let j = 0; j < 100; j++) {\n opt();\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 483591: (/home/wjm/ChakraCore/lib/Backend/BackwardPass.cpp, line 2702) target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource\n// Failure: (target->GetBasicBlock()->isAirLockBlock || target->GetBasicBlock()->isAirLockCompensationBlock || target->GetBasicBlock()->isBreakBlock || target->GetBasicBlock()->isBreakCompensationBlockAtSink || target->GetBasicBlock()->isBreakCompensationBlockAtSource)\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 23 ms\n\n\n/*\n\nTitle: \n\n## Version"..., fileLength=1374, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug06_AirLock.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #42: 0x00005555557863f0 ch`ExecuteTest(fileName="bug06_AirLock.js") at ch.cpp:917:13 frame #43: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug06_AirLock.js") at ch.cpp:967:10 frame #44: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #45: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #46: 0x0000555555783b7e ch`_start + 46 ```
Assertion failure: target->GetBasicBlock()->isAirLockBlock in ChakraCore/lib/Backend/BackwardPass.cpp, line 2702
https://api.github.com/repos/chakra-core/ChakraCore/issues/6902/comments
0
2023-05-13T04:24:39Z
2023-05-13T04:24:39Z
https://github.com/chakra-core/ChakraCore/issues/6902
1,708,427,490
6,902
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` for (let i = 0; i < 100; i++) { for (let j = 2; j < 2; j = j % i) { for (let k = 0; k < 0x7fffffff; k = k + 0x7fffffff) { } } } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 360039: (/home/wjm/ChakraCore/lib/Backend/GlobOpt.cpp, line 2378) !instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4 || prevInstr->m_opcode == Js::OpCode::Ld_A ) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym())) Failure: (!instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4 || prevInstr->m_opcode == Js::OpCode::Ld_A ) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym()))) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x0000555556b5b257 ch`GlobOpt::CollectMemOpInfo(this=0x00007fffffff9880, instrBegin=0x00007ff7e7c0ae30, instr=0x00007ff7e7c074b0, src1Val=0x00007ff7e7bbadb0, src2Val=0x0000000000000000) at GlobOpt.cpp:2361:9 frame #1: 0x0000555556b4ad47 ch`GlobOpt::OptInstr(this=0x00007fffffff9880, instr=0x00007fffffff86f8, isInstrRemoved=0x00007fffffff86ee) at GlobOpt.cpp:2743:9 frame #2: 0x0000555556b46dce ch`GlobOpt::OptBlock(this=0x00007fffffff9880, block=0x00007ff7e7c06980) at GlobOpt.cpp:521:27 frame #3: 0x0000555556b458a7 ch`GlobOpt::ForwardPass(this=0x00007fffffff9880) at GlobOpt.cpp:402:15 frame #4: 0x0000555556b44ab3 ch`GlobOpt::Optimize(this=0x00007fffffff9880) at GlobOpt.cpp:212:15 frame #5: 0x0000555556b262ab ch`Func::TryCodegen(this=0x00007fffffff9f30) at Func.cpp:457:21 frame #6: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffa4f0, workItem=0x00007ff7e7bf4030, threadContextInfo=0x0000555557eb7468, scriptContextInfo=0x0000555557ee93e8, outputData=0x00007fffffffa930, epInfo=0x00007ff7e7c64200, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7c3f2e0, codeGenAllocators=0x0000555557ef5e78, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #7: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eeabb8, pageAllocator=0x0000555557eb77f0, workItemData=0x0000555557ef5d70, jitWriteData=0x00007fffffffa930, foreground=true, epInfo=0x00007ff7e7c64200) at NativeCodeGenerator.cpp:890:9 frame #8: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eeabb8, pageAllocator=0x0000555557eb77f0, workItem=0x0000555557ef5d48, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #9: 0x00005555569139a7 ch`NativeCodeGenerator::Process(this=0x0000555557eeabb8, job=0x0000555557ef5d50, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1895:13 frame #10: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef5d50) at Jobs.cpp:426:36 frame #11: 0x0000555556922bc3 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eeabb8, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:207:36 frame #12: 0x0000555556918804 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::EntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eeabb8, holder=0x00007ff7e7c64200, function=0x0000000000000000) at Jobs.inl:81:58 frame #13: 0x000055555690d4fc ch`NativeCodeGenerator::GenerateLoopBody(this=0x0000555557eeabb8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c77810, entryPoint=0x00007ff7e7c64200, localCount=14, localSlots=0x00007fffffffc150) at NativeCodeGenerator.cpp:711:22 frame #14: 0x00005555568157dd ch`GenerateLoopBody(nativeCodeGen=0x0000555557eeabb8, fn=0x00007ff7e7c47000, loopHeader=0x00007ff7e7c77810, info=0x00007ff7e7c64200, localCount=14, localSlots=0x00007fffffffc150) at BackendApi.cpp:88:20 frame #15: 0x0000555555fb220b ch`Js::InterpreterStackFrame::DoLoopBodyStart(this=0x00007fffffffbff0, loopNumber=1, layoutSize=SmallLayout, doProfileLoopCheck=true, isFirstIteration=false) at InterpreterStackFrame.cpp:6277:17 frame #16: 0x0000555555fb5997 ch`void Js::InterpreterStackFrame::LoopBodyStart<false, true>(this=0x00007fffffffbff0, loopNumber=1, layoutSize=SmallLayout, isFirstIteration=false) at InterpreterStackFrame.cpp:5994:9 frame #17: 0x0000555556002d38 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbff0, loopId=1) at InterpreterStackFrame.cpp:5902:9 frame #18: 0x0000555555fcd716 ch`unsigned char const* Js::InterpreterStackFrame::OP_ProfiledLoopBodyStart<(Js::LayoutSize)0, false>(this=0x00007fffffffbff0, ip="\U00000012\U00000003") at InterpreterStackFrame.cpp:5774:16 frame #19: 0x0000555555e704b1 ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffbff0) at InterpreterHandler.inl:52:3 frame #20: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbff0) at InterpreterStackFrame.cpp:3495:22 frame #21: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #22: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #23: 0x00007ff7e7bd0fa2 frame #24: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #25: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #26: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c766e0, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee93e8, inScript=true) at JavascriptFunction.cpp:772:24 frame #27: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee93e8, inScript=true) at JavascriptFunction.cpp:717:15 frame #28: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c766e0, args=<unavailable>, scriptContext=0x0000555557ee93e8, inScript=true) at JavascriptFunction.cpp:832:16 frame #29: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee93e8, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #30: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee93e8)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #31: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #32: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #33: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="for (let i = 0; i < 100; i++) {\n for (let j = 2; j < 2; j = j % i) {\n for (let k = 0; k < 0x7fffffff; k = k + 0x7fffffff) {\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3537549: (/home/wjm/ChakraCore/lib/Backend/GlobOpt.cpp, line 2378) !instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4 || prevInstr->m_opcode == Js::OpCode::Ld_A ) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym()))\n// Failure: (!instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo"..., cb=2105, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug05_loop.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #34: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #35: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #36: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #37: 0x0000555555784924 ch`RunScript(fileName="bug05_loop.js", fileContents="for (let i = 0; i < 100; i++) {\n for (let j = 2; j < 2; j = j % i) {\n for (let k = 0; k < 0x7fffffff; k = k + 0x7fffffff) {\n }\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3537549: (/home/wjm/ChakraCore/lib/Backend/GlobOpt.cpp, line 2378) !instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo || (instr->m_opcode == Js::OpCode::Ld_I4 && prevInstr && (prevInstr->m_opcode == Js::OpCode::Add_I4 || prevInstr->m_opcode == Js::OpCode::Sub_I4 || prevInstr->m_opcode == Js::OpCode::Ld_A ) && instr->GetSrc1()->IsRegOpnd() && instr->GetDst()->IsRegOpnd() && prevInstr->GetDst()->IsRegOpnd() && instr->GetDst()->GetStackSym() == prevInstr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym() == prevInstr->GetDst()->GetStackSym()) || !loop->memOpInfo->inductionVariableChangeInfoMap->ContainsKey(GetVarSymID(instr->GetDst()->GetStackSym()))\n// Failure: (!instr->GetDst() || instr->m_opcode == Js::OpCode::IncrLoopBodyCount || !loop->memOpInfo"..., fileLength=2105, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug05_loop.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #38: 0x00005555557863f0 ch`ExecuteTest(fileName="bug05_loop.js") at ch.cpp:917:13 frame #39: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug05_loop.js") at ch.cpp:967:10 frame #40: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #41: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #42: 0x0000555555783b7e ch`_start + 46 ```
Assertion failure: !instr->GetDst() in ChakraCore/lib/Backend/GlobOpt.cpp, line 2378
https://api.github.com/repos/chakra-core/ChakraCore/issues/6901/comments
0
2023-05-10T12:09:23Z
2023-05-10T12:09:23Z
https://github.com/chakra-core/ChakraCore/issues/6901
1,703,786,263
6,901
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cbarg1935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` function opt(){} for (let i = 0; i < 100; i++) { opt[3] = 99 for (const j in opt) { delete opt.length; } } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 358547: (/home/wjm/ChakraCore/lib/Runtime/Types/SimpleTypeHandler.cpp, line 664) !GetIsLocked() Failure: (!GetIsLocked()) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) run Process 357882 launched: '/home/wjm/ChakraCore/cmake-build-debug/ch' (x86_64) ASSERTION 357882: (/home/wjm/ChakraCore/lib/Runtime/Types/SimpleTypeHandler.cpp, line 664) !GetIsLocked() Failure: (!GetIsLocked()) Process 357882 stopped * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand frame #0: 0x00005555565c99fc ch`Js::SimpleTypeHandler<3ul>::DeleteProperty(this=0x00007ff7e7c767d0, instance=0x00007ff7e7c76780, propertyId=209, propertyOperationFlags=PropertyOperation_None) at SimpleTypeHandler.cpp:664:17 661 if (descriptors[index].Attributes & PropertyDeleted) 662 { 663 // A locked type should not have deleted properties -> 664 Assert(!GetIsLocked()); 665 return true; 666 } 667 if (!(descriptors[index].Attributes & PropertyConfigurable)) (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x00005555565c99fc ch`Js::SimpleTypeHandler<3ul>::DeleteProperty(this=0x00007ff7e7c767d0, instance=0x00007ff7e7c76780, propertyId=209, propertyOperationFlags=PropertyOperation_None) at SimpleTypeHandler.cpp:664:17 frame #1: 0x00005555564d6573 ch`Js::DynamicObject::DeleteProperty(this=0x00007ff7e7c76780, propertyId=209, flags=PropertyOperation_None) at DynamicType.cpp:336:34 frame #2: 0x00005555561d4e6e ch`Js::JavascriptFunction::DeleteProperty(this=0x00007ff7e7c76780, propertyId=209, flags=PropertyOperation_None) at JavascriptFunction.cpp:3055:38 frame #3: 0x0000555556051278 ch`int Js::JavascriptOperators::DeleteProperty_Impl<false>(instance=0x00007ff7e7c76780, propertyId=209, propertyOperationFlags=PropertyOperation_None) at JavascriptOperators.cpp:3129:27 frame #4: 0x0000555556030601 ch`Js::JavascriptOperators::DeleteProperty(instance=0x00007ff7e7c76780, propertyId=209, propertyOperationFlags=PropertyOperation_None) at JavascriptOperators.cpp:3073:16 frame #5: 0x00005555560307c1 ch`Js::JavascriptOperators::OP_DeleteProperty(instance=0x00007ff7e7c76780, propertyId=209, scriptContext=0x0000555557ee8fc8, propertyOperationFlags=PropertyOperation_None) at JavascriptOperators.cpp:3148:13 frame #6: 0x0000555555fb7651 ch`void Js::InterpreterStackFrame::OP_DeleteFld<Js::OpLayoutT_ElementC<Js::LayoutSizePolicy<(Js::LayoutSize)0> > __unaligned>(this=0x00007fffffffbf50, playout=0x00007ff7e7bf8071)0> > __unaligned const __unaligned*) at InterpreterStackFrame.cpp:7682:22 frame #7: 0x0000555555e7638d ch`Js::InterpreterStackFrame::ProcessUnprofiled(this=0x00007fffffffbf50) at InterpreterHandler.inl:191:3 frame #8: 0x0000555555e522be ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffbf50) at InterpreterStackFrame.cpp:3495:22 frame #9: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c76730, args=ArgumentReader @ 0x00007fffffffc530, returnAddress=0x00007ff7e7bd0fa2, addressOfReturnAddress=0x00007fffffffc578, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #10: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc590) at InterpreterStackFrame.cpp:1833:16 frame #11: 0x00007ff7e7bd0fa2 frame #12: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #13: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc798, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #14: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c76730, args=Arguments @ 0x00007fffffffc810, scriptContext=0x0000555557ee8fc8, inScript=true) at JavascriptFunction.cpp:772:24 frame #15: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee8fc8, inScript=true) at JavascriptFunction.cpp:717:15 frame #16: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c76730, args=<unavailable>, scriptContext=0x0000555557ee8fc8, inScript=true) at JavascriptFunction.cpp:832:16 frame #17: 0x0000555555894a8e ch`RunScriptCore(this=0x00007fffffffcbe0, scriptContext=0x0000555557ee8fc8, _actionEntryPopper=0x00007fffffffcbc0)::$_85::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:3705:49 frame #18: 0x0000555555894624 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(this=0x00007fffffffcb78, scriptContext=0x0000555557ee8fc8)::$_85)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #19: 0x0000555555893fc4 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcb78)::$_85) at JsrtInternal.h:192:23 frame #20: 0x00005555558608f6 ch`_JsErrorCode ContextAPIWrapper<false, RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_85>(fn=(anonymous class) @ 0x00007fffffffcbe0)::$_85) at JsrtInternal.h:235:27 frame #21: 0x00005555558607fb ch`RunScriptCore(scriptSource=0x00007ff7e7c44000, script="function f1(a2, a3, a4, a5) {\n a5[1799493994] = 99;\n return a5;\n}\nfor (let v6 = 0; v6 < 100; v6++) {\n const v8 = f1(v6, v6, v6 == 99, f1);\n for (const v9 in v8) {\n delete v8.length;\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3460092: (/home/wjm/ChakraCore/lib/Runtime/Types/SimpleTypeHandler.cpp, line 664) !GetIsLocked()\n// Failure: (!GetIsLocked())\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 87 ms\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", cb=932, loadScriptFlag=LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer, sourceContext=0, sourceUrl=u"/home/wjm/DiTing-pocs/chakra/bug04_typeHandler.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0000000000000000) at Jsrt.cpp:3656:12 frame #22: 0x0000555555862f6e ch`::JsRun(JsValueRef, JsSourceContext, JsValueRef, JsParseScriptAttributes, JsValueRef *) [inlined] CompileRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000, parseOnly=false) at Jsrt.cpp:5019:12 frame #23: 0x0000555555862db9 ch`::JsRun(scriptVal=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at Jsrt.cpp:5041 frame #24: 0x0000555555787293 ch`ChakraRTInterface::JsRun(script=0x00007ff7e7c44000, sourceContext=0, sourceUrl=0x00007ff7e7c71cf0, parseAttributes=JsParseScriptAttributeNone, result=0x0000000000000000) at ChakraRtInterface.h:487:179 frame #25: 0x0000555555784924 ch`RunScript(fileName="bug04_typeHandler.js", fileContents="function f1(a2, a3, a4, a5) {\n a5[1799493994] = 99;\n return a5;\n}\nfor (let v6 = 0; v6 < 100; v6++) {\n const v8 = f1(v6, v6, v6 == 99, f1);\n for (const v9 in v8) {\n delete v8.length;\n }\n}\n// CRASH INFO\n// ==========\n// TERMSIG: 4\n// STDERR:\n// ASSERTION 3460092: (/home/wjm/ChakraCore/lib/Runtime/Types/SimpleTypeHandler.cpp, line 664) !GetIsLocked()\n// Failure: (!GetIsLocked())\n// STDOUT:\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- -reprl fuzzcode.js\n// EXECUTION TIME: 87 ms\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/", fileLength=932, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug04_typeHandler.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:451:25 frame #26: 0x00005555557863f0 ch`ExecuteTest(fileName="bug04_typeHandler.js") at ch.cpp:917:13 frame #27: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug04_typeHandler.js") at ch.cpp:967:10 frame #28: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #29: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #30: 0x0000555555783b7e ch`_start + 46 ```
Assertion failure: (!GetIsLocked()) in ChakraCore/lib/Runtime/Types/SimpleTypeHandler.cpp Js::SimpleTypeHandler::DeleteProperty, line 664
https://api.github.com/repos/chakra-core/ChakraCore/issues/6900/comments
0
2023-05-10T11:42:37Z
2023-06-15T06:13:10Z
https://github.com/chakra-core/ChakraCore/issues/6900
1,703,733,463
6,900
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` async function opt() { Math.max(); Math.imul(2147483649, 2); await 2147483649; return 2147483649; } for (let i = 0; i < 100; i++) { opt(); } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js ASSERTION 357326: (/home/wjm/ChakraCore/lib/Backend/LinearScan.cpp, line 5203) There are unrestorable backend-only symbols across yield points Failure: (unrestorableSymbols.IsEmpty()) Signal: SIGILL (Illegal instruction) ``` ## Backtrace ``` (lldb) run Process 357554 launched: '/home/wjm/ChakraCore/cmake-build-debug/ch' (x86_64) ASSERTION 357554: (/home/wjm/ChakraCore/lib/Backend/LinearScan.cpp, line 5203) There are unrestorable backend-only symbols across yield points Failure: (unrestorableSymbols.IsEmpty()) Process 357554 stopped * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand frame #0: 0x000055555686bd8e ch`LinearScan::GeneratorBailIn::BuildBailInSymbolList(this=0x00007fffffffa940, byteCodeUpwardExposedUses=0x00007ff7e7ba2250, upwardExposedUses=0x00007ff7e7ba3e80, capturedValues=0x00007ff7e7ba3e50) at LinearScan.cpp:5203:5 5200 } 5201 NEXT_BITSET_IN_SPARSEBV_EDITING; 5202 -> 5203 AssertOrFailFastMsg(unrestorableSymbols.IsEmpty(), "There are unrestorable backend-only symbols across yield points"); 5204 } 5205 5206 void LinearScan::GeneratorBailIn::InsertRestoreSymbols( (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGILL: illegal instruction operand * frame #0: 0x000055555686bd8e ch`LinearScan::GeneratorBailIn::BuildBailInSymbolList(this=0x00007fffffffa940, byteCodeUpwardExposedUses=0x00007ff7e7ba2250, upwardExposedUses=0x00007ff7e7ba3e80, capturedValues=0x00007ff7e7ba3e50) at LinearScan.cpp:5203:5 frame #1: 0x000055555685de7f ch`LinearScan::GeneratorBailIn::GenerateBailIn(this=0x00007fffffffa940, bailInInstr=0x00007ff7e7ba3d98) at LinearScan.cpp:5049:11 frame #2: 0x0000555556854947 ch`LinearScan::RegAlloc(this=0x00007fffffffa468) at LinearScan.cpp:293:38 frame #3: 0x0000555556b265c7 ch`Func::TryCodegen(this=0x00007fffffffb1f0) at Func.cpp:501:20 frame #4: 0x0000555556b25ae0 ch`Func::Codegen(alloc=0x00007fffffffb7b0, workItem=0x00007ff7e7c0f030, threadContextInfo=0x0000555557eb6f28, scriptContextInfo=0x0000555557ee8ea8, outputData=0x00007fffffffbbf0, epInfo=0x00007ff7e7c48ea0, runtimeInfo=0x0000000000000000, polymorphicInlineCacheInfo=0x00007ff7e7adf080, codeGenAllocators=0x0000555557f00a78, codeGenProfiler=0x0000000000000000, isBackgroundJIT=false) at Func.cpp:325:18 frame #5: 0x000055555690ef90 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea678, pageAllocator=0x0000555557eb72b0, workItemData=0x0000555557ef8a50, jitWriteData=0x00007fffffffbbf0, foreground=true, epInfo=0x00007ff7e7c48ea0) at NativeCodeGenerator.cpp:890:9 frame #6: 0x0000555556910c28 ch`NativeCodeGenerator::CodeGen(this=0x0000555557eea678, pageAllocator=0x0000555557eb72b0, workItem=0x0000555557ef8a28, foreground=true) at NativeCodeGenerator.cpp:1007:5 frame #7: 0x0000555556913a24 ch`NativeCodeGenerator::Process(this=0x0000555557eea678, job=0x0000555557ef8a30, threadData=0x0000000000000000) at NativeCodeGenerator.cpp:1907:13 frame #8: 0x00005555569b83d4 ch`JsUtil::ForegroundJobProcessor::Process(job=0x0000555557ef8a30) at Jobs.cpp:426:36 frame #9: 0x0000555556920e29 ch`void JsUtil::ForegroundJobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea678, holder=0x00007ff7e7c48ea0, function=0x00007ff7e7c76730) at Jobs.inl:207:36 frame #10: 0x00005555569182e4 ch`void JsUtil::JobProcessor::PrioritizeJobAndWait<NativeCodeGenerator, Js::FunctionEntryPointInfo*>(this=0x0000555557ea2ce8, manager=0x0000555557eea678, holder=0x00007ff7e7c48ea0, function=0x00007ff7e7c76730) at Jobs.inl:81:58 frame #11: 0x0000555556912786 ch`NativeCodeGenerator::CheckCodeGen(function=0x00007ff7e7c76730) at NativeCodeGenerator.cpp:1644:37 frame #12: 0x0000555556978bac ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...) at Thunks.S:36 frame #13: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #14: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc100, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #15: 0x00005555561da48f ch`Js::JavascriptGenerator::CallGenerator(this=0x00007ff7e7c442a0, data=0xbe1c000000200000, resumeKind=Normal) at JavascriptGenerator.cpp:198:26 frame #16: 0x00005555561a8db4 ch`Js::JavascriptAsyncFunction::EntryAsyncSpawnStepNextFunction(function=0x00007ff7e7adc3f0, callInfo=(Count = 1, Flags = CallFlags_Value, unused = 0)) at JavascriptAsyncFunction.cpp:93:31 frame #17: 0x00005555561a8f98 ch`Js::JavascriptAsyncFunction::AsyncSpawnStep(stepFunction=0x00007ff7e7adc3f0, generator=0x00007ff7e7c442a0, resolve=0x00007ff7e7bcc600, reject=0x00007ff7e7bcc660) at JavascriptAsyncFunction.cpp:151:25 frame #18: 0x00005555561a99b6 ch`Js::JavascriptAsyncFunction::EntryAsyncSpawnCallStepFunction(function=0x00007ff7e7bca460, callInfo=(Count = 2, Flags = CallFlags_Value, unused = 0)) at JavascriptAsyncFunction.cpp:130:5 frame #19: 0x00005555563a0164 ch`Js::JavascriptPromise::EntryReactionTaskFunction(function=0x00007ff7e7bcb500, callInfo=(Count = 1, Flags = CallFlags_None, unused = 0)) at JavascriptPromise.cpp:1273:37 frame #20: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #21: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7bcb500, entryPoint=(ch`Js::JavascriptPromise::EntryReactionTaskFunction(Js::RecyclableObject*, Js::CallInfo, ...) at JavascriptPromise.cpp:1236), args=Arguments @ 0x00007fffffffc8b8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #22: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7bcb500, args=Arguments @ 0x00007fffffffc930, scriptContext=0x0000555557ee8ea8, inScript=true) at JavascriptFunction.cpp:772:24 frame #23: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7bcb500, args=<unavailable>, scriptContext=0x0000555557ee8ea8, inScript=true) at JavascriptFunction.cpp:717:15 frame #24: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7bcb500, args=<unavailable>, scriptContext=0x0000555557ee8ea8, inScript=true) at JavascriptFunction.cpp:832:16 frame #25: 0x000055555588add5 ch`JsCallFunction::$_67::operator(this=0x00007fffffffcda0, scriptContext=0x0000555557ee8ea8, _actionEntryPopper=0x00007fffffffcd80)(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:2842:41 frame #26: 0x000055555588a764 ch`_JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(this=0x00007fffffffcd38, scriptContext=0x0000555557ee8ea8)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #27: 0x000055555588a104 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(JsCallFunction::$_67)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcd38) at JsrtInternal.h:192:23 frame #28: 0x000055555585f1b6 ch`_JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(fn=(anonymous class) @ 0x00007fffffffcda0) at JsrtInternal.h:235:27 frame #29: 0x000055555585f179 ch`::JsCallFunction(function=0x00007ff7e7bcb500, args=0x00007fffffffce70, cargs=1, result=0x00007fffffffce68) at Jsrt.cpp:2804:12 frame #30: 0x000055555578bf80 ch`ChakraRTInterface::JsCallFunction(function=0x00007ff7e7bcb500, arguments=0x00007fffffffce70, argumentCount=1, result=0x00007fffffffce68) at ChakraRtInterface.h:416:149 frame #31: 0x0000555555797a7a ch`WScriptJsrt::CallbackMessage::CallFunction(this=0x0000555557f08640, fileName="bug03_linearScan.js") at WScriptJsrt.cpp:2009:21 frame #32: 0x000055555579795d ch`WScriptJsrt::CallbackMessage::Call(this=0x0000555557f08640, fileName="bug03_linearScan.js") at WScriptJsrt.cpp:1980:12 frame #33: 0x00005555557872fe ch`MessageQueue::ProcessAll(this=0x0000555557ef4860, fileName="bug03_linearScan.js") at MessageQueue.h:256:18 frame #34: 0x000055555578499c ch`RunScript(fileName="bug03_linearScan.js", fileContents="async function opt() {\n Math.max();\n Math.imul(2147483649, 2);\n await 2147483649;\n return 2147483649;\n}\nfor (let i = 0; i < 100; i++) {\n opt();\n}\n\n\n// ASSERTION 3399108: (/home/wjm/ChakraCore/lib/Backend/LinearScan.cpp, line 5203) There are unrestorable backend-only symbols across yield points\n// Failure: (unrestorableSymbols.IsEmpty())\n\n\n\n/*\n\nTitle: \n\n## Version\ncommit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9\n\n## Platform\nUbuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64)\n\n## Build\n- Debug Mode\n\n```\n./build.sh --debug --static\n```\n\n## PoC\n```\n\n```\n\n## Execution steps & Output\n```\n./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js\nAborted (core dumped)\n```\n## Backtrace\n```\n\n\n```\n\n*\/\n", fileLength=732, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug03_linearScan.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:480:17 frame #35: 0x00005555557863f0 ch`ExecuteTest(fileName="bug03_linearScan.js") at ch.cpp:917:13 frame #36: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug03_linearScan.js") at ch.cpp:967:10 frame #37: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #38: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #39: 0x0000555555783b7e ch`_start + 46 ```
Assertion Failure: unrestorableSymbols.IsEmpty() in ChakraCore/lib/Backend/LinearScan.cpp, line 5203
https://api.github.com/repos/chakra-core/ChakraCore/issues/6899/comments
0
2023-05-10T11:13:07Z
2023-05-10T11:13:07Z
https://github.com/chakra-core/ChakraCore/issues/6899
1,703,686,819
6,899
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` async function opt(arg1) { await 1300055; [arg1,1300055]; (1300055).indexOf; } for (let i = 0; i < 100; i++) { opt(opt); } ``` ## Execution steps & Output ``` ./ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- poc.js Segmentation fault (core dumped) ``` ## Backtrace ``` * thread #1, name = 'ch', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) frame #0: 0x00005555558a424c ch`Js::Type::GetTypeId(this=0x0f0000000000841f) const at Type.h:48:50 45 46 public: 47 static DWORD GetJavascriptLibraryOffset() { return offsetof(Type, javascriptLibrary); } -> 48 inline TypeId GetTypeId() const { return typeId; } 49 void SetTypeId(TypeId typeId) { this->typeId = typeId; } 50 RecyclableObject* GetPrototype() const { return prototype; } 51 JavascriptMethod GetEntryPoint() const { return entryPoint; } (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) * frame #0: 0x00005555558a424c ch`Js::Type::GetTypeId(this=0x0f0000000000841f) const at Type.h:48:50 frame #1: 0x00005555558a415d ch`Js::RecyclableObject::GetTypeId(this=0x0000555556978bac) const at RecyclableObject.inl:13:33 frame #2: 0x000055555602d415 ch`Js::JavascriptOperators::IsUndefinedOrNull(instance=0x0000555556978bac) at JavascriptOperators.cpp:11022:69 frame #3: 0x00005555560265e7 ch`Js::JavascriptOperators::GetPropertyObject(instance=0x0000555556978bac, scriptContext=0x0000555557ee8ca8, propertyObject=0x00007fffffffbf08) at JavascriptOperators.cpp:2133:13 frame #4: 0x000055555606684f ch`void* Js::JavascriptOperators::PatchGetValue<true, Js::InlineCache>(Js::FunctionBody*, Js::InlineCache*, unsigned int, void*, int) [inlined] void* Js::JavascriptOperators::PatchGetValueWithThisPtr<true, Js::InlineCache>(functionBody=0x00007ff7e7c471f0, inlineCache=0x00007ff7e84caed0, inlineCacheIndex=3, instance=0x0000555556978bac, propertyId=185, thisInstance=0x0000555556978bac) at JavascriptOperators.cpp:7941:22 frame #5: 0x00005555560667ad ch`void* Js::JavascriptOperators::PatchGetValue<true, Js::InlineCache>(functionBody=0x00007ff7e7c471f0, inlineCache=0x00007ff7e84caed0, inlineCacheIndex=3, instance=0x0000555556978bac, propertyId=185) at JavascriptOperators.cpp:7927 frame #6: 0x00007ff7e7b912f7 frame #7: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #8: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76730, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc100, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #9: 0x00005555561da48f ch`Js::JavascriptGenerator::CallGenerator(this=0x00007ff7e7c442a0, data=0x000100000013d657, resumeKind=Normal) at JavascriptGenerator.cpp:198:26 frame #10: 0x00005555561a8db4 ch`Js::JavascriptAsyncFunction::EntryAsyncSpawnStepNextFunction(function=0x00007ff7e7b133f0, callInfo=(Count = 1, Flags = CallFlags_Value, unused = 0)) at JavascriptAsyncFunction.cpp:93:31 frame #11: 0x00005555561a8f98 ch`Js::JavascriptAsyncFunction::AsyncSpawnStep(stepFunction=0x00007ff7e7b133f0, generator=0x00007ff7e7c442a0, resolve=0x00007ff7e7c4f0c0, reject=0x00007ff7e7c4f120) at JavascriptAsyncFunction.cpp:151:25 frame #12: 0x00005555561a99b6 ch`Js::JavascriptAsyncFunction::EntryAsyncSpawnCallStepFunction(function=0x00007ff7e7c4c460, callInfo=(Count = 2, Flags = CallFlags_Value, unused = 0)) at JavascriptAsyncFunction.cpp:130:5 frame #13: 0x00005555563a0164 ch`Js::JavascriptPromise::EntryReactionTaskFunction(function=0x00007ff7e7c76e10, callInfo=(Count = 1, Flags = CallFlags_None, unused = 0)) at JavascriptPromise.cpp:1273:37 frame #14: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #15: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c76e10, entryPoint=(ch`Js::JavascriptPromise::EntryReactionTaskFunction(Js::RecyclableObject*, Js::CallInfo, ...) at JavascriptPromise.cpp:1236), args=Arguments @ 0x00007fffffffc8b8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #16: 0x00005555561cf2f4 ch`Js::JavascriptFunction::CallRootFunctionInternal(obj=0x00007ff7e7c76e10, args=Arguments @ 0x00007fffffffc930, scriptContext=0x0000555557ee8ca8, inScript=true) at JavascriptFunction.cpp:772:24 frame #17: 0x00005555561cf10c ch`Js::JavascriptFunction::CallRootFunction(obj=0x00007ff7e7c76e10, args=<unavailable>, scriptContext=0x0000555557ee8ca8, inScript=true) at JavascriptFunction.cpp:717:15 frame #18: 0x00005555561cf0b1 ch`Js::JavascriptFunction::CallRootFunction(this=0x00007ff7e7c76e10, args=<unavailable>, scriptContext=0x0000555557ee8ca8, inScript=true) at JavascriptFunction.cpp:832:16 frame #19: 0x000055555588add5 ch`JsCallFunction::$_67::operator(this=0x00007fffffffcda0, scriptContext=0x0000555557ee8ca8, _actionEntryPopper=0x00007fffffffcd80)(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const at Jsrt.cpp:2842:41 frame #20: 0x000055555588a764 ch`_JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(this=0x00007fffffffcd38, scriptContext=0x0000555557ee8ca8)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const at JsrtInternal.h:237:16 frame #21: 0x000055555588a104 ch`_JsErrorCode ContextAPIWrapper_Core<false, _JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(JsCallFunction::$_67)::'lambda'(Js::ScriptContext*)>(fn=(anonymous class) @ 0x00007fffffffcd38) at JsrtInternal.h:192:23 frame #22: 0x000055555585f1b6 ch`_JsErrorCode ContextAPIWrapper<false, JsCallFunction::$_67>(fn=(anonymous class) @ 0x00007fffffffcda0) at JsrtInternal.h:235:27 frame #23: 0x000055555585f179 ch`::JsCallFunction(function=0x00007ff7e7c76e10, args=0x00007fffffffce70, cargs=1, result=0x00007fffffffce68) at Jsrt.cpp:2804:12 frame #24: 0x000055555578bf80 ch`ChakraRTInterface::JsCallFunction(function=0x00007ff7e7c76e10, arguments=0x00007fffffffce70, argumentCount=1, result=0x00007fffffffce68) at ChakraRtInterface.h:416:149 frame #25: 0x0000555555797a7a ch`WScriptJsrt::CallbackMessage::CallFunction(this=0x0000555557eff340, fileName="bug02_await.js") at WScriptJsrt.cpp:2009:21 frame #26: 0x000055555579795d ch`WScriptJsrt::CallbackMessage::Call(this=0x0000555557eff340, fileName="bug02_await.js") at WScriptJsrt.cpp:1980:12 frame #27: 0x00005555557872fe ch`MessageQueue::ProcessAll(this=0x0000555557ef4660, fileName="bug02_await.js") at MessageQueue.h:256:18 frame #28: 0x000055555578499c ch`RunScript(fileName="bug02_await.js", fileContents="\nasync function opt(arg1) {\n await 1300055;\n [arg1,1300055];\n (1300055).indexOf;\n}\n\nfor (let i = 0; i < 100; i++) {\n opt(opt);\n}\n\n// ARGS: /home/wjm/ChakraCore/out/Debug/ch --maxinterpretcount:10 --maxsimplejitruncount:100 -bgjit- \n\n", fileLength=245, fileContentsFinalizeCallback=(ch`WScriptJsrt::FinalizeFree(void*) at WScriptJsrt.cpp:217), bufferValue=0x0000000000000000, fullPath="/home/wjm/DiTing-pocs/chakra/bug02_await.js", parserStateCache=0x0000000000000000)(void*), void*, char*, void*) at ch.cpp:480:17 frame #29: 0x00005555557863f0 ch`ExecuteTest(fileName="bug02_await.js") at ch.cpp:917:13 frame #30: 0x00005555557864ac ch`ExecuteTestWithMemoryCheck(fileName="bug02_await.js") at ch.cpp:967:10 frame #31: 0x0000555555786d7a ch`main(argc=5, c_argv=0x00007fffffffd648) at ch.cpp:1274:20 frame #32: 0x00007ffff778d1e2 libc.so.6`__libc_start_main + 242 frame #33: 0x0000555555783b7e ch`_start + 46 ```
SEGV in JS::RecyclableObject::GetTypeId
https://api.github.com/repos/chakra-core/ChakraCore/issues/6898/comments
1
2023-05-10T09:01:21Z
2023-06-15T01:06:33Z
https://github.com/chakra-core/ChakraCore/issues/6898
1,703,442,402
6,898
[ "chakra-core", "ChakraCore" ]
## Version commit id: c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ## Platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ## Build - Debug Mode ``` ./build.sh --debug --static ``` ## PoC ``` ("abcdefg").padStart(1779013264); //("65536").padEnd(~3107152661); ``` ## Execution steps & Output ``` ./ch poc.js Aborted (core dumped) ``` ## Backtrace ``` (lldb) thread backtrace * thread #1, name = 'ch', stop reason = signal SIGTRAP * frame #0: 0x0000555556808bf9 ch`DBG_DebugBreak at debugbreak.S:18 frame #1: 0x00005555567fb181 ch`::DebugBreak() at debug.cpp:408:9 frame #2: 0x0000555555947f29 ch`::ReportFatalException(context=0, exceptionCode=-2147024882, reasonCode=Fatal_OutOfMemory, scenario=10) at ReportError.cpp:20:9 frame #3: 0x00005555559482a6 ch`RecyclerSingleAllocationLimit_unrecoverable_error() at ReportError.cpp:151:5 frame #4: 0x0000555555a2a3b7 ch`char* Memory::Recycler::LargeAlloc<false>(this=0x0000555557eb84c8, heap=0x0000555557ebcf20, size=3558026516, attributes=LeafBit) at Recycler.cpp:1380:21 frame #5: 0x00005555558a9b2d ch`char* Memory::Recycler::RealAlloc<(Memory::ObjectInfoBits)32, false>(this=0x0000555557eb84c8, heap=0x0000555557ebcf20, size=3558026516) at Recycler.inl:384:12 frame #6: 0x00005555558a98ca ch`char* Memory::Recycler::AllocWithAttributesInlined<(Memory::ObjectInfoBits)32, false>(this=0x0000555557eb84c8, size=3558026516) at Recycler.inl:113:24 frame #7: 0x00005555558a948d ch`char* Memory::Recycler::AllocWithAttributes<(Memory::ObjectInfoBits)32, false>(this=0x0000555557eb84c8, size=3558026516) at Recycler.h:1589:16 frame #8: 0x00005555558a90bd ch`Memory::Recycler::AllocLeaf(this=0x0000555557eb84c8, size=3558026516) at Recycler.h:1380:5 frame #9: 0x00005555558a93e0 ch`void* operator new[]<Memory::Recycler>(byteSize=3558026516, alloc=0x0000555557eb84c8, AllocFunc=a0 90 8a 55 55 55 00 00 00 00 00 00 00 00 00 00)(unsigned long)) at Allocator.h:498:21 frame #10: 0x0000555555ab0ad4 ch`char16_t* Memory::AllocateArray<Memory::Recycler, char16_t, false>(allocator=0x0000555557eb84c8, AllocFunc=a0 90 8a 55 55 55 00 00 00 00 00 00 00 00 00 00, count=1779013258)(unsigned long), unsigned long) at Allocator.h:348:12 frame #11: 0x00005555563e3f8f ch`Js::JavascriptString::RepeatCore(currentString=0x00007ff7e6c3c600, count=1779013257, scriptContext=0x0000555557ee8cc8) at JavascriptString.cpp:2627:26 frame #12: 0x00005555563e3a85 ch`Js::JavascriptString::PadCore(args=0x00007fffffffad58, mainString=0x00007ff7e6c2f280, isPadStart=true, scriptContext=0x0000555557ee8cc8) at JavascriptString.cpp:2187:24 frame #13: 0x00005555563e3730 ch`Js::JavascriptString::EntryPadStart(function=0x00007ff7e6c3c4c0, callInfo=(Count = 2, Flags = CallFlags_NotUsed, unused = 0)) at JavascriptString.cpp:2120:16 frame #14: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #15: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e6c3c4c0, entryPoint=(ch`Js::JavascriptString::EntryPadStart(Js::RecyclableObject*, Js::CallInfo, ...) at JavascriptString.cpp:2108), args=Arguments @ 0x00007fffffffaed0, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 frame #16: 0x0000555555ffc5fe ch`void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc090, playout=0x00007ff7e84d31b2, function=0x00007ff7e6c3c4c0, flags=16, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:3973:21 frame #17: 0x0000555555ffc0e1 ch`void Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(this=0x00007fffffffc090, playout=0x00007ff7e84d31b2, function=0x00007ff7e6c3c4c0, flags=0, profileId=0, inlineCacheIndex=0, spreadIndices=0x0000000000000000)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) at InterpreterStackFrame.cpp:4016:9 frame #18: 0x0000555555fc72a8 ch`void Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(this=0x00007fffffffc090, playout=0x00007ff7e84d31b2)0> > > const __unaligned*) at InterpreterStackFrame.h:520:115 frame #19: 0x0000555555eac7d3 ch`Js::InterpreterStackFrame::ProcessProfiled(this=0x00007fffffffc090) at InterpreterHandler.inl:91:3 frame #20: 0x0000555555e52112 ch`Js::InterpreterStackFrame::Process(this=0x00007fffffffc090) at InterpreterStackFrame.cpp:3472:20 frame #21: 0x0000555555e50dd3 ch`Js::InterpreterStackFrame::InterpreterHelper(function=0x00007ff7e7c766e0, args=ArgumentReader @ 0x00007fffffffc580, returnAddress=0x00007ff7e6bc0fa2, addressOfReturnAddress=0x00007fffffffc5c8, asmJsReturn=0x0000000000000000) at InterpreterStackFrame.cpp:2153:40 frame #22: 0x0000555555e4feb0 ch`Js::InterpreterStackFrame::InterpreterThunk(layout=0x00007fffffffc5e0) at InterpreterStackFrame.cpp:1833:16 frame #23: 0x00007ff7e6bc0fa2 frame #24: 0x00005555564a37de ch`amd64_CallFunction at JavascriptFunctionA.S:100 frame #25: 0x00005555561d7a4b ch`void* Js::JavascriptFunction::CallFunction<true>(function=0x00007ff7e7c766e0, entryPoint=(ch`NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject*, Js::CallInfo, ...)), args=Arguments @ 0x00007fffffffc7e8, useLargeArgCount=false)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments, bool) at JavascriptFunction.cpp:1364:16 ```
Aborted in ReportFatalException (Js::JavascriptString::PadCore)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6897/comments
1
2023-05-10T08:19:53Z
2023-05-11T07:43:55Z
https://github.com/chakra-core/ChakraCore/issues/6897
1,703,367,900
6,897
[ "chakra-core", "ChakraCore" ]
After adding a Apple Silicon support when building of the ChakraCore for Windows (ARM64) using the following command: ``` msbuild /m /p:Platform=arm64 /p:Configuration=Release /p:RuntimeLib=static_library D:\Projects\ChakraCore\Build\Chakra.Core.sln ``` An error occurs: ``` "D:\Projects\ChakraCore\Build\Chakra.Core.sln" (default target) (1) -> "D:\Projects\ChakraCore\bin\NativeTests\NativeTests.vcxproj" (default target) (31) -> "D:\Projects\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj" (default target) (32) -> (Link target) -> Chakra.Jsrt.lib(JsrtDebugManager.obj) : error LNK2001: unresolved external symbol arm64_GET_CURRENT_FRAME [D:\ Projects\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj] D:\Projects\ChakraCore\Build\VcBuild\bin\arm64_release\ChakraCore.dll : fatal error LNK1120: 1 unresolved exte rnals [D:\Projects\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj] ```
Windows (ARM64) build failed after adding a Apple Silicon support
https://api.github.com/repos/chakra-core/ChakraCore/issues/6895/comments
1
2023-05-09T10:27:18Z
2024-04-17T13:57:59Z
https://github.com/chakra-core/ChakraCore/issues/6895
1,701,808,220
6,895
[ "chakra-core", "ChakraCore" ]
jsish reversion c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 master Build platform Ubuntu 20.04 LTS (Linux 5.4.0-1018-aws x86_64) Build steps ```sh ./build.sh ./ch poc.js ``` Test case poc.js ```javascript try { (function TestFunc() { var a; (function outer() { (function inner() { outer() })(); try { throw "Exception"; } catch (ex) { with ({}) { outer(); } } })(); })(); } catch (ex) { if (ex.message == "Out of stack space") { WScript.Echo("PASSED"); } } ``` Backtrace ```sh #0 0x00007fffecf92d27 in DebugBreak () at ../../lib/Common/CommonPal.h:161 #1 ReportFatalException (context=<optimized out>, exceptionCode=<optimized out>, reasonCode=<optimized out>, scenario=<optimized out>) at ../../lib/Common/Exceptions/ReportError.cpp:20 #2 0x00007fffec78177b in IRBuilder::DoClosureRegCheck (this=0x7ff7eaa80de8, reg=6) at ../../lib/Backend/IRBuilder.cpp:7803 #3 0x00007fffec767596 in IRBuilder::BuildReg1<Js::LayoutSizePolicy<(Js::LayoutSize)0> > ( this=<optimized out>, newOpcode=<optimized out>, offset=<optimized out>) at ../../lib/Backend/IRBuilder.cpp:1486 #4 IRBuilder::Build (this=<optimized out>) at ../../lib/Backend/../Runtime/ByteCode/LayoutTypes.h:47 #5 0x00007fffec53d034 in Func::TryCodegen (this=0x7ff7eaa816f8) at ../../lib/Backend/Func.cpp:422 #6 0x00007fffec53cb65 in Func::Codegen (alloc=0x7ff7eaa81b38, workItem=0x7ff7ea1c1030, threadContextInfo=0x55555592b3b0, scriptContextInfo=0x555555953620, outputData=0x7ff7eaa81c60, epInfo=0x7ff7ea229120, runtimeInfo=<optimized out>, polymorphicInlineCacheInfo=<optimized out>, codeGenAllocators=<optimized out>, codeGenProfiler=0x0, isBackgroundJIT=<optimized out>) at ../../lib/Backend/Func.cpp:325 #7 0x00007fffecbaae3e in NativeCodeGenerator::CodeGen (this=<optimized out>, pageAllocator=<optimized out>, workItemData=<optimized out>, jitWriteData=..., foreground=<optimized out>, epInfo=<optimized out>) at ../../lib/Backend/NativeCodeGenerator.cpp:890 #8 0x00007fffecbab4c9 in NativeCodeGenerator::CodeGen (this=<optimized out>, pageAllocator= 0x555555954310, workItem=0x5555559650c0, foreground=<optimized out>) at ../../lib/Backend/NativeCodeGenerator.cpp:1007 #9 0x00007fffecbad02f in NativeCodeGenerator::Process (this=0x5555559177a0, job=<optimized out>, threadData=0x5555559542f0) at ../../lib/Backend/NativeCodeGenerator.cpp:1907 #10 0x00007fffecf7059a in JsUtil::BackgroundJobProcessor::Process (this=<optimized out>, job=0xffffffda, threadData=0x0) at ../../lib/Common/Common/Jobs.cpp:1037 #11 0x00007fffecf709c7 in JsUtil::BackgroundJobProcessor::Run (this=0x555555953d90, threadData=0x5555559542f0) at ../../lib/Common/Common/Jobs.cpp:1135 #12 0x00007fffecf6e25f in JsUtil::BackgroundJobProcessor::StaticThreadProc (lpParam=0x5555559542f0) at ../../lib/Common/Common/Jobs.cpp:1319 #13 0x00007fffec05e125 in CorUnix::CPalThread::ThreadEntry (pvParam=0x555555954680) at ../../pal/src/thread/pal_thread.cpp:1554 ---Type <return> to continue, or q <return> to quit--- ```
Aborted in ReportFatalException (Func::TryCodegen)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6894/comments
4
2023-05-02T14:18:20Z
2023-08-31T08:07:19Z
https://github.com/chakra-core/ChakraCore/issues/6894
1,692,516,793
6,894
[ "chakra-core", "ChakraCore" ]
###### Version Branch : master Version: https://github.com/chakra-core/ChakraCore/commit/c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 ###### Build platform Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) ###### Build steps - Address Sanitizer=On - Debug ```sh ./build.sh -d --static --sanitize=address ``` ###### POC <details><summary>testcase</summary> <p> ```JavaScript var e = [ 1 , 2 , 2 ] ; new Date ( " 1 - 1 0 - a " ) . toString ( ) , new Date ( 0 ) , Object . defineProperty ( e , 1 , { configurable : " abc " } ) ; ``` </p> </details> ``` JavaScript // poc.js new Date ( " 1 - 1 0 - a " ); ``` ###### Execution steps & Output ```sh $ ./ch poc.js (gdb) bt #0 0x0000555558912bb5 in Js::DateImplementation::UtcTimeFromStrCore (psz=<optimized out>, ulength=<optimized out>, retVal=<optimized out>, scriptContext=0x622000000158) at /chakracore/lib/Runtime/Library/DateImplementation.cpp:1138 #1 0x000055555890d815 in Js::DateImplementation::UtcTimeFromStr (scriptContext=<optimized out>, pParseString=0x7ffff283f280) at /chakracore/lib/Runtime/Library/DateImplementation.cpp:647 #2 0x0000555558b896bc in Js::JavascriptDate::ParseHelper (scriptContext=0x622000000158, str=0x10007fff7400) at /chakracore/lib/Runtime/Library/JavascriptDate.cpp:833 #3 Js::JavascriptDate::NewInstanceAsConstructor (args=..., scriptContext=0x622000000158, forceCurrentDate=<optimized out>) at /chakracore/lib/Runtime/Library/JavascriptDate.cpp:159 #4 0x0000555558b88567 in Js::JavascriptDate::NewInstance (function=<optimized out>, callInfo=...) at /chakracore/lib/Runtime/Library/JavascriptDate.cpp:97 #5 0x0000555559723c4e in amd64_CallFunction () at /chakracore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 #6 0x0000555558c16c5e in Js::JavascriptFunction::CallAsConstructor (v=0x7ffff2860240, overridingNewTarget=<optimized out>, args=..., scriptContext=<optimized out>, spreadIndices=<optimized out>) at /chakracore/lib/Runtime/Library/JavascriptFunction.cpp:972 #7 0x0000555558570f4d in Js::JavascriptOperators::NewScObject (callee=0x0, args=..., scriptContext=<optimized out>, spreadIndices=<optimized out>) at /chakracore/lib/Runtime/Language/JavascriptOperators.cpp:6931 #8 0x0000555558713ed7 in Js::ProfilingHelpers::ProfiledNewScObject (callee=0x7ffff2860240, args=..., callerFunctionBody=<optimized out>, profileId=<optimized out>, inlineCacheIndex=<optimized out>, spreadIndices=<optimized out>) at /chakracore/lib/Runtime/Language/ProfilingHelpers.cpp:720 #9 0x000055555830774f in Js::InterpreterStackFrame::ProfiledNewScObject_Helper (this=0x7fffffffc680, target=<optimized out>, ArgCount=2, profileId=<optimized out>, inlineCacheIndex=<optimized out>, spreadIndices=<optimized out>) at /chakracore/lib/Runtime/Language/InterpreterStackFrame.cpp:6596 #10 0x0000555557e01b2e in Js::InterpreterStackFrame::OP_NewScObject_Impl<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> >, true, false>(Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned*, unsigned int, Js::AuxArray<unsigned int> const*) ( this=0x7fffffffc680, playout=0x7ffff28ef16d, inlineCacheIndex=4294967295, spreadIndices=0x0) at /chakracore/lib/Runtime/Language/InterpreterStackFrame.cpp:6464 #11 Js::InterpreterStackFrame::OP_ProfiledNewScObject_Impl<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> >, true, false>(Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > const __unaligned*, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x7fffffffc680, playout=0x7ffff28ef16d, inlineCacheIndex=4294967295, spreadIndices=0x0) at /chakracore/lib/Runtime/./Language/InterpreterStackFrame.h:759 #12 Js::InterpreterStackFrame::OP_ProfiledNewScObject<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > const __unaligned*) (this=0x7fffffffc680, playout=0x7ffff28ef16d) at /chakracore/lib/Runtime/./Language/InterpreterStackFrame.h:767 #13 Js::InterpreterStackFrame::ProcessProfiled (this=<optimized out>) at /chakracore/lib/Runtime/Language/InterpreterHandler.inl:302 #14 0x0000555557c426df in Js::InterpreterStackFrame::Process (this=0x7fffffffc680) at /chakracore/lib/Runtime/Language/InterpreterStackFrame.cpp:3472 #15 0x0000555557c3d150 in Js::InterpreterStackFrame::InterpreterHelper (function=<optimized out>, args=<error reading variable: Cannot access memory at address 0x0>, returnAddress=<optimized out>, addressOfReturnAddress=<optimized out>, asmJsReturn=<optimized out>) at /chakracore/lib/Runtime/Language/InterpreterStackFrame.cpp:2153 #16 0x0000555557c3a80d in Js::InterpreterStackFrame::InterpreterThunk (layout=0x7ffff26c0fa2) at /chakracore/lib/Runtime/Language/InterpreterStackFrame.cpp:1833 #17 0x00007ffff26c0fa2 in ?? () #18 0x00007fffffffcc50 in ?? () #19 0x0000555559723c4e in amd64_CallFunction () at /chakracore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 ``` --- ###### Outputs ``` ASSERTION 292943: (/chakracore/lib/Runtime/Library/DateImplementation.cpp, line 1138) isNextFieldDateNegativeVersion5 == false Failure: (isNextFieldDateNegativeVersion5 == false) Illegal instruction ``` credits: @EJueon, @Ye0nny of the seclab-yonsei.
Assertion Failure : isNextFieldDateNegativeVersion5 == false in ChakraCore/lib/Runtime/Library/DateImplementation.cpp, line 1138
https://api.github.com/repos/chakra-core/ChakraCore/issues/6893/comments
1
2023-04-30T07:30:41Z
2023-05-09T21:36:24Z
https://github.com/chakra-core/ChakraCore/issues/6893
1,689,815,520
6,893
[ "chakra-core", "ChakraCore" ]
Version --- Branch : master Version : https://github.com/chakra-core/ChakraCore/commit/c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 Platform --- Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) Build --- - Address Sanitizer=On - Debug ``` ./build.sh -d --static --sanitize=address ``` PoC --- <details><summary>testcase1</summary> <p> ```javascript var c = " x " ; for ( var r = 0 ; r < 8 * 8 ; r ++ ) { try { c += c ; } catch ( c ) { } } try { / ( x | x ) ; * / . exec ( c ) ; } catch ( c ) { } ``` </p> </details> <details><summary>testcase2</summary> <p> ```javascript var c = " x " ; for ( var r = 0 ; r < 32 ; r ++ ) { try { c += c ; } catch ( c ) { } } try { / ( x | x ) * / . exec ( c ) ; } catch ( c ) { } ``` </p> </details> ```javascript // poc.js var c = " x " ; for ( var r = 0 ; r < 29 ; r ++ ) { try { c += c ; } catch ( c ) { } } / / . exec ( c ) ; ``` Execution steps & Output --- ``` $ ./ch poc.js Aborted ``` Backtrace --- Debug (ASAN) ``` (gdb) r poc.js Starting program: ./ChakraCore/out/Debug/ch poc.js [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ff7f1915700 (LWP 528483)] [New Thread 0x7ff7f1114700 (LWP 528484)] [New Thread 0x7ff7f0913700 (LWP 528485)] Thread 1 "ch" received signal SIGILL, Illegal instruction. 0x0000555556a35e09 in DebugBreak () at ./ChakraCore/lib/Common/CommonPal.h:161 161 __builtin_trap(); (gdb) bt #0 0x0000555556a35e09 in DebugBreak () at ./ChakraCore/lib/Common/CommonPal.h:161 #1 ReportFatalException (context=<optimized out>, exceptionCode=<optimized out>, reasonCode=<optimized out>, scenario=<optimized out>) at ./ChakraCore/lib/Common/Exceptions/ReportError.cpp:20 #2 0x0000555556a36247 in RecyclerSingleAllocationLimit_unrecoverable_error () at ./ChakraCore/lib/Common/Exceptions/ReportError.cpp:151 #3 0x0000555556deecba in Memory::Recycler::LargeAlloc<false> (this=0x632000000858, heap=0x6320000052b8, size=3221225474, attributes=Memory::LeafBit) at ./ChakraCore/lib/Common/Memory/Recycler.cpp:1380 #4 0x00005555567fd87f in Memory::Recycler::RealAlloc<(Memory::ObjectInfoBits)32, false> (this=0x632000000858, heap=0x6320000052b8, size=3221225474) at ./ChakraCore/lib/Common/Memory/Recycler.inl:384 #5 0x00005555567fcb24 in Memory::Recycler::AllocWithAttributesInlined<(Memory::ObjectInfoBits)32, false> (this=<optimized out>, size=<optimized out>) at ./ChakraCore/lib/Common/Memory/HeapInfoManager.h:18 #6 0x00005555567fbce9 in operator new[]<Memory::Recycler> (byteSize=3221225474, alloc=<optimized out>, AllocFunc=<optimized out>) at ./ChakraCore/lib/Common/DataStructures/../Memory/Allocator.h:498 #7 0x000055555888c82a in Memory::AllocateArray<Memory::Recycler, char16_t, false> (allocator=0x632000000858, AllocFunc=<optimized out>, count=<optimized out>) at ./ChakraCore/lib/Common/DataStructures/../Memory/Allocator.h:348 #8 Js::CompoundString::GetSz (this=0x7ffff2849340) at ./ChakraCore/lib/Runtime/Library/CompoundString.cpp:1039 #9 0x00005555593ceff8 in Js::JavascriptString::GetString (this=0x7ffff2849340) at ./ChakraCore/lib/Runtime/Library/JavascriptString.cpp:2850 #10 0x00005555594fdfca in Js::RegexHelperTrace (scriptContext=0x622000000158, use=UnifiedRegex::RegexStats::Exec, regExp=0x7ffff2849b40, input=0x7ffff2849340) at ./ChakraCore/lib/Runtime/Library/RegexHelper.cpp:340 #11 0x00005555594fd044 in Js::RegexHelper::RegexExecImpl (scriptContext=<optimized out>, regularExpression=0x7ffff2849b40, input=<optimized out>, noResult=<optimized out>, stackAllocationPointer=<optimized out>) at ./ChakraCore/lib/Runtime/Library/RegexHelper.cpp:607 #12 0x000055555951a48f in Js::RegexHelper::RegexExec (entryFunctionContext=0x622000000158, regularExpression=0x0, input=0x10007fff7e00, noResult=false, stackAllocationPointer=0x7ffff7fc4000) at ./ChakraCore/lib/Runtime/Library/RegexHelper.cpp:2278 #13 0x000055555937eb72 in Js::JavascriptRegExp::EntryExec (function=<optimized out>, callInfo=...) at ./ChakraCore/lib/Runtime/Library/JavascriptRegularExpression.cpp:636 #14 0x0000555559723c4e in amd64_CallFunction () at ./ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 #15 0x000055555843ceef in Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x7fffffffca40, playout=<optimized out>, function=<optimized out>, flags=<optimized out>, spreadIndices=<optimized out>) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3973 #16 0x000055555843bae9 in Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x7fffffffca40, playout=0x7ffff26e11a4, function=<optimized out>, flags=0, profileId=<optimized out>, inlineCacheIndex=0, spreadIndices=0x0) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:4016 #17 0x0000555557df8817 in Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > const __unaligned*) (this=0x7fffffffca40, playout=0x7ffff26e11a4) at ./ChakraCore/lib/Runtime/./Language/InterpreterStackFrame.h:520 #18 Js::InterpreterStackFrame::ProcessProfiled (this=<optimized out>) at ./ChakraCore/lib/Runtime/Language/InterpreterHandler.inl:91 #19 0x0000555557c426df in Js::InterpreterStackFrame::Process (this=0x7fffffffca40) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3472 #20 0x0000555557c3d150 in Js::InterpreterStackFrame::InterpreterHelper (function=<optimized out>, args=<error reading variable: Cannot access memory at address 0x0>, returnAddress=<optimized out>, addressOfReturnAddress=<optimized out>, asmJsReturn=<optimized out>) at ./ChakraCorelib/Runtime/Language/InterpreterStackFrame.cpp:2153 #21 0x0000555557c3a80d in Js::InterpreterStackFrame::InterpreterThunk (layout=0x7ffff26c0fa2) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:1833 #22 0x00007ffff26c0fa2 in ?? () #23 0x00007fffffffd010 in ?? () #24 0x0000555559723c4e in amd64_CallFunction () at ./ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 Backtrace stopped: frame did not save the PC (gdb) ``` Credits: @Ye0nny, @EJueon of the seclab-yonsei.
Aborted in ReportFatalException (Js::CompoundString::GetSz)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6892/comments
1
2023-04-25T12:40:19Z
2023-05-09T21:47:35Z
https://github.com/chakra-core/ChakraCore/issues/6892
1,683,096,075
6,892
[ "chakra-core", "ChakraCore" ]
Version --- Branch : master Version : https://github.com/chakra-core/ChakraCore/commit/c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 Platform --- Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) Build --- - Address Sanitizer=On - Debug ``` ./build.sh -d --static --sanitize=address ``` It also happens on release mode. ``` ./build.sh --static ``` PoC --- <details><summary>testcase</summary> <p> ```javascript var o ; try { o = " a " . repeat ( 536870912 ) , RegExp . prototype . toString . call ( { source : o , flags : o } ) ; } catch ( o ) { } console . log ( " PASS : no crash " ) ; ``` </p> </details> ```javascript // poc.js " a " . repeat ( 536870912 ) ``` Execution steps & Output --- ``` $ ./ch poc.js Aborted ``` Backtrace --- Debug (ASAN) ``` (gdb) r poc.js Starting program: ./ChakraCore/out/Debug/ch poc.js [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ff7f1915700 (LWP 2302071)] [New Thread 0x7ff7f1114700 (LWP 2302072)] [New Thread 0x7ff7f0913700 (LWP 2302074)] Thread 1 "ch" received signal SIGILL, Illegal instruction. 0x0000555556a35e09 in DebugBreak () at ./ChakraCore/lib/Common/CommonPal.h:161 161 __builtin_trap(); (gdb) bt #0 0x0000555556a35e09 in DebugBreak () at ./ChakraCore/lib/Common/CommonPal.h:161 #1 ReportFatalException (context=<optimized out>, exceptionCode=<optimized out>, reasonCode=<optimized out>, scenario=<optimized out>) at ./ChakraCore/lib/Common/Exceptions/ReportError.cpp:20 #2 0x0000555556a36247 in RecyclerSingleAllocationLimit_unrecoverable_error () at ./ChakraCore/lib/Common/Exceptions/ReportError.cpp:151 #3 0x0000555556deecba in Memory::Recycler::LargeAlloc<false> (this=0x632000000858, heap=0x6320000052b8, size=3221225474, attributes=Memory::LeafBit) at ./ChakraCore/lib/Common/Memory/Recycler.cpp:1380 #4 0x00005555567fd87f in Memory::Recycler::RealAlloc<(Memory::ObjectInfoBits)32, false> (this=0x632000000858, heap=0x6320000052b8, size=3221225474) at ./ChakraCore/lib/Common/Memory/Recycler.inl:384 #5 0x00005555567fcb24 in Memory::Recycler::AllocWithAttributesInlined<(Memory::ObjectInfoBits)32, false> (this=<optimized out>, size=<optimized out>) at ./ChakraCore/lib/Common/Memory/HeapInfoManager.h:18 #6 0x00005555567fbce9 in operator new[]<Memory::Recycler> (byteSize=3221225474, alloc=<optimized out>, AllocFunc=<optimized out>) at ./ChakraCore/lib/Common/DataStructures/../Memory/Allocator.h:498 #7 0x0000555559402613 in Memory::AllocateArray<Memory::Recycler, char16_t, false> (allocator=0x632000000858, AllocFunc=<optimized out>, count=1610612737) at ./ChakraCore/lib/Common/DataStructures/../Memory/Allocator.h:348 #8 Js::JavascriptString::RepeatCore (currentString=<optimized out>, count=<optimized out>, scriptContext=<optimized out>) at ./ChakraCore/lib/Runtime/Library/JavascriptString.cpp:2627 #9 0x000055555940c592 in Js::JavascriptString::EntryRepeat (function=<optimized out>, callInfo=...) at ./ChakraCore/lib/Runtime/Library/JavascriptString.cpp:2607 #10 0x0000555559723c4e in amd64_CallFunction () at ./ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 #11 0x000055555843ceef in Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x7fffffffca60, playout=<optimized out>, function=<optimized out>, flags=<optimized out>, spreadIndices=<optimized out>) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3973 #12 0x000055555843bae9 in Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x7fffffffca60, playout=0x7ffff28f31b2, function=<optimized out>, flags=0, profileId=<optimized out>, inlineCacheIndex=0, spreadIndices=0x0) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:4016 #13 0x0000555557df8817 in Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > const __unaligned*) (this=0x7fffffffca60, playout=0x7ffff28f31b2) at ./ChakraCore/lib/Runtime/./Language/InterpreterStackFrame.h:520 #14 Js::InterpreterStackFrame::ProcessProfiled (this=<optimized out>) at ./ChakraCore/lib/Runtime/Language/InterpreterHandler.inl:91 #15 0x0000555557c426df in Js::InterpreterStackFrame::Process (this=0x7fffffffca60) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3472 #16 0x0000555557c3d150 in Js::InterpreterStackFrame::InterpreterHelper (function=<optimized out>, args=<error reading variable: Cannot access memory at address 0x0>, returnAddress=<optimized out>, addressOfReturnAddress=<optimized out>, asmJsReturn=<optimized out>) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2153 #17 0x0000555557c3a80d in Js::InterpreterStackFrame::InterpreterThunk (layout=0x7ffff26c0fa2) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:1833 #18 0x00007ffff26c0fa2 in ?? () #19 0x00007fffffffcff0 in ?? () #20 0x0000555559723c4e in amd64_CallFunction () at ./ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 Backtrace stopped: frame did not save the PC (gdb) ``` Release ``` (gdb) r poc.js Starting program: ./ChakraCore/out/Release/ch poc.js [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ff7f572f700 (LWP 2758859)] [New Thread 0x7ff7f4eff700 (LWP 2758860)] [New Thread 0x7ff7effff700 (LWP 2758861)] Thread 1 "ch" received signal SIGILL, Illegal instruction. 0x000055555595618f in DebugBreak () at ./ChakraCore/lib/Common/CommonPal.h:161 161 __builtin_trap(); (gdb) bt #0 0x000055555595618f in DebugBreak () at ./ChakraCore/lib/Common/CommonPal.h:161 #1 ReportFatalException (context=<optimized out>, exceptionCode=<optimized out>, reasonCode=<optimized out>, scenario=<optimized out>) at ./ChakraCore/lib/Common/Exceptions/ReportError.cpp:20 #2 0x0000555555956597 in OutOfMemory_unrecoverable_error () at ./ChakraCore/lib/Common/Exceptions/ReportError.cpp:145 #3 0x0000555556abce81 in Js::Exception::RaiseIfScriptActive (scriptContext=0x0, kind=0, returnAddress=0x0) at ./ChakraCore/lib/Runtime/Base/Exception.cpp:20 #4 0x0000555555956af7 in Js::Throw::OutOfMemory () at ./ChakraCore/lib/Common/Exceptions/Throw.cpp:122 #5 0x00005555559fb79e in Memory::Recycler::OutOfMemory (this=0x555557d05b50) at ./ChakraCore/lib/Common/Memory/Recycler.cpp:1423 #6 Memory::Recycler::LargeAlloc<false> (this=0x555557d05b50, heap=0x555557d094f0, size=3221225474, attributes=Memory::LeafBit) at ./ChakraCore/lib/Common/Memory/Recycler.cpp:1384 #7 0x0000555555881758 in Memory::Recycler::RealAlloc<(Memory::ObjectInfoBits)32, false> (this=0x555557d05b50, heap=0x555557d094f0, size=3221225474) at ./ChakraCore/lib/Common/Memory/Recycler.inl:384 #8 0x00005555565a3115 in Memory::Recycler::AllocWithAttributesInlined<(Memory::ObjectInfoBits)32, false> (this=0x555557d05b50, size=<optimized out>) at ./ChakraCore/lib/Common/Memory/Recycler.inl:113 #9 Memory::Recycler::AllocWithAttributes<(Memory::ObjectInfoBits)32, false> (this=0x555557d05b50, size=<optimized out>) at ./ChakraCore/lib/Common/Memory/Recycler.h:1589 #10 Memory::Recycler::AllocLeaf (this=0x555557d05b50, size=<optimized out>) at ./ChakraCore/lib/Common/Memory/Recycler.h:1380 #11 operator new[]<Memory::Recycler> (byteSize=<optimized out>, alloc=0x555557d05b50, AllocFunc=<optimized out>) at ./ChakraCore/lib/Common/DataStructures/../Memory/Allocator.h:498 #12 Memory::AllocateArray<Memory::Recycler, char16_t, false> (allocator=0x555557d05b50, AllocFunc=<optimized out>, count=<optimized out>) at ./ChakraCore/lib/Common/DataStructures/../Memory/Allocator.h:348 #13 Js::JavascriptString::RepeatCore (currentString=<optimized out>, count=536870912, scriptContext=0x555557d2f6b0) at ./ChakraCore/lib/Runtime/Library/JavascriptString.cpp:2627 #14 0x00005555565a5aab in Js::JavascriptString::EntryRepeat (function=<optimized out>, callInfo=...) at ./ChakraCore/lib/Runtime/Library/JavascriptString.cpp:2607 #15 0x00005555566b46fe in amd64_CallFunction () at ./ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 #16 0x0000555555effef7 in Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x7fffffffd8b0, playout=<optimized out>, function=0x7ff7f469fb00, flags=<optimized out>, spreadIndices=0x0) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3973 #17 0x0000555555eff68d in Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (this=0x0, playout=0x7ff7f575ca12, function=<optimized out>, flags=0, profileId=0, inlineCacheIndex=0, spreadIndices=0x0) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:4016 #18 0x0000555555df2490 in Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > >(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > const __unaligned*) (this=0x7fffffffd8b0, playout=0x7ff7f575ca12) at ./ChakraCore/lib/Runtime/./Language/InterpreterStackFrame.h:520 #19 Js::InterpreterStackFrame::ProcessProfiled (this=<optimized out>) at ./ChakraCore/lib/Runtime/Language/InterpreterHandler.inl:91 #20 0x0000555555da1782 in Js::InterpreterStackFrame::Process (this=0x7fffffffd8b0) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:3472 #21 0x0000555555d9fc47 in Js::InterpreterStackFrame::InterpreterHelper (function=<optimized out>, args=<error reading variable: Cannot access memory at address 0x0>, returnAddress=0x7ff7f4650fa2, addressOfReturnAddress=0x7fffffffdb68, asmJsReturn=0x0) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2153 #22 0x0000555555d9ebba in Js::InterpreterStackFrame::InterpreterThunk (layout=0x7fffffffdb80) at ./ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:1833 #23 0x00007ff7f4650fa2 in ?? () #24 0x00007fffffffdb90 in ?? () #25 0x00005555566b46fe in amd64_CallFunction () at ./ChakraCore/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100 Backtrace stopped: frame did not save the PC (gdb) ``` Credits: @Ye0nny, @EJueon of the seclab-yonsei.
Aborted in ReportFatalException (Js::JavascriptString::RepeatCore)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6891/comments
1
2023-04-23T07:46:48Z
2023-05-09T21:42:36Z
https://github.com/chakra-core/ChakraCore/issues/6891
1,679,908,194
6,891
[ "chakra-core", "ChakraCore" ]
Version --- Branch : master Version : https://github.com/chakra-core/ChakraCore/commit/c3ead3f8a6e0bb8e32e043adc091c68cba5935e9 Platform --- Ubuntu 20.04.5 LTS (Linux 5.4.0-144-generic x86_64) Build --- - Address Sanitizer=On - Debug ``` ./build.sh -d --static --sanitize=address ``` PoC --- <details><summary>testcase</summary> <p> ```javascript var t = 0 ; var r = 0 ; class e { static method ( { ... e ] ) { assert . sameValue ( t , 1 ) ; verifyProperty ( e , " v " , { enumerable : true , writable : true , configurable : true , value : 2 } ) ; r = r + 1 ; } static get method ( ) { return this . method ; } } e . method ( { get v ( ) { t ++ ; return 2 ; } } ) ; assert . sameValue ( r , 1 , " method invoked exactly once " ) ; ``` </p> </details> ```javascript // poc.js class e { static method ( { ... e ] ) { } static get method ( ) { return this . method ; } } e . method ( ) ; ``` Execution steps & Output --- ``` $ ./ch poc.js ASSERTION 202349: (./ChakraCore/lib/Parser/Parse.cpp, line 13296) m_token.tk == tkRCurly Failure: (m_token.tk == tkRCurly) Illegal instruction ``` Backtrace --- ``` (gdb) bt #0 0x0000555559e21030 in Parser::ParseDestructuredObjectLiteral<true> (this=<optimized out>, declarationType=<optimized out>, isDecl=true, topLevel=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:13296 #1 0x0000555559e1de52 in Parser::ParseDestructuredLiteral<true> (this=0x7fffffffc7b0, declarationType=tkLET, isDecl=true, topLevel=false, initializerContext=DIC_None, allowIn=true, forInOfOkay=0x0, nativeForOkay=0x0) at ./ChakraCore/lib/Parser/Parse.cpp:13207 #2 0x0000555559d9d220 in Parser::ParseFncFormals<true> (this=<optimized out>, pnodeFnc=<optimized out>, pnodeParentFnc=<optimized out>, flags=<optimized out>, isTopLevelDeferredFunc=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:6920 #3 0x0000555559e40fc3 in Parser::ParseFncDeclHelper<true> (this=<optimized out>, pnodeFnc=<optimized out>, pNameHint=<optimized out>, flags=<optimized out>, fUnaryOrParen=<optimized out>, noStmtContext=<optimized out>, pNeedScanRCurly=<optimized out>, skipFormals=<optimized out>, pFncNamePid=<optimized out>, fAllowIn=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:5840 #4 0x0000555559e3cf9a in Parser::ParseFncDeclInternal<true> (this=<optimized out>, flags=104, pNameHint=<optimized out>, needsPIDOnRCurlyScan=<optimized out>, fUnaryOrParen=<optimized out>, noStmtContext=<optimized out>, superRestrictionState=<optimized out>, fAllowIn=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:5421 #5 0x0000555559df0486 in Parser::ParseFncDeclNoCheckScope<true> (this=0x7fffffffc7b0, flags=104, superRestrictionState=SuperRestrictionState::PropertyAllowed, pNameHint=0x621000005e52 u"method", needsPIDOnRCurlyScan=true, fUnaryOrParen=false, fAllowIn=true) at ./ChakraCore/lib/Parser/Parse.cpp:5327 #6 0x0000555559dfd4cf in Parser::ParseClassDecl<true> (this=<optimized out>, isDeclaration=<optimized out>, pNameHint=<optimized out>, pHintLength=<optimized out>, pShortNameOffset=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:8152 #7 0x0000555559e0578e in Parser::ParseStatement<true> (this=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:10251 #8 0x0000555559d98511 in Parser::ParseStmtList<true> (this=0x7fffffffc7b0, ppnodeList=<optimized out>, pppnodeLast=<optimized out>, smEnvironment=<optimized out>, isSourceElementList=<optimized out>, strictModeOn=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:11504 #9 0x0000555559d17284 in Parser::Parse (this=<optimized out>, pszSrc=<optimized out>, offset=<optimized out>, length=<optimized out>, charOffset=<optimized out>, isUtf8=<optimized out>, grfscr=<optimized out>, lineNumber=<optimized out>, nextFunctionId=<optimized out>, pse=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:12125 #10 0x0000555559d13e13 in Parser::ParseSourceInternal (this=<optimized out>, parseTree=0x7fffffffc540, pszSrc=<optimized out>, offsetInBytes=<optimized out>, encodedCharCount=<optimized out>, offsetInChars=<optimized out>, isUtf8=<optimized out>, grfscr=<optimized out>, pse=<optimized out>, nextFunctionId=<optimized out>, lineNumber=<optimized out>, sourceContextInfo=<optimized out>) at ./ChakraCore/lib/Parser/Parse.cpp:507 #11 0x0000555559d675f4 in Parser::ParseUtf8Source (this=0x7fffffffc7b0, parseTree=0x7fffffffc540, pSrc=0x60c000000040 "class e { \n\tstatic method ( { ... e ] ) { } \n\tstatic get method ( ) { return this . method ; } \n} \ne . method ( ) ; \n", length=117, grfsrc=4112, pse=0x7fffffffd710, nextFunctionId=0x7ffff2842304, sourceContextInfo=0x7ffff2842300) at ./ChakraCore/lib/Parser/Parse.cpp:12347 #12 0x00005555570bba18 in Js::ScriptContext::ParseScript (this=<optimized out>, parser=<optimized out>, script=<optimized out>, cb=<optimized out>, pSrcInfo=<optimized out>, pse=<optimized out>, ppSourceInfo=<optimized out>, rootDisplayName=<optimized out>, loadScriptFlag=<optimized out>, sourceIndex=<optimized out>, scriptSource=<optimized out>) at ./ChakraCore/lib/Runtime/Base/ScriptContext.cpp:2090 #13 0x00005555570c08d0 in Js::ScriptContext::LoadScriptInternal (this=<optimized out>, parser=<optimized out>, script=<optimized out>, cb=<optimized out>, pSrcInfo=<optimized out>, pse=<optimized out>, ppSourceInfo=<optimized out>, rootDisplayName=<optimized out>, loadScriptFlag=<optimized out>, scriptSource=<optimized out>) at ./ChakraCore/lib/Runtime/Base/ScriptContext.cpp:2553 #14 0x00005555570c1f52 in Js::ScriptContext::LoadScript (this=0x622000000158, script=<optimized out>, cb=<optimized out>, pSrcInfo=<optimized out>, pse=<optimized out>, ppSourceInfo=<optimized out>, rootDisplayName=<optimized out>, loadScriptFlag=<optimized out>, scriptSource=<optimized out>) at ./ChakraCore/lib/Runtime/Base/ScriptContext.cpp:2601 #15 0x00005555567a29e3 in RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const (this=<optimized out>, scriptContext=<optimized out>, _actionEntryPopper=...) at ./ChakraCore/lib/Jsrt/Jsrt.cpp:3611 #16 ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84, bool, bool)::{lambda(Js::ScriptContext*)#1}::operator()(Js::ScriptContext*) const (this=<optimized out>, scriptContext=<optimized out>) at ./ChakraCore/lib/Jsrt/JsrtInternal.h:316 #17 ContextAPINoScriptWrapper_Core<ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84, bool, bool)::{lambda(Js::ScriptContext*)#1}>(ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84, bool, bool)::{lambda(Js::ScriptContext*)#1}, bool, bool) (fn=..., allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false) at ./ChakraCore/lib/Jsrt/JsrtInternal.h:277 #18 ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_84, bool, bool) (fn=..., allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false) at ./ChakraCore/lib/Jsrt/JsrtInternal.h:314 #19 RunScriptCore (scriptSource=<optimized out>, script=<optimized out>, cb=<optimized out>, loadScriptFlag=<optimized out>, sourceContext=<optimized out>, sourceUrl=<optimized out>, parseOnly=<optimized out>, parseAttributes=<optimized out>, isSourceModule=<optimized out>, result=<optimized out>) at ./ChakraCore/lib/Jsrt/Jsrt.cpp:3555 #20 0x00005555567c7eee in CompileRun (scriptVal=0x7ffff2844000, sourceContext=140737353891840, sourceUrl=0x7ffff26e1090, parseAttributes=JsParseScriptAttributeNone, result=0x0, parseOnly=false) at ./ChakraCore/lib/Jsrt/Jsrt.cpp:5019 #21 JsRun (scriptVal=<optimized out>, sourceContext=<optimized out>, sourceUrl=<optimized out>, parseAttributes=<optimized out>, result=<optimized out>) at ./ChakraCore/lib/Jsrt/Jsrt.cpp:5041 #22 0x000055555640d8fd in ChakraRTInterface::JsRun (script=0x0, sourceContext=0, sourceUrl=0x10007fff7e00, parseAttributes=JsParseScriptAttributeNone, result=0x0) at ./ChakraCore/bin/ch/ChakraRtInterface.h:487 #23 RunScript (fileName=<optimized out>, fileContents=<optimized out>, fileLength=<optimized out>, fileContentsFinalizeCallback=<optimized out>, bufferValue=<optimized out>, fullPath=<optimized out>, parserStateCache=<optimized out>) at ./ChakraCore/bin/ch/ch.cpp:451 #24 0x0000555556413102 in ExecuteTest (fileName=<optimized out>) at ./ChakraCore/bin/ch/ch.cpp:917 #25 0x0000555556413905 in ExecuteTestWithMemoryCheck (fileName=0x0) at ./ChakraCore/bin/ch/ch.cpp:967 #26 0x0000555556414fcc in main (argc=<optimized out>, c_argv=<optimized out>) at ./ChakraCore/bin/ch/ch.cpp:1274 ``` Credits: @Ye0nny, @EJueon of the seclab-yonsei.
Assertion Failure : m_token.tk == tkRCurly in ChakraCore/lib/Parser/Parse.cpp, line 13296
https://api.github.com/repos/chakra-core/ChakraCore/issues/6890/comments
0
2023-04-23T06:41:08Z
2023-05-09T21:38:30Z
https://github.com/chakra-core/ChakraCore/issues/6890
1,679,885,670
6,890
[ "chakra-core", "ChakraCore" ]
null
Support building with CMake and MSYS2 on Windows
https://api.github.com/repos/chakra-core/ChakraCore/issues/6889/comments
1
2023-04-23T03:42:08Z
2023-06-14T23:42:18Z
https://github.com/chakra-core/ChakraCore/issues/6889
1,679,841,714
6,889
[ "chakra-core", "ChakraCore" ]
Branch: `master` Commit: `cbb9b101d18e4c1682ca39a52a201d8e4241ea17` POC is: ``` let xxx = new Uint32Array(0x10000); xxx.slice = Array.prototype.slice; function jit(arr, index){ let ut = arr.slice(0,0); //become definite Uint32Array but |arr| is a VirtualUint32Array for(let i = 0; i < (i + 4); i++){ arr[i] = 0; //will be crash at |Op_memset| } } for(let i = 0;i < 0x10000; i++){ jit(xxx, 2); } if (xxx[0] === 0) { WScript.Echo('pass'); } ``` In release build ` ./build.sh --sanitize=address --static -j` I get ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==10375==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x5654a00b501f bp 0x7f2732ef76b0 sp 0x7f2732ef75a0 T2) ==10375==The signal is caused by a READ memory access. ==10375==Hint: address points to the zero page. #0 0x5654a00b501e in BackwardPass::IsEmptyLoopAfterMemOp(Loop*) (/root/ChakraCore-latest/out/Release/ch+0x1dff01e) #1 0x5654a005db67 in BackwardPass::Optimize() (/root/ChakraCore-latest/out/Release/ch+0x1da7b67) #2 0x56549fbbc9dc in GlobOpt::BackwardPass(Js::Phase) (/root/ChakraCore-latest/out/Release/ch+0x19069dc) #3 0x56549fbbd3e1 in GlobOpt::Optimize() (/root/ChakraCore-latest/out/Release/ch+0x19073e1) #4 0x56549fba4d16 in Func::TryCodegen() (/root/ChakraCore-latest/out/Release/ch+0x18eed16) #5 0x56549fba43c0 in Func::Codegen(Memory::JitArenaAllocator*, JITTimeWorkItem*, ThreadContextInfo*, ScriptContextInfo*, JITOutputIDL*, Js::EntryPointInfo*, FunctionJITRuntimeInfo const*, JITTimePolymorphicInlineCacheInfo*, void*, Js::ScriptContextProfiler*, bool) (/root/ChakraCore-latest/out/Release/ch+0x18ee3c0) #6 0x56549fa1fbd8 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBase<Memory::VirtualAllocWrapper>, Memory::PageSegmentBase<Memory::VirtualAllocWrapper> >*, CodeGenWorkItemIDL*, JITOutputIDL&, bool, Js::EntryPointInfo*) (/root/ChakraCore-latest/out/Release/ch+0x1769bd8) #7 0x56549fa20350 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBase<Memory::VirtualAllocWrapper>, Memory::PageSegmentBase<Memory::VirtualAllocWrapper> >*, CodeGenWorkItem*, bool) (/root/ChakraCore-latest/out/Release/ch+0x176a350) #8 0x56549fa21f5d in NativeCodeGenerator::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) (/root/ChakraCore-latest/out/Release/ch+0x176bf5d) #9 0x56549fa551a3 in JsUtil::BackgroundJobProcessor::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) (/root/ChakraCore-latest/out/Release/ch+0x179f1a3) #10 0x56549fa55500 in JsUtil::BackgroundJobProcessor::Run(JsUtil::ParallelThreadData*) (/root/ChakraCore-latest/out/Release/ch+0x179f500) #11 0x56549fa511c1 in JsUtil::BackgroundJobProcessor::StaticThreadProc(void*) (/root/ChakraCore-latest/out/Release/ch+0x179b1c1) #12 0x56549e7391e8 in CorUnix::CPalThread::ThreadEntry(void*) (/root/ChakraCore-latest/out/Release/ch+0x4831e8) #13 0x56549e63a85e in __asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*) (/root/ChakraCore-latest/out/Release/ch+0x38485e) #14 0x7f2f3978c6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da) #15 0x7f2f38af361e in clone (/lib/x86_64-linux-gnu/libc.so.6+0x12161e) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/root/ChakraCore-latest/out/Release/ch+0x1dff01e) in BackwardPass::IsEmptyLoopAfterMemOp(Loop*) Thread T2 created by T0 here: #0 0x56549e585e00 in pthread_create (/root/ChakraCore-latest/out/Release/ch+0x2cfe00) #1 0x56549e738101 in CorUnix::InternalCreateThread(CorUnix::CPalThread*, _SECURITY_ATTRIBUTES*, unsigned int, unsigned int (*)(void*), void*, unsigned int, CorUnix::PalThreadType, unsigned int*, void**) (/root/ChakraCore-latest/out/Release/ch+0x482101) #2 0x56549e737aea in CreateThread (/root/ChakraCore-latest/out/Release/ch+0x481aea) #3 0x56549fa509ce in JsUtil::BackgroundJobProcessor::InitializeParallelThreadData(AllocationPolicyManager*, bool) (/root/ChakraCore-latest/out/Release/ch+0x179a9ce) #4 0x56549fa51ac8 in JsUtil::BackgroundJobProcessor::BackgroundJobProcessor(AllocationPolicyManager*, JsUtil::ThreadService*, bool) (/root/ChakraCore-latest/out/Release/ch+0x179bac8) #5 0x56549ea0b911 in ThreadContext::GetJobProcessor() (/root/ChakraCore-latest/out/Release/ch+0x755911) #6 0x56549fa1c428 in NativeCodeGenerator::NativeCodeGenerator(Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0x1766428) #7 0x56549fa13ac8 in NewNativeCodeGenerator(Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0x175dac8) #8 0x56549e9c6386 in Js::ScriptContext::Initialize() (/root/ChakraCore-latest/out/Release/ch+0x710386) #9 0x56549e84d622 in JsrtContextCore::EnsureScriptContext() (/root/ChakraCore-latest/out/Release/ch+0x597622) #10 0x56549e84d335 in JsrtContextCore::New(JsrtRuntime*) (/root/ChakraCore-latest/out/Release/ch+0x597335) #11 0x56549e7401bd in CreateContextCore(void*, TTD::TTDJsRTActionResultAutoRecorder&, bool, bool, bool, void**) (/root/ChakraCore-latest/out/Release/ch+0x48a1bd) #12 0x56549e743569 in JsCreateContext (/root/ChakraCore-latest/out/Release/ch+0x48d569) #13 0x56549e66d2db in ExecuteTest(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3b72db) #14 0x56549e66e606 in main (/root/ChakraCore-latest/out/Release/ch+0x3b8606) #15 0x7f2f389f3c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) ==10375==ABORTING ```
SEGV on unknown address 0x000000000000
https://api.github.com/repos/chakra-core/ChakraCore/issues/6888/comments
1
2023-04-09T04:55:55Z
2023-04-21T02:47:23Z
https://github.com/chakra-core/ChakraCore/issues/6888
1,659,749,340
6,888
[ "chakra-core", "ChakraCore" ]
Branch: `master` Commit: `cbb9b101d18e4c1682ca39a52a201d8e4241ea17` POC is: ``` async function f1() { await null; throw WScript.f2a(f1()); } f1(); async function f2() { async function f2a() { throw "err"; } async function f2b() { try { var p = f2a(); } catch (e) { console.log("caught " + e); } } async function f2c() { var p = f2a(); } f2b(); f2c(); } f2(); ``` In release build `./build.sh --sanitize=address --static -j` I get: ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==10354==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000020 (pc 0x55d5e2d0b000 bp 0x7ffd7e5a66e0 sp 0x7ffd7e5a66e0 T0) ==10354==The signal is caused by a READ memory access. ==10354==Hint: address points to the zero page. #0 0x55d5e2d0afff in Js::EntryPointInfo::HasInlinees() (/root/ChakraCore-latest/out/Release/ch+0x6e3fff) #1 0x55d5e343229f in Js::InlinedFrameWalker::FromPhysicalFrame(Js::InlinedFrameWalker&, Js::Amd64StackFrame&, Js::ScriptFunction*, bool, int, Js::JavascriptStackWalker const*, bool, bool) (/root/ChakraCore-latest/out/Release/ch+0xe0b29f) #2 0x55d5e34333d4 in Js::JavascriptStackWalker::UpdateFrame(bool) (/root/ChakraCore-latest/out/Release/ch+0xe0c3d4) #3 0x55d5e342e90f in Js::JavascriptStackWalker::Walk(bool) (/root/ChakraCore-latest/out/Release/ch+0xe0790f) #4 0x55d5e343537e in Js::JavascriptStackWalker::GetCaller(Js::JavascriptFunction**, bool) (/root/ChakraCore-latest/out/Release/ch+0xe0e37e) #5 0x55d5e3435f56 in Js::JavascriptStackWalker::GetCaller(Js::JavascriptFunction**, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xe0ef56) #6 0x55d5e33dfe6d in Js::JavascriptOperators::PatchGetMethodFromObject(void*, Js::RecyclableObject*, int, Js::PropertyValueInfo*, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xdb8e6d) #7 0x55d5e33dfaf7 in Js::JavascriptOperators::PatchGetMethodNoFastPath(Js::FunctionBody*, Js::InlineCache*, unsigned int, void*, int) (/root/ChakraCore-latest/out/Release/ch+0xdb8af7) #8 0x55d5e3450c85 in void* Js::ProfilingHelpers::ProfiledLdFld<false, true, false>(void*, int, Js::InlineCache*, unsigned int, Js::FunctionBody*, void*) (/root/ChakraCore-latest/out/Release/ch+0xe29c85) #9 0x55d5e3127bcf in Js::InterpreterStackFrame::ProcessProfiled() (/root/ChakraCore-latest/out/Release/ch+0xb00bcf) #10 0x55d5e30791dd in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa521dd) #11 0x55d5e307756f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #12 0x55d5e30768ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #13 0x7f6f2c750f99 (<unknown module>) #14 0x55d5e3961ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #15 0x55d5e35ed2d5 in Js::JavascriptGenerator::CallGenerator(void*, Js::ResumeYieldKind) (/root/ChakraCore-latest/out/Release/ch+0xfc62d5) #16 0x55d5e35ac1dc in Js::JavascriptAsyncFunction::AsyncSpawnStep(Js::JavascriptAsyncSpawnStepFunction*, Js::JavascriptGenerator*, void*, void*) (/root/ChakraCore-latest/out/Release/ch+0xf851dc) #17 0x55d5e35ac9eb in Js::JavascriptAsyncFunction::EntryAsyncSpawnCallStepFunction(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xf859eb) #18 0x55d5e381e5ee in Js::JavascriptPromise::EntryReactionTaskFunction(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x11f75ee) #19 0x55d5e3961ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #20 0x55d5e35dda61 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb6a61) #21 0x55d5e35dd72f in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb672f) #22 0x55d5e2ad675a in JsCallFunction (/root/ChakraCore-latest/out/Release/ch+0x4af75a) #23 0x55d5e29feb1a in WScriptJsrt::CallbackMessage::CallFunction(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3d7b1a) #24 0x55d5e29db804 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) (/root/ChakraCore-latest/out/Release/ch+0x3b4804) #25 0x55d5e29de913 in ExecuteTest(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3b7913) #26 0x55d5e29df606 in main (/root/ChakraCore-latest/out/Release/ch+0x3b8606) #27 0x7f6f30c78c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #28 0x55d5e28ddd59 in _start (/root/ChakraCore-latest/out/Release/ch+0x2b6d59) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/root/ChakraCore-latest/out/Release/ch+0x6e3fff) in Js::EntryPointInfo::HasInlinees() ==10354==ABORTING ```
SEGV (/root/ChakraCore-latest/out/Release/ch+0x6e3fff) in Js::EntryPointInfo::HasInlinees()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6887/comments
2
2023-04-09T03:34:13Z
2023-04-21T02:46:29Z
https://github.com/chakra-core/ChakraCore/issues/6887
1,659,734,429
6,887
[ "chakra-core", "ChakraCore" ]
Branch: `master` Commit: `cbb9b101d18e4c1682ca39a52a201d8e4241ea17` POC is: ``` function attach(f) { (function (r) { WScript.Attach(r); })(f); } async function mainTest(notAttachCall) { if (notAttachCall) { for (let i = 0; i < 1; []) { await attach(mainTest); } } else { var i = 10;/**bp:locals()**/ } } mainTest(true); WScript.Echo("PASSED"); ``` In release build, `./build.sh --sanitize=address --static -j` I get: ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==10344==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55cae7e6e8a6 bp 0x7ffe4b5e4470 sp 0x7ffe4b5e4440 T0) ==10344==The signal is caused by a READ memory access. ==10344==Hint: address points to the zero page. #0 0x55cae7e6e8a5 in Js::ProfilingHelpers::ProfiledNewScArray(unsigned int, Js::FunctionBody*, unsigned short) (/root/ChakraCore-latest/out/Release/ch+0xe248a5) #1 0x55cae7ac0ca8 in Js::InterpreterStackFrame::ProcessWithDebugging() (/root/ChakraCore-latest/out/Release/ch+0xa76ca8) #2 0x55cae7a9bb77 in Js::InterpreterStackFrame::DebugProcess() (/root/ChakraCore-latest/out/Release/ch+0xa51b77) #3 0x55cae7a9a981 in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa50981) #4 0x55cae7a998ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #5 0x7f6a4d020f99 (<unknown module>) #6 0x55cae8384ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #7 0x55cae776965a in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f65a) #8 0x55cae8384ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #9 0x55cae80102d5 in Js::JavascriptGenerator::CallGenerator(void*, Js::ResumeYieldKind) (/root/ChakraCore-latest/out/Release/ch+0xfc62d5) #10 0x55cae8384ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #11 0x55cae7769446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #12 0x55cae7fcf1dc in Js::JavascriptAsyncFunction::AsyncSpawnStep(Js::JavascriptAsyncSpawnStepFunction*, Js::JavascriptGenerator*, void*, void*) (/root/ChakraCore-latest/out/Release/ch+0xf851dc) #13 0x55cae7fcf9eb in Js::JavascriptAsyncFunction::EntryAsyncSpawnCallStepFunction(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xf859eb) #14 0x55cae8384ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #15 0x55cae7769446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #16 0x55cae82415ee in Js::JavascriptPromise::EntryReactionTaskFunction(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x11f75ee) #17 0x55cae8384ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #18 0x55cae776b31a in Js::ScriptContext::ProfileModeThunk_DebugModeWrapper(Js::JavascriptFunction*, Js::ScriptContext*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments&) (/root/ChakraCore-latest/out/Release/ch+0x72131a) #19 0x55cae776936d in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f36d) #20 0x55cae8384ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #21 0x55cae8000a61 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb6a61) #22 0x55cae800072f in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb672f) #23 0x55cae74f975a in JsCallFunction (/root/ChakraCore-latest/out/Release/ch+0x4af75a) #24 0x55cae7421b1a in WScriptJsrt::CallbackMessage::CallFunction(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3d7b1a) #25 0x55cae73fe804 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) (/root/ChakraCore-latest/out/Release/ch+0x3b4804) #26 0x55cae7401913 in ExecuteTest(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3b7913) #27 0x55cae7402606 in main (/root/ChakraCore-latest/out/Release/ch+0x3b8606) #28 0x7f6a5151cc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #29 0x55cae7300d59 in _start (/root/ChakraCore-latest/out/Release/ch+0x2b6d59) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/root/ChakraCore-latest/out/Release/ch+0xe248a5) in Js::ProfilingHelpers::ProfiledNewScArray(unsigned int, Js::FunctionBody*, unsigned short) ==10344==ABORTING ```
SEGV (/root/ChakraCore-latest/out/Release/ch+0xe248a5) in Js::ProfilingHelpers::ProfiledNewScArray(unsigned int, Js::FunctionBody*, unsigned short)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6886/comments
1
2023-04-09T03:28:26Z
2023-04-21T02:41:02Z
https://github.com/chakra-core/ChakraCore/issues/6886
1,659,733,406
6,886
[ "chakra-core", "ChakraCore" ]
Branch: `master` Commit: `cbb9b101d18e4c1682ca39a52a201d8e4241ea17` POC: ``` function Run() { function f1() { var m = 31; m++; var coll = new Intl.Collator(); m += f2(); return m; } function f2() { return 100; } function test6() { var formatter = new Intl.NumberFormat("en-US");/**bp:locals();resume('step_over');locals();resume('step_into');locals();stack();resume('step_out');locals();stack();**/ try { throw -1; } catch { // catch scope let b = 2; (function g() { var c = 3; a; b; c; /**bp:locals(1)**/ })(); } formatter; formatter = new Intl.NumberFormat("en-US"); /**bp:locals();resume('step_into');locals();**/ } test6(); function test8() { function test7() { var d = new Date(2013, 1, 1); [d.toLocaleString].every(function (f) { f; /**bp:resume('step_out');locals();stack()**/ return f; }); return d; } test7(); /**bp:locals();resume('step_into');locals();removeExpr()**/ } test8(); function test9() { var k = 10; function test10 () { var k1 = 10; /**bp:locals()**/ return k1; } k+= test10(); /**bp:resume('step_over');**/ } test9(); WScript.Echo("Pass"); } WScript.Attach(Run); ``` Error info: ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==10311==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x55570e6a7ab0 bp 0x7ffc8f8a7a70 sp 0x7ffc8f8a79a0 T0) ==10311==The signal is caused by a READ memory access. ==10311==Hint: address points to the zero page. #0 0x55570e6a7aaf in Js::DiagScopeVariablesWalker::GetChildrenCount() (/root/ChakraCore-latest/out/Release/ch+0x8bcaaf) #1 0x55570e6adb4c in Js::LocalsWalker::GetChildrenCount() (/root/ChakraCore-latest/out/Release/ch+0x8c2b4c) #2 0x55570e2e47ca in JsrtDebuggerStackFrame::GetLocalsObject(Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0x4f97ca) #3 0x55570e3767f5 in JsDiagGetStackProperties (/root/ChakraCore-latest/out/Release/ch+0x58b7f5) #4 0x55570e1a596b in Debugger::GetStackProperties(void*, bool, void**, unsigned short, void*) (/root/ChakraCore-latest/out/Release/ch+0x3ba96b) #5 0x55570ed9bf61 in Js::JavascriptExternalFunction::StdCallExternalFunctionThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb0f61) #6 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #7 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #8 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #9 0x55570edade91 in void* Js::JavascriptFunction::CalloutHelper<false>(Js::RecyclableObject*, void*, void*, void*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xfc2e91) #10 0x55570eda04ef in Js::JavascriptFunction::EntryApply(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb54ef) #11 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #12 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #13 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #14 0x55570eb47385 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5c385) #15 0x55570eb46de1 in void Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5bde1) #16 0x55570e8e92d9 in Js::InterpreterStackFrame::ProcessProfiled() (/root/ChakraCore-latest/out/Release/ch+0xafe2d9) #17 0x55570e83d1dd in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa521dd) #18 0x55570e83b56f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #19 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #20 0x7f2e8c681f41 (<unknown module>) #21 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #22 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #23 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #24 0x55570eb449c5 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd599c5) #25 0x55570eb44421 in void Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd59421) #26 0x55570e8e9dd8 in Js::InterpreterStackFrame::ProcessProfiled() (/root/ChakraCore-latest/out/Release/ch+0xafedd8) #27 0x55570e83d1dd in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa521dd) #28 0x55570e83b56f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #29 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #30 0x7f2e8c681eb9 (<unknown module>) #31 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #32 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #33 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #34 0x55570edade91 in void* Js::JavascriptFunction::CalloutHelper<false>(Js::RecyclableObject*, void*, void*, void*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xfc2e91) #35 0x55570eda04ef in Js::JavascriptFunction::EntryApply(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb54ef) #36 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #37 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #38 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #39 0x55570eb47385 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5c385) #40 0x55570e877d79 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8cd79) #41 0x55570e83d24a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #42 0x55570e83b56f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #43 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #44 0x7f2e8c681ef1 (<unknown module>) #45 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #46 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #47 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #48 0x55570eb44b55 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd59b55) #49 0x55570e878893 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8d893) #50 0x55570e83d24a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #51 0x55570e83b56f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #52 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #53 0x7f2e8c681f01 (<unknown module>) #54 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #55 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #56 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #57 0x55570edade91 in void* Js::JavascriptFunction::CalloutHelper<false>(Js::RecyclableObject*, void*, void*, void*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xfc2e91) #58 0x55570eda04ef in Js::JavascriptFunction::EntryApply(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb54ef) #59 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #60 0x55570e50a446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #61 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #62 0x55570eb47385 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5c385) #63 0x55570e877d79 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8cd79) #64 0x55570e83d24a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #65 0x55570e83b56f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #66 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #67 0x7f2e8c681f09 (<unknown module>) #68 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #69 0x55570e50c31a in Js::ScriptContext::ProfileModeThunk_DebugModeWrapper(Js::JavascriptFunction*, Js::ScriptContext*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments&) (/root/ChakraCore-latest/out/Release/ch+0x72131a) #70 0x55570e50a36d in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f36d) #71 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #72 0x55570eda1a61 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb6a61) #73 0x55570eda172f in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb672f) #74 0x55570e29a75a in JsCallFunction (/root/ChakraCore-latest/out/Release/ch+0x4af75a) #75 0x55570e1a7c15 in Debugger::CallFunction(char const*, void**, void*, void*) (/root/ChakraCore-latest/out/Release/ch+0x3bcc15) #76 0x55570e1a4319 in Debugger::HandleDebugEvent(_JsDiagDebugEvent, void*) (/root/ChakraCore-latest/out/Release/ch+0x3b9319) #77 0x55570e2d9d20 in JsrtDebugManager::CallDebugEventCallback(_JsDiagDebugEvent, Js::DynamicObject*, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0x4eed20) #78 0x55570e2daf0a in JsrtDebugManager::CallDebugEventCallbackForBreak(_JsDiagDebugEvent, Js::DynamicObject*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0x4eff0a) #79 0x55570e2d87c3 in JsrtDebugManager::ReportBreak(Js::InterpreterHaltState*) (/root/ChakraCore-latest/out/Release/ch+0x4ed7c3) #80 0x55570e2d82a5 in JsrtDebugManager::DispatchHalt(Js::InterpreterHaltState*) (/root/ChakraCore-latest/out/Release/ch+0x4ed2a5) #81 0x55570e6e3dc9 in Js::ProbeContainer::DispatchStepHandler(Js::InterpreterHaltState*, Js::OpCode*) (/root/ChakraCore-latest/out/Release/ch+0x8f8dc9) #82 0x55570e8562a0 in Js::InterpreterStackFrame::ProcessWithDebugging() (/root/ChakraCore-latest/out/Release/ch+0xa6b2a0) #83 0x55570e83cb77 in Js::InterpreterStackFrame::DebugProcess() (/root/ChakraCore-latest/out/Release/ch+0xa51b77) #84 0x55570e8f9670 in Js::InterpreterStackFrame::OP_TryCatch(Js::OpLayoutBr const __unaligned*) (/root/ChakraCore-latest/out/Release/ch+0xb0e670) #85 0x55570e862238 in Js::InterpreterStackFrame::ProcessWithDebugging() (/root/ChakraCore-latest/out/Release/ch+0xa77238) #86 0x55570e83cb77 in Js::InterpreterStackFrame::DebugProcess() (/root/ChakraCore-latest/out/Release/ch+0xa51b77) #87 0x55570e83b981 in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa50981) #88 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #89 0x7f2e8c680f91 (<unknown module>) #90 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #91 0x55570e50a65a in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f65a) #92 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #93 0x55570eb44b55 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd59b55) #94 0x55570eb44421 in void Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd59421) #95 0x55570e85a174 in Js::InterpreterStackFrame::ProcessWithDebugging() (/root/ChakraCore-latest/out/Release/ch+0xa6f174) #96 0x55570e83cb77 in Js::InterpreterStackFrame::DebugProcess() (/root/ChakraCore-latest/out/Release/ch+0xa51b77) #97 0x55570e83b981 in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa50981) #98 0x55570e83a8ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #99 0x7f2e8c680f99 (<unknown module>) #100 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #101 0x55570e50a65a in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f65a) #102 0x55570f125ffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #103 0x55570eda1a61 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb6a61) #104 0x55570eda172f in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb672f) #105 0x55570e29a75a in JsCallFunction (/root/ChakraCore-latest/out/Release/ch+0x4af75a) #106 0x55570e1c2b1a in WScriptJsrt::CallbackMessage::CallFunction(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3d7b1a) #107 0x55570e1c5e0b in CustomMessage<WScriptJsrt::AttachCallback(void*, bool, void**, unsigned short, void*)::$_1, WScriptJsrt::CallbackMessage>::Call(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3dae0b) #108 0x55570e19f804 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) (/root/ChakraCore-latest/out/Release/ch+0x3b4804) #109 0x55570e1a2913 in ExecuteTest(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3b7913) #110 0x55570e1a3606 in main (/root/ChakraCore-latest/out/Release/ch+0x3b8606) #111 0x7f2e90b81c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #112 0x55570e0a1d59 in _start (/root/ChakraCore-latest/out/Release/ch+0x2b6d59) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/root/ChakraCore-latest/out/Release/ch+0x8bcaaf) in Js::DiagScopeVariablesWalker::GetChildrenCount() ==10311==ABORTING ```
SEGV (/root/ChakraCore-latest/out/Release/ch+0x8bcaaf) in Js::DiagScopeVariablesWalker::GetChildrenCount()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6885/comments
1
2023-04-09T03:16:59Z
2023-04-21T02:42:47Z
https://github.com/chakra-core/ChakraCore/issues/6885
1,659,731,495
6,885
[ "chakra-core", "ChakraCore" ]
Branch: `master` Commit : `cbb9b101d18e4c1682ca39a52a201d8e4241ea17` POC : ``` function Run() { var intl = new Intl.Collator(); intl.compare('a','b');/**bp:resume('step_into');locals()**/ let C1 = class NotC1 { attemptOuterBindingChange() { C1 = 1; } attemptInnerBindingChange() { NotC1 = 1; } outerbindingUnmodified() { return C1 !== 1; } innerbindingUnmodified() { return NotC1 !== 1; } }.Echo('PASS'); } WScript.Attach(Run); ``` In release build, `./build.sh --sanitize=address --static -j` I get the following log: ``` ==10284==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 0x7ffcceecb558 at pc 0x55bf9a7362b3 bp 0x7ffcceec3300 sp 0x7ffcceec32f8 READ of size 8 at 0x7ffcceecb558 thread T0 #0 0x55bf9a7362b2 in Js::ScopeSlots::IsDebuggerScopeSlotArray() (/root/ChakraCore-latest/out/Release/ch+0x6d42b2) #1 0x55bf9a918523 in Js::SlotArrayVariablesWalker::PopulateMembers() (/root/ChakraCore-latest/out/Release/ch+0x8b6523) #2 0x55bf9a916f14 in Js::VariableWalkerBase::GetChildrenCount() (/root/ChakraCore-latest/out/Release/ch+0x8b4f14) #3 0x55bf9a91ed1a in Js::DiagScopeVariablesWalker::GetChildrenCount() (/root/ChakraCore-latest/out/Release/ch+0x8bcd1a) #4 0x55bf9a924b4c in Js::LocalsWalker::GetChildrenCount() (/root/ChakraCore-latest/out/Release/ch+0x8c2b4c) #5 0x55bf9a55b7ca in JsrtDebuggerStackFrame::GetLocalsObject(Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0x4f97ca) #6 0x55bf9a5ed7f5 in JsDiagGetStackProperties (/root/ChakraCore-latest/out/Release/ch+0x58b7f5) #7 0x55bf9a41c96b in Debugger::GetStackProperties(void*, bool, void**, unsigned short, void*) (/root/ChakraCore-latest/out/Release/ch+0x3ba96b) #8 0x55bf9b012f61 in Js::JavascriptExternalFunction::StdCallExternalFunctionThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb0f61) #9 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #10 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #11 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #12 0x55bf9b024e91 in void* Js::JavascriptFunction::CalloutHelper<false>(Js::RecyclableObject*, void*, void*, void*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xfc2e91) #13 0x55bf9b0174ef in Js::JavascriptFunction::EntryApply(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb54ef) #14 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #15 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #16 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #17 0x55bf9adbe385 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5c385) #18 0x55bf9adbdde1 in void Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, unsigned short, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5bde1) #19 0x55bf9ab602d9 in Js::InterpreterStackFrame::ProcessProfiled() (/root/ChakraCore-latest/out/Release/ch+0xafe2d9) #20 0x55bf9aab41dd in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa521dd) #21 0x55bf9aab256f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #22 0x55bf9aab18ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #23 0x7f43138e1f41 (<unknown module>) #24 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #25 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #26 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #27 0x55bf9adbb9c5 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd599c5) #28 0x55bf9aaef893 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8d893) #29 0x55bf9aab424a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #30 0x55bf9aab256f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #31 0x55bf9aab18ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #32 0x7f43138e1eb9 (<unknown module>) #33 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #34 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #35 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #36 0x55bf9b024e91 in void* Js::JavascriptFunction::CalloutHelper<false>(Js::RecyclableObject*, void*, void*, void*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xfc2e91) #37 0x55bf9b0174ef in Js::JavascriptFunction::EntryApply(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb54ef) #38 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #39 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #40 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #41 0x55bf9adbe385 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5c385) #42 0x55bf9aaeed79 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8cd79) #43 0x55bf9aab424a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #44 0x55bf9aab256f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #45 0x55bf9aab18ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #46 0x7f43138e1ef1 (<unknown module>) #47 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #48 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #49 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #50 0x55bf9adbbb55 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallI<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd59b55) #51 0x55bf9aaef893 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8d893) #52 0x55bf9aab424a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #53 0x55bf9aab256f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #54 0x55bf9aab18ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #55 0x7f43138e1f01 (<unknown module>) #56 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #57 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #58 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #59 0x55bf9b024e91 in void* Js::JavascriptFunction::CalloutHelper<false>(Js::RecyclableObject*, void*, void*, void*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0xfc2e91) #60 0x55bf9b0174ef in Js::JavascriptFunction::EntryApply(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0xfb54ef) #61 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #62 0x55bf9a781446 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f446) #63 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #64 0x55bf9adbe385 in void Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned>(Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<(Js::LayoutSize)0> > > __unaligned const __unaligned*, Js::RecyclableObject*, unsigned int, Js::AuxArray<unsigned int> const*) (/root/ChakraCore-latest/out/Release/ch+0xd5c385) #65 0x55bf9aaeed79 in Js::InterpreterStackFrame::ProcessUnprofiled() (/root/ChakraCore-latest/out/Release/ch+0xa8cd79) #66 0x55bf9aab424a in Js::InterpreterStackFrame::Process() (/root/ChakraCore-latest/out/Release/ch+0xa5224a) #67 0x55bf9aab256f in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa5056f) #68 0x55bf9aab18ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #69 0x7f43138e1f09 (<unknown module>) #70 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #71 0x55bf9a78331a in Js::ScriptContext::ProfileModeThunk_DebugModeWrapper(Js::JavascriptFunction*, Js::ScriptContext*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments&) (/root/ChakraCore-latest/out/Release/ch+0x72131a) #72 0x55bf9a78136d in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f36d) #73 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #74 0x55bf9b018a61 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb6a61) #75 0x55bf9b01872f in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb672f) #76 0x55bf9a51175a in JsCallFunction (/root/ChakraCore-latest/out/Release/ch+0x4af75a) #77 0x55bf9a41ec15 in Debugger::CallFunction(char const*, void**, void*, void*) (/root/ChakraCore-latest/out/Release/ch+0x3bcc15) #78 0x55bf9a41b319 in Debugger::HandleDebugEvent(_JsDiagDebugEvent, void*) (/root/ChakraCore-latest/out/Release/ch+0x3b9319) #79 0x55bf9a550d20 in JsrtDebugManager::CallDebugEventCallback(_JsDiagDebugEvent, Js::DynamicObject*, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0x4eed20) #80 0x55bf9a551f0a in JsrtDebugManager::CallDebugEventCallbackForBreak(_JsDiagDebugEvent, Js::DynamicObject*, Js::ScriptContext*) (/root/ChakraCore-latest/out/Release/ch+0x4eff0a) #81 0x55bf9a54f7c3 in JsrtDebugManager::ReportBreak(Js::InterpreterHaltState*) (/root/ChakraCore-latest/out/Release/ch+0x4ed7c3) #82 0x55bf9a54f2a5 in JsrtDebugManager::DispatchHalt(Js::InterpreterHaltState*) (/root/ChakraCore-latest/out/Release/ch+0x4ed2a5) #83 0x55bf9a95adc9 in Js::ProbeContainer::DispatchStepHandler(Js::InterpreterHaltState*, Js::OpCode*) (/root/ChakraCore-latest/out/Release/ch+0x8f8dc9) #84 0x55bf9aacd2a0 in Js::InterpreterStackFrame::ProcessWithDebugging() (/root/ChakraCore-latest/out/Release/ch+0xa6b2a0) #85 0x55bf9aab3b77 in Js::InterpreterStackFrame::DebugProcess() (/root/ChakraCore-latest/out/Release/ch+0xa51b77) #86 0x55bf9aab2981 in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) (/root/ChakraCore-latest/out/Release/ch+0xa50981) #87 0x55bf9aab18ab in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) (/root/ChakraCore-latest/out/Release/ch+0xa4f8ab) #88 0x7f43138e0f99 (<unknown module>) #89 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #90 0x55bf9a78165a in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) (/root/ChakraCore-latest/out/Release/ch+0x71f65a) #91 0x55bf9b39cffd in amd64_CallFunction (/root/ChakraCore-latest/out/Release/ch+0x133affd) #92 0x55bf9b018a61 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb6a61) #93 0x55bf9b01872f in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) (/root/ChakraCore-latest/out/Release/ch+0xfb672f) #94 0x55bf9a51175a in JsCallFunction (/root/ChakraCore-latest/out/Release/ch+0x4af75a) #95 0x55bf9a439b1a in WScriptJsrt::CallbackMessage::CallFunction(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3d7b1a) #96 0x55bf9a43ce0b in CustomMessage<WScriptJsrt::AttachCallback(void*, bool, void**, unsigned short, void*)::$_1, WScriptJsrt::CallbackMessage>::Call(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3dae0b) #97 0x55bf9a416804 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) (/root/ChakraCore-latest/out/Release/ch+0x3b4804) #98 0x55bf9a419913 in ExecuteTest(char const*) (/root/ChakraCore-latest/out/Release/ch+0x3b7913) #99 0x55bf9a41a606 in main (/root/ChakraCore-latest/out/Release/ch+0x3b8606) #100 0x7f4317ecfc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #101 0x55bf9a318d59 in _start (/root/ChakraCore-latest/out/Release/ch+0x2b6d59) Address 0x7ffcceecb558 is located in stack of thread T0 at offset 2968 in frame #0 0x55bf9aacc8bf in Js::InterpreterStackFrame::ProcessWithDebugging() (/root/ChakraCore-latest/out/Release/ch+0xa6a8bf) This frame has 22 object(s): [32, 40) 'thisVar.i' [64, 70) 'ldElemInfo.i' [96, 112) 'agg.tmp36.i.i' [128, 144) 'agg.tmp2.i.i.i.i3477' [160, 176) 'agg.tmp2.i.i.i.i3459' [192, 208) 'agg.tmp2.i.i.i.i3436' [224, 240) 'agg.tmp2.i.i.i.i' [256, 272) 'agg.tmp2.i.i.i' [288, 352) 'info.i.i3194' [384, 448) 'info.i.i3153' [480, 544) 'info.i.i3117' [576, 640) 'info.i.i3087' [672, 736) 'info.i.i' [768, 776) 'ip.addr.i' [800, 808) 'ip' [832, 834) 'op' [848, 912) 'haltState' [944, 1008) 'haltState83' [1040, 1048) 'yieldValue' [1072, 1080) 'yieldValue1592' [1104, 1168) 'haltState1625' [1200, 1264) 'haltState1672' <== Memory access at offset 2968 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: dynamic-stack-buffer-overflow (/root/ChakraCore-latest/out/Release/ch+0x6d42b2) in Js::ScopeSlots::IsDebuggerScopeSlotArray() Shadow bytes around the buggy address: 0x100019dd1650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100019dd1660: ca ca ca ca 00 00 00 00 00 00 00 00 00 00 00 00 0x100019dd1670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100019dd1680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100019dd1690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x100019dd16a0: 00 00 00 00 00 cb cb cb cb cb cb[cb]f1 f1 f1 f1 0x100019dd16b0: f8 f2 f2 f2 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 0x100019dd16c0: f8 f2 f2 f2 f8 f3 f3 f3 00 00 00 00 00 00 00 00 0x100019dd16d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100019dd16e0: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 0x100019dd16f0: 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==10284==ABORTING ```
dynamic-stack-buffer-overflow in release build
https://api.github.com/repos/chakra-core/ChakraCore/issues/6884/comments
0
2023-04-09T03:05:13Z
2023-04-21T02:43:38Z
https://github.com/chakra-core/ChakraCore/issues/6884
1,659,728,699
6,884
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0, 1.13.0.0-beta ###### Test case ```js function foo() { var IntArr2 = new Int32Array(); Object.defineProperty(IntArr2, "length", {value: 1}); IntArr2[5] = 429496725; IntArr2[IntArr2.length] = 3; return [IntArr2,IntArr2.length] } for(let i = 0;i<100000;i++) foo() print(foo()) ``` ###### Execution steps .ch Testcase.js ###### Output ``` ,0 ``` ###### Expected result ,1 ###### Description The correct output of the test case should be `,1` while chakra yields `,0` . This may be caused by the incorrect implementation of chakra JIT compiler.
ChakraCore JIT problem with array
https://api.github.com/repos/chakra-core/ChakraCore/issues/6883/comments
0
2023-04-04T06:12:09Z
2023-04-04T06:12:09Z
https://github.com/chakra-core/ChakraCore/issues/6883
1,653,251,352
6,883
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0, 1.13.0.0-beta ###### Test case ```js function foo() { var IntArr2 = new Int32Array(); IntArr2.__defineGetter__("length", function () { return 1; }); IntArr2[5] = 429496725; IntArr2[IntArr2.length] = 3; return [IntArr2,IntArr2.length] } for(let i = 0;i<100000;i++) foo() print(foo()) ``` ###### Execution steps .ch Testcase.js ###### Output ``` ,0 ``` ###### Expected result ,1 ###### Description The correct output of the test case should be `,1` while chakra yields `,0` . This may be caused by the incorrect implementation of chakra JIT compiler.
JIT did not handle array length correctly
https://api.github.com/repos/chakra-core/ChakraCore/issues/6882/comments
0
2023-04-04T05:50:33Z
2023-04-04T05:50:33Z
https://github.com/chakra-core/ChakraCore/issues/6882
1,653,225,977
6,882
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0, 1.13.0.0-beta ###### Test case ```js var obj = { hi() { super[1] = 'hello'; } }; obj.hi(); print(JSON.stringify(obj)) ``` ###### Execution steps .ch Testcase.js ###### Output ``` {} ``` ###### Expected result {"1":"hello"} ###### Description The correct output of the test case should be `{"1":"hello"}` while chakra yields `{}` . I think it might be an issue of chakra.
chakra Inherit problem
https://api.github.com/repos/chakra-core/ChakraCore/issues/6880/comments
1
2023-03-17T07:10:33Z
2023-03-18T04:28:06Z
https://github.com/chakra-core/ChakraCore/issues/6880
1,628,816,926
6,880
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0 ###### Test case ```js const a = Math.pow() const b = -a const c = b.toLocaleString(); print(c) ``` ###### Execution steps .ch Testcase.js ###### Output ``` -NaN ``` ###### Expected result NaN ###### Description The correct output of the test case should be `NaN` while chakra yields `-NaN` . This may be caused by the incorrect implementation of chakra.
-NaN
https://api.github.com/repos/chakra-core/ChakraCore/issues/6879/comments
3
2023-03-17T06:48:38Z
2023-03-25T09:46:51Z
https://github.com/chakra-core/ChakraCore/issues/6879
1,628,793,723
6,879
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0, 1.13.0.0-beta ###### Test case 1 ```js var a; for(let b = 30000;b>-1;b--){ a = b * -1 a += a ; } print(Object.is(a, 0)); print(Object.is(a, -0)); ``` ###### Execution steps 1 .ch Testcase.js ###### Output 1 ``` true false ``` ###### Expected result 1 ``` false true ``` ###### Test case 2 ```js var a; for(let b = 30;b>-1;b--){ a = b * -1 a += a ; } print(Object.is(a, 0)); print(Object.is(a, -0)); ``` ###### Execution steps 2 .ch Testcase.js ###### Output 2 ``` false true ``` ###### Expected result 1 ``` false true ``` ###### Description When the number of cycles increases, chakra outputs the wrong result.It seems to be caused by incorrect JIT optimization.
Seems to be JIT optimization problem
https://api.github.com/repos/chakra-core/ChakraCore/issues/6878/comments
0
2023-03-17T06:45:29Z
2023-03-17T06:45:29Z
https://github.com/chakra-core/ChakraCore/issues/6878
1,628,790,798
6,878
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0, 1.13.0.0-beta ###### Test case ```js function foo(){ const b = [{name:"bob",age:25}]; const o = {"__proto__":[[]], "":""}; for (const p in o) { var a = b[p]; o.__proto__ = {}; } return JSON.stringify(a) } print(foo()) ``` ###### Execution steps .ch Testcase.js ###### Output ``` {"name":"bob","age":25} ``` ###### Expected result undefined ###### Description The correct output of the test case should be `undefined` while chakra yields {"name":"bob","age":25} . I think it might be an issue of chakra.
chakra Inconsistent execution results
https://api.github.com/repos/chakra-core/ChakraCore/issues/6877/comments
2
2023-03-17T06:30:31Z
2023-03-23T16:34:33Z
https://github.com/chakra-core/ChakraCore/issues/6877
1,628,777,766
6,877
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0 ###### Test case ```js var x = 'a'; //large than 32 cause a crash for (var i = 0; i < 32; i++) { try { x = x + x; } catch (e) { } } print(x.length) ``` ###### Execution steps .ch Testcase.js ###### Output ``` Aborted (core dumped) ``` ###### Description This testcase caused a crash. When we change the number of times in the for-loop to less than `32`, it will not cause a crash. It seems to be caused by the JIT Compiler.
For loop leads to a crash
https://api.github.com/repos/chakra-core/ChakraCore/issues/6876/comments
0
2023-03-17T05:55:18Z
2023-03-17T05:55:18Z
https://github.com/chakra-core/ChakraCore/issues/6876
1,628,739,599
6,876
[ "chakra-core", "ChakraCore" ]
I've found that trying to build from a fresh checkout of ChakraCore in MSVC usually fails with errors like the following: ![image](https://user-images.githubusercontent.com/4097841/216776295-6b861c15-0846-4498-b2f6-d7d5a85c56be.png) When this happens, clicking Build a second time results in a successful build. Seems like some kind of race condition or things being compiled in the wrong order.
Fresh Windows MSVC build fails, then succeeds on second attempt
https://api.github.com/repos/chakra-core/ChakraCore/issues/6875/comments
4
2023-02-04T15:43:57Z
2023-04-22T00:31:51Z
https://github.com/chakra-core/ChakraCore/issues/6875
1,570,997,856
6,875
[ "chakra-core", "ChakraCore" ]
I have enabled debugging in the runtime and provided a callback for debug events. I also called JsDiagSetBreakOnException(runtime, JsDiagBreakOnExceptionAttributeUncaught); If there is an exception in the script which is not caught, the debug event callback is provided and I am able to get all the diagnostic information. However, if I call a native function from the script and in that function I create an exception and call JsSetException; the debug event callback is not made. Stepping through the chakra code, I noticed that in JavascriptExternalFunction.cpp Line 320 JavascriptExceptionObject* recordedException = scriptContext->GetAndClearRecordedException(&considerPassingToDebugger); The considerPassingToDebugger is set to false .. if I force it to true the debug event callback is provided with all the diagnostic information. I tried another 'trick' .. I compiled a js function to just throw an error .. and from my native function I called that function instead of calling JsSetException - but even then the debug event callback is not made. Is this by design that exceptions from native functions will not get routed to the debugging callback? K
Native Functions and Uncaught Exceptions
https://api.github.com/repos/chakra-core/ChakraCore/issues/6873/comments
3
2023-01-29T13:35:25Z
2023-02-09T08:40:20Z
https://github.com/chakra-core/ChakraCore/issues/6873
1,561,291,386
6,873
[ "chakra-core", "ChakraCore" ]
I am now looking at promises and have provided the PromiseContinuationCallback for the runtime. In the callback, I am adding the 'task' provided to a 'promises_to_keep' queue and then when 'control' comes back to my code .. I am processing this queue -calling the 'task' function with JsUndefinedValue as the single argument. All this works fine. In the neospehere code base I noticed that the return value of the task is checked .. if its an object which has a 'then' property, it is calling another 'native' function which seems to do nothing but then I cannot be sure I understood everything there. So the question is whether a check should be made for a 'then' property on the return value of the 'task' and then should something be done with that. In the documentation regarding promises I do see reference to 'thenables' but have not understood that fully as yet .. is my question linked to this? Thanks K
Promise Continuation
https://api.github.com/repos/chakra-core/ChakraCore/issues/6872/comments
5
2023-01-29T13:09:51Z
2023-02-09T08:40:33Z
https://github.com/chakra-core/ChakraCore/issues/6872
1,561,281,871
6,872
[ "chakra-core", "ChakraCore" ]
A key usage while embedding a scripting engine in an application is to create 'native' objects. Two types of native objects are possible: a) those which are created by the host and exposed to the script b) those which can be created from the script with 'new' - here the host provides a constructor function. Typically, these objects will be backed by some memory address storing data about the object. For (b) above, the object is created by the chakra core and so JsSetExternalData returns 'JsErrorInvalidArgument'. So for these type of objects, what would be the recommended way to store an address containing the data .. would it be to define a readonly property in the constructor? Also, what should the return value be of the constructor .. should it be the new object as indicated by info->thisArg or arguments[0]? Thanks K
Native Objects and External Data
https://api.github.com/repos/chakra-core/ChakraCore/issues/6871/comments
3
2023-01-22T13:11:38Z
2023-02-09T08:40:50Z
https://github.com/chakra-core/ChakraCore/issues/6871
1,552,111,306
6,871
[ "chakra-core", "ChakraCore" ]
As part of building C samples for chakra, am now working on modules. For this I am using the examples posted by Mozilla at https://github.com/mdn/js-examples/tree/main/module-examples https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules is the place where they explain the examples. All the examples have a canvas module which in turn uses square, circle and triangle modules to draw the different shapes, reporting their actions in an Unordered List. I created a pseudo DOM in a js script which I parsed in the console application before parsing the main module. The first module is parsed with JsModuleParse. In the FetchImportedModuleCallback callback, I queued other imported modules for parsing. The parsing continues till there are no more modules to parse - this results in a call to NotifyModuleReadyCallback on the root module. I am then calling JsModuleEvaluation. With this sequence, all the examples, except for one, were working fine. The one which is different uses dynamic module import like this... ``` let squareBtn = document.querySelector('.square'); squareBtn.addEventListener('click', () => { import('./modules/square.js').then((Module) => { let square1 = new Module.Square(myCanvas.ctx, myCanvas.listId, 50, 50, 100, 'blue'); square1.draw(); square1.reportArea(); square1.reportPerimeter(); }) }); ``` I have managed to get it to work as follows: The main module and the canvas module are parsed first; and the main module is evaluated. This is the same as the sequence for the other examples. Then I call the 'click' function on the button to trigger the dynamic import. When this function is invoked, the following is the sequence: a) callback is received in FetchImportedModuleCallback for the dynamically imported module. b) in the callback I invoked JsModuleParse c) the callback NotifyModuleReadyCallback was received d) in this callback I invoked JsModuleEvaluate and then JsGetModuleNamespace But the result of the click did not show up. Since this is a dynamic import which returns a Promise, I set a PromiseContinuationCallback callback before calling the 'click' function. When the module is evaluated, the PromiseContinuationCallback callback is invoked twice .. in both cases the 'task' parameter is a JsFunction. A call to toString on this function indicates it is a native function. While calling the function I passed a single argument of the module's namespace. With this, the result of the click showed up just right. bingo! When I passed no arguments to the function, or 'undefined' as the argument, the results of the click were incomplete but no exception was raised. Questions: a) What is the argument that should be passed to the 'task' function - in my simple program, I knew the promise was triggered by the import and so I passed the module's namespace; but in a more complex example this would not be the case - so how does one determine what the argument should be? The JsSetPromiseContinuationCallback provides a callbackState parameter but if I call this in the NotifyModuleReadyCallback, will it not overwrite a previously set callbackState value? b) When is the FetchImportedModuleFromScriptCallback callback made? Looking at the name, I thought it would be used for dynamic imports, but the callback made for dynamic imports was still FetchImportedModuleCallback. c) In FetchImportedModuleCallback for the dynamic module, I created a new ModuleRecord and called JsModuleParse .. when this function returned, I returned the new module record in the out parameter JsModuleRecord* dependentModuleRecord. This did not cause any problem - is this the way the dynamic import should be handled? Thanks Kimman
ChakraCore : Dynamic Module Import
https://api.github.com/repos/chakra-core/ChakraCore/issues/6870/comments
6
2023-01-15T13:42:06Z
2023-02-09T08:41:07Z
https://github.com/chakra-core/ChakraCore/issues/6870
1,533,820,401
6,870
[ "chakra-core", "ChakraCore" ]
Hello I would like to make the document of requirements for the project. Could you give me some information about the project?
Requirements document
https://api.github.com/repos/chakra-core/ChakraCore/issues/6865/comments
1
2022-12-19T22:39:54Z
2022-12-28T05:56:11Z
https://github.com/chakra-core/ChakraCore/issues/6865
1,503,711,070
6,865
[ "chakra-core", "ChakraCore" ]
I am using Visual Studio 2015. When I try to debug my application, it does not step into the Chakra code - I have built the Chakra solution on the same machine and the Debug Output window indicates that the symbols for ChakraCore.dll have been loaded. If I locate the source file in chakra where a particular function is, and put a break point there, the debugger does stop there and lets me debug the code .. different matter that debugging c++ is not easy for me. I had to debug in the context of an issue .. a script was passing a native function a boolean object where a boolean value was expected. The native function determined that that argument was an instance of the Boolean object and so tried to convert that to the boolean value .. Tried with ConvertValueToBoolean - that always returns a value of false. Tried calling the valueOf function of the Boolean object - that returns an object and not a value. But ConvertValueToString returns the correct value. Thanks K
Debugging ChakraCore : Boolean valueOf
https://api.github.com/repos/chakra-core/ChakraCore/issues/6864/comments
3
2022-12-13T11:24:39Z
2023-01-16T17:06:42Z
https://github.com/chakra-core/ChakraCore/issues/6864
1,494,035,881
6,864
[ "chakra-core", "ChakraCore" ]
On ARM macOS (all versions), `./build.sh --icu=/opt/homebrew/opt/icu4c/include -j=4 -y --lto-thin` leads to: ``` CMake Error at CMakeLists.txt:47 (message): Couldn't detect target processor, try `--arch` argument with build.sh ```
Support lacking for Apple Silicon (ARM)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6860/comments
15
2022-11-09T12:49:33Z
2023-03-22T21:51:08Z
https://github.com/chakra-core/ChakraCore/issues/6860
1,442,039,533
6,860
[ "chakra-core", "ChakraCore" ]
Ubuntu18 tests will already fail during scheduled `brownout`. They will be fully unsupported by 4/1/2023. See https://github.com/actions/runner-images/issues/6002, #6831. PR: https://github.com/chakra-core/ChakraCore/pull/6833
Deprecation of `Ubuntu 18.04` Actions (DevOps)
https://api.github.com/repos/chakra-core/ChakraCore/issues/6855/comments
3
2022-10-15T10:12:25Z
2024-04-16T10:37:04Z
https://github.com/chakra-core/ChakraCore/issues/6855
1,410,118,207
6,855
[ "chakra-core", "ChakraCore" ]
https://github.com/chakra-core/ChakraCore/blob/b4f1bb49e4e7d6bb0ac22c538e8bb841e7828336/tools/regenByteCode.py#L119 ```diff - // Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved. + // Copyright (c) ChakraCore Project Contributors. All rights reserved. ```
`regenByteCode.py` creates wrong copyright header
https://api.github.com/repos/chakra-core/ChakraCore/issues/6850/comments
1
2022-10-06T19:22:26Z
2022-10-07T07:11:16Z
https://github.com/chakra-core/ChakraCore/issues/6850
1,400,188,743
6,850
[ "chakra-core", "ChakraCore" ]
OS: Ubuntu 22.04 x86-64 Compiler: Clang ~14.0.0~12.0.1 CMake build type: RelWithDebInfo Bytecode generation for verification segfaults: ``` $ ./ch -GenerateLibraryByteCodeHeader -LdChakraLib -JsBuiltIn /path/to/ChakraCore/tools/../lib/Runtime/Library/InJavascript/Array_prototype.js Segmentation fault (core dumped) ``` The crash comes from code in `ByteCodeSerializer.cpp`, though it might also be related to `ImmutableList`, or something else. ``` $ gdb --args ./ch -GenerateLibraryByteCodeHeader -LdChakraLib -JsBuiltIn /local/petr/ChakraCore/tools/../lib/Runtime/Library/InJavascript/Array_prototype.js GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./ch... (gdb) r Starting program: /local/petr/ChakraCore/build-test/ch -GenerateLibraryByteCodeHeader -LdChakraLib -JsBuiltIn /local/petr/ChakraCore/tools/../lib/Runtime/Library/InJavascript/Array_prototype.js [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ff7f43cf640 (LWP 5873)] [New Thread 0x7ff7f3b9f640 (LWP 5874)] [New Thread 0x7ff7f339e640 (LWP 5875)] Thread 1 "ch" received signal SIGSEGV, Segmentation fault. regex::ImmutableList<Js::BufferBuilder*>::ReverseCurrentList (this=<optimized out>) at /local/petr/ChakraCore/lib/Common/DataStructures/ImmutableList.h:387 387 auto next = current->next; (gdb) bt #0 regex::ImmutableList<Js::BufferBuilder*>::ReverseCurrentList (this=<optimized out>) at /local/petr/ChakraCore/lib/Common/DataStructures/ImmutableList.h:387 #1 Js::ByteCodeBufferBuilder::AddFunction (this=0x7fffffffd9f0, this@entry=0x7fffffffdd48, builder=..., function=0x7ff7f2b65380, srcInfo=srcInfo@entry=0x7ff7f3ba1e40, cache=cache@entry=0x0) at /local/petr/ChakraCore/lib/Runtime/ByteCode/ByteCodeSerializer.cpp:2440 ``` Failure doesn't exist in `Debug` mode. I've tried to build some files with `Debug`, but that leads to undefined symbols (as more inlining removes some of the calls), maybe I'll have some more success with `Release` mode. ~Worth looking into earlier Clang versions, we don't have this failure on Ubuntu 20, where package manager doesn't have Clang 14.~ We didn't have this on Ubuntu 20, which has Clang 10 in the package repo. I can narrow down it to Clang 12 vs Clang 11, latter works.
ImmutableList undefined behavior
https://api.github.com/repos/chakra-core/ChakraCore/issues/6847/comments
19
2022-10-04T17:50:42Z
2024-04-22T03:45:27Z
https://github.com/chakra-core/ChakraCore/issues/6847
1,396,639,112
6,847
[ "chakra-core", "ChakraCore" ]
The following poc outputs different results in CC and V8. ```js const array = [40, 30, 10]; array.sort((x, y) => { array[0] = -1; console.log(array); return x - y; }); console.log(array); ``` #### CC ```js -1,30,10 -1,-1,10 -1,-1,10 ``` #### V8 ```js [ -1, 30, 10 ] [ -1, 30, 10 ] [ 10, 30, 40 ] ``` That's strange, as there's a test case that enforces this behavior in CC: https://github.com/chakra-core/ChakraCore/blob/7bcdec7e4266f786e930f23a45976511733272c3/test/Array/array_sort.js#L209-L226
`Array.prototype.sort` spec compliance
https://api.github.com/repos/chakra-core/ChakraCore/issues/6843/comments
7
2022-10-03T07:41:20Z
2022-10-07T07:07:47Z
https://github.com/chakra-core/ChakraCore/issues/6843
1,394,284,894
6,843
[ "chakra-core", "ChakraCore" ]
when i build this project , it says C:\..\...\ChakraCore-master\lib\Runtime\PlatformAgnostic\Chakra.Runtime.PlatformAgnostic.vcxproj : warning : Platform 'CHPE' referenced in the project file 'Chakra.Runtime.PlatformAgnostic' cannot be found. C:\..\...p\MyDesktop\ChakraCore-master\lib\Runtime\Debug\Chakra.Runtime.Debug.vcxproj : warning : Platform 'CHPE' referenced in the project file 'Chakra.Runtime.Debug' cannot be found. ``` 27>LINK : fatal error LNK1181: cannot open input file 'C:\Users\Admin\Desktop\MyDesktop\ChakraCore-master\Build\VcBuild\obj\x64_debug\Chakra.SCACore\Chakra.SCACore.lib' 27>Done building project "ChakraCore.vcxproj" -- FAILED. and build result ========== Rebuild All: 25 succeeded, 2 failed, 0 skipped ========== ``` in binary chakracore dll not exist , tried in win10 vs2022
i am getting error in build
https://api.github.com/repos/chakra-core/ChakraCore/issues/6837/comments
0
2022-09-19T01:26:16Z
2022-09-19T04:56:40Z
https://github.com/chakra-core/ChakraCore/issues/6837
1,377,261,516
6,837
[ "chakra-core", "ChakraCore" ]
Should we maintain release 1.11 on Ubuntu 20 and newer? Due to updates to the compiler and system headers it does not currently build. I have started working on that, as all the changes should already be known.
Release 1.11 on Ubuntu 20 and later
https://api.github.com/repos/chakra-core/ChakraCore/issues/6836/comments
0
2022-09-17T05:05:18Z
2022-09-17T05:05:33Z
https://github.com/chakra-core/ChakraCore/issues/6836
1,376,668,310
6,836
[ "chakra-core", "ChakraCore" ]
# Summary Construct a specific payload to \[String\].match cause ChakraCore engine StackOverflow crash, which may cause denial of service. # Description ## PoC The following is JS PoC to feed ch (ChakraCore 1.11.24 x64): ```Plain Text var dnaInput = "tacgattttatcgcgactagttaatcatcatagcaagtaaaatttgaattatgtcattat\ catgctccattaacaggttatttaattgatactgacgaaattttttcacaatgggttttc\ tagaatttaatatcagtaattgaagccttcataggggtcctactagtatcctacacgacg\ caggtccgcagtatcctggagggacgtgttactgattaaaagggtcaaaggaatgaaggc\ tcacaatgttacctgcttcaccatagtgagccgatgagttttacattagtactaaatccc\ aaatcatactttacgatgaggcttgctagcgctaaagagaatacatacaccaccacatag\ aattgttagcgatgatatcaaatagactcctggaagtgtcagggggaaactgttcaatat\ ttcgtccacaggactgaccaggcatggaaaagactgacgttggaaactataccatctcac\ gcccgacgcttcactaattgatgatccaaaaaatatagcccggattcctgattagcaaag\ ggttcacagagaaagatattatcgacgtatatcccaaaaaacagacgtaatgtgcatctt\ cgaatcgggatgaatacttgtatcataaaaatgtgacctctagtatacaggttaatgtta\ ctcacccacgtatttggtctaattatgttttatttagtgacaatccaatagataaccggt\ cctattaagggctatatttttagcgaccacgcgtttaaacaaaggattgtatgtagatgg\ gcttgatataagatttcggatgtatgggttttataatcgttggagagctcaatcatgagc\ taatacatggatttcgctacctcaccgagagaccttgcatgaagaattctaaccaaaagt\ ttaataggccggattggattgagttaattaagaccttgttcagtcatagtaaaaaccctt\n\ aaattttaccgattgacaaagtgagcagtcgcaataccctatgcgaaacgcctcgatagt\n\ gactaggtatacaaggtttttgagttcctttgaaatagttaactaatttaaaattaatta\n\ acgacatggaaatcacagaacctaatgctttgtaggagttatttatgctgtttactgcct\n\ ctacaaccctaataaagcagtcctaagaatgaaacgcatcttttagttcagaaagtggta\n\ tccagggtggtcaatttaataaattcaacatcgggtctcaggatattcggtcatataatt\n\ tattaagggctcttcgagtcttactctgagtgaaattggaaacagtcatccttttcgttg\n\ tgaggcatcttacaccgctatcgatatacaatgcattccaccgcggtgtcccgtacacaa\n\ ggaaacttgttaccttggggatataagaaaactcacacgtctcattattaaactgagtac\n\ tggaacgcacctcggatctgttgcactggattaaaatccgattatttttaaaaatattca\n\ gtgctagagcatatcaggtctacttttttatctggtatgtaaagcccacggagcgatagt\n\ gagatccttacgactcaacgaaaagttataacataactcccgttagccaaagcccaatcc\n\ \n"; dnaInput = dnaInput + dnaInput + dnaInput; var seqs = [/a|tttaccct/ig]; Array.prototype.push.call(seqs, false, Array.prototype.concat.call(seqs, seqs, dnaInput)); for (i in seqs) { //print(seqs[i]); dnaInput.match(seqs[i]); } ``` ## Analysis Using windbg to do Time travel debug: ![oUPW6LVEN4SUf2zz-YlK6yEPw93oyuifFWouwhRJ3Wc](https://user-images.githubusercontent.com/6657270/189513618-5f264ec1-c146-4d37-ab43-d28eb302f775.png) It's easy to find `chakracore!UnifiedRegex::RuntimeCharTrie::CloneFrom` continuously invoking itself to clone from compile-time allocator to run-time allocator because of the large length of `seqs[i]`, which caused stackoverflow. The following is a stack trace: ```Plain Text > ChakraCore.dll!UnifiedRegex::RuntimeCharTrie::CloneFrom(Memory::ArenaAllocator * allocator, const UnifiedRegex::CharTrie & other) 行 203 C++ ChakraCore.dll!UnifiedRegex::AltNode::AnnotatePass4(UnifiedRegex::Compiler & compiler) 行 2542 C++ ChakraCore.dll!UnifiedRegex::Compiler::Compile(Js::ScriptContext * scriptContext, Memory::ArenaAllocator * ctAllocator, Memory::ArenaAllocator * rtAllocator, UnifiedRegex::StandardChars<wchar_t> * standardChars, UnifiedRegex::Program * program, UnifiedRegex::Node * root, const wchar_t * litbuf, UnifiedRegex::RegexPattern * pattern, UnifiedRegex::DebugWriter * w, UnifiedRegex::RegexStats * stats) 行 4726 C++ ChakraCore.dll!Js::RegexHelper::PrimCompileDynamic(Js::ScriptContext * scriptContext, const wchar_t * psz, unsigned int csz, const wchar_t * pszOpts, unsigned int cszOpts, bool isLiteralSource) 行 259 C++ ChakraCore.dll!Js::RegexHelper::CompileDynamic(Js::ScriptContext * scriptContext, const wchar_t * psz, unsigned int csz, const wchar_t * pszOpts, unsigned int cszOpts, bool isLiteralSource) 行 100 C++ ChakraCore.dll!Js::JavascriptRegExp::CreatePattern(void * aValue, void * options, Js::ScriptContext * scriptContext) 行 384 C++ ChakraCore.dll!Js::JavascriptRegExp::CreateRegExNoCoerce(void * aValue, void * options, Js::ScriptContext * scriptContext) 行 414 C++ ChakraCore.dll!Js::JavascriptRegExp::CreateRegEx(void * aValue, void * options, Js::ScriptContext * scriptContext) 行 409 C++ ChakraCore.dll!Js::JavascriptString::EntryMatch::__l2::<lambda>(Js::JavascriptString * stringObj) 行 1411 C++ ChakraCore.dll!Js::JavascriptString::DelegateToRegExSymbolFunction<1,void * <lambda>(Js::JavascriptString *) >(Js::ArgumentReader & args, int symbolPropertyId, Js::JavascriptString::EntryMatch::__l2::void * <lambda>(Js::JavascriptString *) fallback, const wchar_t * varName, Js::ScriptContext * scriptContext) 行 1753 C++ ChakraCore.dll!Js::JavascriptString::EntryMatch(Js::RecyclableObject * function, Js::CallInfo callInfo, ...) 行 1425 C++ ChakraCore.dll!amd64_CallFunction() 行 208 未知 ChakraCore.dll!Js::JavascriptFunction::CallFunction<1>(Js::RecyclableObject * function, void *(*)(Js::RecyclableObject *, Js::CallInfo) entryPoint, Js::Arguments args, bool useLargeArgCount) 行 1358 C++ ChakraCore.dll!Js::InterpreterStackFrame::OP_CallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0> > > >(const Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0> > > * playout, Js::RecyclableObject * function, unsigned int flags, const Js::AuxArray<unsigned int> * spreadIndices) 行 3855 C++ ChakraCore.dll!Js::InterpreterStackFrame::OP_ProfileCallCommon<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0> > > >(const Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0> > > * playout, Js::RecyclableObject * function, unsigned int flags, unsigned short profileId, unsigned int inlineCacheIndex, const Js::AuxArray<unsigned int> * spreadIndices) 行 3894 C++ ChakraCore.dll!Js::InterpreterStackFrame::OP_ProfiledCallIWithICIndex<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0> > >(const Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0> > > * playout) 行 505 C++ ChakraCore.dll!Js::InterpreterStackFrame::ProcessProfiled() 行 87 C++ ChakraCore.dll!Js::InterpreterStackFrame::Process() 行 3355 C++ ChakraCore.dll!Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction * function, Js::ArgumentReader args, void * returnAddress, void * addressOfReturnAddress, Js::InterpreterStackFrame::AsmJsReturnStruct * asmJsReturn) 行 2035 C++ ChakraCore.dll!Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout * layout) 行 1731 C++ [外部代码] ChakraCore.dll!amd64_CallFunction() 行 208 未知 ChakraCore.dll!Js::JavascriptFunction::CallFunction<1>(Js::RecyclableObject * function, void *(*)(Js::RecyclableObject *, Js::CallInfo) entryPoint, Js::Arguments args, bool useLargeArgCount) 行 1358 C++ ChakraCore.dll!Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject * obj, Js::Arguments args, Js::ScriptContext * scriptContext, bool inScript) 行 768 C++ ChakraCore.dll!Js::JavascriptFunction::CallRootFunction(Js::RecyclableObject * obj, Js::Arguments args, Js::ScriptContext * scriptContext, bool inScript) 行 728 C++ ChakraCore.dll!Js::JavascriptFunction::CallRootFunction(Js::Arguments args, Js::ScriptContext * scriptContext, bool inScript) 行 829 C++ ChakraCore.dll!RunScriptCore::__l2::<lambda>(Js::ScriptContext * scriptContext, TTD::TTDJsRTActionResultAutoRecorder & _actionEntryPopper) 行 3632 C++ ChakraCore.dll!ContextAPIWrapper::__l2::<lambda>(Js::ScriptContext * scriptContext) 行 238 C++ ChakraCore.dll!ContextAPIWrapper_Core<0,_JsErrorCode <lambda>(Js::ScriptContext *) >(ContextAPIWrapper::__l2::_JsErrorCode <lambda>(Js::ScriptContext *) fn) 行 192 C++ ChakraCore.dll!ContextAPIWrapper<0,_JsErrorCode <lambda>(Js::ScriptContext *, TTD::TTDJsRTActionResultAutoRecorder &) >(RunScriptCore::__l2::_JsErrorCode <lambda>(Js::ScriptContext *, TTD::TTDJsRTActionResultAutoRecorder &) fn) 行 235 C++ ChakraCore.dll!RunScriptCore(void * scriptSource, const unsigned char * script, unsigned __int64 cb, LoadScriptFlag loadScriptFlag, unsigned __int64 sourceContext, const wchar_t * sourceUrl, bool parseOnly, _JsParseScriptAttributes parseAttributes, bool isSourceModule, void * * result) 行 3583 C++ ChakraCore.dll!CompileRun(void * scriptVal, unsigned __int64 sourceContext, void * sourceUrl, _JsParseScriptAttributes parseAttributes, void * * result, bool parseOnly) 行 4993 C++ ChakraCore.dll!JsRun(void * scriptVal, unsigned __int64 sourceContext, void * sourceUrl, _JsParseScriptAttributes parseAttributes, void * * result) 行 5015 C++ ch.exe!ChakraRTInterface::JsRun(void * script, unsigned __int64 sourceContext, void * sourceUrl, _JsParseScriptAttributes parseAttributes, void * * result) 行 419 C++ ch.exe!RunScript(const char * fileName, const char * fileContents, unsigned __int64 fileLength, void(*)(void *) fileContentsFinalizeCallback, void * bufferValue, char * fullPath, void * parserStateCache) 行 479 C++ ch.exe!ExecuteTest(const char * fileName) 行 913 C++ ch.exe!ExecuteTestWithMemoryCheck(char * fileName) 行 955 C++ ch.exe!StaticThreadProc(void * lpParam) 行 1060 C++ ch.exe!thread_start<unsigned int (__cdecl*)(void *),1>(void * const parameter) 行 97 C++ [外部代码] ``` # Detailed Analysis As you may see in the previous PoC, the `seqs[i]` after operation `Array.prototype.push.call(seqs, false, Array.prototype.concat.call(seqs, seqs, dnaInput));` is a very long regular expression `/a|tttaccct/ig,/a|tttaccct/ig,tacgattttatcgcgactagttaatcatcatagcaagtaaaatttgaattatgt...`. (More than 4000 characters) When compiling them, they are all constructed as UnifiedRegex::AltNode, which need to build CharTrie at `ChakraCore-1.11.24\lib\Parser\RegexCompileTime.cpp:2509~2517`: ![AqNP7C1Hw_6adx1bifEdslsiVbaGLdsTSMsPMgJXhWM](https://user-images.githubusercontent.com/6657270/189513615-2c249084-7fdc-4e9d-830e-bc9a9995a4fd.png) Which is a iterative build process. `bool MatchLiteralNode::BuildCharTrie` and `CharTrie* CharTrie::Add` inside void `AltNode::AnnotatePass4` are also running iteratively, so they won't get any problem. ![aQkNmNH2Jj15MOxLeLCXlWYhdLyFcYQLhAybV2UquDQ](https://user-images.githubusercontent.com/6657270/189513614-79ca9ce0-72e8-4669-ab6c-0c75db944b78.png) ![zJj0r7o0IoPrBv8gX0xj5AnkBbz-IINugRA6RF2n7WY](https://user-images.githubusercontent.com/6657270/189513621-40de2b0f-ab08-408f-a771-59abb73039af.png) However, when it running to `ChakraCore-1.11.24\lib\Parser\RegexCompileTime.cpp:2541`, in `RuntimeCharTrie::CloneFrom`: ![pq2Hi85ryA6YU-mk6KnzuiHQ0Cv5JeC0TsqYaKuzDMM](https://user-images.githubusercontent.com/6657270/189513619-e0c9908d-56c8-4633-b630-f56742891651.png) ![SC0LMCXm0ew98Gy3S--BJHo1pJAL9kd8p8StoIqsRd0](https://user-images.githubusercontent.com/6657270/189513620-dec4ff3b-15bd-4a2b-82c7-e6e1d60a9093.png) It is a recursive clone process and the last `AltNode` node which contains most literal part of `seqs[i]` and has length more than 4000 will cause `CloneFrom` repeatedly invoke itself hence stackoverflow. My recommend solution is to rewrite this part with an iterative coding style. Thanks! PS: I've also tried to change the seqs to `var seqs = ['aa'];`, which lead to the regex compiler treat them as a LiteralNode, hence no need to build a Trie. ![OT8jur7VV4iz-5vKWpIOPQNTho8P3uDS--mCcpjHtDg](https://user-images.githubusercontent.com/6657270/189513617-733acd58-46e4-4245-bb43-0f9eea7b8aad.png) ## Supporting materials/ references: ![3slX3cOwO8eVYv9REV4MMpoz37dtbfus3xc-2-XoYrs](https://user-images.githubusercontent.com/6657270/189513613-a6631fad-6893-48d9-ab8e-ae6a44ec5557.png)
Construct a specific payload to [String].match cause ChakraCore engine StackOverflow crash, which may cause denial of service.
https://api.github.com/repos/chakra-core/ChakraCore/issues/6835/comments
10
2022-09-11T05:21:00Z
2022-11-02T05:33:41Z
https://github.com/chakra-core/ChakraCore/issues/6835
1,368,834,960
6,835
[ "chakra-core", "ChakraCore" ]
I wrote the following script to test the retrieval of the stack trace when there is an exception in the script: function func_1() { var a = func_2(); // line 3 : call another function } function func_2() { var b = func_3(); // line 8 : call another function } function func_3() { var x, y; var z = x[y]; // line 14 : trigger an exception since x is undefined return z; } When I call the function call, "func_1", with JsCallFunction, the return value is script exception. Using JsGetAndClearExceptionWithMetadata, I retrieved the exception. When I dump the properties of this object I get (the dump has member name, type, and value) - for Error which is an object, it recurses and dumps the properties of that object. exception Error - message String Unable to get property 'undefined' of undefine or null reference - description String Unable to get property 'undefined' of undefine or null reference - number Number -2146823281 - stack String TypeError: Unable to get property 'undefined' of undefined or null reference - at func_3 (xx:14:5) - at func_2 (xx:8:2) - at func_1 (xx:3:2) source String var z = x[y]; line Number 13 column Number 4 length Number 0 url String xx The stack looks fine .. but .. The column numbers seem incorrect - are they reflecting the 'token' number within that statement? Also what is the 'Number' property of the Error object? K
'stack' member of Exception
https://api.github.com/repos/chakra-core/ChakraCore/issues/6834/comments
2
2022-09-09T12:38:29Z
2023-02-09T09:35:54Z
https://github.com/chakra-core/ChakraCore/issues/6834
1,367,771,446
6,834
[ "chakra-core", "ChakraCore" ]
I've had to downgrade Windows CI image in #6829, and we might want to consider Ubuntu 22 and maybe dropping Ubuntu 18. Platforms we should consider: - [x] Windows 2022, currently msbuild detection fails, see #6828 - [ ] Ubuntu 22, need to give it a try I am not sure what is the best way to track new available images, if we let them to be upgraded under our feet (using 'latest'), then we can get surprise errors, like in #6808, but if we don't try them regularly we can easily forget to test on new versions.
Upgrade CI images
https://api.github.com/repos/chakra-core/ChakraCore/issues/6831/comments
2
2022-08-12T18:45:45Z
2022-08-26T23:37:14Z
https://github.com/chakra-core/ChakraCore/issues/6831
1,337,595,390
6,831
[ "chakra-core", "ChakraCore" ]
I embed chakra and chkracore in one app, but when call two APIs, app crashes. I test in VB6: eg: .... LoadLibrary("Chakra.dll") LoadLibrary("ChakraCore.dll") ... wheather static dll mode or dynamic load dll both crashes. If invoke only one set of APIs,it can run any times.
can't use chakra and chakracore in one app
https://api.github.com/repos/chakra-core/ChakraCore/issues/6827/comments
3
2022-08-02T12:31:34Z
2024-04-17T21:26:20Z
https://github.com/chakra-core/ChakraCore/issues/6827
1,325,785,142
6,827
[ "chakra-core", "ChakraCore" ]
I am porting an old application from Moziall JS to chakra. The application will include helper functions, native objects constructed in C code only and native objects that can be constructed from script with the new operator. I have been experimenting with chakra embedding to complete these tasks. Since the samples available are limited, where can I shared these so that it could be useful to others as well.
Embedding Samples
https://api.github.com/repos/chakra-core/ChakraCore/issues/6826/comments
5
2022-07-29T06:47:30Z
2023-01-22T11:04:07Z
https://github.com/chakra-core/ChakraCore/issues/6826
1,321,832,305
6,826
[ "chakra-core", "ChakraCore" ]
I am porting an old application that embedded a very old version of Mozilla js to use chakra. This application involves several native objects written in C. The methods of these objects will be invoked from the script. If there is an exception to be raised from the native method, is there a way to determine meta data (source, url, line, column) about the script function from where the native function was called?
Script Meta Data in Native Function
https://api.github.com/repos/chakra-core/ChakraCore/issues/6825/comments
1
2022-07-29T06:46:36Z
2024-04-17T16:07:01Z
https://github.com/chakra-core/ChakraCore/issues/6825
1,321,831,693
6,825
[ "chakra-core", "ChakraCore" ]
This poc will output different results in the JIT compiler. ```js let a = [1, 2, 3]; let proto = []; Object.defineProperty(proto, 3, { get: function () { console.log("woops") return 2; } }); a.__proto__ = proto; function oops(){ a.pop() } for(let i=0;i<10;i++){ a.length = 4 oops() } ``` run with the following command: ``` Build\VcBuild\bin\x64_debug\ch.exe test.js -bgjit- -mic:5 -off:simplejit ``` output: ``` woops woops woops woops woops ``` but if run with the following command: ``` Build\VcBuild\bin\x64_debug\ch.exe test.js -bgjit- -mic:10 -off:simplejit ``` the output is: ``` woops woops woops woops woops woops woops woops woops woops ```
Array.prototype.pop doesn't trigger getter in __proto__
https://api.github.com/repos/chakra-core/ChakraCore/issues/6824/comments
2
2022-07-26T14:24:30Z
2022-09-30T20:31:37Z
https://github.com/chakra-core/ChakraCore/issues/6824
1,318,322,644
6,824
[ "chakra-core", "ChakraCore" ]
This poc will output different results in the JIT compiler. ```js function foo(a) { return a.length; } let array = new Int32Array(); Object.defineProperty(array, "length", { value: 10 }); for(let i=0;i<10;i++){ print(foo(array)) } ``` run with the following command ``` Build\VcBuild\bin\x64_debug\ch.exe test.js -bgjit- -mic:5 -off:simplejit ``` output ``` 10 10 10 10 10 0 0 0 0 0 ``` And I don't know if it's the same reason, the output of the poc below is weird. The length of a is 65535, while the loop is just repeated 152 times. ```js var a = new Int8Array(4); a.__defineGetter__("length", function () { return 0xFFFF; }); var mx = 0 print(a.length) for (var i = 0; i < a.length; i++) { mx = i } print(mx) ``` Run with the same command as before. The output is ``` 65535 151 ```
Object.defineProperty with length doesn't work correctly
https://api.github.com/repos/chakra-core/ChakraCore/issues/6823/comments
1
2022-07-26T14:05:05Z
2022-09-28T20:33:46Z
https://github.com/chakra-core/ChakraCore/issues/6823
1,318,296,524
6,823
[ "chakra-core", "ChakraCore" ]
This poc will output different results in the JIT compiler. ```js function test2(a) { if ((a | 0) >>> 0 > (11569 | -29007) >>> 0) return true; else return false; } for (var i = 0; i < 10; i++) { print(test2(-1)) } ``` run with command in current master branch(`commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec`): ``` Build\VcBuild\bin\x64_debug\ch.exe test.js -bgjit- -mic:5 -off:simplejit ``` output: ``` true true true true true false false false false false ```
incorrect result with unsigned right shift operator
https://api.github.com/repos/chakra-core/ChakraCore/issues/6822/comments
1
2022-07-26T13:50:16Z
2022-09-28T21:59:08Z
https://github.com/chakra-core/ChakraCore/issues/6822
1,318,276,307
6,822
[ "chakra-core", "ChakraCore" ]
I'm trying to build chakracore with the visual studio solution but an error is raised during configuration which I traced back to line 63 in CMakeLists.txt that indicates that the processor my machine is running is not supported. How can I be able to complete this build successfully?
Unsupported target processor: AMD64
https://api.github.com/repos/chakra-core/ChakraCore/issues/6821/comments
1
2022-07-19T08:36:58Z
2022-08-18T03:04:26Z
https://github.com/chakra-core/ChakraCore/issues/6821
1,309,178,046
6,821
[ "chakra-core", "ChakraCore" ]
Hello, how can I import and use a module from file ???? ``` Memo1.Lines.Text:=Engine.ConvertToString(Engine.RunScript('import * as customName from ("./myjs/MyNode.js");')); Error $30002: JavaScript failed to compile. Name: SyntaxError Message: 'import' or 'export' can only be used in module code. Source: import * as customName from ("./myjs/MyNode.js"); Line: 0 Column: 0 ```
How can I import and use a module from file
https://api.github.com/repos/chakra-core/ChakraCore/issues/6820/comments
1
2022-07-19T04:04:45Z
2022-09-29T22:05:51Z
https://github.com/chakra-core/ChakraCore/issues/6820
1,308,945,648
6,820
[ "chakra-core", "ChakraCore" ]
When Math functions are involved in a large number of iterations (> 10000), for-of loop is about 10 times slower in master (x86 release build) then in the last released version. ```js const arr = [...Array(10000).keys()]; for (const item of arr) { const a = Math.round(item/3); } ```
for-of 10x slower with Math functions
https://api.github.com/repos/chakra-core/ChakraCore/issues/6819/comments
7
2022-07-09T11:48:48Z
2022-10-05T07:33:19Z
https://github.com/chakra-core/ChakraCore/issues/6819
1,299,653,131
6,819
[ "chakra-core", "ChakraCore" ]
This issue is with reference to another issue from 6 years ago: https://github.com/chakra-core/ChakraCore/issues/1435 Will supporting AssemblyScript be a good idea? This is not a proposal, but I was wondering if any knowledgable person could enlighten me (and others) about the pros and cons of supporting native AssemblyScript in the browser.
Add native support for AssemblyScript
https://api.github.com/repos/chakra-core/ChakraCore/issues/6818/comments
7
2022-06-22T14:08:48Z
2022-06-22T17:10:21Z
https://github.com/chakra-core/ChakraCore/issues/6818
1,280,210,515
6,818
[ "chakra-core", "ChakraCore" ]
### Version: chakra-1.11.24.0 ### Description: For the TestCase below, after judging that `!p` is `true` in line 2, the function should `return` directly, but chakra terminates the program abnormally. Through the stack information of the program`#1 0x00007ffff34ddece in ByteCodeGenerator::EmitInvertedLoop ( this=0x7fffffffb4e0, outerLoop=0x7ff7f0b72da0, invertedLoop=0x7ff7f0b75030, funcInfo=0x7ff7f0b74800)`, maybe there is a problem in optimizing the `for` loop. ### TestCase: ```js var NISLFuzzingFunc = function(p) { if (!p) return; var a = 0; for (var h = 0;; ++h) { for (var r = 0; r < 1; ++r) { a = r; } } }; var NISLParameter0 = false; var NISLCallingResult = NISLFuzzingFunc(NISLParameter0); print(NISLCallingResult); ``` ### Command: ``` ~/ChakraCore/out/Release/ch TestCase.js ``` ### Output: ``` Aborted (core dumped) ``` ### Backtrace (using gdb debugging) : ``` gdb -q -args ~/ChakraCore-1.11.24/out/Debug/ch TestCase.js Reading symbols from ~/ChakraCore-1.11.24/out/Debug/ch...done. (gdb) r Starting program: ~/ChakraCore-1.11.24/out/Debug/ch TestCase.js [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ff7f242f700 (LWP 8102)] [New Thread 0x7ff7f1bff700 (LWP 8103)] [New Thread 0x7ff7f13fe700 (LWP 8104)] Thread 1 "ch" received signal SIGSEGV, Segmentation fault. 0x00007ffff34dcc75 in EmitBooleanExpression (expr=0x0, trueLabel=10, falseLabel=4, byteCodeGenerator=0x7fffffffb4e0, funcInfo=0x7ff7f0b74800, trueFallthrough=true, falseFallthrough=false) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:8835 8835 switch (expr->nop) (gdb) bt #0 0x00007ffff34dcc75 in EmitBooleanExpression (expr=0x0, trueLabel=10, falseLabel=4, byteCodeGenerator=0x7fffffffb4e0, funcInfo=0x7ff7f0b74800, trueFallthrough=true, falseFallthrough=false) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:8835 #1 0x00007ffff34ddece in ByteCodeGenerator::EmitInvertedLoop (this=0x7fffffffb4e0, outerLoop=0x7ff7f0b72da0, invertedLoop=0x7ff7f0b75030, funcInfo=0x7ff7f0b74800) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:9170 #2 0x00007ffff34bbff7 in Emit (pnode=0x7ff7f0b72da0, byteCodeGenerator=0x7fffffffb4e0, funcInfo=0x7ff7f0b74800, fReturnValue=0, isConstructorCall=false, bindingNameLocation=4294967295, isTopLevel=true) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:11085 #3 0x00007ffff34b82de in ByteCodeGenerator::EmitTopLevelStatement (this=0x7fffffffb4e0, stmt=0x7ff7f0b72da0, funcInfo=0x7ff7f0b74800, fReturnValue=0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:956 #4 0x00007ffff34c73ed in ByteCodeGenerator::EmitFunctionBody (this=0x7fffffffb4e0, funcInfo=0x7ff7f0b74800) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:2507 #5 0x00007ffff34ca160 in ByteCodeGenerator::EmitOneFunction (this=0x7fffffffb4e0, pnodeFnc=0x7ff7f0b722d0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:3132 #6 0x00007ffff34c7880 in ByteCodeGenerator::EmitScopeList (this=0x7fffffffb4e0, pnode=0x7ff7f0b722d0, breakOnBodyScopeNode=0x0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:3423 #7 0x00007ffff34c79dd in ByteCodeGenerator::EmitScopeList (this=0x7fffffffb4e0, pnode=0x7ff7f0b72170, breakOnBodyScopeNode=0x0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:3436 #8 0x00007ffff34c786b in ByteCodeGenerator::EmitScopeList (this=0x7fffffffb4e0, pnode=0x7ff7f0b72030, breakOnBodyScopeNode=0x0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:3420 #9 0x00007ffff34c7646 in ByteCodeGenerator::EmitProgram (this=0x7fffffffb4e0, pnodeProg=0x7ff7f0b72030) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeEmitter.cpp:2541 #10 0x00007ffff34fffb1 in ByteCodeGenerator::Generate (pnodeProg=0x7ff7f0b72030, grfscr=4112, byteCodeGenerator=0x7fffffffb4e0, ppRootFunc=0x7fffffffb778, sourceIndex=0, forceNoNative=false, parser=0x7fffffffb9f0, functionRef=0x0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeGenerator.cpp:2021 #11 0x00007ffff3503a8d in GenerateByteCode (pnode=0x7ff7f0b72030, grfscr=4112, scriptContext=0x5555561af538, ppRootFunc=0x7fffffffb778, sourceIndex=0, forceNoNative=false, parser=0x7fffffffb9f0, pse=0x7fffffffc930, parentScopeInfo=0x0, functionRef=0x0) at ~/ChakraCore-1.11.24/lib/Runtime/ByteCode/ByteCodeGenerator.cpp:2192 #12 0x00007ffff33c514a in Js::ScriptContext::GenerateRootFunction (this=0x5555561af538, parseTree=0x7ff7f0b72030, sourceIndex=0, parser=0x7fffffffb9f0, grfscr=4112, pse=0x7fffffffc930, rootDisplayName=0x7ffff43d3f80 <Js::Constants::GlobalCode> u"Global code") at ~/ChakraCore-1.11.24/lib/Runtime/Base/ScriptContext.cpp:2550 #13 0x00007ffff33c4de9 in Js::ScriptContext::LoadScriptInternal (this=0x5555561af538, parser=0x7fffffffb9f0, script=0x55555617d5d0 "var NISLFuzzingFunc = function(p) {\n if (!p) return;\n var a = 0;\n for (var h = 0;; ++h) {\n for (var r = 0; r < 1; ++r) {\n", ' ' <repeats 12 times>, "a = r;\n }\n }\n};\nvar NISLParameter0 = fals"..., cb=286, pSrcInfo=0x7fffffffc5e0, pse=0x7fffffffc930, ppSourceInfo=0x7fffffffc5d8, rootDisplayName=0x7ffff43d3f80 <Js::Constants::GlobalCode> u"Global code", loadScriptFlag=(LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer), scriptSource=0x7ff7f0b97000) at ~/ChakraCore-1.11.24/lib/Runtime/Base/ScriptContext.cpp:2488 #14 0x00007ffff33c5437 in Js::ScriptContext::LoadScript (this=0x5555561af538, script=0x55555617d5d0 "var NISLFuzzingFunc = function(p) {\n if (!p) return;\n var a = 0;\n for (var h = 0;; ++h) {\n for (var r = 0; r < 1; ++r) {\n", ' ' <repeats 12 times>, "a = r;\n }\n }\n};\nvar NISLParameter0 = fals"..., cb=286, pSrcInfo=0x7fffffffc5e0, pse=0x7fffffffc930, ppSourceInfo=0x7fffffffc5d8, rootDisplayName=0x7ffff43d3f80 <Js::Constants::GlobalCode> u"Global code", loadScriptFlag=(LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer), scriptSource=0x7ff7f0b97000) at ~/ChakraCore-1.11.24/lib/Runtime/Base/ScriptContext.cpp:2526 #15 0x00007ffff2c81751 in RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const ( this=0x7fffffffc820, scriptContext=0x5555561af538, _actionEntryPopper=...) at ~/ChakraCore-1.11.24/lib/Jsrt/Jsrt.cpp:3538 #16 0x00007ffff2c81427 in _JsErrorCode ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86, bool, bool)::{lambda(Js::ScriptContext*)#1}::operator()(Js::ScriptContext*) const (this=0x7fffffffc7a8, scriptContext=0x5555561af538) at ~/ChakraCore-1.11.24/lib/Jsrt/JsrtInternal.h:316 #17 0x00007ffff2c80d2a in ContextAPINoScriptWrapper_Core<_JsErrorCode ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86, bool, bool)::{lambda(Js::ScriptContext*)#1}>(_JsErrorCode ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86, bool, bool)::{lambda(Js::ScriptContext*)#1}, bool, bool) (fn=..., allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false) at ~/ChakraCore-1.11.24/lib/Jsrt/JsrtInternal.h:277 #18 0x00007ffff2c4b4b8 in ContextAPINoScriptWrapper<RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86>(RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**)::$_86, bool, bool) (fn=..., allowInObjectBeforeCollectCallback=false, scriptExceptionAllowed=false) at ~/ChakraCore-1.11.24/lib/Jsrt/JsrtInternal.h:314 #19 0x00007ffff2c4b35f in RunScriptCore (scriptSource=0x7ff7f0b97000, script=0x55555617d5d0 "var NISLFuzzingFunc = function(p) {\n if (!p) return;\n var a = 0;\n for (var h = 0;; ++h) {\n for (var r = 0; r < 1; ++r) {\n", ' ' <repeats 12 times>, "a = r;\n }\n }\n};\nvar NISLParameter0 = fals"..., cb=286, loadScriptFlag=(LoadScriptFlag_Utf8Source | LoadScriptFlag_ExternalArrayBuffer), sourceContext=0, sourceUrl=0x7ff7f0b70000 u"/home/nisl1/nisl8121/yw/TencentProject/result_analyse/crash/TestCase.js", parseOnly=false, parseAttributes=JsParseScriptAttributeNone, isSourceModule=false, result=0x0) at ~/ChakraCore-1.11.24/lib/Jsrt/Jsrt.cpp:3487 #20 0x00007ffff2c4deee in CompileRun (scriptVal=0x7ff7f0b97000, sourceContext=0, sourceUrl=0x7ff7f0bd5f00, parseAttributes=JsParseScriptAttributeNone, result=0x0, parseOnly=false) at ~/ChakraCore-1.11.24/lib/Jsrt/Jsrt.cpp:4991 #21 JsRun (scriptVal=0x7ff7f0b97000, sourceContext=0, sourceUrl=0x7ff7f0bd5f00, parseAttributes=JsParseScriptAttributeNone, result=0x0) at ~/ChakraCore-1.11.24/lib/Jsrt/Jsrt.cpp:5013 #22 0x000055555556045e in ChakraRTInterface::JsRun (script=0x7ff7f0b97000, sourceContext=0, sourceUrl=0x7ff7f0bd5f00, parseAttributes=JsParseScriptAttributeNone, result=0x0) at ~/ChakraCore-1.11.24/bin/ch/ChakraRtInterface.h:419 #23 0x000055555555d653 in RunScript (fileName=0x55555617c530 "./TestCase.js", fileContents=0x55555617d5d0 "var NISLFuzzingFunc = function(p) {\n if (!p) return;\n var a = 0;\n for (var h = 0;; ++h) {\n for (var r = 0; r < 1; ++r) {\n", ' ' <repeats 12 times>, "a = r;\n }\n }\n};\nvar NISLParameter0 = fals"..., fileLength=286, fileContentsFinalizeCallback=0x55555556c580 <WScriptJsrt::FinalizeFree(void*)>, bufferValue=0x0, fullPath=0x7fffffffd160 "/home/nisl1/nisl8121/yw/TencentProject/result_analyse/crash/TestCase.js", parserStateCache=0x0) at ~/ChakraCore-1.11.24/bin/ch/ch.cpp:479 #24 0x000055555555f0e1 in ExecuteTest (fileName=0x55555617c530 "./TestCase.js") at ~/ChakraCore-1.11.24/bin/ch/ch.cpp:913 #25 0x000055555555f1ac in ExecuteTestWithMemoryCheck (fileName=0x55555617c530 "./TestCase.js") at ~/ChakraCore-1.11.24/bin/ch/ch.cpp:963 #26 0x000055555555fa9b in main (argc=2, c_argv=0x7fffffffd5a8) at ~/ChakraCore-1.11.24/bin/ch/ch.cpp:1270 ``` ### Using ASAN: ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==8178==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x561fcd822a34 bp 0x7ffc3ac7b580 sp 0x7ffc3ac7b530 T0) ==8178==The signal is caused by a READ memory access. ==8178==Hint: address points to the zero page. #0 0x561fcd822a33 in EmitBooleanExpression(ParseNode*, int, int, ByteCodeGenerator*, FuncInfo*, bool, bool) (~/ChakraCore-1.11.24/out/Release/ch+0x177ea33) #1 0x561fcd8245b9 in ByteCodeGenerator::EmitInvertedLoop(ParseNodeLoop*, ParseNodeFor*, FuncInfo*) (~/ChakraCore-1.11.24/out/Release/ch+0x17805b9) #2 0x561fcd7ea583 in Emit(ParseNode*, ByteCodeGenerator*, FuncInfo*, int, bool, unsigned int, bool) (~/ChakraCore-1.11.24/out/Release/ch+0x1746583) #3 0x561fcd7e4275 in ByteCodeGenerator::EmitTopLevelStatement(ParseNode*, FuncInfo*, int) (~/ChakraCore-1.11.24/out/Release/ch+0x1740275) #4 0x561fcd800fa2 in ByteCodeGenerator::EmitFunctionBody(FuncInfo*) (~/ChakraCore-1.11.24/out/Release/ch+0x175cfa2) #5 0x561fcd806b76 in ByteCodeGenerator::EmitOneFunction(ParseNodeFnc*) (~/ChakraCore-1.11.24/out/Release/ch+0x1762b76) #6 0x561fcd8019ae in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) (~/ChakraCore-1.11.24/out/Release/ch+0x175d9ae) #7 0x561fcd8016f6 in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) (~/ChakraCore-1.11.24/out/Release/ch+0x175d6f6) #8 0x561fcd80199b in ByteCodeGenerator::EmitScopeList(ParseNode*, ParseNode*) (~/ChakraCore-1.11.24/out/Release/ch+0x175d99b) #9 0x561fcc7ef220 in ByteCodeGenerator::Generate(ParseNodeProg*, unsigned int, ByteCodeGenerator*, Js::ParseableFunctionInfo**, unsigned int, bool, Parser*, Js::ScriptFunction**) (~/ChakraCore-1.11.24/out/Release/ch+0x74b220) #10 0x561fcc7f5f31 in GenerateByteCode(ParseNodeProg*, unsigned int, Js::ScriptContext*, Js::ParseableFunctionInfo**, unsigned int, bool, Parser*, CompileScriptException*, Js::ScopeInfo*, Js::ScriptFunction**) (~/ChakraCore-1.11.24/out/Release/ch+0x751f31) #11 0x561fcc767a9e in Js::ScriptContext::LoadScriptInternal(Parser*, unsigned char const*, unsigned long, SRCINFO const*, CompileScriptException*, Js::Utf8SourceInfo**, char16_t const*, LoadScriptFlag, void*) (~/ChakraCore-1.11.24/out/Release/ch+0x6c3a9e) #12 0x561fcc76821f in Js::ScriptContext::LoadScript(unsigned char const*, unsigned long, SRCINFO const*, CompileScriptException*, Js::Utf8SourceInfo**, char16_t const*, LoadScriptFlag, void*) (~/ChakraCore-1.11.24/out/Release/ch+0x6c421f) #13 0x561fcc52a8ef in RunScriptCore(void*, unsigned char const*, unsigned long, LoadScriptFlag, unsigned long, char16_t const*, bool, _JsParseScriptAttributes, bool, void**) (~/ChakraCore-1.11.24/out/Release/ch+0x4868ef) #14 0x561fcc534cc5 in JsRun (~/ChakraCore-1.11.24/out/Release/ch+0x490cc5) #15 0x561fcc432002 in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) (~/ChakraCore-1.11.24/out/Release/ch+0x38e002) #16 0x561fcc434380 in ExecuteTest(char const*) (~/ChakraCore-1.11.24/out/Release/ch+0x390380) #17 0x561fcc435116 in main (~/ChakraCore-1.11.24/out/Release/ch+0x391116) #18 0x7f91738bac86 in __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310 #19 0x561fcc333a69 in _start (~/ChakraCore-1.11.24/out/Release/ch+0x28fa69) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (~/ChakraCore-1.11.24/out/Release/ch+0x177ea33) in EmitBooleanExpression(ParseNode*, int, int, ByteCodeGenerator*, FuncInfo*, bool, bool) ==8178==ABORTING ```
for-loop optimization causes a null pointer exception
https://api.github.com/repos/chakra-core/ChakraCore/issues/6817/comments
3
2022-06-20T12:55:28Z
2022-09-23T13:52:45Z
https://github.com/chakra-core/ChakraCore/issues/6817
1,276,886,647
6,817
[ "chakra-core", "ChakraCore" ]
ChakraCore failed to build "error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC." with MSVC on Windows arm64ec. It can reproduce on latest version on master branch. Could you please help look at this issue? Repro steps: 1. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64 2. git clone https://github.com/chakra-core/ChakraCore F:\aa\ChakraCore 3. cd ChakraCore 4. Change "ARM64" to "ARM64EC" in Chakra.Backend.vcxproj Chakra.Common.Memory.vcxproj Chakra.Runtime.Language.vcxproj Chakra.Runtime.Library.vcxproj Chakra.Core.sln 5. msbuild /m /p:Platform=ARM64EC /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.22618.0 Build\Chakra.Core.sln /t:Rebuild **Error info:** ``` 21>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC. [F:\aa\ChakraCore\manifests\CoreManifests.vcxproj] 21>Done Building Project "F:\aa\ChakraCore\manifests\CoreManifests.vcxproj" (Rebuild target(s)) -- FAILED. 2>Project "F:\aa\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj.metaproj" (2) is building "F:\aa\ChakraCore\lib\Common\Codex\Chakra.Common.Codex.vcxproj" (23) on node 2 (Rebuild target(s)). 23>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC. [F:\aa\ChakraCore\lib\Common\Codex\Chakra.Common.Codex.vcxproj] 23>Done Building Project "F:\aa\ChakraCore\lib\Common\Codex\Chakra.Common.Codex.vcxproj" (Rebuild target(s)) -- FAILED. 2>Project "F:\aa\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj.metaproj" (2) is building "F:\aa\ChakraCore\lib\wabt\wabt.vcxproj" (22) on node 7 (Rebuild target(s)). 22>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC. [F:\aa\ChakraCore\lib\wabt\wabt.vcxproj] 22>Done Building Project "F:\aa\ChakraCore\lib\wabt\wabt.vcxproj" (Rebuild target(s)) -- FAILED. 2>Project "F:\aa\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj.metaproj" (2) is building "F:\aa\ChakraCore\lib\Common\util\Chakra.Common.Util.vcxproj" (24) on node 6 (Rebuild target(s)). 24>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC. [F:\aa\ChakraCore\lib\Common\util\Chakra.Common.Util.vcxproj] 24>Done Building Project "F:\aa\ChakraCore\lib\Common\util\Chakra.Common.Util.vcxproj" (Rebuild target(s)) -- FAILED. 2>Project "F:\aa\ChakraCore\bin\ChakraCore\ChakraCore.vcxproj.metaproj" (2) is building "F:\aa\ChakraCore\lib\Common\Exceptions\Chakra.Common.Exceptions.vcxproj" (25) on node 4 (Rebuild target(s)). 25>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC. [F:\aa\ChakraCore\lib\Common\Exceptions\Chakra.Common.Exceptions.vcxproj] 25>Done Building Project "F:\aa\ChakraCore\lib\Common\Exceptions\Chakra.Common.Exceptions.vcxproj" (Rebuild target(s)) -- FAILED. 1>Project "F:\aa\ChakraCore\Build\Chakra.Core.sln" (1) is building "F:\aa\ChakraCore\lib\Jsrt\Chakra.Jsrt.vcxproj.metaproj" (13) on node 1 (Rebuild target(s)). 13>Project "F:\aa\ChakraCore\lib\Jsrt\Chakra.Jsrt.vcxproj.metaproj" (13) is building "F:\aa\ChakraCore\lib\JITIDL\Chakra.JITIDL.vcxproj" (27) on node 8 (Rebuild target(s)). 27>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC. [F:\aa\ChakraCore\lib\JITIDL\Chakra.JITIDL.vcxproj] ``` **Error log:** [ChakraCore_msbuild_error.log](https://github.com/chakra-core/ChakraCore/files/8917544/ChakraCore_msbuild_error.log)
ChakraCore failed to build "error MSB8013: This project doesn't contain the Configuration and Platform combination of Release|ARM64EC." with MSVC on Windows arm64ec
https://api.github.com/repos/chakra-core/ChakraCore/issues/6816/comments
1
2022-06-16T09:26:47Z
2022-10-01T06:04:24Z
https://github.com/chakra-core/ChakraCore/issues/6816
1,273,297,505
6,816
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0 ###### Test case ```js var foo = function() { var me = arguments.callee; print(me.name); } foo(); ``` ###### Command /root/.jsvu/ch Testcase.js ###### Output ``` ``` ###### Expected result ``` foo ``` ###### Description `callee` is a property of the `arguments` object. It can be used to refer to the currently executing function inside the function body of that function.But when executing this test case, chakra simply return nothing.
arguments.callee can't get the correct result
https://api.github.com/repos/chakra-core/ChakraCore/issues/6814/comments
1
2022-05-14T08:22:05Z
2022-05-20T01:53:22Z
https://github.com/chakra-core/ChakraCore/issues/6814
1,235,913,480
6,814
[ "chakra-core", "ChakraCore" ]
I don't know if my process is wrong, I tried to register the c# class in jscontext, Then, create the registered class new in JS, and then release it, It was found that jssetobjectbeforecollectcallback was not called. My detailed process is shown below: 1: ![image](https://user-images.githubusercontent.com/20411721/166618624-4488bf67-f558-4120-833f-0f87d26a6b15.png) ![image](https://user-images.githubusercontent.com/20411721/166618648-fa1761d9-9eab-44d4-8e7d-9b37c6b61359.png) ![image](https://user-images.githubusercontent.com/20411721/166618668-2b3aac01-8d21-4474-8dc4-347bda4e0735.png) ![image](https://user-images.githubusercontent.com/20411721/166618685-df8f72d4-bc7b-41f5-b78f-f77959466b8a.png) I found that "collect" was not printed, and the breakpoint was not hit, so it was not executed at all I'm not sure if there's something wrong with my JS or there's something missing in chakracore's library. I hope you can find the answer here. Thank you very much for your reply below. Thank you very much!!! My current project is in “https://github.com/527395632/ChakraRuntime”
”JsSetObjectBeforeCollectCallback“ No call
https://api.github.com/repos/chakra-core/ChakraCore/issues/6813/comments
1
2022-05-04T03:17:12Z
2022-05-27T01:30:55Z
https://github.com/chakra-core/ChakraCore/issues/6813
1,224,881,419
6,813
[ "chakra-core", "ChakraCore" ]
### commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec ### Build platform Ubuntu 20.04 ### Build steps ``` ./build.sh --debug ``` ### poc ```js function foo(f) { WScript.Attach(f); } async function bar() { for (let i = 0; i < 1; [0,1][0]--) { await foo(bar); } } bar(); ``` ### assert log ``` ASSERTION 2406829: (ChakraCore/lib/Runtime/Language/DynamicProfileInfo.cpp, line 1255) index < functionBody->GetProfiledArrayCallSiteCount() Failure: (index < functionBody->GetProfiledArrayCallSiteCount()) Illegal instruction ```
ASSERTION Failure: "(index < functionBody->GetProfiledArrayCallSiteCount())" in ChakraCore/lib/Runtime/Language/DynamicProfileInfo.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6812/comments
1
2022-04-20T13:54:00Z
2022-05-27T04:24:50Z
https://github.com/chakra-core/ChakraCore/issues/6812
1,209,726,102
6,812
[ "chakra-core", "ChakraCore" ]
### commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec ### Build platform Ubuntu 20.04 ### Build steps ``` ./build.sh --debug ``` ### poc ```js function foo() { var x = new bar(); } function bar() { foo(); WebAssembly[0 === 1 ? keys : valueOf]; return {}; } WScript.Attach(bar); ``` ### assert log ``` ASSERTION 2405716: (/media/Store/Project/js-engines/ChakraCore/lib/Backend/GlobOpt.cpp, line 6709) !Js::TaggedInt::Is(right) Failure: (!Js::TaggedInt::Is(right)) Illegal instruction ```
ASSERTION Failure: (!Js::TaggedInt::Is(right)) in ChakraCore/lib/Backend/GlobOpt.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6811/comments
0
2022-04-20T13:46:42Z
2022-04-20T13:48:07Z
https://github.com/chakra-core/ChakraCore/issues/6811
1,209,716,028
6,811
[ "chakra-core", "ChakraCore" ]
### commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec ### Build platform Ubuntu 20.04 ### Build steps ``` ./build.sh --debug ``` ### poc ```js var bar = function foo() {}; delete bar.length; bar.toString = ''; delete Function.prototype.length; bar.length = 13; ``` ### assert log ``` ASSERTION 2403445: (ChakraCore/lib/Runtime/Types/PathTypeHandler.cpp, line 3920) Re-add of deleted property NYI in PathTypeHandler Failure: (0) Illegal instruction ```
ASSERTION Failure: "Re-add of deleted property NYI in PathTypeHandler" in ChakraCore/lib/Runtime/Types/PathTypeHandler.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6810/comments
0
2022-04-20T13:46:06Z
2022-04-20T13:46:06Z
https://github.com/chakra-core/ChakraCore/issues/6810
1,209,715,183
6,810
[ "chakra-core", "ChakraCore" ]
###### Version ``` chakra-1.11.24.0 ``` ###### Test case ```js var foo = function() { var start = Date.now(); var stop = Date.now(); return stop - start; }; var result = foo(); print(result); ``` ###### Execution steps /root/.jsvu/ch Testcase.js ###### Output ``` 5 ``` ###### Description When executing this code, in the vast majority of cases, other engines output 0, but chakra outputs 5. Is this a problem with the time conversion mechanism or is it simply a difference in execution time?
A question about Date.now()
https://api.github.com/repos/chakra-core/ChakraCore/issues/6809/comments
2
2022-04-11T09:12:44Z
2022-05-20T01:52:25Z
https://github.com/chakra-core/ChakraCore/issues/6809
1,199,660,795
6,809
[ "chakra-core", "ChakraCore" ]
###### Version ``` chakra-1.11.24.0 ``` ###### Test case ```js var foo = function () { try { print("1") } catch { } }; foo(); ``` ###### Execution steps /root/.jsvu/ch Testcase.js ###### Output ``` SyntaxError: Expected '(' at code (javascriptTestcase_eut5pcps.js:4:12) ``` ###### Expected behavior ``` 1 ``` ###### Description When executing this test case, other engines can execute normally and output the expected result `1`, but chakra throws a syntax error in line 4. It seems like chakra requires `()` after `catch`, or it won't work properly.
chakra require () after catch
https://api.github.com/repos/chakra-core/ChakraCore/issues/6807/comments
1
2022-03-30T11:52:43Z
2022-09-26T14:15:03Z
https://github.com/chakra-core/ChakraCore/issues/6807
1,186,344,899
6,807
[ "chakra-core", "ChakraCore" ]
``` commit : 41ad58a Engine version : ch version 1.13.0.0-beta Build platform : Ubuntu 18.04 Clang version : 6.0.0 Build steps : ./build.sh --sanitize=address --static -j -d ``` POC ``` cat efe25658e8db4c358a13283eec7f6e85.js ------------------------------------------------ function main() { function v0(v1, v2) { main(); const v7 = new Int16Array(44915); for (let v10 = 0; v10 < 1337; v10++) { v7[v10] = 1337; v7[v10] = v2; } } const v12 = new Promise(v0); } ``` Assert Log ``` ./ch efe25658e8db4c358a13283eec7f6e85.js ------------------------------------------------- ASSERTION 3893: (ChakraCore-master/lib/Common/Exceptions/Throw.cpp, line 103) Js reentrancy error!! Failure: (false) Illegal instruction ``` Hi, Richard, could you please help check this issue? @rhuanjl
ASSERTION Failure "Js reentrancy error" in ChakraCore/lib/Common/Exceptions/Throw.cpp, line 103
https://api.github.com/repos/chakra-core/ChakraCore/issues/6806/comments
1
2022-03-12T15:46:01Z
2022-03-26T00:38:01Z
https://github.com/chakra-core/ChakraCore/issues/6806
1,167,321,941
6,806
[ "chakra-core", "ChakraCore" ]
``` commit : 41ad58a Engine version : ch version 1.13.0.0-beta Build platform : Ubuntu 18.04 Clang version : 6.0.0 Build steps : ./build.sh --sanitize=address --static -j -d ``` POC ``` cat 87b228d1b5ba4db0b1cc8dc471c76e52.js -------------------------------------------------------------------------------------------------------- var date0 = new Date('1995-12-17T03:24:00'); var dateti1 = new Intl.DateTimeFormat("iw-up-a-caiaup-araup-ai-pdu-sp-bs-up-arscna-zeieiaup-araup-arscia-rews-us-up-arscna-zeieiaup-araup-arsciap-arscna-zeieiaup-araup-arscie-u-sp-bs-uaup-arscia"); d = dateti1.format(date0); ``` Assert Log ``` ./ch 87b228d1b5ba4db0b1cc8dc471c76e52.js --------------------------------------------------- ASSERTION 3898: (ChakraCore-master/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 941) U_STRING_NOT_TERMINATED_WARNING Failure: (false) Illegal instruction ``` Hi, Richard, could you please help check this issue? @rhuanjl
ASSERTION Failure "U_STRING_NOT_TERMINATED_WARNING" in ChakraCore-master/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 941
https://api.github.com/repos/chakra-core/ChakraCore/issues/6805/comments
1
2022-03-12T15:45:29Z
2022-03-26T00:38:21Z
https://github.com/chakra-core/ChakraCore/issues/6805
1,167,321,798
6,805
[ "chakra-core", "ChakraCore" ]
``` commit : 41ad58a Engine version : ch version 1.13.0.0-beta Build platform : Ubuntu 18.04 Clang version : 6.0.0 Build steps : ./build.sh --sanitize=address --static -j -d ``` POC ``` cat 10aab6552c2849fa81e1ba53001be52d.js ---------------------------------------------------------------------- var number = 5.0260805378947765e+223; var nf = new Intl.NumberFormat("bs-u-nu-bzcu-cab-cabs-avnlubs-avnihu-zcu-cab-cbs-avnllubs-avnihq-zcu-cab-cbs-ubs-avnihu-cabs-flus-xxd-vnluy" + String.prototype.valueOf.call("v1")); var f = nf.format(number); ``` Assert Log ``` ./ch 10aab6552c2849fa81e1ba53001be52d.js ASSERTION 3909: (ChakraCore-master/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 945) U_ILLEGAL_ARGUMENT_ERROR Failure: (false) Illegal instruction ``` Hi, Richard, could you please help check this issue? @rhuanjl
ASSERTION Failure "U_ILLEGAL_ARGUMENT_ERROR" in ChakraCore/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 945
https://api.github.com/repos/chakra-core/ChakraCore/issues/6804/comments
1
2022-03-12T15:44:43Z
2022-03-26T00:37:12Z
https://github.com/chakra-core/ChakraCore/issues/6804
1,167,321,376
6,804
[ "chakra-core", "ChakraCore" ]
``` commit : 41ad58a Engine version : ch version 1.13.0.0-beta Build platform : Ubuntu 18.04 Clang version : 6.0.0 Build steps : ./build.sh --sanitize=address --static -j -d ``` POC ``` cat b66bf88394d84085b34f1ca313f087e2.js ----------------------------------------------------------------- // |reftest| skip-if(!this.hasOwnProperty("Intl")) /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Check for duplicate variants and singletons case-insensitively, but don't // check in privateuse components. function checkInvalidLocale(locale) { try { new Intl.NumberFormat(locale); throw new Error("didn't throw"); } catch (e) { e instanceof RangeError; true; "expected RangeError for locale '" + locale + "', got " + e; } } var badLocales = ["en-u-foo-U-foo", "en-tester-Tester", "en-tesTER-TESter", "de-DE-u-kn-true-U-kn-true", "ar-u-foo-q-bar-u-baz", "ar-z-moo-u-foo-q-bar-z-eit-u-baz"]; for (var locale of badLocales) { checkInvalidLocale(locale); } // Fully-privateuse locales are okay. for (var locale of badLocales) { new Intl.NumberFormat("x-" + locale).format(5); } // Locales with trailing privateuse also okay. for (var locale of badLocales) { new Intl.NumberFormat("en-x-" + locale).format(5); badLocales.reduce(function () { checkInvalidLocale(locale); locale += locale + locale; }); new Intl.NumberFormat("en-u-foo-x-u-" + locale).format(5); } if (typeof reportCompare === "function") { reportCompare(true, true); } ``` Assert Log ``` ./ch b66bf88394d84085b34f1ca313f087e2.js ASSERTION 3914: (ChakraCore-master/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 941) U_BUFFER_OVERFLOW_ERROR Failure: (false) Illegal instruction ``` Hi, Richard, could you please help check this issue? @rhuanjl
ASSERTION Failure "U_BUFFER_OVERFLOW_ERROR" in ChakraCore/lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp, line 941
https://api.github.com/repos/chakra-core/ChakraCore/issues/6803/comments
1
2022-03-12T15:44:10Z
2022-03-26T00:37:35Z
https://github.com/chakra-core/ChakraCore/issues/6803
1,167,321,176
6,803
[ "chakra-core", "ChakraCore" ]
``` commit : 41ad58a Engine version : ch version 1.13.0.0-beta Build platform : Ubuntu 18.04 Clang version : 6.0.0 Build steps : ./build.sh --sanitize=address --static -j -d ``` POC ``` cat da5c7dd74b3349db93bbbd5f9340f241.js ----------------------------------------------------- try { (function TestFunc() { var a; (function outer() { (function inner() { outer(); a; })(); with ({}) { outer(); outer(); TestFunc(); TestFunc(); TestFunc(); } })(); })(); } catch (ex) { if (ex.message == "Out of stack space") { print("PASSED"); } } ``` Assert Log ``` ./ch da5c7dd74b3349db93bbbd5f9340f241.js ASSERTION 3930: (/data/WYC/engines/ChakraCore-master/lib/Runtime/Language/InterpreterStackFrame.cpp, line 7592) scopeSlotCount != 0 Failure: (scopeSlotCount != 0) Illegal instruction ``` Hi, Richard, could you please help check this issue? @rhuanjl
ASSERTION Failure "scopeSlotCount != 0" in ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp, line 7592
https://api.github.com/repos/chakra-core/ChakraCore/issues/6802/comments
1
2022-03-12T15:43:25Z
2022-03-26T00:35:50Z
https://github.com/chakra-core/ChakraCore/issues/6802
1,167,320,978
6,802
[ "chakra-core", "ChakraCore" ]
``` commit : 41ad58a Engine version : ch version 1.13.0.0-beta Build platform : Ubuntu 18.04 Clang version : 6.0.0 Build steps : ./build.sh --sanitize=address --static -j -d ``` POC ``` cat c47abaee6c514e2a80bdb63b8b7db8d0.js ---------------------------------------------------------------------------------- async function test(func, funcs) { try { await func(); throw new Error("Expected " + func.toString() + " to throw"); } catch (e) { var stack = e.stack.split('\n').slice(1).map(line => line.trim()).map(line => line.match(/at (?:(.*) )?.*$/)[1]).filter(x => typeof x === 'string' && x.length); funcs; stack; `Unexpected stack trace ${"FAIL"}`; } } function thrower() { throw new Error("NOPE"); } function reject() { return Promise.reject(new Error("NOPE")); } async function runTests() { await test(async function a() { throw new Error("FAIL"); }, ["a", "test", "runTests"]); await test(async function a2() { runTests(); throw new Error("FAIL"); }, ["a2"]); await test(async function a3() { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } }, ["a3"]); await test(async function a4() { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } }, ["a4"]); await test({ async b() { throw new Error("FAIL"); } }.b, ["b", "test", "runTests"]); await test({ async b2() { await 1; throw new Error("FAIL"); } }.b2, ["b2"]); await test({ async b3() { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } } }.b3, ["b3"]); await test({ async b4() { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } } }.b4, ["b4"]); await test(new class { async c() { throw new Error("FAIL"); } }().c, ["c", "test", "runTests"]); await test(new class { async c2() { await 1; throw new Error("FAIL"); } }().c2, ["c2"]); await test(new class { async c3() { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } } }().c3, ["c3"]); await test(new class { async c4() { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } } }().c4, ["c4"]); await test(async x => { throw new Error("FAIL"); }, ["test", "runTests"]); await test(async () => { throw new Error("FAIL"); }, ["test", "runTests"]); await test(async a => { throw new Error("FAIL"); }, ["set".repeat(1518500249).valueOf(), "runTests"]); await test(async (a, b) => { throw new Error("FAIL"); }, ["test", "runTests"]); await test(async x => { await 1; throw new Error("FAIL"); }, []); await test(async () => { await 1; throw new Error("FAIL"); }, String.prototype.toLocaleUpperCase.call("test").match(/\w*\d/)); await test(async a => { await 1; throw new Error("FAIL"); }, []); await test(async (a, b) => { await 1; throw new Error("FAIL"); }, []); await test(async x => { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async () => { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async a => { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async (a, b) => { await 1; try { await thrower(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async x => { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async () => { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async a => { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } }, []); await test(async (a, b) => { await 1; try { await reject(); } catch (e) { throw new Error("FAIL"); } }, []); } runTests().catch(e => { print(e); quit(1); }); ``` Assert Log ``` ./ch c47abaee6c514e2a80bdb63b8b7db8d0.js ------------------------------------------------- RangeError: String length is out of bound ASSERTION 3935: (ChakraCore-master/lib/Runtime/Language/JavascriptStackWalker.cpp, line 1289) Inlined frame should resolve to the right parent address Failure: (entryPointInfo != nullptr) Illegal instruction ``` Hi, Richard, could you please help check this issue? @rhuanjl
ASSERTION Failure "entryPointInfo != nullptr" in ChakraCore/lib/Runtime/Language/JavascriptStackWalker.cpp, line 1289
https://api.github.com/repos/chakra-core/ChakraCore/issues/6801/comments
1
2022-03-12T15:42:32Z
2022-03-26T00:36:38Z
https://github.com/chakra-core/ChakraCore/issues/6801
1,167,320,734
6,801
[ "chakra-core", "ChakraCore" ]
### commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec ### Build platform Ubuntu 20.04 ### Build steps ``` ./build.sh --debug ``` ### poc ``` function foo(o) { switch (o.f) { case 1: return 1; case 2: return class Baz{}; default: return 0; } } function bar() { for (var i = 0; i < 64; ++i) x += foo( { f: 5 } ); } var x = bar(); ``` ### assert log ``` ASSERTION 2399095: (ChakraCore/lib/Backend/IRBuilder.cpp, line 2394) opndConstructor->m_sym->m_isSingleDef Failure: (opndConstructor->m_sym->m_isSingleDef) Illegal instruction ```
ASSERTION Failure: (opndConstructor->m_sym->m_isSingleDef) in ChakraCore/lib/Backend/IRBuilder.cpp, line 2394
https://api.github.com/repos/chakra-core/ChakraCore/issues/6794/comments
1
2022-03-09T13:21:01Z
2022-03-26T00:31:35Z
https://github.com/chakra-core/ChakraCore/issues/6794
1,163,932,473
6,794
[ "chakra-core", "ChakraCore" ]
### commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec ### Build platform Ubuntu 20.04 ### Build steps ``` ./build.sh --debug ``` ### poc ```js function foo() { (function () { function bar( a = 1, b = function () { return a; } ) { var arguments = 3; } }()); } WScript.Attach(foo); ``` ### assert log ``` ASSERTION 2397793: (ChakraCore/lib/Runtime/./Base/FunctionBody.h, line 2977) reg < this->GetConstantCount() Failure: (reg < this->GetConstantCount()) Illegal instruction ```
ASSERTION Failure: "reg < this->GetConstantCount()" in ChakraCore/lib/Runtime/./Base/FunctionBody.h, line 2977
https://api.github.com/repos/chakra-core/ChakraCore/issues/6793/comments
1
2022-03-09T12:57:05Z
2022-03-26T00:32:12Z
https://github.com/chakra-core/ChakraCore/issues/6793
1,163,907,144
6,793
[ "chakra-core", "ChakraCore" ]
### Commit hash 41ad58a9eebf8d52a83424c8fccfaacdb14105ec ### Build platform Ubuntu 20.04 ### Build steps ``` ./build.sh --debug ``` ### poc ```js let foo = new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 7, 1, 96, 2, 126, 127, 1, 127, 3, 2, 1, 0, 4, 4, 1, 112, 0, 4, 6, '-0', 5, 127, 0 ]); let bar = new WebAssembly.Module(foo); ``` ### assert log ``` ASSERTION 2388397: (ChakraCore/lib/WasmReader/WasmBinaryReader.cpp, line 1319) m_pc + m_funcState.size == m_currentSection.end Failure: (m_pc + m_funcState.size == m_currentSection.end) Illegal instruction ```
ASSERTION Failure: (m_pc + m_funcState.size == m_currentSection.end) in ChakraCore/lib/WasmReader/WasmBinaryReader.cpp, line 1319
https://api.github.com/repos/chakra-core/ChakraCore/issues/6792/comments
1
2022-03-09T12:31:51Z
2022-03-26T00:33:27Z
https://github.com/chakra-core/ChakraCore/issues/6792
1,163,881,646
6,792
[ "chakra-core", "ChakraCore" ]
I just pulled down the project and attempted to build the Debug x64 configuration with Visual Studio 2015 **2>C:\Dev\ChakraCore-master\lib\Runtime\Library\JavascriptArray.cpp(8938): error C2872: 'uint32_t': ambiguous symbol 2> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdint.h(23): note: could be 'unsigned int uint32_t' 2> c:\dev\chakracore-master\lib\runtime\Language/AsmJsTypes.h(35): note: or 'Js::uint32_t'**
VC 2015 build issue. JavascriptArray.cpp(8938) error C2872: 'uint32_t': ambiguous symbol
https://api.github.com/repos/chakra-core/ChakraCore/issues/6791/comments
0
2022-02-23T03:40:46Z
2022-02-23T03:40:46Z
https://github.com/chakra-core/ChakraCore/issues/6791
1,147,595,384
6,791
[ "chakra-core", "ChakraCore" ]
###### Version chakra-1.11.24.0 ###### Test case 1 ```js var foo = function() { var o = [1,2,3]; var a = [...o]; print(a); }; foo(); ``` ###### Execution steps 1 ./ChakraCore/out/Release/ch Testcase1.js ###### Output 1 ``` 1,2,3 ``` ###### Test case 2 ```js var foo = function() { var o = [1, 2, 3]; var b = {...o}; print(b); }; foo(); ``` ###### Execution steps 2 ./ChakraCore/out/Release/ch Testcase2.js ###### Output 2 ``` SyntaxError: Expected identifier, string or number at code (Testcase2.js:3:14) ``` ###### Expected behavior 2 ``` [object Object] ``` ###### Description When executing the above two test cases that both contain a spread operator `...`. When the operator `...` is used in an array assignment statement at line 3 in Test case 1, the test case can be executed normally and output the correct result. But when it is used in an object assignment statement at line 3 in Test case 2, a `SyntaxError` exception was thrown shown as Output 2. I executed both test cases on other JS engines and they all output excepted results. I think it might be an issue of chakra. ###### Reference https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
chakra can't recognize spread_syntax
https://api.github.com/repos/chakra-core/ChakraCore/issues/6790/comments
1
2022-02-22T11:08:25Z
2022-09-26T14:15:07Z
https://github.com/chakra-core/ChakraCore/issues/6790
1,146,770,582
6,790
[ "chakra-core", "ChakraCore" ]
Version: 41ad58a9eebf8d52a83424c8fccfaacdb14105ec (2022//2/20 latest) OS: Linux Ubuntu 20.04.3 LTS Architecture: x64 ### **Poc:** function attach(f) { (function (r) {    WScript.Attach(r); })(f); } async function mainTest(notAttachCall) {    if (notAttachCall) {        for (let i = 0; i < [1]; ++i) {            await attach(mainTest);       }   } else {        var i = 10;/**bp:locals()**/   } } mainTest(true); WScript.Echo("PASSED"); ### **Trace:** AddressSanitizer:DEADLYSIGNAL ==229002==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x5564849d4998 bp 0x7ffe7ae00630 sp 0x7ffe7ae00630 T0) ==229002==The signal is caused by a READ memory access. ==229002==Hint: address points to the zero page. #0 0x5564849d4998 in Js::ByteBlock::GetBuffer() /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/ByteCode/ByteBlock.cpp:21:16 #1 0x556484a3bb4c in Js::AuxArray<int> const* Js::ByteCodeReader::ReadAuxArray<int>(unsigned int, Js::FunctionBody*) /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/ByteCode/ByteCodeReader.cpp:231:104 #2 0x556484f54aaf in void Js::InterpreterStackFrame::ProfiledNewScIntArray<true>(Js::OpLayoutDynamicProfile<Js::OpLayoutAuxiliary> const __unaligned*) /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:5409:43 #3 0x556484cc279b in Js::InterpreterStackFrame::ProcessWithDebugging() /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/Language/InterpreterHandler.inl:401:3 #4 0x556484c9d977 in Js::InterpreterStackFrame::DebugProcess() /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2517:34 #5 0x556484c9c4f3 in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:2143:40 #6 0x556484c9b73b in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) /home/xyf2001/Desktop/wy/ChakraCore/lib/Runtime/Language/InterpreterStackFrame.cpp:1833:16 #7 0x7fed87010f99 (<unknown module>) ... #55 0x5564845e4f28 in main /home/xyf2001/Desktop/wy/ChakraCore/bin/ch/ch.cpp:1274:20 #56 0x7fed8bd460b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #57 0x55648453581d in _start (/home/xyf2001/Desktop/wy/ChakraCore/out/Release/ch+0x2c181d) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/.../ChakraCore/lib/Runtime/ByteCode/ByteBlock.cpp:21:16 in Js::ByteBlock::GetBuffer() ==229002==ABORTING
Segmentation fault
https://api.github.com/repos/chakra-core/ChakraCore/issues/6789/comments
0
2022-02-20T06:48:25Z
2022-10-13T02:49:34Z
https://github.com/chakra-core/ChakraCore/issues/6789
1,144,937,068
6,789
[ "chakra-core", "ChakraCore" ]
When a `ReportModuleCompletionCallback` is set, the callback is called even for modules that fail to load due to a syntax error (an exception object is passed to the callback in this case). It seems that, while a valid `JsModuleRecord` is still passed in in this situation, subsequently calling `JsGetModuleNamespace()` on the same module record will cause a segfault, rather than simply setting the namespace to `NULL`. There may be other module APIs affected by this (I assume the function can't deal with being passed an incomplete module record), but this is the only one I've encountered so far.
`JsGetModuleNamespace()` can segfault if passed an incomplete module record
https://api.github.com/repos/chakra-core/ChakraCore/issues/6788/comments
2
2022-02-15T07:36:59Z
2024-05-16T22:11:17Z
https://github.com/chakra-core/ChakraCore/issues/6788
1,138,300,123
6,788
[ "chakra-core", "ChakraCore" ]
Chakracore can't support some important nodejs module, like 'commonmark' and 'graphql' var reLinkLabel = /^\[(?:[^\\\[\]]|\\.){0,1000}\]/s; JavaScript failed to compile. SyntaxError: Syntax error in regular expression function KnownArgumentNamesRule(context) { return { // eslint-disable-next-line new-cap ...KnownArgumentNamesOnDirectivesRule(context), <----- syntax error Argument(argNode) { const argDef = context.getArgument(); const fieldDef = context.getFieldDef(); const parentType = context.getParentType(); if (!argDef && fieldDef && parentType) { const argName = argNode.name.value; const knownArgsNames = fieldDef.args.map((arg) => arg.name); const suggestions = (0, _suggestionList.suggestionList)( argName, knownArgsNames, ); context.reportError( new _GraphQLError.GraphQLError( `Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + (0, _didYouMean.didYouMean)(suggestions), argNode, ), ); } }, }; } it seems that chakracore can't support some es6 syntax, and I can't find some test example in chakracore\test,there's only example about spread syntax for array
chakarcore have not implement some es6 syntax
https://api.github.com/repos/chakra-core/ChakraCore/issues/6787/comments
5
2022-02-03T12:19:12Z
2024-04-17T15:56:41Z
https://github.com/chakra-core/ChakraCore/issues/6787
1,123,018,625
6,787
[ "chakra-core", "ChakraCore" ]
I'm working on a "Script Loader" that loads .js files from a specific path and runs the code within through the chakra environment, with this I've been able to make something like for the script: function onTick() { // Do Stuff }; and have a tick on the C++ end that not only finds this function in the script but then executes it. But I wanted to know was how I can pass arguments through the function call (on the C++ end) like: function onTick(objectOfSomething) { // Do stuff with the passed variable };
Calling JsCallFunction with arguments?
https://api.github.com/repos/chakra-core/ChakraCore/issues/6784/comments
1
2022-01-12T03:48:21Z
2022-01-18T13:28:36Z
https://github.com/chakra-core/ChakraCore/issues/6784
1,099,845,167
6,784
[ "chakra-core", "ChakraCore" ]
the following poc cause a inconsistent output. ``` function v0(v1, v2) { const v4 = v1["o"](); return v4; } function v5() { const v9 = arguments[-1]; return v9; } const v10 = { "o": v5 }; const v11 = { }; c0 = v0(v10, v11);//true print(Object.is(c0,undefined)); for (i = 0; i < 10000; i++) { v0(v10, v11); } c1 = v0(v10, v11); print(Object.is(c1,undefined));//false ```
incorrect optimization bug
https://api.github.com/repos/chakra-core/ChakraCore/issues/6783/comments
3
2021-12-30T09:01:50Z
2022-09-28T06:27:12Z
https://github.com/chakra-core/ChakraCore/issues/6783
1,090,967,636
6,783
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function main() { const v4 = ` const v214 = async (v215,...v216) => { const v219 = {"construct":v215,"defineProperty":v215,"deleteProperty":v205,"get":v215,"getOwnPropertyDescriptor":v215,"getPrototypeOf":v214,"isExtensible":Number,"ownKeys":undefined,"preventExtensions":Array,"setPrototypeOf":v215}; const v221 = \` with (3820293751n) { const v223 = v214(null,5978n,4294967297,-12075807n); constructor = -536870912n; } \`; }; const v225 = \` function v226(v227,v228,v229) { return -1005802608n; return -1046319162n; } \`; const v231 = \` const v233 = [-3290630866,-3290630866,1479576250n,6,-3290630866]; \`; const v235 = \` function v236(v237,v238,v239) { return -1005802608n; } \`; const v246 = \` with (v41) { switch (Uint8ClampedArray) { default: break; case -3214534038n: break; case -2147483648n: break; case 6: break; case v246: } constructor = -536870912n; const v247 = Proxy && 256n; } \`; const v252 = \` function v253(v254,v255,v256) { return -1005802608n; return -268435456n; } \`; const v258 = \` function* v259(v260,v261) { yield* 8n; } const v263 = [-3290630866,-3290630866,1479576250n,2419694973n,-3290630866]; \`; const v265 = \` function v266(v267,v268,v269) { return -1005802608n; return 256n; } \`; const v272 = \` const v273 = -1005802608n >= -1683432796; \`; const v295 = {}; const v296 = \` const v297 = v296(...v295,...9007199254740993,-1005802608n); \`; const v301 = {}; const v302 = [v301]; const v303 = {}; const v304 = [{}]; const v308 = [150050.77584817936]; const v309 = /\d(N*)?/gm; const v310 = /(H\W)/sium; async function v314(v315,v316,v317) { const v318 = {}; v318[0] = BigInt; } const v320 = \` function v321(v322,v323,v324) { return 797151056n; return -9007199254740993n; return -4256153502n; } \`; function v669(v670,v671) { const v672 = \` function v673(v674,v675,v676) { return 65537n; return -1918956861n; } \`; const v678 = \` function v679(v680,v681,v682) { return -4139769482n; } \`; const v685 = (-3290630866).a; const v687 = \` const v689 = v685("entries",...v687,3961059690n); \`; const v690 = \` Symbol.toPrimitive = -1315759576n; \`; const v693 = \` switch (-9007199254740991n) { default: break; case 2147483649n: case -65536: } \`; for (let v700 = v672; v700 < -3679967650; v700 = v700 || 4) { const v701 = \` const v702 = 536870912n === v700; \`; } const v709 = \` const v710 = {}.join(Number,...-4294967295n); \`; const v711 = \` function v712(v713,v714,v715) { return -2851821453n; return -2457772485n; return 512n; return 65536n; return -128n; return 9007199254740991n; } \`; const v716 = v669(); } const v718 = new Promise(v669); const v728 = \` with ([NaN,NaN]) { switch (isFinite) { default: valueOf = -2591578432n; break; case -3214534038n: break; case -3214534038n: break; case 6: break; case v728: } constructor = -536870912n; } \`; `; let v1212 = eval(); v1212 = eval; const v1213 = v1212(v4); } main(); ```
Assertion failure in FuncInfo.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6782/comments
0
2021-12-28T06:50:56Z
2021-12-28T06:50:56Z
https://github.com/chakra-core/ChakraCore/issues/6782
1,089,654,281
6,782
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function main() { do { for (let v7 = 0; v7 != 0; v7++) { for (let v11 = 0; v11 < 9; v11 = v11 + 2147483647) { } } } while (0 !== 6); } main(); ```
Assertion failure in GlobOpt.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6781/comments
1
2021-12-28T06:49:03Z
2022-03-11T14:56:08Z
https://github.com/chakra-core/ChakraCore/issues/6781
1,089,653,508
6,781
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function main() { const v0 = async () => { const v1 = ` const v2 = [..."-2147483647"]; for (const v3 of v2) { for (let v4 = 0; v4 < 9; v4++) { const v5 = () => { const v6 = \`\`; const v7 = eval(v6); for (const v8 in v3) { const v9 = {"call":Symbol}; v9.toString = Symbol; for (let v10 = 0; v10 < 8; v10++) {} const v11 = [NaN]; } }; const v12 = v5(); } } const v13 = [NaN]; `; const v14 = eval(v1); }; const v15 = [4]; const v16 = v15["map"](v0); } main(); ```
Assertion failure in Backend/Lower.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6780/comments
0
2021-12-28T06:48:20Z
2021-12-28T06:48:20Z
https://github.com/chakra-core/ChakraCore/issues/6780
1,089,653,225
6,780
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function main() { const v3 = [-3290630866,-3290630866,-3290630866,-3290630866,0]; for (const v4 of v3) { const v13 = async (v14) => { const v24 = ``; const v29 = await v14; for (let v52 = 1; v52 == -1; v52 = v52-4096) { const v89 = ``; } }; for (let v125 = 0; v125 < 9; v125++) { const v127 = [4,723347.8822827139]; const v129 = v127["map"](v13); } } } main(); ```
Assertion failure in EncoderMD.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6779/comments
0
2021-12-28T06:47:32Z
2021-12-28T06:47:32Z
https://github.com/chakra-core/ChakraCore/issues/6779
1,089,652,896
6,779
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function main() { do { let v4 = 0; const v6 = ` for (let v12 = 1; v12 < -1683432796; v12 = v12 || 1) { } `; const v23 = eval(v6); for (let v26 = 0; v26 != 9; v26++) { switch (v4) { case -3290630866: break; case v26: break; case -3290630866: } } } while (0 !== 6); } main(); ```
Assertion failure in Backend/ValueInfo.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6778/comments
0
2021-12-28T06:44:47Z
2021-12-28T06:44:47Z
https://github.com/chakra-core/ChakraCore/issues/6778
1,089,651,819
6,778
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function v0(v1,v2) { try { for (let v6 = -1332925573; v6 >= 256; v6++) { try { } catch(v7) { } finally { break; } } } finally { } } function v8(v9,v10) { } const v13 = [65537,v8,65537,-2609076265]; const v16 = AggregateError("bigint"); const opt = v0;let p0 = v13;let p1 = v16; ```
Assertion failure in BackwardPass.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6777/comments
0
2021-12-24T11:13:31Z
2021-12-24T11:13:31Z
https://github.com/chakra-core/ChakraCore/issues/6777
1,088,323,965
6,777
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function v0(v1,v2) { function v3(v4,v5) { } const v7 = new v3(); function v8(v9,v10) { v2.__proto__ = v7; return v2; } const v11 = v8(); v11.constructor = Map; v11.length = 1; return v11; } const v14 = new Promise(v0); ```
Assertion failure in CacheOperators.inl
https://api.github.com/repos/chakra-core/ChakraCore/issues/6776/comments
0
2021-12-24T11:12:16Z
2021-12-24T11:12:16Z
https://github.com/chakra-core/ChakraCore/issues/6776
1,088,323,336
6,776
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function v0(v1,v2) { v2.length = 1; return v2; } function v4(v5,v6) { } const v8 = new v4(); function v9(v10,v11) { v11.__proto__ = v8; return v11; } const v12 = v9(undefined,v4); v12[-65537] = v9; const opt = v0;let p0 = v12;let p1 = v12; ```
Assertion failure in InlineCache.inl
https://api.github.com/repos/chakra-core/ChakraCore/issues/6775/comments
0
2021-12-24T11:10:49Z
2021-12-24T11:10:49Z
https://github.com/chakra-core/ChakraCore/issues/6775
1,088,322,607
6,775
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` const v6 = Array(4294967295); const v8 = v6["copyWithin"](); ```
Assertion failure in JavascriptArray.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6774/comments
1
2021-12-24T11:09:40Z
2022-02-03T08:04:00Z
https://github.com/chakra-core/ChakraCore/issues/6774
1,088,322,028
6,774
[ "chakra-core", "ChakraCore" ]
the following poc cause a assertion failure in "debug" build on ubuntu. ``` function v0(v1,v2) { try { const v3 = v0(); } catch(v4) { const v7 = "65537".localeCompare; const v8 = Reflect.apply(v7,"65537",v4); } finally { } } const v9 = v0(); ```
Assertion failure in /IntlEngineInterfaceExtensionObject.cpp
https://api.github.com/repos/chakra-core/ChakraCore/issues/6773/comments
2
2021-12-24T11:08:10Z
2022-03-11T15:16:14Z
https://github.com/chakra-core/ChakraCore/issues/6773
1,088,321,277
6,773