mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-04-21 05:52:25 -04:00
fix: Steam Deck/Ubuntu crash with jemalloc allocator
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>
This commit is contained in:
95
docs/STEAMDECK_DEBUG_COMMANDS.md
Normal file
95
docs/STEAMDECK_DEBUG_COMMANDS.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# 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
|
||||
```
|
||||
Reference in New Issue
Block a user