opentibia / server

An open source server for the MMORPG Tibia.
GNU General Public License v2.0
414 stars 149 forks source link

Core dump (gdb)at /shutdown #46

Open Pietia10 opened 9 years ago

Pietia10 commented 9 years ago

When you type /shutdown and gdb is on this happens:

Program terminated with signal SIGSEGV, Segmentation fault.

0 malloc_consolidate (av=av@entry=0x7f9b64000020) at malloc.c:4151

4151 malloc.c: No such file or directory. (gdb) bt

0 malloc_consolidate (av=av@entry=0x7f9b64000020) at malloc.c:4151

1 0x00007f9b6ed21691 in _int_free (av=0x7f9b64000020, p=,

have_lock=0) at malloc.c:4057

2 0x00007f9b6ecdfbc9 in __run_exit_handlers (status=0,

listp=0x7f9b6f04b5a8 <__exit_funcs>,
run_list_atexit=run_list_atexit@entry=true) at exit.c:82

3 0x00007f9b6ecdfc15 in __GI_exit (status=) at exit.c:104

4 0x00007f9b6ecc9b4c in __libc_start_main (

main=0x416bc0 <main(int, char**)>, argc=4, argv=0x7fff109c3418,
init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
stack_end=0x7fff109c3408) at libc-start.c:321

5 0x000000000041a900 in _start ()

iryont commented 9 years ago

The log does not provide enough information due to being incomplete. Also, I never had this issue myself.

You should ask each thread of the server where it currently is (thread N -> where) and perhaps you will be able to find some more useful information.

Pietia10 commented 9 years ago

This bug is in latest trunk for sure. That didn't helped same trace.

iryont commented 9 years ago

Alright then, please comment following two lines:

https://github.com/opentibia/server/blob/legacy/src/game.cpp#L167 https://github.com/opentibia/server/blob/legacy/src/game.cpp#L168

Basically these two:

g_scheduler.stop();
g_dispatcher.stop();

They shouldn't be in there. The dispatcher won't execute final shutdown call due to closing state.

Pietia10 commented 9 years ago

(gdb) bt full

0 0x00007f48013bd78b in std::ostream::flush() ()

from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 No symbol table info available.

1 0x00007f480139607c in std::ios_base::Init::~Init() ()

from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 No symbol table info available.

2 0x00007f4800a9ef4f in **cxa_finalize (d=0x7f480277d200)

at cxa_finalize.c:56
    check = 149
    cxafn = <optimized out>
    cxaarg = <optimized out>
    f = 0x7f4800e0bdd0 <initial+368>
    funcs = 0x7f4800e0bc60 <initial>

3 0x00007f4802574823 in ?? ()

from /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.55.0 No symbol table info available.

4 0x00007fff9e29f050 in ?? ()

No symbol table info available.

5 0x00007f480311400a in _dl_fini () at dl-fini.c:252

    array = 0x7f480277c230
    i = 0
    nmaps = <optimized out>
    nloaded = <optimized out>

---Type to continue, or q to quit--- i = l = 0x7f480331b520 ns = 139947225509711 maps = 0x7f480277cd68 maps_size = 139947234910332 do_audit = 32584 __PRETTY_FUNCTION** = "_dl_fini" Backtrace stopped: frame did not save the PC

diegorodriguesvieira commented 7 years ago

@Pietia10 did you fix this bug?

Pietia10 commented 7 years ago

I'm afraid not.

diegorodriguesvieira commented 7 years ago

@Pietia10 can you help me with an issue? https://github.com/TwistedScorpio/OTHire/issues/133

This crash rarely happens and I do not know how to solve it

Cheers =)

Pietia10 commented 7 years ago

Try to copy CreatureEvent::executeOnKill function also copy this https://github.com/opentibia/server/commit/ae3493ad9386a3b4aed34a3bbacd1180d2ccba7d from latest legacy.

diegorodriguesvieira commented 7 years ago

Thank you a lot @Pietia10 I will test...

diegorodriguesvieira commented 7 years ago

@Pietia10 Sorry for bothering you so much, but you're my last hope...

Can you help-me with this crash? https://github.com/TwistedScorpio/OTHire/issues/141

I do not understand very well, but can it be something related to this (checksum)? https://github.com/opentibia/server/blob/legacy/src/connection.cpp#L349

OTHire does not have this... https://github.com/TwistedScorpio/OTHire/blob/master/source/connection.cpp#L327

diegorodriguesvieira commented 7 years ago

@iryont can you help me please?

sutari69 commented 5 years ago

prankat