chakra-core / chakra-core/ChakraCore

crash in BackwardPass::ReverseCopyProp

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

Description

the following poc will crash the latest build on ubuntu.
```
function opt() {
let v4 = 9;
for (let v5 = 0; v5 < v4; v5 = v5 / v4) {
v4 = v5;
}
const v6 = v4--;
}
for(i = 0;i < 1000; i++){
opt();
}

```

#0 0x0000555555e96e6d in BackwardPass::ReverseCopyProp(IR::Instr*) ()
#1 0x0000555555e90fb5 in BackwardPass::ProcessBlock(BasicBlock*) ()
#2 0x0000555555e8d66d in BackwardPass::OptBlock(BasicBlock*) ()
#3 0x0000555555e8cf1e in BackwardPass::Optimize() ()
#4 0x0000555555d485ca in GlobOpt::BackwardPass(Js::Phase) ()
#5 0x0000555555d488a8 in GlobOpt::Optimize() ()
#6 0x0000555555d4155f in Func::TryCodegen() ()
#7 0x0000555555d4125c in Func::Codegen(Memory::JitArenaAllocator*, JITTimeWorkItem*, ThreadContextInfo*, ScriptContextInfo*, JITOutputIDL*, Js::EntryPointInfo*, FunctionJITRuntimeInfo const*, JITTimePolymorphicInlineCacheInfo*, void*, Js::ScriptContextProfiler*, bool) ()
#8 0x0000555555cc0e29 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase, Memory::PageSegmentBase >*, CodeGenWorkItemIDL*, JITOutputIDL&, bool, Js::EntryPointInfo*) ()
#9 0x0000555555cc10cd in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase, Memory::PageSegmentBase >*, CodeGenWorkItem*, bool) ()
#10 0x0000555555cc1953 in NativeCodeGenerator::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) ()
#11 0x0000555555cd4a0e in JsUtil::BackgroundJobProcessor::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) ()
#12 0x0000555555cd4b15 in JsUtil::BackgroundJobProcessor::Run(JsUtil::ParallelThreadData*) ()
#13 0x0000555555cd3a47 in JsUtil::BackgroundJobProcessor::StaticThreadProc(void*) ()
#14 0x000055555571f9fd in CorUnix::CPalThread::ThreadEntry(void*) ()
#15 0x00007ffff7aa2609 in start_thread (arg=) at pthread_create.c:477
#16 0x00007ffff7857293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied JavaScript PoC on Ubuntu, then inspect BackwardPass::ReverseCopyProp and its callers ProcessBlock, OptBlock, and Optimize. Trace the failing IR state from the provided stack trace; done means the PoC completes without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.