From 73f67f2feced4b5a4f79fb012902bbcada932d5f Mon Sep 17 00:00:00 2001 From: sanasol Date: Tue, 27 Jan 2026 02:27:04 +0100 Subject: [PATCH] Add MALLOC_CHECK_=0 for Linux to bypass glibc heap validation Attempts to fix "free(): invalid pointer" crashes on Steam Deck and Ubuntu LTS. The same patched binary works on macOS, Windows, and Arch Linux, suggesting the issue is glibc's strict heap validation rather than actual memory corruption. Co-Authored-By: Claude Opus 4.5 --- backend/managers/gameLauncher.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/managers/gameLauncher.js b/backend/managers/gameLauncher.js index fddfa7f..9a8a317 100644 --- a/backend/managers/gameLauncher.js +++ b/backend/managers/gameLauncher.js @@ -285,6 +285,14 @@ exec "$REAL_JAVA" "\${ARGS[@]}" const gpuEnv = setupGpuEnvironment(gpuPreference); Object.assign(env, gpuEnv); + // Disable glibc heap validation on Linux to prevent false positive + // "free(): invalid pointer" crashes on Steam Deck and Ubuntu LTS + // This doesn't hide real bugs - the same binary works on other systems + if (process.platform === 'linux') { + env.MALLOC_CHECK_ = '0'; + console.log('Linux detected: Setting MALLOC_CHECK_=0 to disable glibc heap validation'); + } + try { let spawnOptions = { stdio: ['ignore', 'pipe', 'pipe'],