In order to improve crash reporting for mangos I will explain non-programmers howto bebug mangos.
I hope this will help to improve crash reporting by providing more critical information.
Everybody sees that now server is a lot more stabile that it was before around 200 revisions , but there are still crashes around.
If you have questions ask here.
HOWTO: Debug MaNGOS using GDB or Microsoft Visual Studio
Intro:Core Dump is file that contains the currient memory state of program , it is used for diagnostics and examining crashes. When you generate core file on crash it can be examined by developers and they can get very useful information.
Using GDB:
1.You need to start the debugger.Here is command:
gdb /path/to/mangos/executable
You need to find the properly linked executable which is usually located in /src/mangosd/.libs/ folder.
if you started successfully gdb you will see
(gdb)
2.Need to start mangos:
(gdb) run -c /path/to/mangos/config/file
Ok , now the server is started and you can start playing on it.
What happens on crash is that the debugger pauses execution of the server and shows the comand promt.
Here is example output of what happens on crash:
CODE
Program received signal SIGABRT, Aborted.
[Switching to Thread -1295549520 (LWP 7116)]
0xffffe410 in __kernel_vsyscall ()
(gdb)
If you see something like this:
CODE
Program received signal SIGABRT, Aborted.
[Switching to Thread -1295549520 (LWP 7116)]
0xffffe410 in ?????????? (??)
(gdb)
or any other kind of ?????`s then you probably havent builded mangos with debug information or your OS has some security restrictions.
3.Now you can generate dump file:
(gdb) gcore filename
where filename is some name.
archive this file ( it is rather big ) and upload it togeather with your server log.
4.Getting backtraces ( like Weedy )
bt - shows backtrace
bt full - backtrace with more info on it.
there a lot of other commands ( for examining memory , swiching to threads , calling functions from the program ,listing source files and so on , use help comand to see them all ).
Using Microsoft Visual Studio 2003
1.You need to compile MaNGOS with debug configuration.
2.Setting Up the debugger:
Go to the solution explorer ( View -> Solution Explorer )
Right click on mangosd project and click Set as Startup Project
Then again right click on it and click Properties ,then Debugging -> Working Directory and write the absolute path to your mangosd executable.
3.Press F5 ( or Debug -> Start ) and mangos will start through the debugger.
4.When server crashes then the debugger will halt mangos popup some message :
Unhandled exception at 0x005c5802 in mangosd.exe: User breakpoint.
click break on it.
If there is assertion failed Click Retry and the same message will appear.
5.Click Debug -> Save Dump As then you can choose mini-dump or mini-dump-with-heap the second is better but takes more space ( because directly copyes the memory that server used ) ,choose one and click save ,this will produce dump file containing the currient state of the server.
Just-In-Time Debug on Windows.
I think everybody know the Windwos` messages that appear when some program crash.
CODE
mangosd.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
with "Send Error Report" and "Dont Send" buttons on it.
May be you have noticed that when you installed Visual Studio there is 3th box called Debug.
When you see such message click on "Debug" button and it will attach the debugger.Press Yes and Ok until the debugger appears ,then you can go to step 4.
Assertion fault messages can be converted to Send/DontSend by pressing "Retry" !!!
--------------------
Sorry for my bad English ,I am from Mars.
Share This Thread