mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 12:51:47 -03:00
Root cause: glibc 2.41 has stricter heap validation that catches a
pre-existing race condition triggered by binary patching.
Changes:
- Add jemalloc auto-detection and usage on Linux
- Add auto-install via pkexec (graphical sudo prompt)
- Clean up clientPatcher.js (remove debug env vars)
- Add null-padding fix for shorter domain replacements
- Document investigation and solution
The launcher now:
1. Auto-detects jemalloc if installed
2. Offers to auto-install if missing (password prompt)
3. Falls back to MALLOC_CHECK_=0 if jemalloc unavailable
Install manually: sudo pacman -S jemalloc (Arch/Steam Deck)
sudo apt install libjemalloc2 (Debian/Ubuntu)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
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
# 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):
HYTALE_NO_JEMALLOC=1 npm start
Manual Launch with jemalloc
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
cd ~/.hytalef2p/release/package/game/latest
GDB Stack Trace (for crash analysis)
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:
GLIBC_TUNABLES=glibc.malloc.tcache_count=0 ./Client/HytaleClient ...
Disable heap validation:
MALLOC_CHECK_=0 ./Client/HytaleClient ...
Binary Validation
file ~/.hytalef2p/release/package/game/latest/Client/HytaleClient
ldd ~/.hytalef2p/release/package/game/latest/Client/HytaleClient
Hex Dump Commands
# 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
# 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