When the System.GC.Collect() is called (manually or automatically by runtime), it will produce a crash in StackFrameIterator::CalculateCurrentMethodState() at StackFrameIterator.cpp:1933:9
Reproduction Steps
The repro case is a C/C++ app where a Lua library is implemented in C#.
The app calls Lua, which in turn calls the C# implementation.
This works fine. The problem is if during those calls, the System.GC.Collect() is called.
The C# is using NativeAOT to produce a static library that is linked with the executable.
Description
When the System.GC.Collect() is called (manually or automatically by runtime), it will produce a crash in
StackFrameIterator::CalculateCurrentMethodState() at StackFrameIterator.cpp:1933:9
Reproduction Steps
The repro case is a C/C++ app where a Lua library is implemented in C#. The app calls Lua, which in turn calls the C# implementation. This works fine. The problem is if during those calls, the System.GC.Collect() is called.
The C# is using NativeAOT to produce a static library that is linked with the executable.
Steps to reproduce (macos):
gc-repro.zip
(build scripts should be easy enough to modify for linux as well)
Expected behavior
I expect no error will occur.
Actual behavior
The app throws a SIGABRT.
Regression?
No response
Known Workarounds
No response
Configuration
DotNet 9 rc2 Running arm64 macOS Lua 5.1 (also tested with LuaJIT 2.1)
Other information
Callstack: