Taritsyn/JavaScriptEngineSwitcher

Program terminated with signal SIGSEGV, Segmentation fault

xtroncode opened this issue · 11 comments

Hi,
I am using ReactJS.net (v5.2.5) with JavaScriptEngineSwitcher.ChakraCore (v3.7.1) in .netcore 3.1 on linux.
My application terminates randomly with Segmentation fault. I don't know much about gdb but running basic commands on the core dump generated by Segmentation fault gives the following output:

> gdb carwaleweb/Carwale.UI core
Reading symbols from carwaleweb/Carwale.UI...(no debugging symbols found)...done.
[New LWP 16056]
[New LWP 28234]
[New LWP 29708]
[New LWP 22062]
[New LWP 29709]
...
[New LWP 27109]
[New LWP 26219]
[New LWP 31207]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./Carwale.UI'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ff14396324e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/libChakraCore.so
[Current thread is 1 (Thread 0x7fe81896d700 (LWP 16056))]
(gdb) where
#0  0x00007ff14396324e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/libChakraCore.so
#1  0x00007ff143aad715 in Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const () from /home/consul/carwaleweb/libChakraCore.so
#2  0x00007ff1439894dc in void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const () from /home/consul/carwaleweb/libChakraCore.so
#3  0x00007ff143985bd7 in void Js::FunctionBody::CleanUpInlineCaches<false>() () from /home/consul/carwaleweb/libChakraCore.so
#4  0x00007ff14397bc48 in Js::FunctionBody::CleanupRecyclerData(bool, bool) () from /home/consul/carwaleweb/libChakraCore.so
#5  0x00007ff143972fd0 in Js::FunctionBody::Cleanup(bool) () from /home/consul/carwaleweb/libChakraCore.so
#6  0x00007ff143972b9b in Js::FunctionBody::RedeferFunction() () from /home/consul/carwaleweb/libChakraCore.so
#7  0x00007ff14398e338 in Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) () from /home/consul/carwaleweb/libChakraCore.so
#8  0x00007ff1439a5597 in ThreadContext::TryRedeferral() () from /home/consul/carwaleweb/libChakraCore.so
#9  0x00007ff1439a53e5 in ThreadContext::PostSweepRedeferralCallBack() () from /home/consul/carwaleweb/libChakraCore.so
#10 0x00007ff143959859 in Memory::Recycler::Sweep(unsigned long, bool, bool) () from /home/consul/carwaleweb/libChakraCore.so
#11 0x00007ff14395ab6a in Memory::Recycler::CollectOnConcurrentThread() () from /home/consul/carwaleweb/libChakraCore.so
#12 0x00007ff14395a439 in Memory::Recycler::DoCollect(Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so
#13 0x00007ff1439a4135 in ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so
#14 0x00007ff14373f7bc in _JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const ()
   from /home/consul/carwaleweb/libChakraCore.so
