Hi again,

I recently got (several times) a crash with the following call-stack:

wxString::UngetWriteBuf() line 509 + 24 bytes
wxGetWindowText(unsigned long 459630) line 1542
wxWindow::GetTitle() line 598 + 18 bytes
wxWindowBase::GetLabel() line 163 + 31 bytes
wxControlContainer::SetLastFocus(wxWindow * 0x00e94d38) line 85 + 15 bytes
wxSplitterWindow::OnChildFocus(wxChildFocusEvent & {...}) line 62 + 30 bytes
wxEvtHandler::SearchEventTable(wxEventTable & {...}, wxEvent & {...}) line 961
wxEvtHandler::ProcessEvent(wxEvent & {...}) line 875 + 19 bytes
wxEvtHandler::ProcessEvent(wxEvent & {...}) line 904 + 26 bytes
wxWindow::HandleSetFocus(unsigned long 3474300) line 3370
wxWindow::MSWWindowProc(unsigned int 7, unsigned int 3474300, long 0) line 2428 + 15 
bytes
wxTreeCtrl::MSWWindowProc(unsigned int 7, unsigned int 3474300, long 0) line 2265 + 23 
bytes
wxWndProc(HWND__ * 0x0007036e, unsigned int 7, unsigned int 3474300, long 0) line 2333 
+ 26 bytes
USER32! 77d67ad7()
USER32! 77d6ccd4()
USER32! 77d445bd()
USER32! 77d447d4()
NTDLL! 77fb4da6()
wxSetFocusToChild(wxWindow * 0x00e94120, wxWindow * * 0x00e93638) line 358
wxTopLevelWindowMSW::OnActivate(wxActivateEvent & {...}) line 781 + 18 bytes
wxEvtHandler::SearchEventTable(wxEventTable & {...}, wxEvent & {...}) line 961
wxEvtHandler::ProcessEvent(wxEvent & {...}) line 875 + 19 bytes
wxWindow::HandleActivate(int 1, unsigned char 0, unsigned char 0) line 3358 + 26 bytes
wxWindow::MSWWindowProc(unsigned int 6, unsigned int 1, long 3474300) line 2423 + 40 
bytes
wxFrame::MSWWindowProc(unsigned int 6, unsigned int 1, long 3474300) line 790 + 20 
bytes
wxWndProc(HWND__ * 0x002a01d2, unsigned int 6, unsigned int 1, long 3474300) line 2333 
+ 26 bytes
USER32! 77d67ad7()
USER32! 77d6ccd4()
USER32! 77d445bd()
USER32! 77d447d4()
NTDLL! 77fb4da6()
wxTopLevelWindowMSW::Show(unsigned char 0) line 540
wxWindowBase::Hide() line 372 + 20 bytes
ReallyCloseTopLevelWindow(wxFrame * 0x020dd1f0) line 382
MProgressInfo::~MProgressInfo() line 3153 + 11 bytes
MProgressInfo::`scalar deleting destructor'(unsigned int 1) + 15 bytes
BusyIndicator::~BusyIndicator() line 383 + 31 bytes
BusyIndicator::`scalar deleting destructor'(unsigned int 1) + 15 bytes
HeaderInfoListImpl::BuildTables() line 1554 + 28 bytes
HeaderInfoListImpl::GetMsgnoFromPos(unsigned long 121) line 637
HeaderInfoListImpl::GetIdxFromPos(unsigned long 121) line 665 + 29 bytes
HeaderInfoList::GetItem(unsigned long 121) line 208 + 22 bytes
HeaderInfoList::operator[](unsigned long 121) line 211 + 19 bytes
HeaderInfoList_obj::operator[](unsigned long 121) line 413 + 21 bytes
wxFolderView::SelectInitialMessage() line 3401 + 12 bytes
wxFolderListCtrl::UpdateListing(HeaderInfoList * 0x020ea3b0) line 2229
wxFolderView::Update() line 3576
wxFolderView::OnFolderUpdateEvent(MEventFolderUpdateData & {...}) line 4783
FolderView::OnMEvent(MEventData & {...}) line 95
wxFolderView::OnMEvent(MEventData & {...}) line 150
MEventManager::Dispatch(MEventData * 0x020d0c90) line 179 + 18 bytes
MEventManager::DispatchPending() line 129 + 9 bytes
wxFolderView::ShowFolder(MailFolder * 0x020ecdc0) line 3747
wxFolderView::OpenFolder(MFolder * 0x00ead4b0, unsigned char 0) line 3915
wxMainFrame::OpenFolder(MFolder * 0x00ead4b0, unsigned char 0) line 686 + 36 bytes
wxMainFolderTree::OnOpenHere(MFolder * 0x00ead4b0) line 150
wxFolderTree::OnSelectionChange(MFolder * 0x00eb1888, MFolder * 0x00ead4b0) line 886
wxMainFolderTree::OnSelectionChange(MFolder * 0x00eb1888, MFolder * 0x00ead4b0) line 
140
wxFolderTreeImpl::OnTreeSelect(wxTreeEvent & {...}) line 2483
wxEvtHandler::SearchEventTable(wxEventTable & {...}, wxEvent & {...}) line 961
wxEvtHandler::ProcessEvent(wxEvent & {...}) line 875 + 19 bytes
wxTreeCtrl::MSWOnNotify(int -203, long 1242956, long * 0x0012f598) line 2592 + 41 bytes
wxFolderTreeImpl::MSWOnNotify(int -203, long 1242956, long * 0x0012f598) line 3158 + 
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__ * 0x00070378, 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 9175169) line 1935 + 
37 bytes
wxWindow::MSWWindowProc(unsigned int 513, unsigned int 1, long 9175169) line 2927 + 32 
bytes
wxTreeCtrl::MSWWindowProc(unsigned int 513, unsigned int 1, long 9175169) line 2265 + 
23 bytes
wxWndProc(HWND__ * 0x0007036e, unsigned int 513, unsigned int 1, long 9175169) line 
2333 + 26 bytes
USER32! 77d67ad7()
USER32! 77d6ccd4()
USER32! 77d44455()
USER32! 77d495d5()
USER32! 77d5d6c8()
wxWindow::MSWProcessMessage(void * * 0x008c7ac0 struct tagMSG s_currentMsg) line 2157 
+ 32 bytes
wxApp::ProcessMessage(void * * 0x008c7ac0 struct tagMSG s_currentMsg) line 1063 + 18 
bytes
wxApp::DoMessage(void * * 0x008c7ac0 struct tagMSG s_currentMsg) line 927 + 18 bytes
wxApp::DoMessage() line 922
wxApp::MainLoop() line 963
wxAppBase::OnRun() line 140
wxMApp::OnRun() line 999
wxEntry(void * 0x00400000, void * 0x00000000, char * 0x00141f02, int 1, unsigned char 
1) line 719
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f02, int 1) 
line 87 + 23 bytes
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 

The crash occurs at the first line of UngetWriteBuff, which reads:
  GetStringData()->nDataLength = wxStrlen(m_pchData);

I have the following state for the wxString:
  m_pchData[0] == '\0'
  (wxStringData*)m_pchData - 1:
      nRefs == -1
      nDataLength == 0
      nAllocLength == 0

It seems that the window we are trying to get the text from is an
instance of wxFolderTreeImpl. It also seems to me that the string for
which UngetWriteBuf() is called is empty, and thus GetStringData()
returns a pointer to a global instance of the structure, which has a
null pointer, leading to the crash.

If someone has an idea... A side note: I am not using a recent version
of wxWindows. I will try to update, and see what happens.

-- 
Xavier Nodet
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." - Benjamin Franklin, 1759.


Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to