Fix server crashes: tcmalloc and workshop collection issues

- Add automatic tcmalloc disable in start scripts to prevent 'large alloc' segfaults
- Add warnings and documentation about workshop COLLECTION vs addon IDs
- Expand troubleshooting section with solutions for common crashes
- Document that -authkey deprecation warning can be safely ignored

Fixes:
- tcmalloc: large alloc XXXXXXX bytes == (nil) followed by Segmentation fault
- Item is not a collection! error when using addon ID instead of collection ID
- Missing 32-bit libraries warning with installation instructions
This commit is contained in:
openhands
2026-01-20 08:56:59 +00:00
parent dd7759027d
commit e713c9734e
4 changed files with 79 additions and 3 deletions

View File

@@ -123,6 +123,29 @@ docker-compose pull && docker-compose up -d
## 🛠️ Troubleshooting
### Server crashes with "tcmalloc: large alloc" error
This is a memory allocation failure in Google's tcmalloc library. The fix is applied automatically by our start scripts, which disable tcmalloc. If you still see this error:
```bash
# Manually disable tcmalloc
mv /home/gmod/serverfiles/bin/libtcmalloc_minimal.so.4 /home/gmod/serverfiles/bin/libtcmalloc_minimal.so.4.disabled
```
### "Item is not a collection!" error
```
Processing collection XXXXX...
Item is not a collection!
```
**Cause:** You're using an individual addon ID instead of a collection ID.
**Fix:**
1. Go to `https://steamcommunity.com/sharedfiles/filedetails/?id=YOUR_ID`
2. If it shows a single addon (not a "Collection"), you need to create a proper collection
3. Create a new collection on Steam Workshop containing your desired addons
4. Use that collection's ID instead
### "-authkey is no longer required" warning
This warning can be safely ignored. The `-authkey` parameter was deprecated by Garry's Mod and is no longer needed for workshop content.
### Server won't start
- Check that `SRCDS_TOKEN` is set
- Verify ports 27015-27020 are open
@@ -130,13 +153,26 @@ docker-compose pull && docker-compose up -d
### Workshop content not downloading
- Verify collection is public
- Check `WORKSHOP_COLLECTION` is set correctly
- Check `WORKSHOP_COLLECTION` is set correctly (must be a Collection ID, not an addon ID!)
- Ensure server has internet access
### Players can't connect
- Ensure firewall allows UDP/TCP 27015
- Verify server is properly registered with Steam
### Missing 32-bit libraries warning
```
WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5.
```
Install the required libraries:
```bash
# Debian/Ubuntu
sudo apt-get install lib32tinfo5 libncurses5:i386
# CentOS/RHEL
sudo yum install ncurses-libs.i686
```
## 📜 License
MIT License - Free to use and modify.

View File

@@ -150,9 +150,13 @@ if [[ -n "$RCON_PASSWORD" && "$RCON_PASSWORD" != "changeme" ]]; then
fi
# Add workshop collection if provided
# NOTE: Make sure WORKSHOP_COLLECTION is a COLLECTION ID, not an individual item ID!
# You can verify at: https://steamcommunity.com/sharedfiles/filedetails/?id=YOUR_ID
# If it says "Collection" it's valid. If it says "Addon" it will fail.
if [[ -n "$WORKSHOP_COLLECTION" ]]; then
ARGS="$ARGS +host_workshop_collection $WORKSHOP_COLLECTION"
log_info "Workshop collection: $WORKSHOP_COLLECTION"
log_warning "Ensure this is a Collection ID, not an individual addon ID!"
fi
# Display configuration
@@ -182,15 +186,21 @@ trap cleanup SIGTERM SIGINT
# Add -disableluarefresh to prevent lua refresh issues
ARGS="$ARGS -disableluarefresh"
# Disable tcmalloc which causes issues in Docker environments
# Disable tcmalloc which causes segfaults with large memory allocations in Docker
# This is a known issue with Source engine games in containers
# Override the tcmalloc library with standard glibc malloc
# The error "tcmalloc: large alloc XXXXXXX bytes == (nil)" indicates memory allocation failure
export LD_PRELOAD=""
unset LD_PRELOAD
# Use the included 32-bit glibc directly
export LD_LIBRARY_PATH="$SERVER_DIR/bin:$LD_LIBRARY_PATH"
# Disable tcmalloc by renaming the library if it exists (fallback to system malloc)
if [[ -f "$SERVER_DIR/bin/libtcmalloc_minimal.so.4" ]]; then
log_info "Disabling tcmalloc to prevent memory allocation crashes..."
mv "$SERVER_DIR/bin/libtcmalloc_minimal.so.4" "$SERVER_DIR/bin/libtcmalloc_minimal.so.4.disabled" 2>/dev/null || true
fi
# Start the server directly (not via srcds_run to avoid script issues)
cd "$SERVER_DIR"
exec ./srcds_linux $ARGS -norestart -nohltv -condebug

View File

@@ -57,9 +57,13 @@ else
fi
# Add workshop collection if provided
# NOTE: Make sure WORKSHOP_COLLECTION is a COLLECTION ID, not an individual item ID!
# You can verify at: https://steamcommunity.com/sharedfiles/filedetails/?id=YOUR_ID
# If it says "Collection" it's valid. If it says "Addon" it will fail with "Item is not a collection!"
if [[ -n "$WORKSHOP_COLLECTION" ]]; then
ARGS="$ARGS +host_workshop_collection $WORKSHOP_COLLECTION"
echo -e "${BLUE}[INFO]${NC} Workshop collection: $WORKSHOP_COLLECTION"
echo -e "${YELLOW}[WARNING]${NC} Ensure this is a Collection ID, not an individual addon ID!"
fi
echo ""
@@ -70,6 +74,13 @@ echo " • Port: $PORT"
echo " • Gamemode: $GAMEMODE"
echo ""
# Disable tcmalloc which causes segfaults with large memory allocations
# The error "tcmalloc: large alloc XXXXXXX bytes == (nil)" indicates memory allocation failure
if [[ -f "$SERVER_DIR/bin/libtcmalloc_minimal.so.4" ]]; then
echo -e "${BLUE}[INFO]${NC} Disabling tcmalloc to prevent memory allocation crashes..."
mv "$SERVER_DIR/bin/libtcmalloc_minimal.so.4" "$SERVER_DIR/bin/libtcmalloc_minimal.so.4.disabled" 2>/dev/null || true
fi
echo -e "${GREEN}Starting server...${NC}"
# Start the server

View File

@@ -14,6 +14,25 @@ Here are some popular PropHunt workshop collections you can use:
host_workshop_collection "YOUR_COLLECTION_ID"
```
### ⚠️ IMPORTANT: Collection vs Addon IDs
**The WORKSHOP_COLLECTION setting MUST be a Collection ID, NOT an individual addon ID!**
To verify your ID is correct:
1. Go to: `https://steamcommunity.com/sharedfiles/filedetails/?id=YOUR_ID`
2. Look at the page - it should say **"Collection"** at the top
3. If it says "Addon" or shows a single item, it's NOT a collection!
**If you use an addon ID instead of a collection ID, you'll see this error:**
```
Processing collection XXXXX...
Item is not a collection!
Collection 'Name' (0 items)
Reported 0 items, skipping
```
**Fix:** Create your own collection containing the addons you want, or find an existing PropHunt collection.
### Essential Content to Include
Your workshop collection should include: