Resonite-Issues icon indicating copy to clipboard operation
Resonite-Issues copied to clipboard

[Headless] System.AccessViolationException Crash

Open Moonbasee opened this issue 3 months ago • 19 comments

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

  1. Run A Headless
  2. Put It Under Heavy Load
  3. 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

Moonbasee avatar Aug 31 '25 06:08 Moonbasee

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!

github-actions[bot] avatar Aug 31 '25 06:08 github-actions[bot]

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.

Frooxius avatar Aug 31 '25 06:08 Frooxius

just edited with a log, apologies i thought it wouldnt be useful since .net was the thing crashing

Moonbasee avatar Aug 31 '25 06:08 Moonbasee

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.

Frooxius avatar Aug 31 '25 06:08 Frooxius

Actually what exactly is "heavy load" in this case? Is it lots of users? Or something else?

Frooxius avatar Aug 31 '25 06:08 Frooxius

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

Image

Moonbasee avatar Aug 31 '25 06:08 Moonbasee

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.

Frooxius avatar Aug 31 '25 06:08 Frooxius

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

Moonbasee avatar Aug 31 '25 06:08 Moonbasee

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.

Frooxius avatar Aug 31 '25 06:08 Frooxius

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).

Redd56 avatar Aug 31 '25 08:08 Redd56

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.

Moonbasee avatar Aug 31 '25 19:08 Moonbasee

might be the same issue im running into as well then but only happening on the headless for you.

Redd56 avatar Aug 31 '25 20:08 Redd56

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.

Moonbasee avatar Aug 31 '25 21:08 Moonbasee

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

Moonbasee avatar Sep 03 '25 23:09 Moonbasee

#5288 yeah same one its that STUPID infinite depth bug

Redd56 avatar Sep 04 '25 00:09 Redd56

ittle get fixed when we upgrade bepu hopefully #4748

Redd56 avatar Sep 04 '25 00:09 Redd56

it might be shadowed cove doing it then since there's constant particles. unless they need to have collisions?

Moonbasee avatar Sep 04 '25 01:09 Moonbasee

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.

Moonbasee avatar Sep 24 '25 19:09 Moonbasee

FWIW, just had this issue occur in the (modded) graphical client (2025.9.23.1237) while having a debugger attached, which blames Bepu.

Image

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.

TayIorRobinson avatar Nov 18 '25 21:11 TayIorRobinson