aMule Forum

English => Backtraces => Topic started by: llama on November 15, 2008, 03:27:55 AM

Title: assertion fail in AddContact2()
Post by: llama on November 15, 2008, 03:27:55 AM
I run amule 2.2.2 compiled with --enable-debug, with wxGTK 2.8.9 (built from upstream source with debugging) on amd64 Ubuntu Intrepid.  It runs inside Xvnc.

Amule was just sitting there showing the transfer window when:

Logger.cpp(275): Debug: ../../src/kademlia/net/KademliaUDPListener.cpp(461): assert "wxAssertFailure" failed in AddContact2().

backtrace from gdb, followed by some extra info gathering. (Thread 1, frame #8 is where the assertion happened.)

Code: [Select]
Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7f261f32a780 (LWP 12235)]
0x00007f261ef3dfab in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
42      ../nptl/sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/pt-raise.c
(gdb) thread apply all bt full

Thread 4 (Thread 0x4184c950 (LWP 12329)):
#0  0x00007f261ef3a55d in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/debug/libpthread.so.0
No locals.
#1  0x00007f261d6fdfdd in wxConditionInternal::WaitTimeout (this=0x2809460, milliseconds=100) at ../src/unix/threadpsx.cpp:405
        curtime = {m_ll = 1226713283441}
        temp = {m_ll = 441}
        sec = 1226713283
        millis = 441
        tspec = {tv_sec = 1226713283, tv_nsec = 441000000}
        err = 0
#2  0x00007f261d6fe0a9 in wxCondition::WaitTimeout (this=0x2809258, milliseconds=100) at ../include/wx/thrimpl.cpp:256
        __FUNCTION__ = "WaitTimeout"
#3  0x00007f261d6fed5b in wxSemaphoreInternal::WaitTimeout (this=0x2809250, milliseconds=100) at ../src/unix/threadpsx.cpp:552
        elapsed = {m_ll = 0}
        remainingTime = 100
        locker = {m_isOk = true, m_mutex = @0x2809250}
        startTime = {m_ll = 1226713283341}
#4  0x00007f261d6fee3f in wxSemaphore::WaitTimeout (this=0x2809df0, milliseconds=100) at ../include/wx/thrimpl.cpp:320
        __FUNCTION__ = "WaitTimeout"
#5  0x000000000068e008 in CTimerThread::Entry (this=0x2809db0) at ../../src/Timer.cpp:64
        now = 18446744073709551100
        sinceLast = 4852601
        timeout = 0
        evt = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x821b10, static ms_classInfo = {m_className = 0x7f261d73d0e0,
        m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7f261e645b80,
        m_next = 0x7f261d9b3940, static sm_classTable = 0x27904d0}, m_refData = 0x0}, m_eventObject = 0x0, m_eventType = 10244,
    m_timeStamp = 0, m_id = 6128, m_callbackUserData = 0x0, m_propagationLevel = 0, m_skipped = false, m_isCommandEvent = false,
    static ms_classInfo = {m_className = 0x7f261d754a30, m_objectSize = 64, m_objectConstructor = 0,
      m_baseInfo1 = 0x7f261d9b3840, m_baseInfo2 = 0x0, static sm_first = 0x7f261e645b80, m_next = 0x7f261d9b57e0,
      static sm_classTable = 0x27904d0}}, <No data fields>}
        lastEvent = 2647603981
#6  0x00007f261d6fff32 in wxThreadInternal::PthreadStart (thread=0x2809db0) at ../src/unix/threadpsx.cpp:766
        __clframe = {__cancel_routine = 0x7f261d6ffde2 <wxPthreadCleanup>, __cancel_arg = 0x2809db0, __do_it = 1,
  __cancel_type = 0}
        pthread = (wxThreadInternal *) 0x2809b90
        rc = 0
        dontRunAtAll = false
        __FUNCTION__ = "PthreadStart"
#7  0x00007f261d700092 in wxPthreadStart (ptr=0x2809db0) at ../src/unix/threadpsx.cpp:718
No locals.
#8  0x00007f261ef363ea in start_thread (arg=<value optimized out>) at pthread_create.c:297
        __res = <value optimized out>
        pd = (struct pthread *) 0x4184c950
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -8534477539052507638, 8392704, 139801709158464, 0, 140733851277280,
        -8534335669859144182, 8629824889196097034}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
      cleanup = 0x0, canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
#9  0x00007f261c94ac6d in clone () from /usr/lib/debug/libc.so.6
        fstab_state = {fs_fp = 0x0, fs_buffer = 0x0, fs_mntres = {mnt_fsname = 0x0, mnt_dir = 0x0, mnt_type = 0x0,
    mnt_opts = 0x0, mnt_freq = 0, mnt_passno = 0}, fs_ret = {fs_spec = 0x0, fs_file = 0x0, fs_vfstype = 0x0, fs_mntops = 0x0,
    fs_type = 0x0, fs_freq = 0, fs_passno = 0}}
        __elf_set___libc_subfreeres_element_fstab_free__ = (const void *) 0x7f261c988490
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x4084a950 (LWP 12283)):
#0  0x00007f261ef3d851 in nanosleep () from /usr/lib/debug/libpthread.so.0
No locals.
#1  0x00007f261d70a992 in wxMicroSleep (microseconds=1000000) at ../src/unix/utilsunx.cpp:191
        tmReq = {tv_sec = 1, tv_nsec = 0}
#2  0x00007f261d70a9b0 in wxMilliSleep (milliseconds=1000) at ../src/unix/utilsunx.cpp:212
No locals.
#3  0x00007f261d6fdd31 in wxThread::Sleep (milliseconds=1000) at ../src/unix/threadpsx.cpp:986
No locals.
#4  0x0000000000559891 in UploadBandwidthThrottler::Entry (this=0x3e3de20) at ../../src/UploadBandwidthThrottler.cpp:324
        timeSinceLastLoop = 0
        minFragSize = 1300
        doubleSendSize = 2600
        bytesToSpend = 36352
        sleepTime = 1000
        thisLoopTick = 2647603943
        lastLoopTick = 2647603943
        realBytesToSpend = 2560999
        allowedDataRate = 33792
        rememberedSlotCounter = 2
        extraSleepTime = 1000
        sendLock = {m_isOk = 208, m_mutex = @0x7f261d69b1a9}
#5  0x00007f261d6fff32 in wxThreadInternal::PthreadStart (thread=0x3e3de20) at ../src/unix/threadpsx.cpp:766
        __clframe = {__cancel_routine = 0x7f261d6ffde2 <wxPthreadCleanup>, __cancel_arg = 0x3e3de20, __do_it = 1,
  __cancel_type = 0}
        pthread = (wxThreadInternal *) 0x3cac740
        rc = 0
        dontRunAtAll = false
        __FUNCTION__ = "PthreadStart"
#6  0x00007f261d700092 in wxPthreadStart (ptr=0x3e3de20) at ../src/unix/threadpsx.cpp:718
No locals.
#7  0x00007f261ef363ea in start_thread (arg=<value optimized out>) at pthread_create.c:297
        __res = <value optimized out>
        pd = (struct pthread *) 0x4084a950
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -8534477539052507638, 8392704, 139801709158464, 0, 140733851275056,
        -8534337872103625206, 8629824889196097034}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
      cleanup = 0x0, canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
#8  0x00007f261c94ac6d in clone () from /usr/lib/debug/libc.so.6
        fstab_state = {fs_fp = 0x0, fs_buffer = 0x0, fs_mntres = {mnt_fsname = 0x0, mnt_dir = 0x0, mnt_type = 0x0,
    mnt_opts = 0x0, mnt_freq = 0, mnt_passno = 0}, fs_ret = {fs_spec = 0x0, fs_file = 0x0, fs_vfstype = 0x0, fs_mntops = 0x0,
    fs_type = 0x0, fs_freq = 0, fs_passno = 0}}
        __elf_set___libc_subfreeres_element_fstab_free__ = (const void *) 0x7f261c988490
#9  0x0000000000000000 in ?? ()
Current language:  auto; currently asm

Thread 1 (Thread 0x7f261f32a780 (LWP 12235)):
#0  0x00007f261ef3dfab in raise
... (trimmed to fit within forum character limit)
#7  0x00007f261d641c59 in wxOnAssert (szFile=0x75f9b0, nLine=461, szFunc=0x7624e8 "AddContact2", szCond=0x71b9b8, szMsg=0x0)

#8  0x00000000005a3372 in Kademlia::CKademliaUDPListener::AddContact2 (this=0x4971bb0, data=<value optimized out>,
    lenData=<value optimized out>, ip=1568980541, port=@0x7fff2736404c, outVersion=<value optimized out>, udpKey=@0x7fff27365070,
    ipVerified=@0x7fff27364048, update=true, fromHelloReq=true, outRequestsACK=0x0, outContactID=0x7fff27364050)
    at ../../src/kademlia/net/KademliaUDPListener.cpp:461
        tag = (class CTag *) 0x7987110
        bio = {<CFileDataIO> = {_vptr.CFileDataIO = 0x81f830}, m_growthRate = 0, m_position = 26, m_BufferSize = 31,
  m_fileSize = 31, m_delete = false, m_readonly = true, m_buffer = 0x7fff27365202 "é\221\203?"}
        id = {m_data = {1065587177, 3445810432, 1143234758, 1354866525}}
        tport = 53068
        version = 8 '\b'
        udpFirewalled = false
        tcpFirewalled = false
        tags = 2 '\002'
        __FUNCTION__ = "AddContact2"
#9  0x00000000005a6183 in Kademlia::CKademliaUDPListener::Process2HelloRequest (this=0x4971bb0,
    packetData=0x7fff27365202 "é\221\203?", lenPacket=31, ip=1568980541, port=63309, senderKey=@0x7fff27365070,
    validReceiverKey=false) at ../../src/kademlia/net/KademliaUDPListener.cpp:696
        dbgOldUDPPort = 63309
        contactVersion = 8 '\b'
        contactID = {m_data = {1065587177, 3445810432, 1143234758, 1354866525}}
        addedOrUpdated = <value optimized out>
        __FUNCTION__ = "Process2HelloRequest"
#10 0x00000000005a8888 in Kademlia::CKademliaUDPListener::ProcessPacket (this=0x4971bb0, data=<value optimized out>, lenData=33,
    ip=1568980541, port=63309, validReceiverKey=<value optimized out>, senderKey=@0x7fff27365070)
    at ../../src/kademlia/net/KademliaUDPListener.cpp:274
        curCon = <value optimized out>
        opcode = <value optimized out>
        packetData = (const uint8_t *) 0x7fff27365202 "é\221\203?"
        lenPacket = 31
#11 0x00000000005825a4 in Kademlia::CKademlia::ProcessPacket (data=0x7fff273638b0 "", lenData=<value optimized out>,
    ip=<value optimized out>, port=<value optimized out>, validReceiverKey=<value optimized out>, senderKey=<value optimized out>)
    at ../../src/kademlia/kademlia/Kademlia.cpp:288
No locals.
#12 0x00000000004a21fc in CClientUDPSocket::OnPacketReceived (this=0x39be0b0, ip=48640, port=65535, buffer=<value optimized out>,
    length=<value optimized out>) at ../../src/ClientUDPSocket.cpp:100
        decryptedBuffer = (uint8_t *) 0x7fff27365200 "ä\021é\221\203?"
        receiverVerifyKey = 0
        senderVerifyKey = 1303573865
        packetLen = 33
        protocol = 228 'ä'
        opcode = 17 '\021'
        __FUNCTION__ = "OnPacketReceived"
#13 0x000000000051b4d6 in CMuleUDPSocket::OnReceive (this=0x39be0b0, errorCode=<value optimized out>)
    at ../../src/MuleUDPSocket.cpp:184
        buffer = "Ð\223\223{B\201ÿX01 Òpé\223eä\021é\221\203?\000åbÍÆ`$D]\237ÁPLÏ\b\002\b\001\000ü\000\000\t\001\000ò\001\000\000\000\000\000\000\000 R6'ÿ\177\000\000\000\000\000\000\000\000\000\000ÀR6'ÿ\177\000\000@IÎ\006\000\000\000\000\016", '\0' <repeats 15 times>, "²\215÷\026&\177\000\000|R6'ÿ\177", '\0' <repeats 18 times>, "ÀR6'ÿ\177\000\000@IÎ\006\000\000\000\000\016", '\0' <repeats 15 times>, "ª\221\213\030&\177", '\0' <repeats 18 times>, "`\vú\026&\177\000\000@S6'ÿ\177\000\000\000\000\000\000\000\000\000\000e\000\000\000\016", '\0' <repeats 27 times>...
        addr = {<wxIPaddress> = {<wxSockAddress> = {<wxObject> = {_vptr.wxObject = 0x7f261dbf7a30, static ms_classInfo = {
          m_className = 0x7f261d73d0e0, m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0,
          static sm_first = 0x7f261e645b80, m_next = 0x7f261d9b3940, static sm_classTable = 0x27904d0}, m_refData = 0x0},
      static ms_classInfo = {m_className = 0x7f261d9ec590, m_objectSize = 24, m_objectConstructor = 0,
        m_baseInfo1 = 0x7f261d9b3840, m_baseInfo2 = 0x0, static sm_first = 0x7f261e645b80, m_next = 0x7f261dbfa480,
        static sm_classTable = 0x27904d0}, m_address = 0x6d6a1f0}, static ms_classInfo = {m_className = 0x7f261d9ec5c8,
      m_objectSize = 24, m_objectConstructor = 0, m_baseInfo1 = 0x7f261dbfa380, m_baseInfo2 = 0x0,
      static sm_first = 0x7f261e645b80, m_next = 0x7f261dbfa380, static sm_classTable = 0x27904d0}}, static ms_classInfo = {
    m_className = 0x7f261d9ec5f8, m_objectSize = 32, m_objectConstructor = 0x7f261d9dd85a <wxIPV4address::wxCreateObject()>,
    m_baseInfo1 = 0x7f261dbfa3c0, m_baseInfo2 = 0x0, static sm_first = 0x7f261e645b80, m_next = 0x7f261dbfa3c0,
    static sm_classTable = 0x27904d0}, m_origHostname = {<wxStringBase> = {static npos = 18446744073709551615,
      m_pchData = 0x7f261d743b78}, <No data fields>}}
        length = 49
        error = false
        lastError = <value optimized out>
        ip = 1035895901
        port = 63309
#14 0x00000000004a27d9 in CClientUDPSocket::OnReceive (this=0x2fcb, errorCode=12235) at ../../src/ClientUDPSocket.cpp:69
No locals.
#15 0x00007f261d641633 in wxAppConsole::HandleEvent (this=0x27cd080, handler=0x27cd080,
    func=0x4529d0 <CamuleApp::UDPSocketHandler(wxSocketEvent&)>, event=@0xa89f2c0) at ../src/common/appbase.cpp:322
No locals.
#16 0x00007f261d7020bc in wxEvtHandler::ProcessEventIfMatches (entry=@0xdaf650, handler=0x27cd080, event=@0xa89f2c0)
    at ../src/common/event.cpp:1231
        tableId1 = 6126
        tableId2 = -1
#17 0x00007f261d704064 in wxEventHashTable::HandleEvent (this=0xdaf5c0, event=@0xa89f2c0, self=0x27cd080)
    at ../src/common/event.cpp:906
        n = 2
        eventEntryTable = (const wxEventTableEntryPointerArray &) @0x345fed8: {<wxBaseArrayPtrVoid> = {m_nSize = 3, m_nCount = 3,
    m_pItems = 0x39bb380}, <No data fields>}
        count = 3
        eventType = 10002
        eTTnode = (wxEventHashTable::EventTypeTable * const) 0x345fed0
#18 0x00007f261d70419f in wxEvtHandler::ProcessEvent (this=0x27cd080, event=@0xa89f2c0) at ../src/common/event.cpp:1293
        __FUNCTION__ = "ProcessEvent"
#19 0x00007f261d7029e8 in wxEvtHandler::ProcessPendingEvents (this=0x27cd080) at ../src/common/event.cpp:1191
        event = {m_ptr = 0xa89f2c0}
        node = {m_ptr = 0x5cb2b10}
        n = 1
        __FUNCTION__ = "ProcessPendingEvents"
#20 0x00007f261d64289b in wxAppConsole::ProcessPendingEvents (this=0x27cd080) at ../src/common/appbase.cpp:294
        handler = (class wxEvtHandler *) 0x27cd080
        node = {m_ptr = 0x4ae0c60}
#21 0x00007f261ded6053 in wxAppBase::ProcessIdle (this=0x27cd080) at ../src/common/appcmn.cpp:435
        event = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x1c, static ms_classInfo = {m_className = 0x7f261d73d0e0,
        m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7f261e645b80,
        m_next = 0x7f261d9b3940, static sm_classTable = 0x27904d0}, m_refData = 0x7f261a308fd8}, m_eventObject = 0x0,

    m_eventType = 448583006, m_timeStamp = 0, m_id = 493872463, m_callbackUserData = 0x0, m_propagationLevel = 41575392,
    m_skipped = false, m_isCommandEvent = false, static ms_classInfo = {m_className = 0x7f261d754a30, m_objectSize = 64,
      m_objectConstructor = 0, m_baseInfo1 = 0x7f261d9b3840, m_baseInfo2 = 0x0, static sm_first = 0x7f261e645b80,
      m_next = 0x7f261d9b57e0, static sm_classTable = 0x27904d0}}, m_requestMore = false,
  static sm_idleMode = wxIDLE_PROCESS_ALL, static ms_classInfo = {m_className = 0x7f261dfd2188, m_objectSize = 64,
    m_objectConstructor = 0x7f261de02354 <wxIdleEvent::wxCreateObject()>, m_baseInfo1 = 0x7f261d9b5820, m_baseInfo2 = 0x0,
    static sm_first = 0x7f261e645b80, m_next = 0x7f261e30bc20, static sm_classTable = 0x27904d0}}
        needMore = false
        node = {m_ptr = 0x7fff27369580}
#22 0x00007f261de1628e in wxapp_idle_callback () at ../src/gtk/app.cpp:206
        idleID_save = 14036489
        moreIdles = false
        lock = {m_isOk = true, m_mutex = @0x1}
#23 0x00007f261a314d3b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0x00007f261a31850d in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00007f261a318a3d in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#26 0x00007f261c1a57a7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#27 0x00007f261de34fa9 in wxEventLoop::Run (this=0x80e6ba0) at ../src/gtk/evtloop.cpp:76
        activate = {m_evtLoopOld = 0x0}
        exitcode = 0
        __FUNCTION__ = "Run"
#28 0x00007f261ded5b00 in wxAppBase::MainLoop (this=0x27cd080) at ../src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x80e6ba0}, m_pp = 0x27cd0f8, m_pOld = 0x0}
#29 0x00007f261ded589d in wxAppBase::OnRun (this=0x27cd080) at ../src/common/appcmn.cpp:367
No locals.
#30 0x00007f261d689eee in wxEntry (argc=@0x7f261d9b2470, argv=0x27bade0) at ../src/common/init.cpp:460
        callOnExit = {<No data fields>}
        cleanupOnExit = {<No data fields>}
#31 0x00007f261d68a124 in wxEntry (argc=@0x7fff27369914, argv=0x7fff273699e8) at ../src/common/init.cpp:472
No locals.
#32 0x00000000005ba202 in main (argc=1, argv=0x2fcb) at ../../src/amule-gui.cpp:95
No locals.
Current language:  auto; currently c

(gdb) l
456                     CTag *tag = bio.ReadTag();
457                     if (!tag->GetName().Cmp(TAG_SOURCEUPORT)) {
458                             if (tag->IsInt() && (uint16_t)tag->GetInt() > 0) {
459                                     port = tag->GetInt();
460                             } else {
461                                     wxFAIL;
462                             }
463                     } else if (!tag->GetName().Cmp(TAG_KADMISCOPTIONS)) {
464                             if (tag->IsInt() && tag->GetInt() > 0) {
465                                     udpFirewalled = (tag->GetInt() & 0x01) > 0;
(gdb) p *tag
$7 = {_vptr.CTag = 0x74e170, m_uType = 8 '\b', {m_hashVal = 0x0, m_pstrVal = 0x0, m_uVal = 0, m_fVal = 0, m_pData = 0x0},
  m_nSize = 0, m_uName = 0 '\0', m_Name = {<wxStringBase> = {static npos = 18446744073709551615,
      m_pchData = 0xb23f3a8}, <No data fields>}}
(gdb) p tag->IsInt()
$8 = true
(gdb) p tag->GetInt()
$9 = 0
Title: Re: assertion fail in AddContact2()
Post by: llama on November 21, 2008, 10:55:16 PM
I hit this one again, and it looks exactly the same as last time.  (tag->IsInt() = true, ->GetInt() = 0).

 This was on a freshly-started amule (no previous crashes or assertions), that was downloading 2 files with a lot of sources (80, and 250, or something.  never mind, these apparently were finished by the time the assertion failed, or the assertion failure doesn't stop downloads?), plus half a dozen files with only a couple sources, plus ~20 files with no sources.

Code: [Select]
Debug: ../../src/kademlia/net/KademliaUDPListener.cpp(461): assert "wxAssertFailure" failed in AddContact2().

[New Thread 0x42414950 (LWP 23938)]
[Thread 0x42414950 (LWP 23938) exited]
CAUGHT DEAD SOCKET IN SENDPACKET()
Invalid Kad tag; type=0x47 name=
[New Thread 0x42414950 (LWP 3341)]
[Thread 0x42414950 (LWP 3341) exited]
[New Thread 0x42414950 (LWP 5702)]
[Thread 0x42414950 (LWP 5702) exited]
[New Thread 0x42414950 (LWP 5773)]
[Thread 0x42414950 (LWP 5773) exited]

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7f053ae15780 (LWP 22301)]
0x00007f053aa28fab in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
42      ../nptl/sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/pt-raise.c
Current language:  auto; currently c


(gdb) fr 8
#8  0x00000000005a3372 in Kademlia::CKademliaUDPListener::AddContact2 (this=0x49cf7f0, data=<value optimized out>,
    lenData=<value optimized out>, ip=3375578908, port=@0x7fff42e4db3c, outVersion=<value optimized out>, udpKey=@0x7fff42e4eb60,
    ipVerified=@0x7fff42e4db38, update=true, fromHelloReq=true, outRequestsACK=0x0, outContactID=0x7fff42e4db40)
    at ../../src/kademlia/net/KademliaUDPListener.cpp:461
461                                     wxFAIL;
Current language:  auto; currently c++
(gdb) l
456                     CTag *tag = bio.ReadTag();
457                     if (!tag->GetName().Cmp(TAG_SOURCEUPORT)) {
458                             if (tag->IsInt() && (uint16_t)tag->GetInt() > 0) {
459                                     port = tag->GetInt();
460                             } else {
461                                     wxFAIL;
462                             }
463                     } else if (!tag->GetName().Cmp(TAG_KADMISCOPTIONS)) {
464                             if (tag->IsInt() && tag->GetInt() > 0) {
465                                     udpFirewalled = (tag->GetInt() & 0x01) > 0;
(gdb) p *tag
$1 = {_vptr.CTag = 0x74e170, m_uType = 8 '\b', {m_hashVal = 0x0, m_pstrVal = 0x0, m_uVal = 0, m_fVal = 0, m_pData = 0x0},
  m_nSize = 0, m_uName = 0 '\0', m_Name = {<wxStringBase> = {static npos = 18446744073709551615,
      m_pchData = 0x5ba45a8}, <No data fields>}}
(gdb) p tag->IsInt()
$2 = true
(gdb) p tag->GetInt()
$3 = 0

(gdb) thread apply all bt full

Thread 4 (Thread 0x42c15950 (LWP 22311)):
#0  0x00007f053aa2555d in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/debug/libpthread.so.0
#1  0x00007f05391e8fdd in wxConditionInternal::WaitTimeout (this=0x28ee460, milliseconds=100) at ../src/unix/threadpsx.cpp:405
        curtime = {m_ll = 1227303482369}
        temp = {m_ll = 369}
        sec = 1227303482
        millis = 369
        tspec = {tv_sec = 1227303482, tv_nsec = 369000000}
        err = 0
#2  0x00007f05391e90a9 in wxCondition::WaitTimeout (this=0x49cfb08, milliseconds=100) at ../include/wx/thrimpl.cpp:256
#3  0x00007f05391e9d5b in wxSemaphoreInternal::WaitTimeout (this=0x49cfb00, milliseconds=100) at ../src/unix/threadpsx.cpp:552
        elapsed = {m_ll = 0}
        remainingTime = 100
        locker = {m_isOk = true, m_mutex = @0x49cfb00}
        startTime = {m_ll = 1227303482269}
#4  0x00007f05391e9e3f in wxSemaphore::WaitTimeout (this=0x28eedf0, milliseconds=100) at ../include/wx/thrimpl.cpp:320
#5  0x000000000068e008 in CTimerThread::Entry (this=0x28eedb0) at ../../src/Timer.cpp:64
        now = 18446744073709551100
        sinceLast = 965893
        timeout = 0
        evt = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x821b10, static ms_classInfo = {m_className = 0x7f05392280e0,
        m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7f053a130b80,
        m_next = 0x7f053949e940, static sm_classTable = 0x28754d0}, m_refData = 0x0}, m_eventObject = 0x0, m_eventType = 10244,
    m_timeStamp = 0, m_id = 6128, m_callbackUserData = 0x0, m_propagationLevel = 0, m_skipped = false, m_isCommandEvent = false,
    static ms_classInfo = {m_className = 0x7f053923fa30, m_objectSize = 64, m_objectConstructor = 0,
      m_baseInfo1 = 0x7f053949e840, m_baseInfo2 = 0x0, static sm_first = 0x7f053a130b80, m_next = 0x7f05394a07e0,
      static sm_classTable = 0x28754d0}}, <No data fields>}
        lastEvent = 3237802909
#6  0x00007f05391eaf32 in wxThreadInternal::PthreadStart (thread=0x28eedb0) at ../src/unix/threadpsx.cpp:766
        __clframe = {__cancel_routine = 0x7f05391eade2 <wxPthreadCleanup>, __cancel_arg = 0x28eedb0, __do_it = 1,
  __cancel_type = 0}
        pthread = (wxThreadInternal *) 0x28eeb90
        rc = 0
        dontRunAtAll = false
