Raised This Month: $32 Target: $400
 8% 

Solved ./hlds_run: line 255: 5856 Segmentation fault $HL_CMD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 11-29-2017 , 16:38   ./hlds_run: line 255: 5856 Segmentation fault $HL_CMD
Reply With Quote #1

Greetings,

Hope you guys are having a good day.

I've been running a test HLDS since a couple years and was trying to setup another one today on centOS 7, but came across a Segmentation Fault at Line 255(hlds_run)
Code:
L 11/29/2017 - 22:18:33: -------- Mapchange to surf_ski_2 --------
[AMXX] Loaded 5 admins from file
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
Unable to determine VR Path Registry filename
dlopen failed trying to load:
(null)/.steam/sdk32/steamclient.so
with error:
(null)/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit

Executing AMX Mod X Configuration File
Scrolling message displaying frequency: 10:00 minutes
couldn't exec listip.cfg
couldn't exec banned.cfg
./hlds_run: line 255:  5856 Segmentation fault      $HL_CMD
email debug.log to [email protected]
Wed Nov 29 22:18:34 CET 2017: Server restart in 10 seconds
Checklist :
SELinux - Disabled (tried permissive as well)
AMXX - Tried Disabling (same error) (v1.8.2)
MetaMod - Tried Disabling (same error) (metamod-p-1.21p37-linux_i686)

liblist.gam
PHP Code:
game "Counter-Strike"
url_info "www.counter-strike.net"
url_dl ""
version "1.6"
size "184000000"
svonly "0"
secure "1"
type "multiplayer_only"
cldll "1" 
hlversion "1111"
nomodels "1"
nohimodel "1"
mpentity "info_player_start"
gamedll "dlls\mp.dll"
gamedll_linux "addons/metamod/dlls/metamod_i386.so"
trainmap "tr_1"
edicts    "1800" 
hlds_run
PHP Code:
#!/bin/sh
#
#       Copyright (c) 2002, Valve LLC. All rights reserved.
#
#    a wrapper script for the main hl dedicated server binary.
#    Performs auto-restarting of the server on crash. You can
#    extend this to log crashes and more.
#

# setup the libraries, local dir first!
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

init() {
    
# Initialises the various variables
    # Set up the defaults
    
GAME="valve"
    
DEBUG=“”
    RESTART
="yes"
    
HL=./hlds_linux
    HL_DETECT
=1
    TIMEOUT
=10 # time to wait after a crash (in seconds)
    
CRASH_DEBUG_MSG="email debug.log to [email protected]"
    
GDB="gdb" # the gdb binary to run
    
DEBUG_LOG="debug.log"
    
PID_FILE=""
    
STEAM=""
    
STEAMERR=""
    
SIGINT_ACTION="quit 0" # exit normally on sig int
    
NO_TRAP=0
    AUTO_UPDATE
=""
    
BETA_VERSION=""
    
PARAMS=$*

    
# Remove any old default pid files
    # Cant do this as they may be still running
    #rm -f hlds.*.pid

    # use the $FORCE environment variable if its set
    
if test -"$FORCEthen
        
# Note: command line -binary will override this
        
HL=$FORCE
        HL_DETECT
=0
    fi

    
while test $# -gt 0; do
        
case "$1" in
        
"-game")
            
GAME="$2"
            
shift ;;
        
"-debug")
            
DEBUG=“”
            
# Ensure that PID_FILE is set
            
if test -"$PID_FILE"then
                PID_FILE
="hlds.$$.pid"
            
fi ;;
        
"-restart")
            
RESTART="" ;;
        
"-pidfile")
            
PID_FILE="$2"
            
shift ;;
        
"-binary")
            
HL="$2"
            
HL_DETECT=0
            shift 
;;
        
"-timeout")
            
TIMEOUT="$2"
            
shift ;;
        
"-gdb")
            
GDB="$2"
            
shift ;;
        
"-debuglog")
            
DEBUG_LOG="$2"
            
shift ;;
        
"-autoupdate")
            
AUTO_UPDATE="yes"
            
STEAM="steamcmd/steamcmd.sh"
            
RESTART="yes" ;;
        
"-steamerr")
            
STEAMERR=;;
        
"-ignoresigint")
            
SIGINT_ACTION="" ;;
        
"-notrap")
            
NO_TRAP=;;
        
"-beta")
            
BETA_VERSION="$2"
            
shift ;;
        
"-help")
            
# quit with syntax
            
quit 2
            
;;
        
esac
        shift
    done

    
# Ensure we have a game specified
    
if test -"$GAME"then
        
echo "Unable to determine game type from command line."
        
quit 1
    elif test 
! -"$GAME"then
        
echo "Invalid game type '$GAME' sepecified."
        
quit 1
    fi

    
#if test 0 -eq "$NO_TRAP"; then
        # Set up the int handler
        # N.B. Dont use SIGINT symbolic value
        #  as its just INT under ksh
        #trap "$SIGINT_ACTION" 2
    #fi

    
if test ! -"$HL"then
        
