aMule Forum

English => aMule crashes => Topic started by: legolas558 on October 07, 2008, 09:00:59 AM

Title: Startup crash in CPartFile::Process
Post by: legolas558 on October 07, 2008, 09:00:59 AM
This crash happens early when starting up aMule

Code: [Select]
bt full
#0  0xffffe424 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb76c4191 in raise () from /lib/libc.so.6
No symbol table info available.
#2  0xb76c5978 in abort () from /lib/libc.so.6
No symbol table info available.
#3  0xb784a6ce in __gnu_debug::_Error_formatter::_M_error () from /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6
No symbol table info available.
#4  0x080a781f in __gnu_debug::operator!=<std::__norm::_List_iterator<CUpDownClient*>, std::__debug::list<CUpDownClient*, std::allocator<CUpDownClient*> > > (__lhs=@0xbffbc940, __rhs=@0xbffbc954)
    at /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g++-v4/debug/safe_iterator.h:462
No locals.
#5  0x082e3ae5 in CPartFile::Process (this=0xc184e00, reducedownload=200, m_icounter=5 '\005') at PartFile.cpp:1474
it = {<__gnu_debug::_Safe_iterator_base> = {_M_sequence = 0xc185104, _M_version = 0, _M_prior = 0xbffbc954,
    _M_next = 0x0}, _M_current = {_M_node = 0xb6e5098}}
old_trans = 2
dwCurTick = 3591962870
#6  0x080f339d in CDownloadQueue::Process (this=0x91b9278) at DownloadQueue.cpp:401
file = (class CPartFile *) 0xc184e00
unlocker = {m_isOk = true, m_mutex = @0x91b92a4}
i = 334
lock = {m_isOk = true, m_mutex = @0x91b92a4}
downspeed = 200
cur_datarate = 0
cur_udcounter = 5
#7  0x08079160 in CamuleApp::OnCoreTimer (this=0x88ba638) at amule.cpp:1449
msCur = 57234
msPrev1 = 56853
msPrev5 = 55017
msPrevSave = 0
msPrevHist = 57000
msPrevOS = 0
msPrevKnownMet = 0
#8  0xb7934335 in wxAppConsole::HandleEvent () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
#9  0xb79dc70f in wxEvtHandler::ProcessEventIfMatches () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
#10 0xb79dc85b in wxEventHashTable::HandleEvent () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#11 0xb79dc9df in wxEvtHandler::ProcessEvent () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
#12 0xb79dcdd7 in wxEvtHandler::ProcessPendingEvents () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
#13 0xb7934def in wxAppConsole::ProcessPendingEvents () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
#14 0xb7c45dff in wxAppBase::ProcessIdle () from /usr/lib/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#15 0xb7b98668 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#16 0xb714f321 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#17 0x00000000 in ?? ()
No symbol table info available.
(gdb) thread apply all bt

