gdb bt를 봐도 잘 모르겠네요..
글쓴이: tkfkdgody / 작성시간: 금, 2008/08/01 - 3:51오후
봐도 봐도 모르겠네요 ;; 죄송하지만 한번 좀 봐주세요;;
Program terminated with signal 11, Segmentation fault. #0 0xb7f8a408 in std::__default_alloc_template<true, 0>::allocate () from /usr/lib/libstdc++.so.5 (gdb) bt #0 0xb7f8a408 in std::__default_alloc_template<true, 0>::allocate () from /usr/lib/libstdc++.so.5 #1 0x0805c75f in std::__simple_alloc<std::_Rb_tree_node<std::pair<unsigned long long const, GamePlayer*> >, std::__default_alloc_template<true, 0> >::allocate (__n=1) at /usr/include/c++/3.3.5/bits/stl_alloc.h:232 #2 0x0805c730 in std::_Rb_tree_alloc_base<std::pair<unsigned long long const, GamePlayer*>, std::allocator<std::pair<unsigned long long const, GamePlayer*> >, true>::_M_get_node ( this=0x80750c8) at /usr/include/c++/3.3.5/bits/stl_tree.h:564 #3 0x0805e3e1 in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, GamePlayer*>, std::_Select1st<std::pair<unsigned long long const, GamePlayer*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, GamePlayer*> > >::_M_create_node (this=0x80750c8, __x=@0xb72d78d0) at /usr/include/c++/3.3.5/bits/stl_tree.h:616 #4 0x0805ddea in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, GamePlayer*>, std::_Select1st<std::pair<unsigned long long const, GamePlayer*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, GamePlayer*> > >::_M_insert ( this=0x80750c8, __x_=0x809a0e0, __y_=0x809a0e0, __v=@0xb72d78d0) at /usr/include/c++/3.3.5/bits/stl_tree.h:985 #5 0x0805cf18 in std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, GamePlayer*>, std::_Select1st<std::pair<unsigned long long const, GamePlayer*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, GamePlayer*> > >::insert_unique (this=0x80750c8, __position= {<std::_Rb_tree_base_iterator> = {_M_node = 0x809a0e0}, <No data fields>}, __v=@0xb72d78d0) at /usr/include/c++/3.3.5/bits/stl_tree.h:1091 #6 0x0805ccad in std::map<unsigned long long, GamePlayer*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, GamePlayer*> > >::insert (this=0x80750c8, position=Cannot access memory at address 0x0 ) at /usr/include/c++/3.3.5/bits/stl_map.h:364 #7 0x0805c0fd in std::map<unsigned long long, GamePlayer*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, GamePlayer*> > >::operator[] (this=0x80750c8, __k=@0xb72d79b8) at /usr/include/c++/3.3.5/bits/stl_map.h:319 #8 0x0805b1c5 in PlayerControler::Login (this=0xb72d7a80, forMap=18446744073709367305, gameServerID=4294967295, account=0xb72da320 "\223?202?202?, ip=0xb72da360 "e4598079", charname=0xb72da340 "\006\223?202?202?) at ../user.cpp:161 #9 0x0805b42e in Player::login (this=0xb72d7a80, forMap=18446744073709367305, gameServerID=4294967295, account=0xb72da320 "\223?202?202?, ip=0xb72da360 "e4598079", charname=0xb72da340 "\006\223?202?202?) at ../user.cpp:243 ---Type <return> to continue, or q <return> to quit--- #10 0x08051462 in Notice::Run (this=0x806e140) at ../NoticeListener.cpp:222 #11 0x08051a9a in _BaseThreadProc_ (lpParameter=0x806e140) at ../base_thread.cpp:7 #12 0xb7ecc112 in start_thread () from /lib/libpthread.so.0 #13 0xb7e312ee in clone () from /lib/libc.so.6
Forums:
저도 Linux
저도 Linux 프로그래밍은 한지 얼마 안된 초짜라서 도움이 안될수도 있겠지만, - -;;
다음에서 보이는 std:: 네임스테이스의 함수들을 보니 string 처리 부분 같네요.
#6 0x0805ccad in std::map, std::allocator > >::insert (this=0x80750c8,
position=Cannot access memory at address 0x0
) at /usr/include/c++/3.3.5/bits/stl_map.h:364
#7 0x0805c0fd in std::map, std::allocator > >::operator[] (this=0x80750c8,
__k=@0xb72d79b8) at /usr/include/c++/3.3.5/bits/stl_map.h:319
그러니까 다음에 언급된 user.cpp 함수에서
#8 0x0805b1c5 in PlayerControler::Login (this=0xb72d7a80, forMap=18446744073709367305,
gameServerID=4294967295, account=0xb72da320 "\223?202?202?, ip=0xb72da360 "e4598079",
charname=0xb72da340 "\006\223?202?202?) at ../user.cpp:161
뭔가 string 포메팅 (sprintf같은) 부분에서 뭔가 잘못된 파라미터가 전달된것은 아닐지요?
-------------------------------------------------
$yes 4 8 15 16 23 42
감사합니다...
흠... 한번 다시 봐야겠네요..
stl부분이 눈에 많이 띄어서 좀 걸리긴 한데... gdb해도 첨해보는거라 뭐가 먼지 볼 수가 없네요.
답변 정말 감사합니다. 한번 확인해보겠습니다.
댓글 달기