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 <noreply@anthropic.com>
This commit is contained in:
sanasol
2026-01-27 02:27:04 +01:00
parent 2582d9b6d1
commit 73f67f2fec

View File

@@ -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'],