Thread 6 (Thread 0xb2ee8b90 (LWP 5811)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7f7e7fc in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb79d9ccb in wxConditionInternal::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#3  0xb79d9d2f in wxCondition::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#4  0xb79da8ca in wxSemaphoreInternal::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#5  0xb79da94f in wxSemaphore::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#6  0x083552c0 in CTimerThread::Entry (this=0xb5a4308) at Timer.cpp:64
#7  0xb79dadb8 in wxThreadInternal::PthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#8  0xb79dae2d in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#9  0xb7f7a18b in start_thread () from /lib/libpthread.so.0
#10 0xb775c29e in clone () from /lib/libc.so.6

Thread 2 (Thread 0xb515bb90 (LWP 5806)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7f817f6 in nanosleep () from /lib/libpthread.so.0
#2  0xb79e0dc6 in wxMicroSleep () from /usr/lib/libwx_baseu-2.8.so.0
#3  0xb79e0df1 in wxMilliSleep () from /usr/lib/libwx_baseu-2.8.so.0
#4  0xb79d949d in wxThread::Sleep () from /usr/lib/libwx_baseu-2.8.so.0
#5  0x081c0b0b in UploadBandwidthThrottler::Entry (this=0xc0600b8) at UploadBandwidthThrottler.cpp:324
#6  0xb79dadb8 in wxThreadInternal::PthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#7  0xb79dae2d in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#8  0xb7f7a18b in start_thread () from /lib/libpthread.so.0
#9  0xb775c29e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb6a8d9c0 (LWP 5803)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb76c4191 in raise () from /lib/libc.so.6
#2  0xb76c5978 in abort () from /lib/libc.so.6
#3  0xb784a6ce in __gnu_debug::_Error_formatter::_M_error () from /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/libstdc++.so.6
#4  0x080a781f in __gnu_debug::operator!=<std::__norm::_List_iterator<CUpDownClient*>, std::__debug::list<CUpDownClient*, std::allocator<CUpDownClient*> > > (__lhs=@0xbffbc940, __rhs=@0xbffbc954)
    at /usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g++-v4/debug/safe_iterator.h:462
#5  0x082e3ae5 in CPartFile::Process (this=0xc184e00, reducedownload=200, m_icounter=5 '\005') at PartFile.cpp:1474
#6  0x080f339d in CDownloadQueue::Process (this=0x91b9278) at DownloadQueue.cpp:401
#7  0x08079160 in CamuleApp::OnCoreTimer (this=0x88ba638) at amule.cpp:1449
#8  0xb7934335 in wxAppConsole::HandleEvent () from /usr/lib/libwx_baseu-2.8.so.0
#9  0xb79dc70f in wxEvtHandler::ProcessEventIfMatches () from /usr/lib/libwx_baseu-2.8.so.0
---Type <return> to continue, or q <return> to quit---
#10 0xb79dc85b in wxEventHashTable::HandleEvent () from /usr/lib/libwx_baseu-2.8.so.0
#11 0xb79dc9df in wxEvtHandler::ProcessEvent () from /usr/lib/libwx_baseu-2.8.so.0
#12 0xb79dcdd7 in wxEvtHandler::ProcessPendingEvents () from /usr/lib/libwx_baseu-2.8.so.0
#13 0xb7934def in wxAppConsole::ProcessPendingEvents () from /usr/lib/libwx_baseu-2.8.so.0
#14 0xb7c45dff in wxAppBase::ProcessIdle () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#15 0xb7b98668 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#16 0xb714f321 in ?? () from /usr/lib/libglib-2.0.so.0
#17 0x00000000 in ?? ()
Title: Re: Startup crash in CPartFile::Process
Post by: legolas558 on October 07, 2008, 09:12:17 AM
The relevant code is:

Code: [Select]
if (m_icounter < 10) {
// Update only downloading sources.
CClientPtrList::iterator it = m_downloadingSourcesList.begin();
for( ; it != m_downloadingSourcesList.end(); ) {
CUpDownClient *cur_src = *it++;
if(cur_src->GetDownloadState() == DS_DOWNLOADING) {
++transferingsrc;
kBpsDown += cur_src->SetDownloadLimit(reducedownload);
}
}
} else {

Does some developer know anything about it? Why should it crash? I also think that there is something wrong because __gnu_debug::_Error_formatter::_M_error() is called, but no error is shown
Title: Re: Startup crash in CPartFile::Process
Post by: legolas558 on October 07, 2008, 08:56:17 PM
Both the debug and non-debug version are affected by this bug, happening randomly.

These are today's crashes, 2 in about 6 hours.

Code: [Select]
Current version is: aMule 2.2.2 using wxGTK2 v2.8.8
Running on: Linux 2.6.25-gentoo-r8 i686

[2] CamuleApp::OnFatalException() in :0
[3] wxFatalSignalHandler in /usr/lib/libwx_baseu-2.8.so.0[0xb7ac7136]
[4] ?? in [0xffffe400]
[5] CUpDownClient::SendPacket(CPacket*, bool, bool) in :0
[6] CUpDownClient::CalculateKBpsDown() in :0
[7] CUpDownClient::SetDownloadLimit(unsigned int) in :0
[8] CPartFile::Process(unsigned int, unsigned char) in :0
[9] CDownloadQueue::Process() in :0
[10] CamuleApp::OnCoreTimer(CTimerEvent&) in :0
[11] wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const in /usr/lib/libwx_baseu-2.8.so.0[0xb7a1d2b1]
[12] wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) in /usr/lib/libwx_baseu-2.8.so.0[0xb7ac29e8]
[13] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) in /usr/lib/libwx_baseu-2.8.so.0[0xb7ac2b46]
[14] wxEvtHandler::ProcessEvent(wxEvent&) in /usr/lib/libwx_baseu-2.8.so.0[0xb7ac2cbf]
[15] wxEvtHandler::ProcessPendingEvents() in /usr/lib/libwx_baseu-2.8.so.0[0xb7ac3060]
[16] wxAppConsole::ProcessPendingEvents() in /usr/lib/libwx_baseu-2.8.so.0[0xb7a1dd2f]
[17] wxAppBase::ProcessIdle() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7d2926f]
[18] ?? in /usr/lib/libwx_gtk2u_core-2.8.so.0 [0xb7c7dabd]
[19] ?? in /usr/lib/libglib-2.0.so.0 [0xb7238321]
[20] g_main_context_dispatch in /usr/lib/libglib-2.0.so.0[0xb7239f2f]
[21] ?? in /usr/lib/libglib-2.0.so.0 [0xb723d43f]
[22] g_main_loop_run in /usr/lib/libglib-2.0.so.0[0xb723d7f7]
[23] gtk_main in /usr/lib/libgtk-x11-2.0.so.0[0xb75598d1]
[24] wxEventLoop::Run() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7c96e3c]
[25] wxAppBase::MainLoop() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7d2911e]
[26] wxAppBase::OnRun() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7d287a1]
[27] wxEntry(int&, wchar_t**) in /usr/lib/libwx_baseu-2.8.so.0[0xb7a586fa]
[28] wxEntry(int&, char**) in /usr/lib/libwx_baseu-2.8.so.0[0xb7a587a7]
[29] main in :0
[30] __libc_start_main in /lib/libc.so.6[0xb7799fdc]
[31] wxAppBase::MainLoop() in :0

