SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Server Support (https://forum.sa-mp.com/forumdisplay.php?f=19)
-   -   [Tutorial] - how to get meaningful crash reports - linux server (https://forum.sa-mp.com/showthread.php?t=495402)

JernejL 17/02/2014 07:42 AM

[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.

Kyle 17/02/2014 09:05 AM

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".

JernejL 17/02/2014 09:38 AM

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..)

blackgangs 15/03/2014 10:13 AM

Re: [Tutorial] - how to get meaningful crash reports - linux server
 
you must You can get the PID for the server from typing "ps x".

Sublime 19/03/2014 01:05 PM

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.

JernejL 13/09/2014 07:13 AM

Re: [Tutorial] - how to get meaningful crash reports - linux server
 
Quote:

Originally Posted by Sublime (Post 2959318)
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).

Sublime 13/09/2014 08:57 AM

Re: [Tutorial] - how to get meaningful crash reports - linux server
 
Quote:

Originally Posted by JernejL (Post 3194739)
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? :)

ReD_DeVi 13/09/2014 09:50 AM

Re: [Tutorial] - how to get meaningful crash reports - linux server
 
Thanks for this

TracerX 13/09/2014 10:16 AM

Re: [Tutorial] - how to get meaningful crash reports - linux server
 
Thanks

nicholasramdhan 17/01/2015 12:02 AM

Re: [Tutorial] - how to get meaningful crash reports - linux server
 
Thankss.


All times are GMT. The time now is 11:10 PM.

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