To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92372
------- Additional comments from [EMAIL PROTECTED] Tue Aug 5 21:31:26 +0000
2008 -------
So are you saying there is no problem? I do think there is. I still can't
pinpoint exactly what it is, but here are some annotated debugging printouts
where I try to understand what is happening... Unfortunately producing such an
annotated debugging printout is hard, as when you notice that you really would
need more debugging printout, you add it, re-run the test, and then of course
all the pointer values are different, and it is a pain to copy the pieces of the
printout back into the annotation...
After adding lots of debugging printfs in interesting places in
window.cxx, syswin.cxx and taskpanelist.cxx, going through the output,
and trying to understand the code, I think I understand what
happens. Here is the scenario that leads to the crash. Below are
excerpts from the debugging output with comments. I will attach the
versions of window.cxx, syswin.cxx and taskpanelist.cxx with the
debugging printfs for reference.
A window is created:
Window::Window(WindowType)): #113, this=07079760
This window 0795CF38 is what we are tracing here.
It's mpWindowImpl->mpRealParent is set:
Window::ImplInsertWindow(Window*): this=07079760 setting
mpWindowImpl->mpRealParent=053710F8
It is added to a TaskPaneList:
TaskPaneList::AddWindow: this=0538B218 pWindow=07079760
Then SetParent() is called on it:
Window::SetParent(): this=07079760 newParent=05321E58 pSysWin=053710F8 current
mpWindowImpl->mpRealParent=053710F8
The test
if ( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) )
succeeds because pSyswin->ImplIsInTaskPaneList() returns true:
SystemWindow::ImplIsInTaskPaneList(WINDOW*): this=053710F8 pWin=07079760
mpImplData=05370FA0, mpImplData->mpTaskPaneList=0538B218
SystemWindow::ImplIsInTaskPaneList(WINDOW*):
mpImplData->mpTaskPaneList->IsInList returned TRUE, returning that
Also we get a pNewSysWin:
Window::SetParent(): this=07079760 pNewSysWin=05373C48
so the code to remove the window from its old TaskPaneList is invoked, and
bChangeTaskPaneList is set to TRUE:
Window::SetParent(): bChangeTaskPaneList=TRUE pSysWin=053710F8 removing
this=07079760 from its TaskPaneList=0538B218
TaskPaneList::RemoveWindow: this=0538B218 pWindow=07079760
TaskPaneList::RemoveWindow: this=0538B218 pWindow=07079760 found it, removing!
The window has no border window:
Window::SetParent(): this=07079760 no mpWindowImpl->mpBorderWindow!?
Then ImplInsertWindow() is called to really set the parent:
Window::ImplInsertWindow(Window*): this=07079760 setting
mpWindowImpl->mpRealParent=05321E58
and then as bChangeTaskPaneList is TRUE, the window is added to the new system
window's TaskPaneList:
Window::SetParent(): pNewSysWin=05373C48 adding this=07079760 to its
TaskPaneList=053B2008
TaskPaneList::AddWindow: this=053B2008 pWindow=07079760
TaskPaneList::AddWindow: *p=05321E58
Then a bit later SetParent() is called again:
Window::SetParent(): this=07079760 newParent=0534D998 pSysWin=05373C48 current
mpWindowImpl->mpRealParent=05321E58
Nothing odd this time either:
SystemWindow::ImplIsInTaskPaneList(WINDOW*): this=05373C48 pWin=07079760
mpImplData=05373EB0, mpImplData->mpTaskPaneList=053B2008
SystemWindow::ImplIsInTaskPaneList(WINDOW*):
mpImplData->mpTaskPaneList->IsInList returned TRUE, returning that
Window::SetParent(): this=07079760 pNewSysWin=053710F8
Window::SetParent(): bChangeTaskPaneList=TRUE pSysWin=05373C48 removing
this=07079760 from its TaskPaneList=053B2008
TaskPaneList::RemoveWindow: this=053B2008 pWindow=07079760
TaskPaneList::RemoveWindow: this=053B2008 pWindow=07079760 found it, removing!
Window::SetParent(): this=07079760 no mpWindowImpl->mpBorderWindow!?
Window::ImplInsertWindow(Window*): this=07079760 setting
mpWindowImpl->mpRealParent=0534D998
Window::SetParent(): pNewSysWin=053710F8 adding this=07079760 to its
TaskPaneList=0538B218
TaskPaneList::AddWindow: this=0538B218 pWindow=07079760
Then again a bit later SetParent() is called a third time. Now the
newParent is the same as the current mpWindowImpl->mpRealParent. Note
that for some reason the pSysWin calculated by
ImplGetLastSystemWindow() is not the pNewSysWin from last time
SetParent() was called. This is probably the cause of the problem. For
some reason the pNewSysWin calculated in SetParent() isn't actually
true.
Window::SetParent(): this=07079760 newParent=05321E58 pSysWin=05373C48 current
mpWindowImpl->mpRealParent=05321E58
This time the ImplIsInTaskPaneList() returns FALSE:
SystemWindow::ImplIsInTaskPaneList(WINDOW*): this=05373C48 pWin=07079760
mpImplData=05373EB0, mpImplData->mpTaskPaneList=053B2008
SystemWindow::ImplIsInTaskPaneList(WINDOW*):
mpImplData->mpTaskPaneList->IsInList returned FALSE, returning that
so pSysWin->GetTaskPaneList()->RemoveWindow(this) doesn't get called, and
bChangeTaskPaneList isn't set to TRUE.
Window::SetParent(): this=07079760 no mpWindowImpl->mpBorderWindow!?
Window::ImplInsertWindow(Window*): this=07079760 setting
mpWindowImpl->mpRealParent=05321E58
Window::SetParent(): bChangeTaskPaneList is FALSE, not adding this=07079760 to
pNewSysWin=00000000 's (if any) TaskPaneList=00000000
Then the window gets destroyed. It first tries to remove itself from
the TaskPaneList, but fails:
Window::~Window(): this=07079760 mpWindowImpl->mbIsInTaskPaneList=1
Window::~Window(): this=07079760 pMySysWin=05373C48 , its TaskPaneList=053B2008
SystemWindow::ImplIsInTaskPaneList(WINDOW*): this=05373C48 pWin=07079760
mpImplData=05373EB0, mpImplData->mpTaskPaneList=053B2008
SystemWindow::ImplIsInTaskPaneList(WINDOW*):
mpImplData->mpTaskPaneList->IsInList returned FALSE, returning that
Window::~Window(): 07079760 not found in TaskPaneList
Window::~Window(): #31, this=07079760
The Window has now been destructed. However, the Window pointer is
still left in the TaskPaneList 0538B218, so what another window then
later tries to add itself to that TaskPaneList, the code comes across
this bogus pointer which causes a crash because the Window object
contains bogus data, and the pWindow->IsWindowOrChild(*p) call tries
to call methods on it.
Window::Window(WindowType)): #120, this=06F89AE0
Window::ImplInsertWindow(Window*): this=06F89AE0 setting
mpWindowImpl->mpRealParent=053710F8
TaskPaneList::AddWindow: this=0538B218 pWindow=06F89AE0
TaskPaneList::AddWindow: *p=07079760
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]