• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help me Segmentation fault

abel13angra

New Member
Joined
Jul 21, 2009
Messages
6
Reaction score
0
Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff205c700 (LWP 23210)]
_int_free (av=0x7fffec000020, p=0x7fff65d826c0, have_lock=0) at malloc.c:4022

use tfs tfs 1.3.10 in Debian 9.4 Stretch (stable) - debian9
 
Solution
Good, except no symbols. :p

No symbol table info available.

I consulted a TFS dev as I wasn't quite sure how to do it properly. (Djarek & Ninja)

If you are following this tutorial:

instead of just doing cmake ..

Do:
cmake -DCMAKE_BUILD_TYPE=Debug ..

If this makes the server to laggy, increase performance (but loose some information) with this instead:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..

Remember if you already have build folder, delete it/remove all files in it and rebuilt it to make sure there are no conflicts with previous builds.

And then run the server with gdb, show the bt full when it crashes.

And...
compile the server with the -g options to enable symbols -ggdb?
Run the server with gdb
if server crashes, get the stacktrace bt full? to reveal more information.

Post that, and we should be able to figure out where in the source things went wrong.
 
compile the server with the -g options to enable symbols -ggdb?
Run the server with gdb
if server crashes, get the stacktrace bt full? to reveal more information.

Post that, and we should be able to figure out where in the source things went wrong.
can pass commands ?
 
[CITAÇÃO = "Znote, post: 2578837, membro: 5993"]
compilar o servidor com as opções -g [/ ICODE] para ativar os símbolos [ICODE] -ggdb [/ ICODE]? Execute o servidor com gdb se o servidor travar, obtenha o stacktrace [ICODE] bt full [/ ICODE]? para revelar mais informações. Poste isso e poderemos descobrir onde as coisas deram errado. [/CITAR] bt cheio # 0 _int_free (av = 0x7fffec000020, p = 0x7fff343e5fe0, have_lock = 0) em malloc.c: 3968 size = 72057594037927968 fb = <otimizado para fora> nextchunk = 0x1007fff343e6000 nextsize = <otimizado para fora> nextinuse = <otimizado para fora> prevsize = <otimizado para fora> bck = <otimizado para fora> fwd = <otimizado para fora> errstr = 0x0 bloqueado = <saída otimizada> # 1 0x000000000061cfb2 em __gnu_cxx :: new_allocator <char não assinado> :: deallocate (char não assinado *, não assinado por muito tempo) () Nenhuma informação da tabela de símbolos disponível. # 2 0x000000000061b764 em std :: _ Vector_base <caracter não assinado, std :: alocador <caracter não assinado>> :: _ M_deallocate (caracter não assinado *, não assinado por muito tempo) () Nenhuma informação da tabela de símbolos disponível. # 3 0x00000000006196d9 em std :: _ Vector_base <caracter não assinado, std :: alocador <caracter não assinado>> :: ~ _Vector_base () () Nenhuma informação da tabela de símbolos disponível. # 4 0x0000000000618669 em std :: vector <caracter não assinado, std :: alocador <caracter não assinado>> :: ~ vector () () Nenhuma informação da tabela de símbolos disponível. # 5 0x00000000007a28b0 no Player :: ~ Player () () Nenhuma informação da tabela de símbolos disponível. # 6 0x00000000007a2ab6 no Player :: ~ Player () () Nenhuma informação da tabela de símbolos disponível. # 7 0x00000000005ab9f4 em Criatura :: decrementReferenceCounter () () Nenhuma informação da tabela de símbolos disponível. # 8 0x00000000005e3703 no jogo :: cleanup () () Nenhuma informação da tabela de símbolos disponível. # 9 0x00000000005dcfaf em Game :: checkCreatures (sem assinatura por muito tempo) () Nenhuma informação da tabela de símbolos disponível. # 10 0x000000000061115c em void std :: _ Mem_fn <void (Jogo :: *) (sem assinatura)> :: operator () <sem assinatura por muito tempo, e void> (Jogo *, sem assinatura por muito tempo & amp const () Nenhuma informação da tabela de símbolos disponível. # 11 0x000000000060cb4d no void std :: _ Bind <std :: _ Mem_fn <void (Jogo :: *) (sem assinatura)> (Jogo *, sem assinatura)> :: __ call <void,, 0ul, 1ul> (std :: tupla <> &&, std :: _ Index_tuple <0ul, 1ul & gt () Nenhuma informação da tabela de símbolos disponível. # 12 0x00000000006059f8 no void std :: _ Bind <std :: _ Mem_fn <void (Jogo :: *) (não assinado l --- Digite <retorno> para continuar ou q <retorno> para sair --- Sair
 
compile the server with the -g options to enable symbols -ggdb?
Run the server with gdb
if server crashes, get the stacktrace bt full? to reveal more information.

Post that, and we should be able to figure out where in the source things went wrong.
bt full
#0 _int_free (av=0x7fffec000020, p=0x7fff343e5fe0, have_lock=0)
at malloc.c:3968
size = 72057594037927968
fb = <optimized out>
nextchunk = 0x1007fff343e6000
nextsize = <optimized out>
nextinuse = <optimized out>
prevsize = <optimized out>
bck = <optimized out>
fwd = <optimized out>
errstr = 0x0
locked = <optimized out>
#1 0x000000000061cfb2 in __gnu_cxx::new_allocator<unsigned char>::deallocate(unsigned char*, unsigned long) ()
No symbol table info available.
#2 0x000000000061b764 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_deallocate(unsigned char*, unsigned long) ()
No symbol table info available.
#3 0x00000000006196d9 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::~_Vector_base() ()
No symbol table info available.
#4 0x0000000000618669 in std::vector<unsigned char, std::allocator<unsigned char> >::~vector() ()
No symbol table info available.
#5 0x00000000007a28b0 in Player::~Player() ()
No symbol table info available.
#6 0x00000000007a2ab6 in Player::~Player() ()
No symbol table info available.
#7 0x00000000005ab9f4 in Creature::decrementReferenceCounter() ()
No symbol table info available.
#8 0x00000000005e3703 in Game::cleanup() ()
No symbol table info available.
#9 0x00000000005dcfaf in Game::checkCreatures(unsigned long) ()
No symbol table info available.
#10 0x000000000061115c in void std::_Mem_fn<void (Game::)(unsigned long)>::operator()<unsigned long&, void>(Game, unsigned long&amp const ()
No symbol table info available.
#11 0x000000000060cb4d in void std::_Bind<std::_Mem_fn<void (Game::)(unsigned long)> (Game, unsigned long)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul&gt ()
No symbol table info available.
#12 0x00000000006059f8 in void std::_Bind<std::_Mem_fn<void (Game::*)(unsigned l---Type <return> to continue, or q <return> to quit---Quit
 
Good, except no symbols. :p

No symbol table info available.

I consulted a TFS dev as I wasn't quite sure how to do it properly. (Djarek & Ninja)

If you are following this tutorial:

instead of just doing cmake ..

Do:
cmake -DCMAKE_BUILD_TYPE=Debug ..

If this makes the server to laggy, increase performance (but loose some information) with this instead:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..

Remember if you already have build folder, delete it/remove all files in it and rebuilt it to make sure there are no conflicts with previous builds.

And then run the server with gdb, show the bt full when it crashes.

And symbols should exist and tell us what is going on in our source files! :)

Added a wiki page for compiling debug binaries:
 
Last edited by a moderator:
Solution
Back
Top