Results 1 to 3 of 3
http://idgs.in/24396
  1. #1
    gaptekbet's Avatar
    Join Date
    Feb 2007
    Location
    Anywhere near Computer & Internet
    Posts
    2,892
    Points
    549.96
    Thanks: 80 / 394 / 108

    Default [How To]Debug Mangos

    Directly taken from mangosproject.com :
    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.

  2. Hot Ad
  3. #2
    kotsk's Avatar
    Join Date
    May 2007
    Posts
    96
    Points
    124.80
    Thanks: 0 / 0 / 0

    Default

    nice posting bro........ kl loe juga bisa (kebetulan kan loe demen liat2 mangos project ) sekalian aja loe jadi moderator juga di wow, bantu2 compile mangos updatenya.... BTW nih server masih pake linux ubuntu kaga? (hendra oi oi)

  4. #3
    gaptekbet's Avatar
    Join Date
    Feb 2007
    Location
    Anywhere near Computer & Internet
    Posts
    2,892
    Points
    549.96
    Thanks: 80 / 394 / 108

    Default [How To] BackUp DB Files (Linux)

    again taken from mangosproject.org

    backup_char

    CODE
    #!/bin/bash

    DBUSER=root
    DBPASS=putyourpasswordhere
    MDBNAME=mangos
    RDBNAME=realmd

    echo "EXPORTING ACCOUNTS BACKUP..."
    mysqldump --user=${DBUSER} --password=${DBPASS} --opt ${RDBNAME} account ip_banned realmcharacters realmlist > realmd_char.sql
    mysqldump --user=${DBUSER} --password=${DBPASS} --opt ${MDBNAME} auctionhouse character character_action character_aura character_gifts character_homebind character_instance character_inventory character_kill character_pet character_queststatus character_reputation character_ticket character_social character_spell character_spell_cooldown character_tutorial guild guild_charter guild_charter_sign guild_member guild_rank item_instance item_text mail corpse corpse_grid group group_member instance looking_for_group arena_team arena_team_member > mangos_char.sql
    echo "COMPLETED"


    backup_full

    CODE
    #!/bin/bash

    DBUSER=root
    DBPASS=putyourpasswordhere
    MDBNAME=mangos
    RDBNAME=realmd

    echo "EXPORTING FULL BACKUP..."
    mysqldump --user=${DBUSER} --password=${DBPASS} --opt ${RDBNAME} > realmd_full.sql
    mysqldump --user=${DBUSER} --password=${DBPASS} --opt ${MDBNAME} > mangos_full.sql
    echo "COMPLETED"
    if you need the file http://www.e-turay.com/files/MaNGOS/...ckup_linux.rar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •