On Tue, 1 Jul 2003 01:42:12 +0200 (Romance Daylight Time) Vadim Zeitlin <[EMAIL PROTECTED]> wrote:
> On Mon, 30 Jun 2003 18:01:40 +0200 Xavier Nodet <[EMAIL PROTECTED]> wrote: > XN> The simplest way I found to avoid all crashes was to remove the all the > XN> 'busy indicator' stuff from HeaderInfoListImpl::BuildTables(), and not > XN> create the BusyIndicator at all. > If all these crashes are really due to reentrancy problems (which does > seem likely), there should be a better way to fix them by inserting guards > in whatever is reentered. Unfortunately so far I still haven't seen any > informative back traces to understand where exactly the problem is. As, for > some reason, I don't see these bugs here I'd be very grateful if you could > try to provoke them (instead of trying to avoid them :-) and send here the > stack when it crashes. The problem is that I never have a stack that shows the re-entrency itself: the crashes happen in the threading code because m_sizeTables is reset to 0 *during the threading itself*. I know this because I've put some assert: if ( IsSorting() && !m_tableSort ) { CHECK_RET( m_sizeTables, _T("Threading an empty list!!") ); wxString msg = _("Sorting %lu messages..."); if ( busy ) busy->SetLabel(msg, m_sizeTables); else busy = new BusyIndicator(!m_firstSort, m_mf, msg, m_sizeTables); if ( !Sort() ) { busy->Fail(_("Sorting failed!")); } CHECK_RET( m_sizeTables, _T("Threading an empty list!!") ); How can you imagine that the assert on the last line of this code snippet is triggered!! It must be because the busy indicator allowed some reentrency that in some code that resets m_sizeTable. The problem is that the crash is delayed until *after* the re-entrant code was exited... I will try to find what exactly this code is, but it will be quite difficult to set a breakpoint like: 'break here if and only if wxYield is in the stack'! Here is the trace, but I'm affraid it's completely useless... NTDLL! 77f75a58() ShowAssertDialog(const char * 0x008370b0, int 1514, const char * 0x008370a0, const char * 0x00837084) line 569 wxAppBase::OnAssert(const char * 0x008370b0, int 1514, const char * 0x008370a0, const char * 0x00837084) line 640 + 21 bytes wxMApp::OnAssert(const char * 0x008370b0, int 1514, const char * 0x008370a0, const char * 0x00837084) line 506 wxOnAssert(const char * 0x008370b0, int 1514, const char * 0x008370a0, const char * 0x00837084) line 632 wxAssert(int 0, const char * 0x008370b0, int 1514, const char * 0x008370a0, const char * 0x00837084) line 519 + 21 bytes HeaderInfoListImpl::BuildTables() line 1514 + 49 bytes HeaderInfoListImpl::GetMsgnoFromPos(unsigned long 251) line 637 HeaderInfoListImpl::GetIdxFromPos(unsigned long 251) line 665 + 29 bytes HeaderInfoList::GetItem(unsigned long 251) line 208 + 22 bytes HeaderInfoList::operator[](unsigned long 251) line 211 + 19 bytes HeaderInfoList_obj::operator[](unsigned long 251) line 413 + 21 bytes wxFolderView::SelectInitialMessage() line 3398 + 12 bytes wxFolderListCtrl::UpdateListing(HeaderInfoList * 0x04eb2f70) line 2229 wxFolderView::Update() line 3573 wxFolderView::OnFolderUpdateEvent(MEventFolderUpdateData & {...}) line 4783 FolderView::OnMEvent(MEventData & {...}) line 95 wxFolderView::OnMEvent(MEventData & {...}) line 150 MEventManager::Dispatch(MEventData * 0x03990248) line 179 + 18 bytes MEventManager::DispatchPending() line 129 + 9 bytes wxFolderView::ShowFolder(MailFolder * 0x04e93780) line 3744 wxFolderView::OpenFolder(MFolder * 0x00eb2c10, unsigned char 0) line 3912 wxMainFrame::OpenFolder(MFolder * 0x00eb2c10, unsigned char 0) line 689 + 36 bytes wxMainFolderTree::OnOpenHere(MFolder * 0x00eb2c10) line 151 wxFolderTree::OnSelectionChange(MFolder * 0x00e9c570, MFolder * 0x00eb2c10) line 886 wxMainFolderTree::OnSelectionChange(MFolder * 0x00e9c570, MFolder * 0x00eb2c10) line 141 wxFolderTreeImpl::OnTreeSelect(wxTreeEvent & {...}) line 2486 wxEvtHandler::SearchEventTable(wxEventTable & {...}, wxEvent & {...}) line 970 wxEvtHandler::ProcessEvent(wxEvent & {...}) line 884 + 19 bytes wxTreeCtrl::MSWOnNotify(int -203, long 1242956, long * 0x0012f598) line 2592 + 41 bytes wxFolderTreeImpl::MSWOnNotify(int -203, long 1242956, long * 0x0012f598) line 3161 + 20 bytes wxWindow::HandleNotify(int -203, long 1242956, long * 0x0012f598) line 3122 + 26 bytes wxWindow::MSWWindowProc(unsigned int 78, unsigned int 4294967093, long 1242956) line 2569 + 23 bytes wxWndProc(HWND__ * 0x00080a6a, unsigned int 78, unsigned int 4294967093, long 1242956) line 2333 + 26 bytes USER32! 77d67ad7() USER32! 77d6ccd4() USER32! 77d456b6() USER32! 77d46202() COMCTL32! 773456f8() COMCTL32! 7735eac5() COMCTL32! 7735e9b0() COMCTL32! 77396741() COMCTL32! 77377ba6() USER32! 77d67ad7() USER32! 77d6ccd4() USER32! 77d45cd6() USER32! 77d45cf5() wxWindow::MSWDefWindowProc(unsigned int 513, unsigned int 1, long 26935386) line 1935 + 37 bytes wxWindow::MSWWindowProc(unsigned int 513, unsigned int 1, long 26935386) line 2927 + 32 bytes wxTreeCtrl::MSWWindowProc(unsigned int 513, unsigned int 1, long 26935386) line 2265 + 23 bytes wxWndProc(HWND__ * 0x00140a40, unsigned int 513, unsigned int 1, long 26935386) line 2333 + 26 bytes USER32! 77d67ad7() USER32! 77d6ccd4() USER32! 77d44455() USER32! 77d495d5() USER32! 77d5d6c8() wxWindow::MSWProcessMessage(void * * 0x008c8a88 struct tagMSG s_currentMsg) line 2157 + 32 bytes wxApp::ProcessMessage(void * * 0x008c8a88 struct tagMSG s_currentMsg) line 1050 + 18 bytes wxApp::DoMessage(void * * 0x008c8a88 struct tagMSG s_currentMsg) line 914 + 18 bytes wxApp::DoMessage() line 909 wxApp::MainLoop() line 950 wxAppBase::OnRun() line 140 wxMApp::OnRun() line 999 wxEntry(void * 0x00400000, void * 0x00000000, char * 0x00141f02, int 1, unsigned char 1) line 706 WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f02, int 1) line 87 + 23 bytes WinMainCRTStartup() line 330 + 54 bytes KERNEL32! 77e814c7() -- Xavier Nodet "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759.
pgp00000.pgp
Description: PGP signature