#7  0x00007f05391eb092 in wxPthreadStart (ptr=0x28eedb0) at ../src/unix/threadpsx.cpp:718
#8  0x00007f053aa213ea in start_thread (arg=<value optimized out>) at pthread_create.c:297
        __res = <value optimized out>
        pd = (struct pthread *) 0x42c15950
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 7427787926345545318, 8392704, 139660439670848, 0, 140734315705040,
        7427641131361564262, -7413285042490640794}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
      cleanup = 0x0, canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
#9  0x00007f0538435c6d in clone () from /usr/lib/debug/libc.so.6
        fstab_state = {fs_fp = 0x0, fs_buffer = 0x0, fs_mntres = {mnt_fsname = 0x0, mnt_dir = 0x0, mnt_type = 0x0,
    mnt_opts = 0x0, mnt_freq = 0, mnt_passno = 0}, fs_ret = {fs_spec = 0x0, fs_file = 0x0, fs_vfstype = 0x0, fs_mntops = 0x0,
    fs_type = 0x0, fs_freq = 0, fs_passno = 0}}
        __elf_set___libc_subfreeres_element_fstab_free__ = (const void *) 0x7f0538473490
#10 0x0000000000000000 in ?? ()
No symbol table info available.

Thread 2 (Thread 0x41c13950 (LWP 22309)):
#0  0x00007f053aa28851 in nanosleep () from /usr/lib/debug/libpthread.so.0
#1  0x00007f05391f5992 in wxMicroSleep (microseconds=1000000) at ../src/unix/utilsunx.cpp:191
        tmReq = {tv_sec = 1, tv_nsec = 0}
---Type <return> to continue, or q <return> to quit---
#2  0x00007f05391f59b0 in wxMilliSleep (milliseconds=1000) at ../src/unix/utilsunx.cpp:212
#3  0x00007f05391e8d31 in wxThread::Sleep (milliseconds=1000) at ../src/unix/threadpsx.cpp:986
#4  0x0000000000559891 in UploadBandwidthThrottler::Entry (this=0x3dea400) at ../../src/UploadBandwidthThrottler.cpp:324
        timeSinceLastLoop = 0
        minFragSize = 1300
        doubleSendSize = 2600
        bytesToSpend = 26624
        sleepTime = 1000
        thisLoopTick = 3237802850
        lastLoopTick = 3237802850
        realBytesToSpend = 2048999
        allowedDataRate = 24576
        rememberedSlotCounter = 4
        extraSleepTime = 1000
        sendLock = {m_isOk = 208, m_mutex = @0x7f05391861a9}
#5  0x00007f05391eaf32 in wxThreadInternal::PthreadStart (thread=0x3dea400) at ../src/unix/threadpsx.cpp:766
        __clframe = {__cancel_routine = 0x7f05391eade2 <wxPthreadCleanup>, __cancel_arg = 0x3dea400, __do_it = 1,
  __cancel_type = 0}
        pthread = (wxThreadInternal *) 0x3e05710
        rc = 0
        dontRunAtAll = false
#6  0x00007f05391eb092 in wxPthreadStart (ptr=0x3dea400) at ../src/unix/threadpsx.cpp:718
#7  0x00007f053aa213ea in start_thread (arg=<value optimized out>) at pthread_create.c:297
        __res = <value optimized out>
        pd = (struct pthread *) 0x41c13950
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 7427787926345545318, 8392704, 139660439670848, 0, 140734315702816,
        7427647729505072742, -7413285042490640794}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
      cleanup = 0x0, canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
#8  0x00007f0538435c6d in clone () from /usr/lib/debug/libc.so.6
        fstab_state = {fs_fp = 0x0, fs_buffer = 0x0, fs_mntres = {mnt_fsname = 0x0, mnt_dir = 0x0, mnt_type = 0x0,
    mnt_opts = 0x0, mnt_freq = 0, mnt_passno = 0}, fs_ret = {fs_spec = 0x0, fs_file = 0x0, fs_vfstype = 0x0, fs_mntops = 0x0,
    fs_type = 0x0, fs_freq = 0, fs_passno = 0}}
        __elf_set___libc_subfreeres_element_fstab_free__ = (const void *) 0x7f0538473490
#9  0x0000000000000000 in ?? ()
No symbol table info available.
Current language:  auto; currently asm

Thread 1 (Thread 0x7f053ae15780 (LWP 22301)):
#0  0x00007f053aa28fab in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
... (trimmed to fit 20000 char forum limit)
#8  0x00000000005a3372 in Kademlia::CKademliaUDPListener::AddContact2 (this=0x49cf7f0, data=<value optimized out>,
    lenData=<value optimized out>, ip=3375578908, port=@0x7fff42e4db3c, outVersion=<value optimized out>, udpKey=@0x7fff42e4eb60,
    ipVerified=@0x7fff42e4db38, update=true, fromHelloReq=true, outRequestsACK=0x0, outContactID=0x7fff42e4db40)
    at ../../src/kademlia/net/KademliaUDPListener.cpp:461
        tag = (class CTag *) 0x720ccb0
        bio = {<CFileDataIO> = {_vptr.CFileDataIO = 0x81f830}, m_growthRate = 0, m_position = 26, m_BufferSize = 26,
  m_fileSize = 26, m_delete = false, m_readonly = true, m_buffer = 0x7fff42e4ecf2 "<aî\217Ôâ¡\211\001q"}
        id = {m_data = {2414764348, 2309087956, 3103813889, 2827209307}}
        tport = 33701
        version = 7 '\a'
        udpFirewalled = false
        tcpFirewalled = false
        tags = 1 '\001'
#9  0x00000000005a6183 in Kademlia::CKademliaUDPListener::Process2HelloRequest (this=0x49cf7f0,
    packetData=0x7fff42e4ecf2 "<aî\217Ôâ¡\211\001q", lenPacket=26, ip=3375578908, port=33711, senderKey=@0x7fff42e4eb60,
    validReceiverKey=true) at ../../src/kademlia/net/KademliaUDPListener.cpp:696
        dbgOldUDPPort = 33711
        contactVersion = 7 '\a'
        contactID = {m_data = {2414764348, 2309087956, 3103813889, 2827209307}}
        addedOrUpdated = <value optimized out>
#10 0x00000000005a8888 in Kademlia::CKademliaUDPListener::ProcessPacket (this=0x49cf7f0, data=<value optimized out>, lenData=28,
    ip=3375578908, port=33711, validReceiverKey=<value optimized out>, senderKey=@0x7fff42e4eb60)
    at ../../src/kademlia/net/KademliaUDPListener.cpp:274
        curCon = <value optimized out>
        opcode = <value optimized out>
        packetData = (const uint8_t *) 0x7fff42e4ecf2 "<aî\217Ôâ¡\211\001q"
        lenPacket = 26
#11 0x00000000005825a4 in Kademlia::CKademlia::ProcessPacket (data=0x7fff42e4d3a0 "", lenData=<value optimized out>,
    ip=<value optimized out>, port=<value optimized out>, validReceiverKey=<value optimized out>, senderKey=<value optimized out>)
    at ../../src/kademlia/kademlia/Kademlia.cpp:288
#12 0x00000000004a21fc in CClientUDPSocket::OnPacketReceived (this=0x3b6a740, ip=16128, port=65535, buffer=<value optimized out>,
    length=<value optimized out>) at ../../src/ClientUDPSocket.cpp:100
        decryptedBuffer = (uint8_t *) 0x7fff42e4ecf0 "ä\021<aî\217Ôâ¡\211\001q"
        receiverVerifyKey = 1620418262
        senderVerifyKey = 2369214722
        packetLen = 28
        protocol = 228 'ä'
        opcode = 17 '\021'
#13 0x000000000051b4d6 in CMuleUDPSocket::OnReceive (this=0x3b6a740, errorCode=<value optimized out>)
    at ../../src/MuleUDPSocket.cpp:184
        buffer = "ìF\200\035þ]\017B\035\236­8\217Më#ä\021<aî\217Ôâ¡\211\001q\000¹[Ê\203¨¥\203\a\001\b\001\000ü\000\000\005\177\000\000 vª\004\000\000\000\000°ïäBÿ\177", '\0' <repeats 18 times>, "\001\000\000\000\000\000\000\000aÖá5\005\177\000\000À3à\003\000\000---Type <return> to continue, or q <return> to quit---
\000\0000\000\000\000\000\000\000\000À3à\003\000\000\000\000\001\000\000\000\000\000\000\000Ðvª\004\000\000\000\000À3à\003\000\000\000\000ÀîäBÿ\177\000\000\001\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000G\026l6\005\177\000\000P4Ù\003\000\000\000\000 \017·\003\000\000\000\000à\017·\003\000\000\000\000 îäBÿ\177\000\000"...
        addr = {<wxIPaddress> = {<wxSockAddress> = {<wxObject> = {_vptr.wxObject = 0x7f05396e2a30, static ms_classInfo = {
          m_className = 0x7f05392280e0, m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0,
          static sm_first = 0x7f053a130b80, m_next = 0x7f053949e940, static sm_classTable = 0x28754d0}, m_refData = 0x0},
      static ms_classInfo = {m_className = 0x7f05394d7590, m_objectSize = 24, m_objectConstructor = 0,
        m_baseInfo1 = 0x7f053949e840, m_baseInfo2 = 0x0, static sm_first = 0x7f053a130b80, m_next = 0x7f05396e5480,
        static sm_classTable = 0x28754d0}, m_address = 0x71e4c90}, static ms_classInfo = {m_className = 0x7f05394d75c8,
      m_objectSize = 24, m_objectConstructor = 0, m_baseInfo1 = 0x7f05396e5380, m_baseInfo2 = 0x0,
      static sm_first = 0x7f053a130b80, m_next = 0x7f05396e5380, static sm_classTable = 0x28754d0}}, static ms_classInfo = {
    m_className = 0x7f05394d75f8, m_objectSize = 32, m_objectConstructor = 0x7f05394c885a <wxIPV4address::wxCreateObject()>,
    m_baseInfo1 = 0x7f05396e53c0, m_baseInfo2 = 0x0, static sm_first = 0x7f053a130b80, m_next = 0x7f05396e53c0,
    static sm_classTable = 0x28754d0}, m_origHostname = {<wxStringBase> = {static npos = 18446744073709551615,
      m_pchData = 0x7f053922eb78}, <No data fields>}}
        length = 44
        error = false
        lastError = <value optimized out>
        ip = 473904073
        port = 33711
