-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Hi everyone,
I decide to disable ENABLE_CONCURRENT_GC, because in our application we don't want extra reserved memory for barriers table, but this result in serious performance implications.Basicly our application spend 95% of the time in GC, because it looks like every API call trigger cleanup.
So i decide to disable it for function ContextAPIWrapper_Core, but this result in a crash in JavascriptArray::DirectSetItem_Full.
Look like this line SparseArraySegment* current = (SparseArraySegment*)this->GetBeginLookupSegment(itemIndex, false);
returns wrong pointer(misinterpreted) or memory behind it is stomped.
I try to add 24 byte marker at begin of SparseArraySegmentBase which i set to zero and when crash occur “current” looks like :
Marker - >0x00000002bc9e8308 {0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0x83, 0x46, 0x4d, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xc1, 0xff, 0xff, 0xff, 0xff}
Left -> 0xffffffff
Length ->0x00000000
size-> 0x00000005
Next -> 0xffffffff000206c1 { buffer=0xffffffff000206c1 {???, ???, ???, ???, ???, ???} left=???
Here is part of the call stack:
Js::SparseArraySegment<void*>::AllocateSegmentImpl(Memory::Recycler* recycler, Js::SparseArraySegmentBase* prev, uint32 index) Line 205 + 0x4 bytes C++
Js::SparseArraySegment<void*>::AllocateSegment(Memory::Recycler* recycler, Js::SparseArraySegmentBase* prev, uint32 index) Line 194 + 0x10 bytes C++
Js::JavascriptArray::DirectSetItem_Full<void*>(uint32 itemIndex, void* newValue) Line 1413 + 0x10 bytes C++
Js::JavascriptArray::DirectSetItemAt<void*>(uint32 itemIndex, Js::Var newValue) Line 455 C++
Js::JavascriptArray::SetItem(uint32 index, Js::Var value, enum class Js::PropertyOperationFlags flags) Line 12534 + 0xc bytes C++
Js::JavascriptOperators::OP_SetElementI(Js::Var instance, Js::Var index, Js::Var value, Js::ScriptContext* scriptContext, enum class Js::PropertyOperationFlags flags) Line 4362 C++
Js::InterpreterStackFrame::OP_SetElementI<Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>>(const Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>* playout, enum class Js::PropertyOperationFlags flags) Line 5168 + 0x3c bytes C++
Js::InterpreterStackFrame::OP_SetElementIStrict<Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>>(const Js::OpLayoutT_ElementI<Js::LayoutSizePolicy<(LayoutSize)0>>* playout) Line 5212 C++
Js::InterpreterStackFrame::ProcessUnprofiled() Line 268 + 0x26 bytes C++
Js::InterpreterStackFrame::Process() Line 3521 + 0x9 bytes C++
Js::InterpreterStackFrame::ProcessThunk(void* address, void* addressOfReturnAddress) Line 2525 + 0x9 bytes C++
Js::InterpreterStackFrame::InterpreterHelper(Js::ScriptFunction* function, Js::ArgumentReader args, void* returnAddress, void* addressOfReturnAddress, struct Js::InterpreterStackFrame::AsmJsReturnStruct* asmJsReturn) Line 2033 + 0x14 bytes C++
Js::InterpreterStackFrame::InterpreterThunk(Js::RecyclableObject* function, Js::CallInfo callInfo, ...) Line 1754 + 0x37 bytes C++
Do you have some ideas what is source the crash or some suggestions how to reduce time spent in GC when ENABLE_CONCURRENT_GC is disable.