[Headless] System.AccessViolationException Crash
Describe the bug?
It seems the headless is suffering from some weird memory access violation or corrupting in memory. It seems to happen consistently under load (multiple people, multiple things)
To Reproduce
- Run A Headless
- Put It Under Heavy Load
- It should crash after a bit
Reproduction Item/World
N/A
Expected behavior
The headless not to crash under heavy load,
Screenshots
No response
Resonite Version Number
Beta 2025.8.27.954
What Platforms does this occur on?
Linux
What headset if any do you use?
Headless
Log Files
It seems that this is an exception being thrown by .NET itself and not the headless, thus it is not in any of my logs. Here is the full message.
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
This could mean an external library is causing it.
Edit: ok have a log anyways lol
731713a5d24d - 2025.8.27.954 - 2025-08-29 12_08_04.log
Additional Context
No response
Reporters
Moonbase__, Juspertinry
Hi! Thank you for reporting this bug on the Resonite issue tracker.
We noticed you haven't attached a proper log file in your report. Including a log helps us pinpoint the exact issue which is why it is required during the report process.
If you do not know where to find log files, please see this tutorial on the Resonite Wiki to see where to find them.
Thank you!
Are there no logs generated?
I'm a bit confused, because it sounds like this happens when the headless is running under heavy load, so I'd assume it would generate normal log files.
just edited with a log, apologies i thought it wouldnt be useful since .net was the thing crashing
Thanks! It's important to check what might be leading to the crash itself, because that can provide clues.
Where exactly does the "Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." message appear?
Is it on the console? Are there no other lines at all?
Right now this could be anything, so I need some way to isolate this.
Actually what exactly is "heavy load" in this case? Is it lots of users? Or something else?
lots of users, also it doesn't even print a new line, it just appears and boom, dead
have an image from a time it did happen in docker log
Hmm you do seem to be running with mod loader. Does this happen without mods too?
How reliably can you reproduce this? Like does it happen often? I could possibly make debug versions of the headless that can help catch this, but they would have worsened performance.
This does also happen without mods. It also happens on a friends server as well.
Here's a log without mods 8ac8b2448d35 - 2025.8.27.954 - 2025-08-30 18_43_00.log
Does this happen when hosting different worlds? Or is it tied to particular world?
One suspicion I'd have is something in Bepu, which does have native memory management for its systems, but there's nothing solid to point to that yet.
hey moonbase, where you or anyone messing with convex hull brushes or had any collision based particles enabled at the time? cause both those seem to cause this exact issue (ive had it happen numerous times).
Does this happen when hosting different worlds? Or is it tied to particular world?
One suspicion I'd have is something in Bepu, which does have native memory management for its systems, but there's nothing solid to point to that yet.
this happens in any world, it also happened in my moonbase world.
hey moonbase, where you or anyone messing with convex hull brushes or had any collision based particles enabled at the time? cause both those seem to cause this exact issue (ive had it happen numerous times).
i didn't see anything of that sorts in the worlds i've hosted on the headless. this could be a different issue.
might be the same issue im running into as well then but only happening on the headless for you.
that tells me that it's definitely something in Bepu then if particles with collisions cause the same crash. perhaps updating it should be put in a higher priority.
i found smthn possibly somewhat related, or at least a clue, a stack overflow in bepu
resonite-headless | Stack overflow. resonite-headless | at BepuPhysics.Trees.Tree.ComputeBoundsMetric(System.Numerics.Vector3 ByRef, System.Numerics.Vec tor3 ByRef) resonite-headless | at BepuPhysics.Trees.Tree.RefitAndMeasure(BepuPhysics.Trees.NodeChild ByRef)
that last line is repeated a billion times none of my logs have this but ill provide one from that time period soon
#5288 yeah same one its that STUPID infinite depth bug
ittle get fixed when we upgrade bepu hopefully #4748
it might be shadowed cove doing it then since there's constant particles. unless they need to have collisions?
Just wanna update, I haven't had this pop up again since limiting the resources the container could use to 16GB of RAM. Perhaps Bepu has issues with non standard RAM amounts.
FWIW, just had this issue occur in the (modded) graphical client (2025.9.23.1237) while having a debugger attached, which blames Bepu.
The log file cuts off at ℹ️21:37:30.703 (FPS: 75): [INFO] [Re so there's no more error details that were flushed to the file.