#15 0x00007ff14373f64e in _JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) () from /home/consul/carwaleweb/libChakraCore.so
#16 0x00007ff14372263d in JsCollectGarbage () from /home/consul/carwaleweb/libChakraCore.so
#17 0x00007ff1b7b85252 in ?? ()
#18 0x00007ff189095228 in ?? ()
#19 0x0000000000871157 in ?? ()
#20 0x00007ff21c706718 in vtable for InlinedCallFrame () from /home/consul/carwaleweb/libcoreclr.so
#21 0x00007fe81896cd50 in ?? ()
#22 0x00007ff1b2adc028 in ?? ()
#23 0x00000fb300000000 in ?? ()
#24 0x00007fe818969960 in ?? ()
#25 0x00007ff1b7b85252 in ?? ()
#26 0x00007fe8189699e0 in ?? ()
#27 0x00007ff1b56cf948 in ?? ()
#28 0x00007fe8189699e0 in ?? ()
#29 0x00007ff1899fbee8 in ?? ()
#30 0x00007ff189088220 in ?? ()
#31 0x00007ff1b29e9d30 in ?? ()
#32 0x00007ff189094b28 in ?? ()
#33 0x00007ff189094a18 in ?? ()
#34 0x00007fe818969a10 in ?? ()
#35 0x00007ff1b67ceda9 in ?? ()
#36 0x00007ff1b67cecb0 in ?? ()
#37 0x00007fe92ccca900 in ?? ()
---Type <return> to continue, or q <return> to quit---
#38 0x00007fe818969d80 in ?? ()
#39 0x00007ff1b56cf948 in ?? ()
#40 0x00007fe818969a40 in ?? ()
#41 0x00007ff1b5dfa361 in ?? ()
#42 0x00007ff1b5dfa320 in ?? ()
#43 0x0000000000000001 in ?? ()
#44 0x00007fe818969d80 in ?? ()
#45 0x00007ff1b56cf948 in ?? ()
#46 0x00007fe818969bd0 in ?? ()
#47 0x00007ff1a3193d9c in ?? ()
#48 0x00007fe818969a80 in ?? ()
#49 0x00007ff1a3192d14 in ?? ()
#50 0x00007ff189088220 in ?? ()
#51 0x00007ff1b29e9d30 in ?? ()
#52 0x00007fe818969bd0 in ?? ()
#53 0x00007ff1a3193d52 in ?? ()
#54 0x00007fe818969a80 in ?? ()
#55 0x00007ff1b2fcaa40 in ?? ()
#56 0x00007fe92ccca900 in ?? ()
#57 0x00007ff190a9bed8 in ?? ()
#58 0x00007fe92a57f778 in ?? ()
#59 0x00007fe92d582450 in ?? ()
#60 0x00007fe92931eef8 in ?? ()
#61 0x00007fe929305b98 in ?? ()
#62 0x00007fe92a58a260 in ?? ()
#63 0x00007fe92a58eee8 in ?? ()
#64 0x00007ff193859138 in ?? ()
#65 0x00007fe92ce26980 in ?? ()
#66 0x00007fe92ce268f8 in ?? ()
#67 0x00007fe92ce268d0 in ?? ()
#68 0x00007fe92ccca5e8 in ?? ()
#69 0x00007fe92ce268b8 in ?? ()
#70 0x00007fe92ce26870 in ?? ()
#71 0x0000000100000001 in ?? ()
#72 0x00007fe92cccab10 in ?? ()
#73 0x00007ff1b2d4e6d8 in ?? ()
#74 0x00007fe92cccaae8 in ?? ()
#75 0x00007fe92ccca900 in ?? ()
#76 0x00007fe92ccca5e8 in ?? ()
#77 0x00007ff189088220 in ?? ()
#78 0x00007fe92ccca5e8 in ?? ()
#79 0x00007fe92ccca5d0 in ?? ()
#80 0x00007fe92a58eee8 in ?? ()
---Type <return> to continue, or q <return> to quit---
#81 0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x00007ff14396324e in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#1  0x00007ff143aad715 in Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#2  0x00007ff1439894dc in void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#3  0x00007ff143985bd7 in void Js::FunctionBody::CleanUpInlineCaches<false>() () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#4  0x00007ff14397bc48 in Js::FunctionBody::CleanupRecyclerData(bool, bool) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#5  0x00007ff143972fd0 in Js::FunctionBody::Cleanup(bool) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#6  0x00007ff143972b9b in Js::FunctionBody::RedeferFunction() () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#7  0x00007ff14398e338 in Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#8  0x00007ff1439a5597 in ThreadContext::TryRedeferral() () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#9  0x00007ff1439a53e5 in ThreadContext::PostSweepRedeferralCallBack() () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#10 0x00007ff143959859 in Memory::Recycler::Sweep(unsigned long, bool, bool) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#11 0x00007ff14395ab6a in Memory::Recycler::CollectOnConcurrentThread() () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#12 0x00007ff14395a439 in Memory::Recycler::DoCollect(Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#13 0x00007ff1439a4135 in ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#14 0x00007ff14373f7bc in _JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const ()
   from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#15 0x00007ff14373f64e in _JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#16 0x00007ff14372263d in JsCollectGarbage () from /home/consul/carwaleweb/libChakraCore.so
No symbol table info available.
#17 0x00007ff1b7b85252 in ?? ()
No symbol table info available.
#18 0x00007ff189095228 in ?? ()
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#19 0x0000000000871157 in ?? ()
No symbol table info available.
#20 0x00007ff21c706718 in vtable for InlinedCallFrame () from /home/consul/carwaleweb/libcoreclr.so
No symbol table info available.
#21 0x00007fe81896cd50 in ?? ()
No symbol table info available.
#22 0x00007ff1b2adc028 in ?? ()
No symbol table info available.
#23 0x00000fb300000000 in ?? ()
No symbol table info available.
#24 0x00007fe818969960 in ?? ()
No symbol table info available.
#25 0x00007ff1b7b85252 in ?? ()
No symbol table info available.
#26 0x00007fe8189699e0 in ?? ()
No symbol table info available.
#27 0x00007ff1b56cf948 in ?? ()
No symbol table info available.
#28 0x00007fe8189699e0 in ?? ()
No symbol table info available.
#29 0x00007ff1899fbee8 in ?? ()
No symbol table info available.
#30 0x00007ff189088220 in ?? ()
No symbol table info available.
#31 0x00007ff1b29e9d30 in ?? ()
No symbol table info available.
#32 0x00007ff189094b28 in ?? ()
No symbol table info available.
#33 0x00007ff189094a18 in ?? ()
No symbol table info available.
#34 0x00007fe818969a10 in ?? ()
No symbol table info available.
#35 0x00007ff1b67ceda9 in ?? ()
No symbol table info available.
#36 0x00007ff1b67cecb0 in ?? ()
No symbol table info available.
#37 0x00007fe92ccca900 in ?? ()
No symbol table info available.
#38 0x00007fe818969d80 in ?? ()
No symbol table info available.
#39 0x00007ff1b56cf948 in ?? ()
No symbol table info available.
#40 0x00007fe818969a40 in ?? ()
---Type <return> to continue, or q <return> to quit---
No symbol table info available.
#41 0x00007ff1b5dfa361 in ?? ()
No symbol table info available.
#42 0x00007ff1b5dfa320 in ?? ()
No symbol table info available.
#43 0x0000000000000001 in ?? ()
No symbol table info available.
#44 0x00007fe818969d80 in ?? ()
No symbol table info available.
#45 0x00007ff1b56cf948 in ?? ()
No symbol table info available.
#46 0x00007fe818969bd0 in ?? ()
No symbol table info available.
#47 0x00007ff1a3193d9c in ?? ()
No symbol table info available.
#48 0x00007fe818969a80 in ?? ()
No symbol table info available.
#49 0x00007ff1a3192d14 in ?? ()
No symbol table info available.
#50 0x00007ff189088220 in ?? ()
No symbol table info available.
#51 0x00007ff1b29e9d30 in ?? ()
No symbol table info available.
#52 0x00007fe818969bd0 in ?? ()
No symbol table info available.
#53 0x00007ff1a3193d52 in ?? ()
No symbol table info available.
#54 0x00007fe818969a80 in ?? ()
No symbol table info available.
#55 0x00007ff1b2fcaa40 in ?? ()
No symbol table info available.
#56 0x00007fe92ccca900 in ?? ()
No symbol table info available.
#57 0x00007ff190a9bed8 in ?? ()
No symbol table info available.
#58 0x00007fe92a57f778 in ?? ()
No symbol table info available.
#59 0x00007fe92d582450 in ?? ()
No symbol table info available.
#60 0x00007fe92931eef8 in ?? ()
No symbol table info available.
#61 0x00007fe929305b98 in ?? ()
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#62 0x00007fe92a58a260 in ?? ()
No symbol table info available.
#63 0x00007fe92a58eee8 in ?? ()
No symbol table info available.
#64 0x00007ff193859138 in ?? ()
No symbol table info available.
#65 0x00007fe92ce26980 in ?? ()
No symbol table info available.
#66 0x00007fe92ce268f8 in ?? ()
No symbol table info available.
#67 0x00007fe92ce268d0 in ?? ()
No symbol table info available.
#68 0x00007fe92ccca5e8 in ?? ()
No symbol table info available.
#69 0x00007fe92ce268b8 in ?? ()
No symbol table info available.
#70 0x00007fe92ce26870 in ?? ()
No symbol table info available.
#71 0x0000000100000001 in ?? ()
No symbol table info available.
#72 0x00007fe92cccab10 in ?? ()
No symbol table info available.
#73 0x00007ff1b2d4e6d8 in ?? ()
No symbol table info available.
#74 0x00007fe92cccaae8 in ?? ()
No symbol table info available.
#75 0x00007fe92ccca900 in ?? ()
No symbol table info available.
#76 0x00007fe92ccca5e8 in ?? ()
No symbol table info available.
#77 0x00007ff189088220 in ?? ()
No symbol table info available.
#78 0x00007fe92ccca5e8 in ?? ()
No symbol table info available.
#79 0x00007fe92ccca5d0 in ?? ()
No symbol table info available.
#80 0x00007fe92a58eee8 in ?? ()
No symbol table info available.
#81 0x0000000000000000 in ?? ()
No symbol table info available.

Please let me know if more info is needed. Or if I should be filing this issue in the ChakraCore repository.

Thankyou.

Hello, Meet!

Are you using an libChakraCore.so assembly from the JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64 package? It's just that this assembly differs from the official one: Tomáš Deml's patch has been applied to it that fixes such errors.

Yes, I only have the following references related to it, also this happened with 3.7.2 as well

    <PackageReference Include="JavaScriptEngineSwitcher.ChakraCore" Version="3.7.2" />
    <PackageReference Include="JavaScriptEngineSwitcher.ChakraCore.Native.win-x64" Version="3.7.2" />
    <PackageReference Include="JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64" Version="3.7.2" />
    <PackageReference Include="JavaScriptEngineSwitcher.Extensions.MsDependencyInjection" Version="3.3.0" />
    <PackageReference Include="React.AspNet" Version="5.2.5" />

Also lldb output :

(lldb) bt
* thread #1: tid = 0, 0x00007f7665166cee libChakraCore.so`Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) + 14, name = 'Carwale.UI', stop reason = signal SIGSEGV
  * frame #0: 0x00007f7665166cee libChakraCore.so`Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) + 14
    frame #1: 0x00007f76652b11b5 libChakraCore.so`Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const + 37
    frame #2: 0x00007f766518cf7c libChakraCore.so`void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const + 236
    frame #3: 0x00007f7665189677 libChakraCore.so`void Js::FunctionBody::CleanUpInlineCaches<false>() + 1063
    frame #4: 0x00007f766517f6e8 libChakraCore.so`Js::FunctionBody::CleanupRecyclerData(bool, bool) + 40
    frame #5: 0x00007f7665176a70 libChakraCore.so`Js::FunctionBody::Cleanup(bool) + 48
    frame #6: 0x00007f766517663b libChakraCore.so`Js::FunctionBody::RedeferFunction() + 43
    frame #7: 0x00007f7665191dd8 libChakraCore.so`Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) + 968
    frame #8: 0x00007f76651a9037 libChakraCore.so`ThreadContext::TryRedeferral() + 215
    frame #9: 0x00007f76651a8e85 libChakraCore.so`ThreadContext::PostSweepRedeferralCallBack() + 53
    frame #10: 0x00007f766515d2f9 libChakraCore.so`Memory::Recycler::Sweep(unsigned long, bool, bool) + 329
    frame #11: 0x00007f766515e60a libChakraCore.so`Memory::Recycler::CollectOnConcurrentThread() + 298
    frame #12: 0x00007f766515ded9 libChakraCore.so`Memory::Recycler::DoCollect(Memory::CollectionFlags) + 745
    frame #13: 0x00007f766515e1ed libChakraCore.so`Memory::Recycler::FinishConcurrentCollect(Memory::CollectionFlags) + 525
    frame #14: 0x00007f76651a7bd5 libChakraCore.so`ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) + 437
    frame #15: 0x00007f7664f428ac libChakraCore.so`_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const + 188
    frame #16: 0x00007f7664f4273e libChakraCore.so`_JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) + 14
    frame #17: 0x00007f7664f2572d libChakraCore.so`JsCollectGarbage + 29
    frame #18: 0x00007f76cb9260d2
    frame #19: 0x00007f76cb306749
    frame #20: 0x00007f76cb2bc901
    frame #21: 0x00007f76b7ce3dbc
    frame #22: 0x00007f76b7ce376f
    ....
    frame #135: 0x00007f7730d6f5ff libcoreclr.so`CallDescrWorkerInternal + 124
    frame #136: 0x00007f7730c9f445 libcoreclr.so`CallDescrWorkerWithHandler(CallDescrData*, int) + 117
    frame #137: 0x00007f7730c9ff20 libcoreclr.so`MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1264
    frame #138: 0x00007f7730de9c2a libcoreclr.so`QueueUserWorkItemManagedCallback(void*) + 74
    frame #139: 0x00007f7730c71645 libcoreclr.so`ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 341
    frame #140: 0x00007f7730c71cad libcoreclr.so`ManagedThreadBase::ThreadPool(void (*)(void*), void*) + 45
    frame #141: 0x00007f7730dd557e libcoreclr.so`ManagedPerAppDomainTPCount::DispatchWorkItem(bool*, bool*) + 270
    frame #142: 0x00007f7730c90999 libcoreclr.so`ThreadpoolMgr::WorkerThreadStart(void*) + 1241
    frame #143: 0x00007f7730fa371d libcoreclr.so`CorUnix::CPalThread::ThreadEntry(void*) + 349
    frame #144: 0x00007f77325d96ba libpthread.so.0`start_thread + 202
    frame #145: 0x00007f773186a4dd libc.so.6`__clone + 109 at clone.S:109
/home/consul/carwaleweb/libChakraCore.so

Because the libChakraCore.so assembly is located at the root of web application, and not in the runtimes/linux-x64/native subdirectory, I recommend that you compare this assembly with the assembly from NuGet package.

This is because it is a self-contained ready to run publish of the application. I'll still compare and let you know. Thanks.

diff does not show any difference between the file in the nuget package and the file at /home/consul/carwaleweb/libChakraCore.so

Try deploying a web application with a assembly from the official release.

I tried deploying the file from the official release by copying the libChakraCore.so file but was unable to run the application with that, is there anything else to be done to use the official release ?

Also I deployed the application without a self-contained build and the frequency of segfaults reduced but it still happened.
Thanks.

The segfault that occurs in the regular build also gives a similar trace

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `dotnet Carwale.UI.dll'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fc60bb05cee in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
[Current thread is 1 (Thread 0x7fc6167fc700 (LWP 31185))]
(gdb) bt
#0  0x00007fc60bb05cee in Memory::RecyclerWriteBarrierManager::WriteBarrier(void*) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#1  0x00007fc60bc501b5 in Js::FunctionCodeGenRuntimeData::GetInlinee(unsigned short) const () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#2  0x00007fc60bb2bf7c in void Js::FunctionCodeGenRuntimeData::MapInlineCaches<void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}>(void Js::FunctionBody::CleanUpInlineCaches<false>()::{lambda(Js::InlineCache*)#1}) const () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#3  0x00007fc60bb28677 in void Js::FunctionBody::CleanUpInlineCaches<false>() () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#4  0x00007fc60bb1e6e8 in Js::FunctionBody::CleanupRecyclerData(bool, bool) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#5  0x00007fc60bb15a70 in Js::FunctionBody::Cleanup(bool) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#6  0x00007fc60bb1563b in Js::FunctionBody::RedeferFunction() () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#7  0x00007fc60bb30dd8 in Js::ScriptContext::RedeferFunctionBodies(BVSparse<Memory::ArenaAllocator>*, unsigned int) ()
   from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#8  0x00007fc60bb48037 in ThreadContext::TryRedeferral() () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#9  0x00007fc60bb47e85 in ThreadContext::PostSweepRedeferralCallBack() () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#10 0x00007fc60bafc2f9 in Memory::Recycler::Sweep(unsigned long, bool, bool) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#11 0x00007fc60bafcefd in Memory::Recycler::DoCollect(Memory::CollectionFlags) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#12 0x00007fc60bb46bd5 in ThreadContext::ExecuteRecyclerCollectionFunction(Memory::Recycler*, int (Memory::Recycler::*)(Memory::CollectionFlags), Memory::CollectionFlags) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#13 0x00007fc60b8e18ac in _JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}::operator()() const ()
   from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#14 0x00007fc60b8e173e in _JsErrorCode GlobalAPIWrapper_Core<_JsErrorCode GlobalAPIWrapper_NoRecord<_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1})::{lambda()#1}>(_JsErrorCode JsCollectGarbageCommon<(Memory::CollectionFlags)536907776>(void*)::{lambda()#1}) () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#15 0x00007fc60b8c472d in JsCollectGarbage () from /home/consul/carwaleweb/runtimes/linux-x64/native/libChakraCore.so
#16 0x00007fc67b3a96a2 in ?? ()
#17 0x00007fc65439f728 in ?? ()
#18 0x0000000000235504 in ?? ()
#19 0x00007fc6e85ac718 in ?? () from /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.8/libcoreclr.so

Let me know how I can help debug this and provide more information. Thanks.

I am not an expert in C++ and Linux, so it is difficult for me to help you solve this problem.

I can only recommend you to try using the JavaScriptEngineSwitcher.Node module as an JS engine.

Hi Taritsyn,
We have already started using JavaScriptEngineSwitcher.Node in production and haven't faced any issues yet, also the latencies are comparable. I'll definitely try out the cross-platform version of JavaScriptEngineSwitcher.V8 some time later.
Thanks.