aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: GapList  (Read 4089 times)

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
GapList
« on: August 03, 2009, 03:39:39 AM »

ASSERT INFO:
GapList.cpp(282): assert "wxAssertFailure" failed in IsComplete().

BACKTRACE:
[1] wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)
[2] CGapList::IsComplete(unsigned short) trunk5/src/GapList.cpp:283
[3] CPartFile::IsComplete(unsigned short) trunk5/src/PartFile.h:121
[4] CPartFile::WritePartStatus(CMemFile*) trunk5/src/PartFile.cpp:1343
[5] CUpDownClient::SendFileRequest() trunk5/src/DownloadClient.cpp:236
[6] CUpDownClient::ConnectionEstablished() trunk5/src/BaseClient.cpp:1666
[7] CUpDownClient::TryToConnect(bool) trunk5/src/BaseClient.cpp:1459
[8] CUpDownClient::AskForDownload() trunk5/src/DownloadClient.cpp:157
[9] CPartFile::Process(unsigned int, unsigned char) trunk5/src/PartFile.cpp:1392
[10] CDownloadQueue::Process() trunk5/src/DownloadQueue.cpp:399
[11] CamuleApp::OnCoreTimer(CTimerEvent&) trunk5/src/amule.cpp:1461
[12] wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) cons)
[13] wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[14] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[15] wxEvtHandler::ProcessEvent(wxEvent&)
[16] wxEvtHandler::ProcessPendingEvents()
[17] wxAppConsole::ProcessPendingEvents()
[18] wxAppBase::ProcessIdle()
[19] g_main_context_dispatch()
[20] g_main_loop_run()
[21] gtk_main()
[22] wxEventLoop::Run()
[23] wxAppBase::MainLoop()


(gdb) bt
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb767a6a7 in poll () from /lib/libc.so.6
#2  0xb7bb935d in wxapp_poll_func (ufds=0xdd1b520, nfds=7, timeout=19) at ./src/gtk/app.cpp:259
#3  0xb6fbbf12 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0xb6fbc5a2 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#5  0xb7261755 in gtk_dialog_run () from /usr/lib/libgtk-x11-2.0.so.0
#6  0xb7bea6f4 in wxGUIAppTraits::ShowAssertDialog (this=0x8cc0b50, msg=@0xbf833a5c) at ./src/gtk/utilsgtk.cpp:387
#7  0xb78d6124 in ShowAssertDialog (szFile=0x8845404, nLine=282, szFunc=0xe08893c, szCond=0x8845434, szMsg=0x0, traits=0x8cc0b50)
    at ./src/common/appbase.cpp:836
#8  0xb78d6370 in wxAppConsole::OnAssertFailure (this=0x8c9aac8, file=0x8845404, line=282, func=0xe08893c, cond=0x8845434, msg=0x0)
    at ./src/common/appbase.cpp:445
#9  0xb7bb8d2b in wxApp::OnAssertFailure (this=0x8c9aac8, file=0x8845404, line=282, func=0xe08893c, cond=0x8845434, msg=0x0)
    at ./src/gtk/app.cpp:556
#10 0x080875ee in CamuleApp::OnAssertFailure (this=0x8c9aac8, file=0x8845404, line=282, func=0xe08893c, cond=0x8845434, msg=0x0) at amule.cpp:1391
#11 0xb78d6250 in wxOnAssert (szFile=0x8845404, nLine=282, szFunc=0x88455a4 "IsComplete", szCond=0x8845434, szMsg=0x0)
    at ./src/common/appbase.cpp:711
#12 0x08368cd7 in CGapList::IsComplete (this=0xa7c6eac, part=9) at GapList.cpp:282
#13 0x0811b6eb in CPartFile::IsComplete (this=0xa7c6c70, part=9) at PartFile.h:121
#14 0x0837541b in CPartFile::WritePartStatus (this=0xa7c6c70, file=0xbf833cd8) at PartFile.cpp:1343
#15 0x08113b0e in CUpDownClient::SendFileRequest (this=0xd8a27d0) at DownloadClient.cpp:234
#16 0x080a75b2 in CUpDownClient::ConnectionEstablished (this=0xd8a27d0) at BaseClient.cpp:1664
#17 0x080a88d8 in CUpDownClient::TryToConnect (this=0xd8a27d0, bIgnoreMaxCon=false) at BaseClient.cpp:1458
#18 0x08114c9c in CUpDownClient::AskForDownload (this=0xd8a27d0) at DownloadClient.cpp:157
#19 0x083870fe in CPartFile::Process (this=0xa7c6c70, reducedownload=0, m_icounter=10 '\n') at PartFile.cpp:1477
#20 0x0812373c in CDownloadQueue::Process (this=0x972b010) at DownloadQueue.cpp:399
#21 0x08089e90 in CamuleApp::OnCoreTimer (this=0x8c9aac8) at amule.cpp:1459
#22 0xb78d5d8d in wxAppConsole::HandleEvent (this=0x8c9aac8, handler=0x8c9aac8, func=0x8089dde <CamuleApp::OnCoreTimer(CTimerEvent&)>,
    event=@0xb4a01920) at ./src/common/appbase.cpp:322
#23 0xb7996410 in wxEvtHandler::ProcessEventIfMatches (entry=@0x8c51e60, handler=0x8c9aac8, event=@0xb4a01920) at ./src/common/event.cpp:1231
#24 0xb7998276 in wxEventHashTable::HandleEvent (this=0x8c51de0, event=@0xb4a01920, self=0x8c9aac8) at ./src/common/event.cpp:906
#25 0xb79983da in wxEvtHandler::ProcessEvent (this=0x8c9aac8, event=@0xb4a01920) at ./src/common/event.cpp:1293
#26 0xb7996d0d in wxEvtHandler::ProcessPendingEvents (this=0x8c9aac8) at ./src/common/event.cpp:1191
#27 0xb78d6ec5 in wxAppConsole::ProcessPendingEvents (this=0x8c9aac8) at ./src/common/appbase.cpp:294
#28 0xb7c839e5 in wxAppBase::ProcessIdle (this=0x8c9aac8) at ./src/common/appcmn.cpp:435
#29 0xb7bb9a84 in wxapp_idle_callback () at ./src/gtk/app.cpp:206
#30 0xb6fb6a91 in ?? () from /usr/lib/libglib-2.0.so.0
#31 0xb6fb89c8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#32 0xb6fbc083 in ?? () from /usr/lib/libglib-2.0.so.0
#33 0xb6fbc5a2 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#34 0xb72df829 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#35 0xb7bd97cd in wxEventLoop::Run (this=0xa210720) at ./src/gtk/evtloop.cpp:76
#36 0xb7c8344a in wxAppBase::MainLoop (this=0x8c9aac8) at ./src/common/appcmn.cpp:312
#37 0xb7c830d5 in wxAppBase::OnRun (this=0x8c9aac8) at ./src/common/appcmn.cpp:367
#38 0xb791ee10 in wxEntry (argc=@0xb7a346ac, argv=0x8c89480) at ./src/common/init.cpp:460
#39 0xb791eedb in wxEntry (argc=@0xbf834850, argv=0xbf8348d4) at ./src/common/init.cpp:472
#40 0x082bb180 in main (argc=Cannot access memory at address 0x7
) at amule-gui.cpp:94
(gdb) f 12
#12 0x08368cd7 in CGapList::IsComplete (this=0xa7c6eac, part=9) at GapList.cpp:282
282                     wxFAIL;
(gdb) l
277     }
278
279     bool CGapList::IsComplete(uint16 part)
280     {
281             if (part >= m_iPartCount) {
282                     wxFAIL;
283                     return false;
284             }
285             ePartComplete status = (ePartComplete) m_partsComplete[part];
286             if (status == unknown) {
(gdb) p m_iPartCount
$1 = 9
(gdb) p part
$2 = 9
Logged

^marcell^

  • Developer
  • Hero Member
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 524
Re: GapList
« Reply #1 on: August 03, 2009, 07:39:12 PM »

Quote
#13 0x0811b6eb in CPartFile::IsComplete (this=0xa7c6c70, part=9) at PartFile.h:121

Could be caused by stack corruption or an inconsistency between GapList::m_iPartCount and CKnownFile::m_iED2KPartCount.

Questions to the experienced developers:
- Does GapList keep track of the gaps (missing parts) only or every single part of the file?
- What's the point in using CKnownFile::m_iED2KPartCount and not CKnownFile::m_iPartCount?
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: GapList
« Reply #2 on: August 03, 2009, 11:17:57 PM »

Hello phoenix, fine to see you again!  :D

Thank you for detecting this problem in my gaplist code. You happen to download a file of exactly n * PARTSIZE ? I'll have to look up what exactly the OP_FILESTATUS is supposed to send in this case. Looks like I didn't consider that. Can you PM me the link ?

@Marcell: 1) gaps are not missing parts, and completely independent of the part segmentation. When you start a download, you have one gap spanning the whole file. If you download then a little block in the middle you have two gaps, one from the beginning to your block, one from the end of your block to your end. And so on.
2) Swamp made a bug in the original EDonkey2000 client I'd say, and everybody keeps it for compatibility. Looks like the protocol transmits one status mask bit too much for files of size n * PARTSIZE (in which case the two values differ).
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: GapList
« Reply #3 on: August 04, 2009, 10:17:48 PM »

Fixed in 9751.  :)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

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: GapList
« Reply #4 on: August 05, 2009, 02:18:27 PM »

Fixed in 9751.  :)
Great, will test it now!
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: GapList
« Reply #5 on: August 05, 2009, 07:34:59 PM »

Ok, it is definetly working now, though I don't think the link I gave you was the file I wanted :D
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: GapList
« Reply #6 on: August 05, 2009, 08:09:57 PM »

Good to hear it was nothing more serious.  :)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon