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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user