Ticket #4841 (closed defect: fixed)

Opened 4 years ago

Last modified 4 weeks ago

aui docking crash bug with KDE4

Reported by: emilevr Owned by:
Priority: high Milestone:
Component: wxAui Version: 2.8.9
Keywords: Cc: emilevr
Blocked By: Patch: yes
Blocking:

Description

Hi there.

I've run into the following aui crash bug on Kubuntu 8.04 KDE 4 Remix with KDE 4.0.4 (but it was also a problem in 4.0.3). I am pretty sure it is related to KDE4 though, no matter which distribution it is installed on, but that is only a guess.

To reproduce:
* Undock any panel, then drag it back to any docking area so the blue overlay indicating where the dock will take place is displayed. Move the mouse a little while still dragging the window, e.g. don't release to dock it. The application will crash with the following error:

The program 'aui' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.

(Details: serial 95812 error_code 3 request_code 15 minor_code 0)
...

Process returned 256 (0x100)

I've traced the problem to using "Desktop Effects" in KDE4.(System Settings->Desktop->General, checkbox "Enable desktop effects") using the "Advanced Options"->OpenGL,Texture from Pixmap,Trilinear settings but I don;t think the compositing settings makes much difference.

Switch off "Desktop Effects" and everything works fine, switch it on, even with every effect disabled and boom.

Ciao,
Emile.

Attachments

stopcrash.patch download (0.6 KB) - added by mmacleod 5 weeks ago.
Patch to fix compositing related crash under KDE
fixtransparency.patch download (0.6 KB) - added by mmacleod 5 weeks ago.
Path to fix hint transparency under KDE
stopcrash2.patch download (0.5 KB) - added by mmacleod 5 weeks ago.
Second possibility for stopping crash

Change History

Changed 4 years ago by wojdyr

  • component set to wxAui

Changed 3 years ago by cprecord

  • version set to 2.8.8

Also seeing this with

wxWidgets 2.8.8

On Xubuntu 8.10 (XFCE windows manager).

As mentioned in the above post when desktop compositing is turned off there are no more crashes. Otherwise the crashes happen when undocking a pane and moving it to a position where the dock hint will be shown resulting in the Xserver BadWindow error.

Changed 3 years ago by cprecord

Also reproduced with current trunk.

Can be reproduced with the aui demo app in the following configuration.

1) Compiz (desktop compositing must be enabled)

2) The AuiManager must be using the Transparent style docking hints.

All other hint styles work fine without causing crashes.

Changed 3 years ago by koshi

  • version changed from 2.8.8 to 2.8.9

i'm getting the same on xfce 4.6 + wxWidgets 2.8.9

Changed 3 years ago by stou

I am getting this crash with wxWidgets 2.8.10 (wxPython 2.8.9) on Fedora 11 with KDE 4.2.4 If desktop effects are disabled or the AuiManager is not using the transparent style hint then it works fine.

Changed 3 years ago by koshi

  • priority changed from normal to high

Tested again against wxWidgets svn trunk (rev 61605), still getting the same error with both xfce 4.6 and kde 4.3

Additionally I get the crash no matter what flag is used for wxAuiManager. 100% reproduceable with auidemo from wx samples.

Imo this not getting fixed is becoming increasingly worrisome as more and more linux distros have desktop effects on by default.

Changed 3 years ago by koshi

digging a little deeper, the crash indeed does not happen if I remove the transparent hint flag in
void wxAuiNotebook::InitNotebook(long style)
...
m_mgr.SetFlags

Changed 3 years ago by biwillia76

Can anybody post a backtrace on this? Thanks.

Changed 3 years ago by koshi

I would if I could, but when running with --sync as the error message suggests I cannot replicate the crash.

Changed 6 weeks ago by jwbrown

I believe I am running into this bug in another context, specifically when running UltraEdit version 3.0.0.11 on 64-bit Fedora 16 in conjunction with XFCE.

The steps to reproduce are basically the same (drag a text editor tab to a new location at which it would dock but don't release the button) and the other information seems to be identical as well: I can only reproduce the crash when 'Enable display compositing' option on the Compositor tab of Window Manager Tweaks is enabled.

As koshi indicated, the error is not reproducible when the application is run with the --sync parameter. I'll provide a backtrace regardless just in case it does help:

(gdb) bt
#0 0x00000031cae4d313 in g_logv () from /lib64/libglib-2.0.so.0
#1 0x00000031cae4d6a2 in g_log () from /lib64/libglib-2.0.so.0
#2 0x00000031d4e6ab2b in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
#3 0x00000031cd24810f in _XError () from /usr/lib64/libX11.so.6
#4 0x00000031cd244f91 in ?? () from /usr/lib64/libX11.so.6
#5 0x00000031cd244fd5 in ?? () from /usr/lib64/libX11.so.6
#6 0x00000031cd245de0 in _XReply () from /usr/lib64/libX11.so.6
#7 0x00000031cd2415a3 in XSync () from /usr/lib64/libX11.so.6
#8 0x0000000000ea5589 in wxTopLevelWindowGTK::SetTransparent(unsigned char) ()
#9 0x0000000001078270 in wxAuiManager::HideHint() ()
#10 0x0000000001081441 in wxAuiManager::DrawHintRect(wxWindow*, wxPoint const&, wxPoint const&) ()
#11 0x00000000010a0b4d in wxAuiNotebook::OnTabDragMotion(wxAuiNotebookEvent&)()
#12 0x0000000000d945ae in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
#13 0x0000000000e70b9e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
#14 0x0000000000e70cfc in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
#15 0x0000000000e70db3 in wxEvtHandler::DoTryChain(wxEvent&) ()
#16 0x0000000000e71381 in wxEvtHandler::ProcessEvent(wxEvent&) ()
#17 0x0000000000fcc5d3 in wxWindowBase::TryAfter(wxEvent&) ()
#18 0x000000000109ecc6 in wxAuiTabCtrl::OnMotion(wxMouseEvent&) ()
#19 0x0000000000d945ae in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
#20 0x0000000000e70b9e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
#21 0x0000000000e70cfc in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
#22 0x0000000000e71303 in wxEvtHandler::ProcessEventLocally(wxEvent&) ()
#23 0x0000000000e71381 in wxEvtHandler::ProcessEvent(wxEvent&) ()
#24 0x0000000000e70e07 in wxEvtHandler::SafelyProcessEvent(wxEvent&) ()
#25 0x0000000000eb00a0 in gtk_window_motion_notify_callback ()
#26 0x00000031d534ed03 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#27 0x00000031cbe0ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#28 0x00000031cbe20d17 in ?? () from /lib64/libgobject-2.0.so.0
#29 0x00000031cbe29f13 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#30 0x00000031cbe2a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#31 0x00000031d5483f41 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#32 0x00000031d534c823 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0
#33 0x00000031d534cb8b in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0
#34 0x00000031d4e6207c in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
#35 0x00000031cae44acd in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#36 0x00000031cae452c8 in ?? () from /lib64/libglib-2.0.so.0
#37 0x00000031cae45815 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#38 0x00000031d534bbb7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#39 0x0000000000ea0727 in wxGUIEventLoop::Run() ()
#40 0x0000000000d951e1 in wxAppConsoleBase::MainLoop() ()
#41 0x0000000000dfe4e4 in wxEntry(int&, wchar_t**) ()
#42 0x0000000000437892 in main ()

I'll be happy to provide any other information required to get this old bug squashed because it's a real nuisance.

Changed 5 weeks ago by mmacleod

Patch to fix compositing related crash under KDE

Changed 5 weeks ago by mmacleod

Path to fix hint transparency under KDE

Changed 5 weeks ago by mmacleod

Second possibility for stopping crash

Changed 5 weeks ago by mmacleod

I think I have made some progress on this, however I know very little about GTK in general so would appreciate some input on this from those more knowledgeable.

1) The problem seems to be happening inside wxGetTopmostWindowX11 - somewhere in the stack of windows XQueryTree is getting lost and having a window become invalid underneath it or something like that.
After some playing around I have traced this to the hint window transparency being set after it is hidden, presumably this (sometimes) depending on ordering of event processing is causing the window to become "invalid" while querying the tree.
It would be useful to know if this patch (stopcrash2.patch) works for:
A) Other KDE users with compositing B)Other Wm users with compositing like XFCE as mentioned above.
It is not clear to me if this call to SetTransparent(0) is actually needed - it looks pointless to me, does anyone have any thoughts on this? If someone can test a bit and see if they spot any harmful effects it would be useful.

2) I also managed to stop the crash using another method (before I tracked the above) shown in the attached patch "stopcrash.patch" - this stops the crashing entirely as well but I am not sure if it is an acceptable thing to do.
It would again be useful to know if this helps also on XFCE - It would also be useful if someone who knows more about the X11 specific stuff could give an opinion. I'm not sure if it might be worth applying this patch as well just for robustness or if it might have bad potential side effects?

3) There is also an issue with the actual transparency (at least for me here on KDE) - the hint window is always solid blue. Is this the case on XFCE as well.
The attached patch (fixtransparency.patch) fixes it for me and draws a proper transparent hint - however I do not understand why the original code sets the transparency on the top level window instead of the actual window, and therefore I don't know if it might break the transparency on another window manager like gnome? Does anyone have any ideas on this?

Changed 5 weeks ago by mmacleod

  • status changed from new to confirmed
  • patch set

Changed 5 weeks ago by bjoernx

duplicated/confirmed (with wxpython 2.8.12) here:#14237

my testing also showed, that it only matters, wether compositing effects are enabled at the moment the application is started. (on my box i can quickly toggle effects pressing Alt-Shift-F12 - kde 4.8.2) so, disabling effects when aui is started, then re-enabling them works fine.

starting with --sync the aui sample does not crash, but the hint overlay behaves strangely. the first drawn overlay is solid blue, then it becomes invisible. switching to another hint-type in the menu makes it visible again and behave normal from there on.

Changed 5 weeks ago by bjoernx

Changed 5 weeks ago by jwbrown

Unfortunately I won't be able to test with the patch in the my use case because it looks like UltraEdit is statically linking the libraries. I'll try to engage that team to see if someone from there can run with the ball a bit.

What I can say is that (in regard to item #3 from mmacleod's message) the hint window is not solid blue on XFCE and that the transparency effect is normal up to the point of failure.

Changed 5 weeks ago by pcor

I have a fix for this ready, I'm just waiting for a configuration problem with our SVN server to be resolved before I can commit it.

Changed 4 weeks ago by PC

  • status changed from confirmed to closed
  • resolution set to fixed

(In [71275]) Remove code to find topmost X window in SetTransparent().
The purpose of this code is unknown, but it may be intended to make WM
decorations transparent. But it causes a crash when docking an AUI panel.
And in my testing the decorations are transparent even without this code.
Fixes #4841

Note: See TracTickets for help on using tickets.