Skip to content

Fix Rapier initialize hard-crash when launcher stdout pipe closes - #1448

Open
JoaoVitorBaggio wants to merge 1 commit into
ryanhcode:mainfrom
JoaoVitorBaggio:fix/rapier-init-hard-crash
Open

Fix Rapier initialize hard-crash when launcher stdout pipe closes#1448
JoaoVitorBaggio wants to merge 1 commit into
ryanhcode:mainfrom
JoaoVitorBaggio:fix/rapier-init-hard-crash

Conversation

@JoaoVitorBaggio

Copy link
Copy Markdown

Summary

  • Closing CurseForge/Overwolf while Minecraft stays open breaks the process stdout pipe. fern then panics on info! during Rapier3D.initialize (Windows os error 232 / "pipe is being closed"), even though the physics scene was already constructed.
  • That panic previously crossed the JNI boundary and hard-killed the JVM (EXCEPTION_UNCAUGHT_CXX_EXCEPTION / hs_err) with no Minecraft crash report.
  • Wrap Rapier native stdout logging in an IgnoreClosedPipe writer, and catch_unwind initialize the same way tick/step already do, so failures become Java exceptions / crash reports instead.

Related to #1269 (same Rapier3D.initialize / hs_err symptom; this PR definitively fixes the launcher-closed-stdout repro; other #1269 causes may still need separate investigation).

Test plan

  • Local NeoForge 1.21.1 / Sable 2.0.3 client: join world with CurseForge open — OK
  • Leave world, close CurseForge/Overwolf, rejoin same world — previously hs_err / panic; with this native build — world loads
  • Intermediate build with only catch_unwind produced a Minecraft crash report naming the closed-pipe panic (confirmed root cause)
  • CI rebuilds multi-platform sable_rapier natives so the Rust fix ships in a release jar

@CLAassistant

CLAassistant commented Aug 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Closing CurseForge/Overwolf while Minecraft stays open breaks the process
stdout pipe. fern then panics on info! during Rapier3D.initialize (Windows
os error 232), which previously crossed JNI and killed the JVM with hs_err.
Ignore closed-pipe writes in the native logger and catch_unwind initialize
like tick/step so failures become Java exceptions / crash reports.
@JoaoVitorBaggio
JoaoVitorBaggio force-pushed the fix/rapier-init-hard-crash branch from 62380df to 3e34d63 Compare August 7, 2026 19:16
@ryanhcode ryanhcode self-assigned this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants