aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: core dumps on openbsd  (Read 2578 times)

chan

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
core dumps on openbsd
« on: June 03, 2006, 01:52:17 PM »

On OpenBSD/x86 3.9 aMule 2.1.2 core dumps after a few seconds of runtime. It can connect to a server and downloads can be started, but after that it always crashes. Seems like a stack overflow. This is with wxWidgets 2.6.3 compiled with "--disable-gui" and amuled:

Code: [Select]
#0  0x0deaf995 in kill () from /usr/lib/libc.so.39.0
#1  0x0ded2498 in __stack_smash_handler (
    func=0x3c00a020 "bool CClientTCPSocket::ProcessPacket(const char*, unsigned int, unsigned char)", damaged=46) at /usr/src/lib/libc/sys/stack_protector.c:88
#2  0x1c04ef98 in CClientTCPSocket::ProcessPacket(char const*, unsigned, unsigned char) (this=0x7ccece00, buffer=0x7e71c980 "\220\036j????C?:??!\021 ?\034",
    size=46, opcode=89 'Y') at ClientTCPSocket.cpp:1058
#3  0x1c053489 in CClientTCPSocket::PacketReceived(CPacket*) (this=0x7ccece00,
    packet=0x823b0240) at ClientTCPSocket.cpp:1798
#4  0x1c073c0e in CEMSocket::OnReceive(int) (this=0x7ccece00, nErrorCode=0)
    at EMSocket.cpp:313
#5  0x1c052c74 in CClientTCPSocket::OnReceive(int) (this=0x7ccece00,
    nErrorCode=0) at ClientTCPSocket.cpp:1726
#6  0x1c04856c in CClientTCPSocketHandler::ClientTCPSocketHandler(wxSocketEvent&) (this=0x3c092ea0, event=@0x8a6a4940) at ClientTCPSocket.cpp:99
#7  0x0367fb84 in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const () from /home/donkey/lib/libwx_base-2.6.so
#8  0x03718d30 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /home/donkey/lib/libwx_base-2.6.so
#9  0x037181a9 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
   from /home/donkey/lib/libwx_base-2.6.so
#10 0x03718ea8 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /home/donkey/lib/libwx_base-2.6.so
#11 0x03718c83 in wxEvtHandler::ProcessPendingEvents() ()
   from /home/donkey/lib/libwx_base-2.6.so
#12 0x0367fb05 in wxAppConsole::ProcessPendingEvents() ()
   from /home/donkey/lib/libwx_base-2.6.so
#13 0x1c00c704 in CamuleDaemonApp::OnRun() (this=0x833ad100) at amuled.cpp:457
#14 0x036bfb72 in wxEntry(int&, char**) ()
   from /home/donkey/lib/libwx_base-2.6.so
#15 0x1c00b585 in main (argc=1, argv=0xcfbeb3f0) at amuled.cpp:132

Note that OpenBSD has stack protection enabled by default in their shipped gcc.

Code: [Select]
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd3.9/3.3.5/specs
Configured with:
Thread model: single
gcc version 3.3.5 (propolice)

CVS aMule required unicode and couldn't run at all on OpenBSD.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: core dumps on openbsd
« Reply #1 on: June 05, 2006, 02:32:15 PM »

Could you post a "bt full"? And also a "frame 2" followed by "list"?
Logged

chan

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: core dumps on openbsd
« Reply #2 on: June 06, 2006, 08:05:53 PM »

As follows:

Code: [Select]
(gdb) bt full
#0  0x0deaf995 in kill () from /usr/lib/libc.so.39.0
No symbol table info available.
#1  0x0ded2498 in __stack_smash_handler (
    func=0x3c00a020 "bool CClientTCPSocket::ProcessPacket(const char*, unsigned int, unsigned char)", damaged=46) at /usr/src/lib/libc/sys/stack_protector.c:88
        sdata = {log_file = -1, connected = 0, opened = 1, log_stat = 0,
  log_tag = 0x0, log_fac = 8, log_mask = 255}
        message = "stack overflow in function %s"
        sa = {__sigaction_u = {__sa_handler = 0, __sa_sigaction = 0},
  sa_mask = 0, sa_flags = 0}
        mask = 4294967263
#2  0x1c04ef98 in CClientTCPSocket::ProcessPacket(char const*, unsigned, unsigned char) (this=0x7ccece00, buffer=0x7e71c980 "\220\036jýýýýCý:ýý!\021 ý\034",
    size=46, opcode=89 'Y') at ClientTCPSocket.cpp:1058
No locals.
#3  0x1c053489 in CClientTCPSocket::PacketReceived(CPacket*) (this=0x7ccece00,
    packet=0x823b0240) at ClientTCPSocket.cpp:1798
        bResult = false
        uRawSize = 46
        exception = { = {static npos = 4294967295,
    m_pchData = 0x23616ca0 ""}, }
#4  0x1c073c0e in CEMSocket::OnReceive(int) (this=0x7ccece00, nErrorCode=0)
    at EMSocket.cpp:313
---Type to continue, or q to quit---
        bPacketResult = true
        toCopy = 46
        GlobalReadBuffer = "ýN\000\000\000\205L0J0\r\006\t*\206H\206ý\r\001\001\001\005\000\0039\00006\0021\000ý\027ý\234\200\204.ýF\221b:\005ýý\016\022ýý\026ý\0365xýQ[ýýýJý\216ý\233Nýzýý5\004\222\020ýýý\"ý\0162Hý\006\022G\032"...
        readMax = 2000000
        ret = 168
        rptr = 0x3c092fc7 "ý\034"
        rend = 0x3c092fe8 "\231\0232\177oNýýTS6\022>ý5\004\222\020ýýý\"ý\0162Hý\006\022G\032o\024ý["
#5  0x1c052c74 in CClientTCPSocket::OnReceive(int) (this=0x7ccece00,
    nErrorCode=0) at ClientTCPSocket.cpp:1726
No locals.
#6  0x1c04856c in CClientTCPSocketHandler::ClientTCPSocketHandler(wxSocketEvent&) (this=0x3c092ea0, event=@0x8a6a4940) at ClientTCPSocket.cpp:99
        socket = (CClientTCPSocket *) 0x7ccece00
#7  0x0367fb84 in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const () from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#8  0x03718d30 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase cons---Type to continue, or q to quit---
t&, wxEvtHandler*, wxEvent&) () from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#9  0x037181a9 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
   from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#10 0x03718ea8 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#11 0x03718c83 in wxEvtHandler::ProcessPendingEvents() ()
   from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#12 0x0367fb05 in wxAppConsole::ProcessPendingEvents() ()
   from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#13 0x1c00c704 in CamuleDaemonApp::OnRun() (this=0x833ad100) at amuled.cpp:457
No locals.
#14 0x036bfb72 in wxEntry(int&, char**) ()
   from /home/donkey/lib/libwx_base-2.6.so
No symbol table info available.
#15 0x1c00b585 in main (argc=1, argv=0xcfbeb3f0) at amuled.cpp:132
No locals.
(gdb) frame 2
#2  0x1c04ef98 in CClientTCPSocket::ProcessPacket(char const*, unsigned, unsigned char) (this=0x7ccece00, buffer=0x7e71c980 "\220\036jýýýýCý:ýý!\021 ý\034",
    size=46, opcode=89 'Y') at ClientTCPSocket.cpp:1058
1058    }
(gdb) list
1053                            AddDebugLogLineM( false, logRemoteClient, wxString::Format(wxT("Edonkey packet: unknown opcode: %i %x"), opcode, opcode) );
1054                            return false;
1055            }
1056
1057            return true;
1058    }
1059
1060
1061    bool CClientTCPSocket::ProcessExtPacket(const char* buffer, uint32 size, uint8 opcode)
1062    {

Logged