Opened 11 years ago

Closed 11 years ago

#10371 closed defect (fixed)

auidemo crashes when undocking toolbars

Reported by: ksinger2 Owned by: biwillia76
Priority: blocker Milestone: 2.9.0
Component: wxAui Version: stable-latest
Keywords: bugfix Cc: net147@…
Blocked By: Blocking:
Patch: yes

Description

auidemo crashes when undocking toolbars with svn checkout of 58061.
os: vista
msvc9

reason pane.frame is null pointer!

bugfix:
..\..\src\aui\framemanager.cpp
line 3520: wxPoint frame_pos = pane.frame->GetPosition();

replace by:
wxPoint frame_pos(0,0);
if(pane.frame) frame_pos= pane.frame->GetPosition();

Attachments (2)

backtrace.txt download (2.5 KB) - added by net147 11 years ago.
Backtrace of crash.
framemanager_floating_pane_move_fix_r58853.patch download (580 bytes) - added by net147 11 years ago.
Fix for crash when moving floating pane.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 11 years ago by bpetty

  • Status changed from new to infoneeded_new

I tried to reproduce this on Windows XP using 2.8.9, SVN 2.8 branch, and SVN trunk (2.9) without success when this was first reported. I figured this was just a Vista issue, and left it for someone with Vista to investigate.

Today, as reported in #10516, this is possibly the same crash supposedly being seen on Windows XP with wxPython 2.8.9.2 and also in the demo. I've now also tried to reproduce this crash using wxPython 2.8.9.2 with Python 2.6, and I still don't see this crash.

Since there's now been two reports of this, and we're just about to release 2.8.10, I've decided to go ahead and commit a blind fix which will likely prevent the crash, but since I can't determine the reason why pane.frame is null, this fix will not likely be the appropriate solution to what could be a different problem altogether, and undocking toolbars in both these cases where it is crashing may still not work (even if the crash is fixed).

I'd appreciate it if you could give a more detailed description of how to reproduce this crash (and include a call stack of the crash), and test my fix in r59107 of the 2.8 branch in SVN.

As described by the reporter, this crash is either in wxAuiManager::OnFloatingPaneMoving() and/or wxAuiManager::OnFloatingPaneMoved(). Both functions should only be called with a valid floating pane which should always have a valid associated frame. So if frame is indeed null, that means we have a problem somewhere else that needs to be fixed. My temporary fix will simply just return from these functions if there isn't a valid frame, but that also means that the floating frame or hint window (if either exist when these functions are being called with an invalid frame) will not be handled correctly.

comment:2 Changed 11 years ago by biwillia76

I've been looking at this bug recently, and will make sure the patch applied is valid. Thanks much. -Ben

comment:3 Changed 11 years ago by byte

  • Status changed from infoneeded_new to new

Did you try "http://trac.wxwidgets.org/attachment/ticket/9931/aui.diff" before that fix?
I had the same problem with aui toolbars and found typo in AUI (+workaround to fix that typo!).
Patch fixes this (remove unneeded comments if all ok).

Changed 11 years ago by net147

Backtrace of crash.

comment:4 Changed 11 years ago by net147

I've attached a backtrace of the crash on 2.9 SVN.

Changed 11 years ago by net147

Fix for crash when moving floating pane.

comment:5 Changed 11 years ago by net147

This issue was fixed in the 2.8 branch by r59107 but has not been applied to 2.9 SVN. I've attached a patch to fix this in 2.9 SVN.

comment:6 Changed 11 years ago by net147

  • Cc net147@… added

comment:7 Changed 11 years ago by net147

I suspect that OnPaneMoving or OnPaneMoved is being called somewhere between when the frame is created and when p.frame is set to the instance of the frame. I can consistently reproduce this crash on one of my development systems so i'll look into this and report back what I find.

comment:8 Changed 11 years ago by net147

I have found why this crash occurs. Changeset r54905 introduced a call inside wxAuiFloatingFrame::SetPaneWindow to SetWindowStyleFlag which sometimes causes a movement event to be triggered before p.frame is set. Undocking and docking toolbars with r59107 applied seems to work fine for this case.

comment:9 Changed 11 years ago by biwillia76

  • Owner set to biwillia76
  • Status changed from new to accepted

Wow. Great job debugging this. This information will form the basis of the correct patch. Thanks much.

comment:10 Changed 11 years ago by net147

  • Milestone changed from 2.8.9 to 2.9.0

comment:11 Changed 11 years ago by vadz

  • Milestone 2.9.0 deleted

Resetting 2.9.0 milestone as it's too late for it

comment:12 Changed 11 years ago by net147

  • Milestone set to 2.9.1

comment:13 Changed 11 years ago by net147

Would it not be a good idea to apply the fix in r59107 to trunk as well so that it doesn't crash until we find a more proper fix (if any) for this?

comment:14 follow-up: Changed 11 years ago by biwillia76

  • Resolution set to fixed
  • Status changed from accepted to closed

Done. Thanks for pointing this out.

comment:15 in reply to: ↑ 14 Changed 11 years ago by net147

Replying to biwillia76:

Done. Thanks for pointing this out.

Did you find any clues for a correct patch for this or is the current one sufficient?

comment:16 Changed 11 years ago by net147

  • Resolution fixed deleted
  • Status changed from closed to reopened

Would it be appropriate to apply the fix in r59107 to the 2.9.0 branch as well since it is still in release candidate status?

comment:17 Changed 11 years ago by net147

  • Milestone changed from 2.9.1 to 2.9.0

comment:18 Changed 11 years ago by net147

I don't see why 2.8 SVN and trunk have the fix applied but 2.9.0 branch doesn't. I think it should be applied so that 2.9.0 shouldn't crash out of the box when people use AUI toolbars on some systems...

comment:19 Changed 11 years ago by BIW

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [60628]) fix from r59107 - aui toolbar crash fixed (fixes #10371)

Note: See TracTickets for help on using tickets.