chakra-core / chakra-core/ChakraCore

Program crashed, Aborted

Open
#6,928 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

### Version
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; ++i) {
await attach(mainTest);
}
} else write(attach + " " + arguments[0]);
}
mainTest(true);
WScript.Echo("PASSED");
```
### Build
In release build `./build.sh --sanitize=address --static -j `
### Execute the poc
I get
```
PASSED
Aborted core dump.
```
### Backtrace

```
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ff7f0b67700 (LWP 22819)]
[New Thread 0x7ff7ebfff700 (LWP 22824)]
[New Thread 0x7ff7eb7fe700 (LWP 22825)]
PASSED
Thread 1 "ch" received signal SIGILL, Illegal instruction.
0x0000555555cd6bb9 in DebugBreak () at /root/ChakraCore-2023-6/lib/Common/CommonPal.h:161
161 /root/ChakraCore-2023-6/lib/Common/CommonPal.h: No such file or directory.
(gdb) bt
#0 0x0000555555cd6bb9 in DebugBreak () at /root/ChakraCore-2023-6/lib/Common/CommonPal.h:161
#1 ReportFatalException (context=, exceptionCode=, reasonCode=, scenario=)
at /root/ChakraCore-2023-6/lib/Common/Exceptions/ReportError.cpp:20
#2 0x0000555555cd7319 in Js::Throw::FatalInternalError (hr=0) at /root/ChakraCore-2023-6/lib/Common/Exceptions/Throw.cpp:72
#3 0x000055555616f655 in Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}::operator()(Js::FunctionBody*) const (pFuncBody=, this=)
at /root/ChakraCore-2023-6/lib/Runtime/Debug/DebugContext.cpp:359
#4 void Js::Utf8SourceInfo::MapFunction(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}::operator()(unsigned int, Js::FunctionBody*) const (
this=, functionBody=) at /root/ChakraCore-2023-6/lib/Runtime/./Base/Utf8SourceInfo.h:163
#5 void JsUtil::BaseDictionary, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::Map(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int const&, Js::FunctionBody* const&)#1}::operator()(void Js::Utf8SourceInfo::MapFunction(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}, unsigned int const&) const (this=, key=, value=)
at /root/ChakraCore-2023-6/lib/Common/DataStructures/BaseDictionary.h:579
#6 bool JsUtil::BaseDictionary, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::MapUntil, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::Map(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int const&, Js::FunctionBody* const&)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(JsUtil::SimpleDictionaryEntry > const&)#1}::operator()(Memory::WriteBarrierPtr) const (this=, entry=...)
at /root/ChakraCore-2023-6/lib/Common/DataStructures/BaseDictionary.h:589
#7 JsUtil::BaseDictionary, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::MapEntryUntil to continue, or q to quit---
tionBody*, Memory::RecyclerLeafAllocator, DictionarySizePolicy, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::MapUntil, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::Map(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int const&, Js::FunctionBody* const&)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(JsUtil::SimpleDictionaryEntry > const&)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const (this=, fn=...) at /root/ChakraCore-2023-6/lib/Common/DataStructures/BaseDictionary.h:755
#8 JsUtil::BaseDictionary, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::MapUntil, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::Map(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int const&, Js::FunctionBody* const&)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const (
this=, fn=...) at /root/ChakraCore-2023-6/lib/Common/DataStructures/BaseDictionary.h:587
#9 JsUtil::BaseDictionary, DefaultComparer, JsUtil::SimpleDictionaryEntry, JsUtil::NoResizeLock>::Map(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const (
this=, fn=...) at /root/ChakraCore-2023-6/lib/Common/DataStructures/BaseDictionary.h:577
#10 JsUtil::SynchronizedDictionary, DefaultComparer, JsUtil::SimpleDictionaryEntry, Js::DefaultContainerLockPolicy, CriticalSection>::Map(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const::{lambda(unsigned int, Js::FunctionBody*)#1}>(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const (this=0x7ffff20e9f00, fn=...) at /root/ChakraCore-2023-6/lib/Common/DataStructures/BaseDictionary.h:1840
#11 Js::Utf8SourceInfo::MapFunction(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const::{lambda(Js::FunctionBody*)#3}) const (this=, mapper=...) at /root/ChakraCore-2023-6/lib/Runtime/./Base/Utf8SourceInfo.h:161
---Type to continue, or q to quit---return
#12 Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1::operator()(int, Js::Utf8SourceInfo*) const (index=0, this=,
sourceInfo=) at /root/ChakraCore-2023-6/lib/Runtime/Debug/DebugContext.cpp:352
#13 JsUtil::List::MapUntilFrom(int, Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1) const (start=0, this=,
map=...) at /root/ChakraCore-2023-6/lib/Common/DataStructures/List.h:531
#14 JsUtil::List::MapUntil(Js::DebugContext::RundownSourcesAndReparse(bool, bool)::$_1) const (this=, map=...)
at /root/ChakraCore-2023-6/lib/Common/DataStructures/List.h:521
#15 Js::DebugContext::RundownSourcesAndReparse (this=, shouldPerformSourceRundown=true, shouldReparseFunctions=)
at /root/ChakraCore-2023-6/lib/Runtime/Debug/DebugContext.cpp:224
#16 0x0000555555ef7853 in Js::ScriptContext::OnDebuggerAttached (this=)
at /root/ChakraCore-2023-6/lib/Runtime/Base/ScriptContext.cpp:3658
#17 0x0000555555c2a54b in JsDiagStartDebugging::$_0::operator() (this=) at /root/ChakraCore-2023-6/lib/Jsrt/JsrtDiag.cpp:96
#18 _JsErrorCode GlobalAPIWrapper_NoRecord(JsDiagStartDebugging::$_0)::{lambda()#1}::operator()() const (
this=) at /root/ChakraCore-2023-6/lib/Jsrt/JsrtInternal.h:167
#19 GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord(JsDiagStartDebugging::$_0)::{lambda()#1}>(_JsErrorCode GlobalAPIWrapper_NoRecord(JsDiagStartDebugging::$_0)::{lambda()#1}) (fn=...)
at /root/ChakraCore-2023-6/lib/Jsrt/JsrtInternal.h:127
#20 GlobalAPIWrapper_NoRecord (fn=...) at /root/ChakraCore-2023-6/lib/Jsrt/JsrtInternal.h:165
#21 JsDiagStartDebugging (runtimeHandle=, debugEventCallback=0x61a000000680, callbackState=0x603000000101)
at /root/ChakraCore-2023-6/lib/Jsrt/JsrtDiag.cpp:54
#22 0x0000555555926f00 in ChakraRTInterface::JsDiagStartDebugging (runtimeHandle=0x0, debugEventCallback=0x0, callbackState=0x6030000013c0)
at /root/ChakraCore-2023-6/bin/ch/ChakraRtInterface.h:444
#23 Debugger::StartDebugging (this=0x6030000013c0, runtime=0x0) at /root/ChakraCore-2023-6/bin/ch/Debugger.cpp:404
#24 0x00005555559557cb in WScriptJsrt::AttachCallback(void*, bool, void**, unsigned short, void*)::$_1::operator()(WScriptJsrt::CallbackMessage&) const (this=, msg=...) at /root/ChakraCore-2023-6/bin/ch/WScriptJsrt.cpp:960
#25 CustomMessage::Call(char const*)
(this=, fileName=) at /root/ChakraCore-2023-6/bin/ch/MessageQueue.h:281
#26 0x00005555559191ad in MessageQueue::ProcessAll (this=, fileName=)
at /root/ChakraCore-2023-6/bin/ch/MessageQueue.h:256
#27 RunScript (fileName=0x612000000040 "/home/tangsong/FuzzingOut/Superion/ch_crashes/ch_06/id:000000,sig:06,src:000055,op:python,pos:0",
fileContents=, fileLength=0, fileContentsFinalizeCallback=0x555555937160 ,
bufferValue=0x7fffffffd7d0, fullPath=0x7fff00000000 "", parserStateCache=) at /root/ChakraCore-2023-6/bin/ch/ch.cpp:480
#28 0x000055555591d991 in ExecuteTest (fileName=) at /root/ChakraCore-2023-6/bin/ch/ch.cpp:917
---Type to continue, or q to quit---return
#29 0x000055555591f178 in ExecuteTestWithMemoryCheck (fileName=0x0) at /root/ChakraCore-2023-6/bin/ch/ch.cpp:967
#30 main (argc=, c_argv=0xffffffffb9e) at /root/ChakraCore-2023-6/bin/ch/ch.cpp:1274

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.