echo "Half-life binary '$HL' not found, exiting"
        
quit 1
    elif test 
! -"$HL"then
        
# Could try chmod but dont know what we will be
        # chmoding so just fail.
        
echo "Half-life binary '$HL' not executable, exiting"
        
quit 1
    fi

    
# Setup debugging
    
if test "$DEBUG-eq 1then
        
#turn on core dumps :) (if possible)
        
echo "Enabling debug mode"
        
if test "`ulimit -c`" -eq 0 then
            ulimit 
-c 2000
        fi
        GDB_TEST
=`$GDB -v`
        if 
test -"$GDB_TEST"then
            
echo "Please install gdb first."
            
echo "goto http://www.gnu.org/software/gdb/ "
            
DEBUG=# turn off debugging cause gdb isn't installed
        
fi
    fi

    PID_IN_PARAMS
="`echo $PARAMS | grep -e -pidfile`"

    
if test -"$PID_IN_PARAMS&& test -"$PID_FILE"then
        HL_CMD
="$HL $PARAMS -pidfile $PID_FILE"
    
else
        
HL_CMD="$HL $PARAMS"
    
fi
}

syntax () {
    
# Prints script syntax

    
echo "Syntax:"
    
echo "$0 [-game <game>] [-debug] [-norestart] [-pidfile]"
    
echo "    [-binary [hlds_linux]"
    
echo "    [-timeout <number>] [-gdb <gdb>] [-autoupdate]"
    
echo "    [-steamerr] [-ignoresigint] [-beta <version>]"
    
echo "  [-debuglog <logname>]"
    
echo "Params:"
    
echo "-game <game>            Specifies the <game> to run."
    
echo "-debug                  Run debugging on failed servers if possible."
    
echo "-debuglog <logname>    Log debug output to this file."
    
echo "-norestart              Don't attempt to restart failed servers."
    
echo "-pidfile <pidfile>      Use the specified <pidfile> to store the server pid."
    
echo "-binary <binary>        Use the specified binary ( no auto detection )."
    
echo "-timeout <number>       Sleep for <number> seconds before restarting"
    
echo "            a failed server."
    
echo "-gdb <gdb>              Use <dbg> as the debugger of failed servers."
    
echo "-steamerr               Quit on steam update failure."
    
echo "-beta <version>        Make use of a beta version of this server from Steam"
    
echo "-ignoresigint           Ignore signal INT ( prevents CTRL+C quitting"
    
echo "            the script )."
    
echo "-notrap                 Don't use trap. This prevents automatic"
    
echo "            removal of old lock files."
    
echo ""
    
echo "Note: All parameters specified as passed through to the server"
    
echo "including any not listed."
}

debugcore () {
    
# Debugs any core file if DEBUG is set and
    # the exitcode is none 0

    
exitcode=$1

    
if test $exitcode -ne 0then
        
if test -"$DEBUGthen 
            
echo "bt" debug.cmds;
            echo 
"info locals" >> debug.cmds;
            echo 
"info sharedlibrary" >> debug.cmds
            
echo "info frame" >> debug.cmds;  # works, but gives an error... must be last
            
echo "----------------------------------------------" >> $DEBUG_LOG
            
echo "CRASH: `date`" >> $DEBUG_LOG
            
echo "Start Line: $HL_CMD>> $DEBUG_LOG

            
# check to see if a core was dumped
            
if test -f core then
                CORE
="core"
            
elif test -f core.`cat $PID_FILE`; then
                CORE
=core.`cat $PID_FILE`
            
elif test -"$HL.core" then
                CORE
="$HL.core"
            
fi
            
            
if test -"$CORE"then
                $GDB $HL $CORE 
-x debug.cmds -batch >> $DEBUG_LOG
            fi
        
            
echo "End of crash report" >> $DEBUG_LOG
            
echo "----------------------------------------------" >> $DEBUG_LOG
            
echo $CRASH_DEBUG_MSG
            rm debug
.cmds
        
else
            echo 
"Add \"-debug\" to the $0 command line to generate a debug.log to help with solving this problem"
        
fi
    fi
}


update() {
    
updatesingle
}

updatesingle() {
    
# Run the steam update
    # exits on failure if STEAMERR is set

    
if test -"$AUTO_UPDATE"then
        
if test -"$STEAM"then
            
echo "Updating server using Steam."
            
CMD="$STEAM +logon anonymous +force_install_dir .. +app_update 90 +quit"
            if  
test -"$BETA_VERSION"then
              CMD
="$CMD -beta $BETA_VERSION";
            
fi
            
            STEAMEXE
=steamcmd $CMD
            
if test $? -ne 0then
                
if test -"$STEAMERR"then
                    
echo "`date`: Steam Update failed, exiting."
                    
quit 1
                
else
                    echo 
"`date`: Steam Update failed, ignoring."
                    
return 0
                fi
            fi
        
else
            if 
test -"$STEAMERR"then
                
echo "Could not locate steam binary:$STEAM, exiting.";
                
quit 1
            
else
                echo 
"Could not locate steam binary:$STEAM, ignoring.";
                return 
0
            fi
        fi
    fi

    
return 1
}
    
