Jump to content
metin2dev
  • 0
Adrian1997

open (GDB) Crash Core

Question

I have a problem sometimes with my server, the channel 1 crash.

I debugged the game.core and this is the results:

 

With gdb:

bt

Core was generated by `./core_1'.
Program terminated with signal SIGABRT, Aborted.
#0  0x28cf0b5f in thr_kill () from /usr/lib32/libc.so.7
[Current thread is 1 (LWP 100495)]
(gdb) bt
#0  0x28cf0b5f in thr_kill () from /usr/lib32/libc.so.7
#1  0x28cf0b3b in raise () from /usr/lib32/libc.so.7
#2  0x28cf0a9f in abort () from /usr/lib32/libc.so.7
#3  0x2864ef75 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/vterminate.cc:95
#4  0x2864bc15 in __cxxabiv1::__terminate (
    handler=0x2864ede0 <__gnu_cxx::__verbose_terminate_handler()>)
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/eh_terminate.cc:47
#5  0x2864bcac in std::terminate ()
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/eh_terminate.cc:57
#6  0x2864bf07 in __cxxabiv1::__cxa_throw (obj=0x299c8860,
    tinfo=0x286e1c00 <typeinfo for std::bad_alloc>,
    dest=0x286499c0 <std::bad_alloc::~bad_alloc()>)
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/eh_throw.cc:84
#7  0x2864d4d2 in operator new (sz=<optimized out>)
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/new_op.cc:54
#8  0x080dda31 in CHARACTER_MANAGER::CreateCharacter (this=0xffffc5cc,
    name=0xf9eb611d "Salbatic devotat", dwPID=0) at char_manager.cpp:84
#9  0x080de056 in CHARACTER_MANAGER::SpawnMob (this=0xffffc5cc, dwVnum=502,
    lMapIndex=43, x=857352, y=269470, z=0, bSpawnMotion=true, iRot=-1,
    bShow=true) at char_manager.cpp:415
#10 0x080de6c6 in CHARACTER_MANAGER::SpawnMobRange (this=0xffffc5cc,
    dwVnum=502, lMapIndex=43, sx=855616, sy=268838, ex=857616, ey=270838,
--Type <RET> for more, q to quit, c to continue without paging--
    eption=true, bSpawnMotion=true, bAggressive=false)
    at char_manager.cpp:466
#11 0x080de89a in CHARACTER_MANAGER::SpawnGroup (this=0xffffc5cc, dwVnum=502,
    lMapIndex=43, sx=855616, sy=268838, ex=857616, ey=270838, pkRegen=0x0,
    bAggressive_=false, pDungeon=0x0) at char_manager.cpp:596
#12 0x080f871d in CHARACTER::__StateIdle_Stone (this=0xe5e0f800)
    at char_state.cpp:413
#13 0x0808e698 in CHARACTER::UpdateStateMachine (this=0xe5e0f800,
    dwPulse=15766990) at char.cpp:5017
#14 0x080e03c4 in std::mem_fun1_t<void, CHARACTER, unsigned int>::operator() (
    __x=<optimized out>, __p=<optimized out>, this=<optimized out>)
    at /usr/include/c++/4.2/bits/stl_function.h:656
#15 std::binder2nd<std::mem_fun1_t<void, CHARACTER, unsigned int> >::operator()
    (__x=<optimized out>, this=<optimized out>)
    at /usr/include/c++/4.2/bits/stl_function.h:446
#16 std::for_each<__gnu_cxx::__normal_iterator<CHARACTER**, std::vector<CHARACTER*, std::allocator<CHARACTER*> > >, std::binder2nd<std::mem_fun1_t<void, CHARACTER, unsigned int> > > (__first=..., __last=..., __f=...)
    at /usr/include/c++/4.2/bits/stl_algo.h:159
#17 0x080dfe21 in CHARACTER_MANAGER::Update (this=0xffffc5cc, iPulse=15766990)
    at char_manager.cpp:695
#18 0x082acc38 in idle () at main.cpp:962
#19 0x082ae326 in main (argc=1, argv=0xffffdbc8) at main.cpp:628

 

bt full

#0  0x28cf0b5f in thr_kill () from /usr/lib32/libc.so.7
No symbol table info available.
#1  0x28cf0b3b in raise () from /usr/lib32/libc.so.7
No symbol table info available.
#2  0x28cf0a9f in abort () from /usr/lib32/libc.so.7
No symbol table info available.
#3  0x2864ef75 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/vterminate.cc:95
        terminating = true
        t = <optimized out>
#4  0x2864bc15 in __cxxabiv1::__terminate (
    handler=0x2864ede0 <__gnu_cxx::__verbose_terminate_handler()>)
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/eh_terminate.cc:47
No locals.
#5  0x2864bcac in std::terminate ()
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/eh_terminate.cc:57
No locals.
#6  0x2864bf07 in __cxxabiv1::__cxa_throw (obj=0x299c8860,
    tinfo=0x286e1c00 <typeinfo for std::bad_alloc>,
    dest=0x286499c0 <std::bad_alloc::~bad_alloc()>)
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/eh_throw.cc:84
        header = <optimized out>
#7  0x2864d4d2 in operator new (sz=<optimized out>)
    at ../../.././../gcc-4.9-20130505/libstdc++-v3/libsupc++/new_op.cc:54
        handler = <optimized out>
        p = 0x0
#8  0x080dda31 in CHARACTER_MANAGER::CreateCharacter (this=0xffffc5cc,
    name=0xf9eb611d "Salbatic devotat", dwPID=0) at char_manager.cpp:84
        dwVID = <optimized out>
        ch = <optimized out>

Now I know that is from mob 502, but I don't know what problem...I looked to regen and mob_proto and looks fine....

Thanks in advanced.

 

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

It crashed when calling the new operator, which means it failed to allocate more memory over a 4gb of process (the limit of 32bit apps).

Metin2 processes take 4gb of ram only when they have memory leaks.

Most of the times, the memory leak comes from fetched mysql queries that didn't get freed.

  • Like 2
  • Sad 1

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, martysama0134 said:

It crashed when calling the new operator, which means it failed to allocate more memory over a 4gb of process (the limit of 32bit apps).

Metin2 processes take 4gb of ram only when they have memory leaks.

Most of the times, the memory leak comes from fetched mysql queries that didn't get freed.

Thank you. Can I find out where this memory leak is from? My knowledge is quite small...

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Adrian1997 said:

Thank you. Can I find out where this memory leak is from? My knowledge is quite small...

Check each DBManager::instance().DirectQuery if they are either wrapped in smart pointers (auto_ptr/unique_ptr), or freed using delete.
Most of the times, it's this.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

My romanian friend, I bet you are using crappy offlineshop by great which doesn't have "smart pointers (auto_ptr/unique_ptr)" as martysama told you.

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Exygo said:

My romanian friend, I bet you are using crappy offlineshop by great which doesn't have "smart pointers (auto_ptr/unique_ptr)" as martysama told you.

Yes. I figured out when martysama told me. 

It's not a realy crappy offline shop, but it's better than ken.

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Exygo said:

It's the worst offlineshop trust me, I tested it long time ago.

I don't have an alternative, so...for a server with 100-150 players on it's ok.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×