#14 0x00000000004a27d9 in CClientUDPSocket::OnReceive (this=0x571d, errorCode=22301) at ../../src/ClientUDPSocket.cpp:69
#15 0x00007f053912c633 in wxAppConsole::HandleEvent (this=0x28b2080, handler=0x28b2080,
    func=0x4529d0 <CamuleApp::UDPSocketHandler(wxSocketEvent&)>, event=@0x5e41c20) at ../src/common/appbase.cpp:322
#16 0x00007f05391ed0bc in wxEvtHandler::ProcessEventIfMatches (entry=@0xdaf650, handler=0x28b2080, event=@0x5e41c20)
    at ../src/common/event.cpp:1231
        tableId1 = 6126
        tableId2 = -1
#17 0x00007f05391ef064 in wxEventHashTable::HandleEvent (this=0xdaf5c0, event=@0x5e41c20, self=0x28b2080)
    at ../src/common/event.cpp:906
        n = 2
        eventEntryTable = (const wxEventTableEntryPointerArray &) @0x3587d78: {<wxBaseArrayPtrVoid> = {m_nSize = 3, m_nCount = 3,
    m_pItems = 0x3b681d0}, <No data fields>}
        count = 3
        eventType = 10002
        eTTnode = (wxEventHashTable::EventTypeTable * const) 0x3587d70
#18 0x00007f05391ef19f in wxEvtHandler::ProcessEvent (this=0x28b2080, event=@0x5e41c20) at ../src/common/event.cpp:1293
#19 0x00007f05391ed9e8 in wxEvtHandler::ProcessPendingEvents (this=0x28b2080) at ../src/common/event.cpp:1191
        event = {m_ptr = 0x5e41c20}
        node = {m_ptr = 0x5558930}
        n = 1
#20 0x00007f053912d89b in wxAppConsole::ProcessPendingEvents (this=0x28b2080) at ../src/common/appbase.cpp:294
        handler = (class wxEvtHandler *) 0x28b2080
        node = {m_ptr = 0x77e6b50}
#21 0x00007f05399c1053 in wxAppBase::ProcessIdle (this=0x28b2080) at ../src/common/appcmn.cpp:435
        event = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x1c, static ms_classInfo = {m_className = 0x7f05392280e0,
        m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7f053a130b80,
        m_next = 0x7f053949e940, static sm_classTable = 0x28754d0}, m_refData = 0x7f0535df3fd8}, m_eventObject = 0x0,
    m_eventType = 913016158, m_timeStamp = 0, m_id = 958305615, m_callbackUserData = 0x0, m_propagationLevel = 42513376,
    m_skipped = false, m_isCommandEvent = false, static ms_classInfo = {m_className = 0x7f053923fa30, m_objectSize = 64,
      m_objectConstructor = 0, m_baseInfo1 = 0x7f053949e840, m_baseInfo2 = 0x0, static sm_first = 0x7f053a130b80,
      m_next = 0x7f05394a07e0, static sm_classTable = 0x28754d0}}, m_requestMore = false,
  static sm_idleMode = wxIDLE_PROCESS_ALL, static ms_classInfo = {m_className = 0x7f0539abd188, m_objectSize = 64,
    m_objectConstructor = 0x7f05398ed354 <wxIdleEvent::wxCreateObject()>, m_baseInfo1 = 0x7f05394a0820, m_baseInfo2 = 0x0,
    static sm_first = 0x7f053a130b80, m_next = 0x7f0539df6c20, static sm_classTable = 0x28754d0}}
        needMore = false
        node = {m_ptr = 0x7fff42e53070}
#22 0x00007f053990128e in wxapp_idle_callback () at ../src/gtk/app.cpp:206
        idleID_save = 8429626
---Type <return> to continue, or q <return> to quit---
        moreIdles = false
        lock = {m_isOk = true, m_mutex = @0x1}
#23 0x00007f0535dffd3b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#24 0x00007f0535e0350d in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#25 0x00007f0535e03a3d in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#26 0x00007f0537c907a7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#27 0x00007f053991ffa9 in wxEventLoop::Run (this=0x7f05280008f0) at ../src/gtk/evtloop.cpp:76
        activate = {m_evtLoopOld = 0x0}
        exitcode = 32517
#28 0x00007f05399c0b00 in wxAppBase::MainLoop (this=0x28b2080) at ../src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x7f05280008f0}, m_pp = 0x28b20f8, m_pOld = 0x0}
#29 0x00007f05399c089d in wxAppBase::OnRun (this=0x28b2080) at ../src/common/appcmn.cpp:367
#30 0x00007f0539174eee in wxEntry (argc=@0x7f053949d470, argv=0x289fde0) at ../src/common/init.cpp:460
        callOnExit = {<No data fields>}
        cleanupOnExit = {<No data fields>}
#31 0x00007f0539175124 in wxEntry (argc=@0x7fff42e53404, argv=0x7fff42e534d8) at ../src/common/init.cpp:472
#32 0x00000000005ba202 in main (argc=1, argv=0x571d) at ../../src/amule-gui.cpp:95
Current language:  auto; currently c
(gdb)
Title: Re: assertion fail in AddContact2()
Post by: GonoszTopi on November 22, 2008, 01:32:40 AM
For the time being, you may safely continue after this assertion. Will be fixed soon.