run() {
    
# Runs the steam update and server
    # Loops if RESTART is set
    # Debugs if server failure is detected
    # Note: if RESTART is not set then
    # 1. DEBUG is set then the server is NOT exec'd
    # 2. DEBUG is not set the the server is exec'd

    
if test -"$RESTARTthen
        
echo "Auto-restarting the server on crash"

        
#loop forever
        
while true
        
do
            
# Update if needed
            
update

            
# Run the server
            
$HL_CMD
            retval
=$?
            if 
test $retval -eq 0 && test -"$RESTARTthen
                
break; # if 0 is returned then just quit
            
fi

            debugcore $retval

            
echo "`date`: Server restart in $TIMEOUT seconds"

            
# don't thrash the hard disk if the server dies, wait a little
            
sleep $TIMEOUT
        done 
# while true 
    
else
        
# Update if needed
        
update

        
# Run the server
        
if test "$DEBUG-eq 0then
            
# debug not requested we can exec
            
exec $HL_CMD
        
else
            
# debug requested we can't exec
            
$HL_CMD
            debugcore 
$?
        
fi
    fi
}

quit() {
    
# Exits with the give error code, 1
    # if none specified.
    # exit code 2 also prints syntax
    
exitcode="$1"

    
# default to failure
    
if test -"$exitcode"then
        exitcode
=1
    fi

    
case "$exitcodein
    0
)
        echo 
"`date`: Server Quit" ;;
    
2)
        
syntax ;;
    *)
        echo 
"`date`: Server Failed" ;;
    
esac

    
# Remove pid file
    
if test -"$PID_FILE&& test -"$PID_FILEthen
        
# The specified pid file
        
rm -f $PID_FILE
    fi

    
# reset SIGINT and then kill ourselves properly
    
trap 2
    kill 
-$$
}

# Initialise
init $*

# Run
run

# Quit normally
quit 0 
startserver CLI
PHP Code:
#!/bin/bash
screen ----S csserver ./hlds_run -console -debug -game cstrike +ip XX.XXX.XX.XX -port 27015 +maxplayers 32 -pingboost 3 -autoupdate -autorestart +map de_dust > /dev/null >&
MetaMod plugins.ini
PHP Code:
linux addons/amxmodx/dlls/amxmodx_mm_i386.so 
Also I'm totally not sure what this is :
PHP Code:
crash_20171129224352_1.dmp[6120]: Uploading dump (out-of-process)
/
tmp/dumps/crash_20171129224352_1.dmp
crash_20171129224352_1
.dmp[6120]: Finished uploading minidump (out-of-process): success no
crash_20171129224352_1
.dmp[6120]: errorlibcurl.socannot open shared object fileNo such file or directory
crash_20171129224352_1
.dmp[6120]: file ''/tmp/dumps/crash_20171129224352_1.dmp''upload no''libcurl.socannot open shared object fileNo such file or directory'' 
Another little thing I found with -condebug
PHP Code:
Memory initialization started.
     
Memory patch failed in "SV_ParseStringCommand" at 0x00000001
     Cmd_ExecuteString address was not found inside SV_ParseStringCommand 
function.
 
Memory initialization ended
Hope these details are enough to get to a conclusion here. Any help would be totally appreciated!

Kindest Regards,
ZEDD

UPDATE : And today, suddenly outta nowhere, it started at the first execution of the startserver CLI, literally no change in the server files, and it's autorestarting on Map Crashes as well.
Guess I gotta thank Motherlord Nature for this miraculous demonstration of the technological skills it's got for fixing this completely horrendous booting problem I had. lol.

Extremely Sorry for :
#1 Posting a thread and fiding a fix myself
#2 For finding a fix that I don't even know about

Kindest Regards
__________________

Last edited by ZEDD_Intensity; 07-07-2018 at 00:02. Reason: fixed
ZEDD_Intensity is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 11-30-2017 , 06:47   Re: ./hlds_run: line 255: 5856 Segmentation fault $HL_CMD
Reply With Quote #2

if its 64bit OS then check if u have all 32bit libs installed, HLDS is strictly 32bit
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 11-30-2017 , 19:29   Re: ./hlds_run: line 255: 5856 Segmentation fault $HL_CMD
Reply With Quote #3

Quote:
Originally Posted by aron9forever View Post
if its 64bit OS then check if u have all 32bit libs installed, HLDS is strictly 32bit
Hey,

Thanks for that response.

Well, it is a 64-bit centOS server, but it is exactly almost a copy of the 2nd test server I've been running without any problems since quite a while. So, assuming that my 2nd server works just perfect, this server also has the same database as that, so, in short, yeah it's all 32-bit.

PS, if you've read my update, it did actually start booting up on it's own, so, that's a bit of a highlight on there, thanks for trying to help though.

I still have no idea what had it fixed overnight automatically that it literally booted up without any external file change. That was totally not understandable.

Regards,
ZEDD
__________________
ZEDD_Intensity is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode