aMule Forum
English => Backtraces => Topic started by: phoenix on November 21, 2004, 10:01:00 PM
-
(gdb) bt
#0 0x0077d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x009d73d5 in raise () from /lib/tls/libpthread.so.0
#2 0x001845f5 in wxTrap () at src/common/appbase.cpp:571
#3 0x001849b9 in ShowAssertDialog (szFile=0x6ae5c3 "src/gtk/app.cpp", nLine=376,
szCond=0x6ae5fa "wxTheApp->m_idleTag == 0", szMsg=0x6ae5d4 "attempt to install idle handler twice", traits=0x87c63f0)
at src/common/appbase.cpp:725
#4 0x00184387 in wxAppConsole::OnAssert (this=0x8795618, file=0x6ae5c3 "src/gtk/app.cpp", line=376,
cond=0x6ae5fa "wxTheApp->m_idleTag == 0", msg=0x6ae5d4 "attempt to install idle handler twice")
at src/common/appbase.cpp:440
#5 0x0053637b in wxApp::OnAssert (this=0x8795618, file=0x6ae5c3 "src/gtk/app.cpp", line=376,
cond=0x6ae5fa "wxTheApp->m_idleTag == 0", msg=0x6ae5d4 "attempt to install idle handler twice")
at src/gtk/app.cpp:675
#6 0x001846ac in wxOnAssert (szFile=0x6ae5c3 "src/gtk/app.cpp", nLine=376, szCond=0x6ae5fa "wxTheApp->m_idleTag == 0",
szMsg=0x6ae5d4 "attempt to install idle handler twice") at src/common/appbase.cpp:617
#7 0x00184628 in wxAssert (cond=0, szFile=0x6ae5c3 "src/gtk/app.cpp", nLine=376,
szCond=0x6ae5fa "wxTheApp->m_idleTag == 0", szMsg=0x6ae5d4 "attempt to install idle handler twice")
at src/common/appbase.cpp:584
#8 0x005359d1 in wxapp_install_idle_handler () at src/gtk/app.cpp:376
#9 0x005357af in wxApp::WakeUpIdle (this=0x8795618) at src/gtk/app.cpp:184
#10 0x001845bd in wxWakeUpIdle () at src/common/appbase.cpp:546
#11 0x00227c64 in wxEvtHandler::AddPendingEvent (this=0x8795618, event=@0xf6cb9960) at src/common/event.cpp:1093
#12 0x0052b4dc in wxPostEvent (dest=0x8795618, event=@0xf6cb9960) at event.h:2352
#13 0x08141807 in CAddFileThread::ThreadCountDec () at AddFileThread.cpp:127
#14 0x08141661 in ~CAddFileThread (this=0x91cbb08) at AddFileThread.cpp:83
#15 0x00224e5d in DeleteThread (This=0x91cbb08) at src/unix/threadpsx.cpp:1683
#16 0x002243a7 in wxThread::Exit (this=0x91cbb08, status=0x0) at src/unix/threadpsx.cpp:1484
#17 0x00222cc3 in wxThreadInternal::PthreadStart (thread=0x91cbb08) at src/unix/threadpsx.cpp:796
#18 0x00222ab6 in wxPthreadStart (ptr=0x91cbb08) at src/unix/threadpsx.cpp:714
#19 0x009d098c in start_thread () from /lib/tls/libpthread.so.0
#20 0x02b4f7da in clone () from /lib/tls/libc.so.6
(gdb) bt full
#0 0x0077d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
No symbol table info available.
#1 0x009d73d5 in raise () from /lib/tls/libpthread.so.0
No symbol table info available.
#2 0x001845f5 in wxTrap () at src/common/appbase.cpp:571
No locals.
#3 0x001849b9 in ShowAssertDialog (szFile=0x6ae5c3 "src/gtk/app.cpp", nLine=376,
szCond=0x6ae5fa "wxTheApp->m_idleTag == 0", szMsg=0x6ae5d4 "attempt to install idle handler twice", traits=0x87c63f0)
at src/common/appbase.cpp:725
s_bNoAsserts = false
msg = { = {static npos = 4294967195,
m_pchData = 0x9328654 "src/gtk/app.cpp(376): assert \"wxTheApp->m_idleTag == 0\" failed: attempt to install idle handler twice [in child thread]"}, }
#4 0x00184387 in wxAppConsole::OnAssert (this=0x8795618, file=0x6ae5c3 "src/gtk/app.cpp", line=376,
cond=0x6ae5fa "wxTheApp->m_idleTag == 0", msg=0x6ae5d4 "attempt to install idle handler twice")
at src/common/appbase.cpp:440
No locals.
#5 0x0053637b in wxApp::OnAssert (this=0x8795618, file=0x6ae5c3 "src/gtk/app.cpp", line=376,
cond=0x6ae5fa "wxTheApp->m_idleTag == 0", msg=0x6ae5d4 "attempt to install idle handler twice")
at src/gtk/app.cpp:675
No locals.
#6 0x001846ac in wxOnAssert (szFile=0x6ae5c3 "src/gtk/app.cpp", nLine=376, szCond=0x6ae5fa "wxTheApp->m_idleTag == 0",
szMsg=0x6ae5d4 "attempt to install idle handler twice") at src/common/appbase.cpp:617
s_bInAssert = true
#7 0x00184628 in wxAssert (cond=0, szFile=0x6ae5c3 "src/gtk/app.cpp", nLine=376,
szCond=0x6ae5fa "wxTheApp->m_idleTag == 0", szMsg=0x6ae5d4 "attempt to install idle handler twice")
at src/common/appbase.cpp:584
No locals.
#8 0x005359d1 in wxapp_install_idle_handler () at src/gtk/app.cpp:376
No locals.
#9 0x005357af in wxApp::WakeUpIdle (this=0x8795618) at src/gtk/app.cpp:184
No locals.
#10 0x001845bd in wxWakeUpIdle () at src/common/appbase.cpp:546
No locals.
#11 0x00227c64 in wxEvtHandler::AddPendingEvent (this=0x8795618, event=@0xf6cb9960) at src/common/event.cpp:1093
eventCopy = (wxEvent *) 0x931df08
#12 0x0052b4dc in wxPostEvent (dest=0x8795618, event=@0xf6cb9960) at event.h:2352
No locals.
#13 0x08141807 in CAddFileThread::ThreadCountDec () at AddFileThread.cpp:127
evt = { = { = {_vptr.wxObject = 0x8318d48, static ms_classInfo = {
m_className = 0x23454d "wxObject", m_objectSize = 8, m_objectConstructor = 0, m_baseInfo1 = 0x0,
m_baseInfo2 = 0x0, static sm_first = 0x83cb010, m_next = 0x2720f0, static sm_classTable = 0x8785008},
m_refData = 0x0}, m_eventObject = 0x0, m_eventType = 10226, m_timeStamp = 0, m_id = -1, m_callbackUserData = 0x0,
m_propagationLevel = 0, m_skipped = false, m_isCommandEvent = false, static ms_classInfo = {
m_className = 0x238c1f "wxEvent", m_objectSize = 36, m_objectConstructor = 0, m_baseInfo1 = 0x2720b4,
m_baseInfo2 = 0x0, static sm_first = 0x83cb010, m_next = 0x272364, static sm_classTable = 0x8785008}},
m_ptr = 0x268aec, m_value = 670, m_commandInt = 1482807}
count = 0 '\0'
#14 0x08141661 in ~CAddFileThread (this=0x91cbb08) at AddFileThread.cpp:83
No locals.
#15 0x00224e5d in DeleteThread (This=0x91cbb08) at src/unix/threadpsx.cpp:1683
locker = {m_isOk = true, m_mutex = @0x87e0ee0}
#16 0x002243a7 in wxThread::Exit (this=0x91cbb08, status=0x0) at src/unix/threadpsx.cpp:1484
No locals.
#17 0x00222cc3 in wxThreadInternal::PthreadStart (thread=0x91cbb08) at src/unix/threadpsx.cpp:796
pthread = (wxThreadInternal *) 0x937d130
rc = 0
dontRunAtAll = false
#18 0x00222ab6 in wxPthreadStart (ptr=0x91cbb08) at src/unix/threadpsx.cpp:714
No locals.
#19 0x009d098c in start_thread () from /lib/tls/libpthread.so.0
No symbol table info available.
#20 0x02b4f7da in clone () from /lib/tls/libc.so.6
No symbol table info available.
(gdb) frame 13
#13 0x08141807 in CAddFileThread::ThreadCountDec () at AddFileThread.cpp:127
127 wxPostEvent(&theApp, evt);
(gdb) l
122 s_count_lock.Unlock();
123
124 // No threads left? Then let it be known.
125 if ( count == 0 ) {
126 wxMuleInternalEvent evt(wxEVT_CORE_FILE_HASHING_SHUTDOWN);
127 wxPostEvent(&theApp, evt);
128 }
129 } else {
130 // Just unlock
131 s_count_lock.Unlock();
-
Remember the wxMutexGuiLock?
Fight with lfroen yourself.
-
Fight with lfroen yourself.
Take a look to wx docs/source: you should lock wxMutexGuiLock only when you directly accessing gui elements from another thread. PostEvent have internal mutex which is locked when another entry is added to event queue.
From wx source, event.cpp:
1080 // 2) Add this event handler to list of event handlers that
1081 // have pending events.
1082
1083 wxENTER_CRIT_SECT(*wxPendingEventsLocker);
And then:
1085 if ( !wxPendingEvents )
1086 wxPendingEvents = new wxList;
1087 wxPendingEvents->Append(this);
1088
1089 wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);
1090
1091 // 3) Inform the system that new pending events are somwehere,
1092 // and that these should be processed in idle time.
1093 wxWakeUpIdle();
And documentation http://www.wxwindows.org/manuals/2.4.2/wx494.htm#wxthreadoverview (http://www.wxwindows.org/manuals/2.4.2/wx494.htm#wxthreadoverview)
Ecplicitly stands: "For communication between threads, use wxEvtHandler::AddPendingEvent or its short version wxPostEvent. These functions have thread safe implementation so that they can be used as they are for sending event from one thread to another."
So either it's bug in wx or I have reading comprehension problems
-
Oh, there's more: void wxapp_install_idle_handler() also lock internal mutex:
378 void wxapp_install_idle_handler()
379 {
380 #if wxUSE_THREADS
381 wxMutexLocker lock(gs_idleTagsMutex);
382 #endif
If still in doubt, go to wx sample called "threads". Take a look to PostEvent usage in child thread.