Skip to content

Running out of memory when creating constants in a loop #6763

@zhunki

Description

@zhunki

the following poc cause a crash in latest build on ubuntu.

for (let v3 = -65537; v3 < 3; v3 = v3 + 0) {
    const v4 = v3++;
}

#0 0x0000555555799691 in ReportFatalException ()
#1 0x0000555555799877 in Js::Throw::FatalInternalError(int) ()
#2 0x0000555555d543a7 in GlobOpt::CollectMemOpInfo(IR::Instr*, IR::Instr*, Value*, Value*) ()
#3 0x0000555555d4bf0e in GlobOpt::OptInstr(IR::Instr*&, bool*) ()
#4 0x0000555555d49e13 in GlobOpt::OptBlock(BasicBlock*) ()
#5 0x0000555555d48f49 in GlobOpt::ForwardPass() ()
#6 0x0000555555d4889b in GlobOpt::Optimize() ()
#7 0x0000555555d4155f in Func::TryCodegen() ()
#8 0x0000555555d4125c in Func::Codegen(Memory::JitArenaAllocator*, JITTimeWorkItem*, ThreadContextInfo*, ScriptContextInfo*, JITOutputIDL*, Js::EntryPointInfo*, FunctionJITRuntimeInfo const*, JITTimePolymorphicInlineCacheInfo*, void*, Js::ScriptContextProfiler*, bool) ()
#9 0x0000555555cc0e29 in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBaseMemory::VirtualAllocWrapper, Memory::PageSegmentBaseMemory::VirtualAllocWrapper >, CodeGenWorkItemIDL, JITOutputIDL&, bool, Js::EntryPointInfo*) ()
#10 0x0000555555cc10cd in NativeCodeGenerator::CodeGen(Memory::PageAllocatorBase<Memory::VirtualAllocWrapper, Memory::SegmentBaseMemory::VirtualAllocWrapper, Memory::PageSegmentBaseMemory::VirtualAllocWrapper >, CodeGenWorkItem, bool) ()
#11 0x0000555555cc1953 in NativeCodeGenerator::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) ()
#12 0x0000555555cd4a0e in JsUtil::BackgroundJobProcessor::Process(JsUtil::Job*, JsUtil::ParallelThreadData*) ()
#13 0x0000555555cd4b15 in JsUtil::BackgroundJobProcessor::Run(JsUtil::ParallelThreadData*) ()
#14 0x0000555555cd3a47 in JsUtil::BackgroundJobProcessor::StaticThreadProc(void*) ()
#15 0x000055555571f9fd in CorUnix::CPalThread::ThreadEntry(void*) ()
#16 0x00007ffff7aa2609 in start_thread (arg=) at pthread_create.c:477
#17 0x00007ffff7857293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions