aMule Forum

English => Backtraces => Topic started by: wimms on December 26, 2003, 10:36:00 AM

Title: CVS 24.12 SEGV strlen in CamuleDlg::AddLogLine, backtrace
Post by: wimms on December 26, 2003, 10:36:00 AM
hi, this is Solaris x86 system, it runs xmule okay, this is first time I compiled amule on it. It starts up, copied .xmule away, started connecting, connected, then after some time, without any action on my side, crashes.

[code:1]
Program received signal SIGSEGV, Segmentation fault.
0xdef3d019 in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0  0xdef3d019 in strlen () from /usr/lib/libc.so.1
#1  0xdef6cf3e in _doprnt () from /usr/lib/libc.so.1
#2  0xdef6e973 in vsnprintf () from /usr/lib/libc.so.1
#3  0x081dcee0 in CamuleDlg::AddLogLine(bool, char const*, ...) (this=0x8514080, addtostatusbar=0,
    line=0x886b73c >Client '%s' (IP:%s) caused an error: %u. Disconnecting client!>) at amuleDlg.cpp:603
#4  0x0809cfd9 in CClientReqSocket::OnError(int) (this=0x886aa68, nErrorCode=134) at /usr/local/include/wx/string.h:391
#5  0x081db0b3 in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x8514080, event=@0x886bd38) at amuleDlg.cpp:469
#6  0xdf6a09f3 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) (this=0x8514080, table=@0x8277204, event=@0x886bd38)
    at src/common/event.cpp:954
#7  0xdf6a07ff in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x8514080, event=@0x886bd38) at src/common/event.cpp:870
#8  0xdf6a0732 in wxEvtHandler::ProcessPendingEvents() (this=0x8514080) at src/common/event.cpp:741
#9  0xdf66d661 in wxAppBase::ProcessPendingEvents() (this=0x850d5e8) at src/common/appcmn.cpp:227
#10 0xdf616402 in wxapp_pending_callback () at src/gtk/app.cpp:214
#11 0xdf120f9a in g_idle_dispatch (source_data=0xdf6163b0, dispatch_time=0x8047700, user_data=0x0) at gmain.c:1367
#12 0xdf11ff86 in g_main_dispatch (dispatch_time=0x8047700) at gmain.c:656
#13 0xdf120593 in g_main_iterate (block=1, dispatch=1) at gmain.c:877
#14 0xdf120728 in g_main_run (loop=0x8858dc0) at gmain.c:935
#15 0xdf2acb17 in gtk_main () at gtkmain.c:524
#16 0xdf616f55 in wxApp::MainLoop() (this=0x850d5e8) at src/gtk/app.cpp:659
#17 0xdf66d4e7 in wxAppBase::OnRun() (this=0x850d5e8) at src/common/appcmn.cpp:142
#18 0xdf61770c in wxEntry(int, char**) (argc=1, argv=0x804784c) at src/gtk/app.cpp:935
#19 0x081d407b in main (argc=1, argv=0x804784c) at amule.cpp:55
(gdb) bt full
#0  0xdef3d019 in strlen () from /usr/lib/libc.so.1
No symbol table info available.
#1  0xdef6cf3e in _doprnt () from /usr/lib/libc.so.1
No symbol table info available.
#2  0xdef6e973 in vsnprintf () from /usr/lib/libc.so.1
No symbol table info available.
#3  0x081dcee0 in CamuleDlg::AddLogLine(bool, char const*, ...) (this=0x8514080, addtostatusbar=0,
    line=0x886b73c >Client '%s' (IP:%s) caused an error: %u. Disconnecting client!>) at amuleDlg.cpp:603
        this = (CamuleDlg * const) 0x8514080
        addtostatusbar = false
        line = (const wxChar *) 0x0
        osDate = ><·\206\b@µ&\b>\000\000\000\000\000\000\000\000u\004\bhR\206\bUt\004\bx{>
        osTime = >P\000\000\000C*\206\bøt\004\bO€\227ß>\000\000\000\000u\004\b>\000\000\000S9>
        temp = >\000\000\000\000H\223M\b\023'\000\000\231'\000\0008\211ßcÕP\b\005˙˙˙O€\227ßA\030U\b0s\004\b\bs\004\bln\f\bA\030U\b0s\004\b\005˙˙˙\231'\000\0008\211ßcÕP\bøp\004\b˙\ajßcÕP\b8\211ßup\004\bó\tjß\030_[\bšs\004\bUp\004\b\236\bjßcÕP\bPt\004\b\000\000\000\000\230'\000\000˙˙˙˙˙˙˙˙Dztß\000\000\000\000\000\000\000\000gl\230ßPt\004\bO€\227ß8\211ß\030_[\b\030q\004\b˙\ajß\030_[\b8\211ߚs\004\bšs\004\b\030_[\b\030_[\b>...
        bufferline = >Client '\000\000\000\000ä\212\036ßO€\227ßU\201N\bao\004\bO€\227ß\214dßO€\227ßUl\004\b\027\001cß(\ts\b\200\224O\b\000\000\000\000\000\000\000\000\001\000\000\000O€\227ßUl\004\bZ\200lß\204p\004\b>, '\0' , >`p\004\b\000\000\000\000Ul\004\b|\234dßPn\004\b\001\000\000\000\210n\004\b\023§\f\bPn\004\b0n\004\b\001\000\000\000d\000\000\000h\223\205\b p\004\ba\002\000\000O€\227ß p\004\ba\002\000\000+˙˙˙\231'\000\000˙˙˙˙˙˙˙˙,maß\000\000\000\000\000\000\000\000H\223M\b+˙>...
        joskus = 1074240426
        nyt = (tm *) 0x0
        ct = (class wxTextCtrl *) 0x0
        filename = {m_pchData = 0x0, static npos = 4294967195}
        file = {m_fd = 396458520, m_error = 122}
#4  0x0809cfd9 in CClientReqSocket::OnError(int) (this=0x886aa68, nErrorCode=134) at /usr/local/include/wx/string.h:391
        this = (CClientReqSocket * const) 0x886aa68
        nErrorCode = 0
        this = (CPreferences * const) 0x0
#5  0x081db0b3 in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x8514080, event=@0x886bd38) at amuleDlg.cpp:469
        this = (CamuleDlg * const) 0x0
        event = (wxSocketEvent &) @0x886bd38: { = { = {_vptr.wxObject = 0xdf8b5188, static sm_classwxObject = {
        m_className = 0xdf868e86 >wxObject>, m_baseClassName1 = 0x0, m_baseClassName2 = 0x0, m_objectSize = 8, m_objectConstructor = 0,
        m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x82e3180, m_next = 0xdf98a1e0, static sm_classTable = 0x84e9eb8},
      m_refData = 0x0}, m_eventObject = 0x886aa68, m_eventType = 10047, m_timeStamp = 0, m_id = 7772, m_callbackUserData = 0x0,
    m_skipped = false, m_isCommandEvent = false, static sm_classwxEvent = {m_className = 0xdf86416a >wxEvent>,
      m_baseClassName1 = 0xdf864347 >wxObject>, m_baseClassName2 = 0x0, m_objectSize = 32, m_objectConstructor = 0,
      m_baseInfo1 = 0xdf98a140, m_baseInfo2 = 0x0, static sm_first = 0x82e3180, m_next = 0xdf986660, static sm_classTable = 0x84e9eb8}},
  m_event = wxSOCKET_LOST, m_clientData = 0x0, static sm_classwxSocketEvent = {m_className = 0xdf86aedb >wxSocketEvent>,
    m_baseClassName1 = 0xdf86aee9 >wxEvent>, m_baseClassName2 = 0x0, m_objectSize = 40,
    m_objectConstructor = 0xdf71bd00 , m_baseInfo1 = 0xdf986680, m_baseInfo2 = 0x0,
    static sm_first = 0x82e3180, m_next = 0xdf98ab00, static sm_classTable = 0x84e9eb8}}
#6  0xdf6a09f3 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) (this=0x8514080, table=@0x8277204, event=@0x886bd38)
    at src/common/event.cpp:954
        entry = { = {m_id = 7772, m_lastId = -1, m_fn = {__pfn = (void ( class wxObject::*)(wxEvent &,)) 17020417,
      __delta = 0}, m_callbackUserData = 0x0}, m_eventType = @0x84d9b80}
        table = (wxEventTable &) @0x0: Cannot access memory at address 0x0
(gdb) gcore core.strlen
Saved corefile core.strlen
[/code:1]
Title: Re: CVS 24.12 SEGV strlen in CamuleDlg::AddLogLine, backtrace
Post by: Kry on December 28, 2003, 09:35:34 PM
Weird. According to the BT, you don't have event table, you don't have GUI, and you don't have preferences.

Weird, to say the least. I'll research on this bt.
Title: Re: CVS 24.12 SEGV strlen in CamuleDlg::AddLogLine, backtrace
Post by: wimms on January 11, 2004, 01:12:46 PM
CVS on sf 11.Jan.2004 still has the same issue.
Now amule runs longer, but few minutes after connecting to server, crash.

this time compiled with:  ./configure --enable-debug --disable-optimise --enable-safetray
gdb is 6.0, gcc is 3.3.2
Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0xdeeed019 in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0  0xdeeed019 in strlen () from /usr/lib/libc.so.1
#1  0xdef1cf3e in _doprnt () from /usr/lib/libc.so.1
#2  0xdef1e973 in vsnprintf () from /usr/lib/libc.so.1
#3  0x081ddbdc in CamuleDlg::AddLogLine(bool, char const*, ...) (this=0x851c678, addtostatusbar=0,
    line=0x88e1544 "Client '%s' (IP:%s) caused an error: %u. Disconnecting client!") at amuleDlg.cpp:608
#4  0x0809b01a in CClientReqSocket::OnError(int) (this=0x8859580, nErrorCode=134) at /usr/local/include/wx/string.h:406
#5  0x081dbc1b in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x851c678, event=@0x886f120) at amuleDlg.cpp:470
#6  0xdf6a09f3 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) (this=0x851c678, table=@0x827a3c4,
    event=@0x886f120) at src/common/event.cpp:954
#7  0xdf6a07ff in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x851c678, event=@0x886f120) at src/common/event.cpp:870
#8  0xdf6a0732 in wxEvtHandler::ProcessPendingEvents() (this=0x851c678) at src/common/event.cpp:741
#9  0xdf66d661 in wxAppBase::ProcessPendingEvents() (this=0x8515be0) at src/common/appcmn.cpp:227
#10 0xdf616402 in wxapp_pending_callback () at src/gtk/app.cpp:214
#11 0xdf9b0f9a in g_idle_dispatch (source_data=0xdf6163b0, dispatch_time=0x80476e0, user_data=0x0) at gmain.c:1367
#12 0xdf9aff86 in g_main_dispatch (dispatch_time=0x80476e0) at gmain.c:656
#13 0xdf9b0593 in g_main_iterate (block=1, dispatch=1) at gmain.c:877
#14 0xdf9b0728 in g_main_run (loop=0x8739700) at gmain.c:935
#15 0xdfaecb17 in gtk_main () at gtkmain.c:524
#16 0xdf616f55 in wxApp::MainLoop() (this=0x8515be0) at src/gtk/app.cpp:659
#17 0xdf66d4e7 in wxAppBase::OnRun() (this=0x8515be0) at src/common/appcmn.cpp:142
#18 0xdf61770c in wxEntry(int, char**) (argc=1, argv=0x804782c) at src/gtk/app.cpp:935
#19 0x081d481b in main (argc=1, argv=0x804782c) at amule.cpp:56


(gdb) bt full
#0  0xdeeed019 in strlen () from /usr/lib/libc.so.1
No symbol table info available.
#1  0xdef1cf3e in _doprnt () from /usr/lib/libc.so.1
No symbol table info available.
#2  0xdef1e973 in vsnprintf () from /usr/lib/libc.so.1
No symbol table info available.
#3  0x081ddbdc in CamuleDlg::AddLogLine(bool, char const*, ...) (this=0x851c678, addtostatusbar=0,
    line=0x88e1544 "Client '%s' (IP:%s) caused an error: %u. Disconnecting client!") at amuleDlg.cpp:608
        this = (CamuleDlg * const) 0x851c678
        addtostatusbar = false
        line = (const wxChar *) 0x0
        osDate = "P\000\000\000\200P.\bØt\004\bL€\227ß>\000\000\000t\004\b>\000\000\000Z9"
        osTime = "xt\004\b\201]šŽl\222öŽ>\000\000\0000\000\000\000L€\227ß\230t\004\b5<"
        temp = "\000\000\000\0000\031N\b\023'\000\000\231'\000\0008ü\211ß[Q\bhp\004\bL€\227ß\020s\004\bLU\b
r\004\br*\f\bLU\b\020s\004\b,maß\000\000\000\000\000\000\000\0000\031N\b\000ÙÙÙ\231'\000\0008ü\211ß[Q\bØp\004\bÙ\ajß[Q\b8ü\211ß
p\004\bó\tjßø/\\\bŠs\004\b p\004\b\236\bjß[Q\b0t\004\b\000\000\000\000\230'\000\000ÙÙÙÙÙÙÙÙDztß\000\000\000\000\000\000\000\000#l\230ß0t\004\bL€\227ß8ü\211ßø/\\\b\bq\004\bÙ\ajßø/\\\b8ü\211ß"...
        bufferline = "Client '\000\000\000\000ä\212¢ßL€\227ߊ\aO\bo\004\bL€\227ß\214üdßL€\227ßøl\004\b\027\001cß Ms\bx\032P\b\000\000\000\000\000\000\000\000\001\000\000\000L€\227ßøl\004\bZ\200lßdp\004\b", '\0' , "@p\004\b\001\000\000\000øl\004\b|\234dß0n\004\b\000\000\000\000hn\004\b\204\203\f\b0n\004\b\020n\004\b\001\000\000\000d\000\000\000H \205\b]\000\000\000199\000s", '\0' , "&ÙÙÙ\231'\000\000ÙÙÙÙÙÙÙÙ,maß\000\000\000\000\000\000\000\0000\031N\b&ÙÙ"...
        joskus = 1074240426
        nyt = (tm *) 0x0
        ct = (class wxTextCtrl *) 0x0
        filename = {m_pchData = 0x0, static npos = 4294967195}
        file = {m_fd = 396458520, m_error = 122}
#4  0x0809b01a in CClientReqSocket::OnError(int) (this=0x8859580, nErrorCode=134) at /usr/local/include/wx/string.h:406
        nErrorCode = 0
        this = (CPreferences * const) 0x0
#5  0x081dbc1b in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x851c678, event=@0x886f120) at amuleDlg.cpp:470
        this = (CamuleDlg * const) 0x0
        event = (wxSocketEvent &) @0x886f120: { = { = {_vptr.wxObject = 0xdf8b5188,
      static sm_classwxObject = {m_className = 0xdf868e86 "wxObject", m_baseClassName1 = 0x0, m_baseClassName2 = 0x0,
        m_objectSize = 8, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x82e5080,
        m_next = 0xdf98a1e0, static sm_classTable = 0x84f24b0}, m_refData = 0x0}, m_eventObject = 0x8859580,
    m_eventType = 10047, m_timeStamp = 0, m_id = 7772, m_callbackUserData = 0x0, m_skipped = false,
    m_isCommandEvent = false, static sm_classwxEvent = {m_className = 0xdf86416a "wxEvent",
      m_baseClassName1 = 0xdf864347 "wxObject", m_baseClassName2 = 0x0, m_objectSize = 32, m_objectConstructor = 0,
      m_baseInfo1 = 0xdf98a140, m_baseInfo2 = 0x0, static sm_first = 0x82e5080, m_next = 0xdf986660,
      static sm_classTable = 0x84f24b0}}, m_event = wxSOCKET_LOST, m_clientData = 0x0, static sm_classwxSocketEvent = {
    m_className = 0xdf86aedb "wxSocketEvent", m_baseClassName1 = 0xdf86aee9 "wxEvent", m_baseClassName2 = 0x0,
    m_objectSize = 40, m_objectConstructor = 0xdf71bd00 , m_baseInfo1 = 0xdf986680,
    m_baseInfo2 = 0x0, static sm_first = 0x82e5080, m_next = 0xdf98ab00, static sm_classTable = 0x84f24b0}}
#6  0xdf6a09f3 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) (this=0x851c678, table=@0x827a3c4,
    event=@0x886f120) at src/common/event.cpp:954
        entry = { = {m_id = 7772, m_lastId = -1, m_fn = {__pfn = (void ( class wxObject::*)(
    wxEvent &,)) 17020782, __delta = 0}, m_callbackUserData = 0x0}, m_eventType = @0x84e2178}
        table = (wxEventTable &) @0x0: Cannot access memory at address 0x0
(gdb)
I also notice alot of strange disconnected clients, like these:
%F 14:01:20: Client 'eserver' (IP:xxx) caused an error: 2. Disconnecting client!
%F 14:01:33: Client 'aijvrc' (IP:xxxx) caused an error: 2. Disconnecting client!
%F 14:06:34: Client 'seb73' (IP:xxxx) caused an error: 134. Disconnecting client!

errno.h:
#define ENOENT     2     /* No such file or directory */
#define ENOTCONN 134     /* Socket is not connected */
Title: Re: CVS 24.12 SEGV strlen in CamuleDlg::AddLogLine, backtrace
Post by: wimms on January 11, 2004, 01:37:42 PM
Code: [Select]
if (theApp.glob_prefs->GetVerbose()) {
   if (client) {
      theApp.amuledlg->AddLogLine(false,CString(_("Client '%s' (IP:%s) caused an error: %u. Disconnecting client!")),
         client->GetUserName(),client->GetFullIP(),nErrorCode);
   } else {
      theApp.amuledlg->AddLogLine(false, CString(_("A client caused an error or did something bad. Disconnecting client !")));
   }
}
Disconnect();
Line 4 above is what triggers crash. I'll try running with verbose off.
So, above it seems that client->GetUserName() returns NULL. I wonder if it would be right to change to:
  client->GetUserName() ? client->GetUserName() : ""
or should this be done in client->GetUserName()?
Title: Re: CVS 24.12 SEGV strlen in CamuleDlg::AddLogLine, backtrace
Post by: deltaHF on January 11, 2004, 02:07:25 PM
Quote
Originally posted by wimms

CVS on sf 11.Jan.2004 still has the same issue.
Now amule runs longer, but few minutes after connecting to server, crash.

I also notice alot of strange disconnected clients, like these:
%F 14:01:20: Client 'eserver' (IP:xxx) caused an error: 2. Disconnecting client!
%F 14:01:33: Client 'aijvrc' (IP:xxxx) caused an error: 2. Disconnecting client!
%F 14:06:34: Client 'seb73' (IP:xxxx) caused an error: 134. Disconnecting client!

errno.h:
#define ENOENT     2     /* No such file or directory */
#define ENOTCONN 134     /* Socket is not connected */

1. uncheck verbose in preferences - tweaks
2. use better berlios anon cvs.. i updated it 2 mins ago and its allready synched.. the tarball -> http://cvs.berlios.de/cgi-bin/viewcvs.cgi/amule/amule-cvs/amule-cvs.tar.gz?tarball=1
Title: Re: CVS 24.12 SEGV strlen in CamuleDlg::AddLogLine, backtrace
Post by: Kry on January 11, 2004, 04:43:01 PM
Commited the fix to CVS