SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 17/02/2014, 06:42 AM   #1
JernejL
Beta Tester
 
JernejL's Avatar
 
Join Date: Jan 2006
Location: Slovenia
Posts: 616
Reputation: 413
Default [Tutorial] - how to get meaningful crash reports - linux server

First install GDB - gnu debugger on your server.
Then create a runserver.sh file with these 3 lines:

Code:
echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file last_crash.log" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "echo \n\nMemory map:\n" -ex "info files" -ex "set logging off" -ex "quit" samp03svr
date >> crash.log
cat last_crash.log >> crash.log
Mark the file as executable and run the .sh file instead of samp03svr directly:

Code:
user@host:~/samp03$ ./runserver
The server will run in GDB with a script that will generate EXCELLENT crash reports, you are encouraged to always use this method to run your server.

These crash reports will be greatly superior to anything else and will be of much more help when analyzing what happened when your server crashes and what caused it.

The script will generate last_crash.log and crash.log - crash.log contains a history of all crashes and last_crash contains the last crash report that happenes.

You can also add core dumps support by adding "-ex "generate-core-file"" before "-ex "set logging off"".
Core dumps can be a few-100 mb big but they allow you to do additional analysis of a crash by a skilled programmer after the crash had happened.
__________________
Please, do no message me anymore, i'm no longer part of sa-mp scene.

I will not reply to private messages.
JernejL is offline   Reply With Quote
Old 17/02/2014, 08:05 AM   #2
Kyle
High-roller
 
Kyle's Avatar
 
Join Date: Mar 2009
Location: United Kingdom
Posts: 2,390
Reputation: 314
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

wtf, I paid for help now you go and post your help. just my luck

Also, I'd like to add to the tutorial that you should use the following command to get the log: "kill -s SIGTERM PID"

You can get the PID for the server from typing "ps x".
Kyle is offline   Reply With Quote
Old 17/02/2014, 08:38 AM   #3
JernejL
Beta Tester
 
JernejL's Avatar
 
Join Date: Jan 2006
Location: Slovenia
Posts: 616
Reputation: 413
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

KyleSmith: a kill is only needed to FORCE a crash log entry if server is stuck in a infinite loop - you had that happen and that's a very special condition.

This is tutorial for when the server crashes normally (like a bad plugin, etc..)
__________________
Please, do no message me anymore, i'm no longer part of sa-mp scene.

I will not reply to private messages.
JernejL is offline   Reply With Quote
Old 15/03/2014, 09:13 AM   #4
blackgangs
Banned
 
Join Date: Mar 2014
Location: cairo,egypt
Posts: 85
Reputation: 7
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

you must You can get the PID for the server from typing "ps x".
blackgangs is offline   Reply With Quote
Old 19/03/2014, 12:05 PM   #5
Sublime
High-roller
 
Sublime's Avatar
 
Join Date: Jul 2013
Location: 6ix god
Posts: 1,039
Reputation: 223
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

or just install and use htop for finding the process id, much easier.

is last_crash.log same as crash.log? from looking at your code, it probs is like that altho i'll conduct further tests and let you know the results.
__________________
Quote:
Originally Posted by Zorono View Post
Becuase its the best mod of GTA SA
and itsn't dead, Kalcor is having some proplems on his real life so he is busy now and release the new version now so shut your fucking mouse !!!!!!!!
Sublime is offline   Reply With Quote
Old 13/09/2014, 06:13 AM   #6
JernejL
Beta Tester
 
JernejL's Avatar
 
Join Date: Jan 2006
Location: Slovenia
Posts: 616
Reputation: 413
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

Quote:
Originally Posted by Sublime View Post
or just install and use htop for finding the process id, much easier.

is last_crash.log same as crash.log? from looking at your code, it probs is like that altho i'll conduct further tests and let you know the results.
No, last_crash is the LAST recorded crash log file, the file is concated to crash.log (which stores all crash logs and adds new ones to the end).
__________________
Please, do no message me anymore, i'm no longer part of sa-mp scene.

I will not reply to private messages.
JernejL is offline   Reply With Quote
Old 13/09/2014, 07:57 AM   #7
Sublime
High-roller
 
Sublime's Avatar
 
Join Date: Jul 2013
Location: 6ix god
Posts: 1,039
Reputation: 223
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

Quote:
Originally Posted by JernejL View Post
No, last_crash is the LAST recorded crash log file, the file is concated to crash.log (which stores all crash logs and adds new ones to the end).
Figured that out, can a sample log be provided for normal interpretation attempt?
__________________
Quote:
Originally Posted by Zorono View Post
Becuase its the best mod of GTA SA
and itsn't dead, Kalcor is having some proplems on his real life so he is busy now and release the new version now so shut your fucking mouse !!!!!!!!
Sublime is offline   Reply With Quote
Old 13/09/2014, 08:50 AM   #8
ReD_DeVi
Banned
 
Join Date: Aug 2012
Location: In Bed Room
Posts: 522
Reputation: 34
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

Thanks for this
ReD_DeVi is offline   Reply With Quote
Old 13/09/2014, 09:16 AM   #9
TracerX
Little Clucker
 
TracerX's Avatar
 
Join Date: Jun 2014
Location: Poland
Posts: 44
Reputation: 2
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

Thanks
__________________
TracerX is offline   Reply With Quote
Old 16/01/2015, 11:02 PM   #10
nicholasramdhan
Big Clucker
 
nicholasramdhan's Avatar
 
Join Date: Nov 2013
Location: Orlando, FL
Posts: 106
Reputation: 6
Default Re: [Tutorial] - how to get meaningful crash reports - linux server

Thankss.
__________________
Skype: nicholas.ramdhan01
[/CENTER]
nicholasramdhan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] SA:MP Server on a Linux Based Server VOXrr Server Support 80 10/12/2017 10:34 AM
[HELP] Server crash on linux telmo_ferreira Scripting Help 5 06/12/2011 06:38 PM
[Tutorial] Server Restarter for linux ZuppR Server Support 13 10/02/2011 12:05 AM
[HELP] Gives crash on linux server? RoCK'N'Rolla Help Archive 0 12/09/2010 10:45 AM
Crash reports at crashinfo.txt [WS]Hyper Help Archive 2 08/02/2009 01:13 PM


All times are GMT. The time now is 04:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.