Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addParticle called by non Render Thread causing Crash with Physics Mod #707

Open
haubna opened this issue Feb 23, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@haubna
Copy link

haubna commented Feb 23, 2024

Describe the bug
A user reported a crash in combination with the physics mod to me. The crash log indicates that the addParticle function of ClientLevel is getting called from a non render thread on your end.

To Reproduce
From the user about the issue:

Unfortunately I am unable to pinpoint which mod is causing the issue. Disabling physics mod does prevent the game from crashing after this error. Re-enabling the mod after playing for a short time with it off allows the game to be stable until the event causing the crash occurs again.

Version Information (please complete the following information):

  • Mod Version: 3.0.0.8
  • Forge Version: 1.20.1

Additional context
Crash log: https://github.com/haubna/PhysicsMod/files/14374966/crash-2024-02-22_07.01.42-server.txt
The issue for reference: haubna/PhysicsMod#829

From a quick look at the decompiled source my guess is that it happens when you start a Singleplayer world. Your DelayedEventQueue hook separates the events with a HashMap which is not thread safe probably causing this issue (and only in Singleplayer both the ClientLevel and the ServerLevel run at the same time). A ConcurrentHashMap might resolve this problem.
Or another cause (although I am not that familiar with the ResourceKey thing) could be that the ServerLevel and ClientLevel share the same Resource Key. That could explain why the stack trace in the log starts with the MinecraftServer and ends up in a ClientLevel.

@Mithion
Copy link
Owner

Mithion commented Feb 23, 2024

Thank you, I will give this a go, and we'll see if it resolves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants