# Steam Deck / Linux Crash Fix ## SOLUTION: Use jemalloc ✓ The crash is caused by glibc 2.41's stricter heap validation. Using jemalloc as the memory allocator fixes the issue. ### Install jemalloc ```bash # Steam Deck / Arch Linux sudo pacman -S jemalloc # Ubuntu / Debian sudo apt install libjemalloc2 # Fedora / RHEL sudo dnf install jemalloc ``` ### Launcher Auto-Detection The launcher automatically uses jemalloc when installed. No manual configuration needed. To disable (for testing): ```bash HYTALE_NO_JEMALLOC=1 npm start ``` ### Manual Launch with jemalloc ```bash cd ~/.hytalef2p/release/package/game/latest LD_PRELOAD=/usr/lib/libjemalloc.so.2 ./Client/HytaleClient --app-dir /home/deck/.hytalef2p/release/package/game/latest --java-exec /home/deck/.hytalef2p/release/package/jre/latest/bin/java --auth-mode authenticated --uuid YOUR_UUID --name Player --identity-token YOUR_TOKEN --session-token YOUR_TOKEN --user-dir /home/deck/.hytalesaves ``` --- ## Debug Commands (for troubleshooting) ### Base Command ```bash cd ~/.hytalef2p/release/package/game/latest ``` ### GDB Stack Trace (for crash analysis) ```bash gdb -ex "run --app-dir ..." ./Client/HytaleClient # After crash: bt bt full info registers quit ``` ### Test glibc tunables (alternative fixes that didn't work reliably) **Disable tcache:** ```bash GLIBC_TUNABLES=glibc.malloc.tcache_count=0 ./Client/HytaleClient ... ``` **Disable heap validation:** ```bash MALLOC_CHECK_=0 ./Client/HytaleClient ... ``` ### Binary Validation ```bash file ~/.hytalef2p/release/package/game/latest/Client/HytaleClient ldd ~/.hytalef2p/release/package/game/latest/Client/HytaleClient ``` ### Hex Dump Commands ```bash # Search for hytale.com UTF-16LE xxd ~/.hytalef2p/release/package/game/latest/Client/HytaleClient.original | grep "6800 7900 7400 6100 6c00 6500 2e00 6300 6f00 6d00" ``` --- ## Test Different Patch Modes ```bash # Restore original cp ~/.hytalef2p/release/package/game/latest/Client/HytaleClient.original ~/.hytalef2p/release/package/game/latest/Client/HytaleClient rm ~/.hytalef2p/release/package/game/latest/Client/HytaleClient.patched_custom # Test UTF-16LE mode HYTALE_PATCH_MODE=utf16le HYTALE_AUTH_DOMAIN=sanasol.ws npm start # Test length-prefixed mode (default) HYTALE_AUTH_DOMAIN=sanasol.ws npm start ```