Skip to content

Conversation

@milkev
Copy link
Contributor

@milkev milkev commented Apr 7, 2025

The Issue

I was experiencing a rare crash upon starting a Create contraption and opening a Tom's Storage terminal blaming Sinytras Thread Factory "setContextClassLoader" line. I was unable to reproduce it with a minimal set of mods, nor was i able to reproduce it consistently in a reasonable time frame (took 10+ hours to reproduce once)

Tom's Storage: https://pastebin.com/xW0sDscN
Create: https://pastebin.com/E2bYNWKJ

While the crash with the Tom's Storage Terminal was savable (a simple re-log fixed it) the Create crash would delete all active contraptions in my world.
Neruina was capable of catching the Tom's Storage Terminal crash and recover with no side effects, but it was unable to catch the Create crash at all.

The Proposal

Wrap thread factory set context class loader in a try

Possible Side Effects

if anything ever tries to check what the class loader context is on a thread after the try failed, possible crash/error? I've not had any issues with 200+ hours playing on a very large modpack after making this change though.

Alternatives

I'll be honest, im not familiar with managing threads at all, im still a fairly novice modder. I'm not sure what the alternative would be, especially without knowing exactly why its happening in the first place.

Additional Notes

Apologies I know I wasnt able to properly reproduce the issue, which is why I have not made an issue about it, however I thought I'd atleast report my findings as I believe I've found a solution. After making this change, I have not been able to intentionally recreate the crash with Tom's Storage or Create, and have been playing normally on my world for 200+ hours since with no related issues. I have seen the log output I added to the catch a handful of times, and not seen any abnormalities in gameplay other than a very brief lag spike surrounding it.

I left the log output on catch in, just in case it ever pops up in issues in the future it will be easier to be related to this, and with how rare this case is, this wont result in log spam.

@Su5eD Su5eD self-assigned this Apr 9, 2025
@Su5eD Su5eD changed the base branch from 1.21.x to dev September 10, 2025 15:28
@Su5eD Su5eD merged commit 56b228f into Sinytra:dev Sep 10, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Connector Triage Sep 10, 2025
Su5eD added a commit that referenced this pull request Sep 29, 2025
* Start beta 10, perform routine maintenance

* Fix ffloader impl change

* Wrap thread factory set context class loader in a try (#1771)

* Propagate issue tracker link to bridged mods.toml

Port of #1933

Co-authored-by: nergizer <[email protected]>

* Check LoadingModList#hasErrors instead of LoadingModList#getModLoadingIssues != empty (#1830)

this makes Connector only check for true mod loading errors instead of non-fatal warnings, which prevents difficult-to-debug crashes due to Connector not running early setup despite the game continuing to launch

Signed-off-by: unilock <[email protected]>

* Implement Adapter UTP transforms

Fixed issues related to Polymer

Fixes #1333
Fixes #1734

* Silence mixin errors from unused mixins

* Update adapter definition to 1.13.37

Fixes Cinderscapes

* Display Connector version in debug overlay

Update adapter definition to 1.13.38

* Update README

* Don't crash if moving module fails

* Update adapter definition to 1.13.40

Fixes #1384

* Make PLUGIN modules read connector

Fixes #1966

* Update adapter to 1.13.42

Fixes #1922

* Always show loading errors

Fixes the annoying "requires connector" error again, this time for mods that require fabric mods

* Fix lazy entity attribute replacement

Fixes #1343

---------

Signed-off-by: unilock <[email protected]>
Co-authored-by: Milkev <[email protected]>
Co-authored-by: nergizer <[email protected]>
Co-authored-by: Katherine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants