chakra-core / chakra-core/ChakraCore
SEGV on unknown address 0x000000000000
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Branch: `master`
commit: `c3ead3f8a6e0bb8e32e043adc091c68cba5935e9`
Poc is:
```
function attach(f) {
(function (r) {
WScript.Attach(r);
})(f);
}
async function mainTest(notAttachCall) {
if (notAttachCall) {
for (let i = 0; i < 1; WScript.Echo([Attach||i])) {
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
=================================================================
==37824==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55cf944d0209 bp 0x7ffd07952b30 sp 0x7ffd07952af0 T0)
==37824==The signal is caused by a READ memory access.
==37824==Hint: address points to the zero page.
#0 0x55cf944d0208 in Js::ArrayCallSiteInfo::IsNativeIntArray() const /root/ChakraCore-2023-6/lib/Runtime/./Language/DynamicProfileInfo.h:377:50
#1 0x55cf944d0208 in Js::ProfilingHelpers::ProfiledNewScArray(unsigned int, Js::FunctionBody*, unsigned short) /root/ChakraCore-2023-6/lib/Runtime/Language/ProfilingHelpers.cpp:493
#2 0x55cf93ff436a in void Js::InterpreterStackFrame::ProfiledNewScArray>>(Js::OpLayoutDynamicProfile>> const __unaligned*) /root/ChakraCore-2023-6/lib/Runtime/Language/InterpreterStackFrame.cpp:5368:13
#3 0x55cf93ff436a in void Js::InterpreterStackFrame::OP_ProfiledNewScArray>>(Js::OpLayoutDynamicProfile>> const __unaligned*) /root/ChakraCore-2023-6/lib/Runtime/./Language/InterpreterStackFrame.h:649
#4 0x55cf93ff436a in Js::InterpreterStackFrame::ProcessWithDebugging() /root/ChakraCore-2023-6/lib/Runtime/Language/InterpreterHandler.inl:400
#5 0x55cf93fc97ff in Js::InterpreterStackFrame::DebugProcess() /root/ChakraCore-2023-6/lib/Runtime/Language/InterpreterStackFrame.cpp:2517:34
#6 0x55cf93fc7543 in Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction*, Js::ArgumentReader, void*, void*, Js::InterpreterStackFrame::AsmJsReturnStruct*) /root/ChakraCore-2023-6/lib/Runtime/Language/InterpreterStackFrame.cpp:2143:40
#7 0x55cf93fc5d7c in Js::InterpreterStackFrame::InterpreterThunk(Js::JavascriptCallStackLayout*) /root/ChakraCore-2023-6/lib/Runtime/Language/InterpreterStackFrame.cpp:1833:16
#8 0x7fd550230f99 ()
#9 0x55cf94d7175d in amd64_CallFunction /root/ChakraCore-2023-6/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#10 0x55cf93aae3f2 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda'()::operator()() const::'lambda'()::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4681:36
#11 0x55cf93aae3f2 in void* ThreadContext::SafeReentrantCall(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda'()::operator()() const::'lambda'()) /root/ChakraCore-2023-6/lib/Runtime/./Base/ThreadContext.h:1812
#12 0x55cf93aae3f2 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda'()::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4678
#13 0x55cf93aae3f2 in void TryFinally(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda'() const&, Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda'(bool) const&) /root/ChakraCore-2023-6/lib/Common/CommonPal.h:661
#14 0x55cf93aae3f2 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4676
#15 0x55cf93aae3f2 in void TryFinally(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9 const&, Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_10 const&) /root/ChakraCore-2023-6/lib/Common/CommonPal.h:661
#16 0x55cf93aae3f2 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4635
#17 0x55cf94d7175d in amd64_CallFunction /root/ChakraCore-2023-6/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#18 0x55cf947a18fe in Js::JavascriptGenerator::CallGenerator(void*, Js::ResumeYieldKind) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptGenerator.cpp:198:26
#19 0x55cf94d7175d in amd64_CallFunction /root/ChakraCore-2023-6/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#20 0x55cf93aae000 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda0'()::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4698:32
#21 0x55cf93aae000 in void* ThreadContext::SafeReentrantCall(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda0'()) /root/ChakraCore-2023-6/lib/Runtime/./Base/ThreadContext.h:1812
#22 0x55cf93aae000 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4695
#23 0x55cf93aae000 in void TryFinally(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9 const&, Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_10 const&) /root/ChakraCore-2023-6/lib/Common/CommonPal.h:661
#24 0x55cf93aae000 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4635
#25 0x55cf947362c1 in Js::JavascriptAsyncFunction::AsyncSpawnStep(Js::JavascriptAsyncSpawnStepFunction*, Js::JavascriptGenerator*, void*, void*) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptAsyncFunction.cpp:151:25
#26 0x55cf947374a6 in Js::JavascriptAsyncFunction::EntryAsyncSpawnCallStepFunction(Js::RecyclableObject*, Js::CallInfo, ...) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptAsyncFunction.cpp:130:5
#27 0x55cf94d7175d in amd64_CallFunction /root/ChakraCore-2023-6/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#28 0x55cf93aae000 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda0'()::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4698:32
#29 0x55cf93aae000 in void* ThreadContext::SafeReentrantCall(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const::'lambda0'()) /root/ChakraCore-2023-6/lib/Runtime/./Base/ThreadContext.h:1812
#30 0x55cf93aae000 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4695
#31 0x55cf93aae000 in void TryFinally(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9 const&, Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_10 const&) /root/ChakraCore-2023-6/lib/Common/CommonPal.h:661
#32 0x55cf93aae000 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4635
#33 0x55cf94b5376e in Js::JavascriptPromise::EntryReactionTaskFunction(Js::RecyclableObject*, Js::CallInfo, ...) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptPromise.cpp:1273:37
#34 0x55cf94d7175d in amd64_CallFunction /root/ChakraCore-2023-6/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#35 0x55cf93ab15b7 in Js::ScriptContext::ProfileModeThunk_DebugModeWrapper(Js::JavascriptFunction*, Js::ScriptContext*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments&)::$_11::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4754:24
#36 0x55cf93ab15b7 in void* Js::HelperOrLibraryMethodWrapper(Js::ScriptContext*, Js::ScriptContext::ProfileModeThunk_DebugModeWrapper(Js::JavascriptFunction*, Js::ScriptContext*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments&)::$_11) /root/ChakraCore-2023-6/lib/Runtime/./Debug/DiagHelperMethodWrapper.h:53
#37 0x55cf93ab15b7 in Js::ScriptContext::ProfileModeThunk_DebugModeWrapper(Js::JavascriptFunction*, Js::ScriptContext*, void* (*)(Js::RecyclableObject*, Js::CallInfo, ...), Js::Arguments&) /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4751
#38 0x55cf93aade79 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9::operator()() const /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4660:27
#39 0x55cf93aade79 in void TryFinally(Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_9 const&, Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...)::$_10 const&) /root/ChakraCore-2023-6/lib/Common/CommonPal.h:661
#40 0x55cf93aade79 in Js::ScriptContext::DebugProfileProbeThunk(Js::RecyclableObject*, Js::CallInfo, ...) /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:4635
#41 0x55cf94d7175d in amd64_CallFunction /root/ChakraCore-2023-6/lib/Runtime/Library/amd64/JavascriptFunctionA.S:100
#42 0x55cf94788096 in Js::JavascriptFunction::CallRootFunctionInternal(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptFunction.cpp:772:24
#43 0x55cf94787c7e in Js::JavascriptFunction::CallRootFunction(Js::RecyclableObject*, Js::Arguments, Js::ScriptContext*, bool) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptFunction.cpp:717:15
#44 0x55cf94787c7e in Js::JavascriptFunction::CallRootFunction(Js::Arguments, Js::ScriptContext*, bool) /root/ChakraCore-2023-6/lib/Runtime/Library/JavascriptFunction.cpp:832
#45 0x55cf936769c0 in JsCallFunction::$_65::operator()(Js::ScriptContext*, TTD::TTDJsRTActionResultAutoRecorder&) const /root/ChakraCore-2023-6/lib/Jsrt/Jsrt.cpp:2842:41
#46 0x55cf936769c0 in _JsErrorCode ContextAPIWrapper(JsCallFunction::$_65)::'lambda'(Js::ScriptContext*)::operator()(Js::ScriptContext*) const /root/ChakraCore-2023-6/lib/Jsrt/JsrtInternal.h:237
#47 0x55cf936769c0 in _JsErrorCode ContextAPIWrapper_Core(JsCallFunction::$_65)::'lambda'(Js::ScriptContext*)>(JsCallFunction::$_65) /root/ChakraCore-2023-6/lib/Jsrt/JsrtInternal.h:192
#48 0x55cf936769c0 in _JsErrorCode ContextAPIWrapper(JsCallFunction::$_65) /root/ChakraCore-2023-6/lib/Jsrt/JsrtInternal.h:235
#49 0x55cf936769c0 in JsCallFunction /root/ChakraCore-2023-6/lib/Jsrt/Jsrt.cpp:2804
#50 0x55cf935024ee in ChakraRTInterface::JsCallFunction(void*, void**, unsigned short, void**) /root/ChakraCore-2023-6/bin/ch/ChakraRtInterface.h:416:149
#51 0x55cf935024ee in WScriptJsrt::CallbackMessage::CallFunction(char const*) /root/ChakraCore-2023-6/bin/ch/WScriptJsrt.cpp:2009
#52 0x55cf934cb1ac in MessageQueue::ProcessAll(char const*) /root/ChakraCore-2023-6/bin/ch/MessageQueue.h:256:18
#53 0x55cf934cb1ac in RunScript(char const*, char const*, unsigned long, void (*)(void*), void*, char*, void*) /root/ChakraCore-2023-6/bin/ch/ch.cpp:480
#54 0x55cf934cf990 in ExecuteTest(char const*) /root/ChakraCore-2023-6/bin/ch/ch.cpp:917:13
#55 0x55cf934d1177 in ExecuteTestWithMemoryCheck(char*) /root/ChakraCore-2023-6/bin/ch/ch.cpp:967:10
#56 0x55cf934d1177 in main /root/ChakraCore-2023-6/bin/ch/ch.cpp:1274
#57 0x7fd5547a5c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
#58 0x55cf933ccc69 in _start (/home/tangsong/engines/all_version/ChakraCore/ChakraCore-2023-6/sanitize/ch+0x2c6c69)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /root/ChakraCore-2023-6/lib/Runtime/./Language/DynamicProfileInfo.h:377:50 in Js::ArrayCallSiteInfo::IsNativeIntArray() const
==37824==ABORTING
```
Contributor guide
Assessment
This issue has not been assessed yet.