Code: [Select]
Current version is: aMule 2.2.2 using wxGTK2 v2.8.8
Running on: Linux 2.6.25-gentoo-r8 i686

[2] CamuleApp::OnFatalException() in :0
[3] wxFatalSignalHandler in /usr/lib/libwx_baseu-2.8.so.0[0xb7a50136]
[4] ?? in [0xffffe400]
[5] CUpDownClient::GetDownloadState() const in :0
[6] CPartFile::Process(unsigned int, unsigned char) in :0
[7] CDownloadQueue::Process() in :0
[8] CamuleApp::OnCoreTimer(CTimerEvent&) in :0
[9] wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const in /usr/lib/libwx_baseu-2.8.so.0[0xb79a62b1]
[10] wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) in /usr/lib/libwx_baseu-2.8.so.0[0xb7a4b9e8]
[11] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) in /usr/lib/libwx_baseu-2.8.so.0[0xb7a4bb46]
[12] wxEvtHandler::ProcessEvent(wxEvent&) in /usr/lib/libwx_baseu-2.8.so.0[0xb7a4bcbf]
[13] wxEvtHandler::ProcessPendingEvents() in /usr/lib/libwx_baseu-2.8.so.0[0xb7a4c060]
[14] wxAppConsole::ProcessPendingEvents() in /usr/lib/libwx_baseu-2.8.so.0[0xb79a6d2f]
[15] wxAppBase::ProcessIdle() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7cb226f]
[16] ?? in /usr/lib/libwx_gtk2u_core-2.8.so.0 [0xb7c06abd]
[17] ?? in /usr/lib/libglib-2.0.so.0 [0xb71c1321]
[18] g_main_context_dispatch in /usr/lib/libglib-2.0.so.0[0xb71c2f2f]
[19] ?? in /usr/lib/libglib-2.0.so.0 [0xb71c643f]
[20] g_main_loop_run in /usr/lib/libglib-2.0.so.0[0xb71c67f7]
[21] gtk_main in /usr/lib/libgtk-x11-2.0.so.0[0xb74e28d1]
[22] wxEventLoop::Run() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7c1fe3c]
[23] wxAppBase::MainLoop() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7cb211e]
[24] wxAppBase::OnRun() in /usr/lib/libwx_gtk2u_core-2.8.so.0[0xb7cb17a1]
[25] wxEntry(int&, wchar_t**) in /usr/lib/libwx_baseu-2.8.so.0[0xb79e16fa]
[26] wxEntry(int&, char**) in /usr/lib/libwx_baseu-2.8.so.0[0xb79e17a7]
[27] main in :0
[28] __libc_start_main in /lib/libc.so.6[0xb7722fdc]
[29] wxAppBase::MainLoop() in :0
Title: Re: Startup crash in CPartFile::Process
Post by: Stu Redman on October 07, 2008, 11:59:29 PM
Could it be that AddDownloadingSource/RemoveDownloadingSource are called from different threads and corrupt the m_downloadingSourcesList ?
Title: Re: Startup crash in CPartFile::Process
Post by: legolas558 on October 08, 2008, 11:16:56 PM
Could it be that AddDownloadingSource/RemoveDownloadingSource are called from different threads and corrupt the m_downloadingSourcesList ?

(Oh no! More mutexes!)

I think some hardcore aMule developer can better answer this question right now (I think it is at least possible, if the lists are not someway protected), however, shooting in the dark, I would say:

maybe that aMule adds/removes sources while the startup seed sources loading process is not yet finished?