Ubuntu

gtk-window-decorator crashes with BadWindow (invalid Window parameter), from XGetWindowProperty() from get_frame_type()

Reported by Miklos Juhasz on 2012-06-29
326
This bug affects 109 people
Affects Status Importance Assigned to Milestone
Compiz
High
Daniel van Vugt
Compiz Core
High
Daniel van Vugt
compiz (Ubuntu)
High
Unassigned
Precise
High
Unassigned

Bug Description

After installing the compiz package 1:0.9.7.8-0ubuntu1.1 from the precise-proposed repository gtk-window-decorator started crashing and leaving the windows without any decoration. I reproduced the issue on several up-to-date Ubuntu 12.04 (Precise) 64bit installations.

From the cherry-picked patches included in the mentioned proposed compiz package I identified the one for bug LP: #929989 as the cause of the crashes. Rebuilding the proposed package after dropping that patch makes the crashes go away.

[Test Case]
1. Open IntelliJ (a Java IDE) with a project.
2. Hit Ctrl+N (or Navigate/Class... menu) and wait for the small popup to show up.
3. Start typing and wait for class name suggestions to show up.
4. Hit Esc to close the popup window.
5. Observe that system-wide all window decorations are gone (window titlebars are missing, i.e. no close/maximize/minimize button). You may have to repeat step 2-4 a few times until the bug gets triggered.

[Expected Result]
Window decorations do not disappear after closing the popup with Esc.

[Regression Potential]
No direct regression potentials.

An attempt to collect stacktrace:

mjuhasz@desktop:~$ gdb /usr/bin/gtk-window-decorator
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/gtk-window-decorator...(no debugging symbols found)...done.
(gdb) run --replace
Starting program: /usr/bin/gtk-window-decorator --replace
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffef1a9700 (LWP 7631)]
[New Thread 0x7fffee9a8700 (LWP 7632)]

The program 'gtk-window-decorator' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 10112 error_code 3 request_code 20 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
[Thread 0x7fffee9a8700 (LWP 7632) exited]
[Thread 0x7fffef1a9700 (LWP 7631) exited]
[Inferior 1 (process 7628) exited with code 01]
(gdb)
(gdb) bt
No stack.
(gdb)

Related branches

lp:~vanvugt/compiz/fix-1019337
Merged into lp:compiz/0.9.8 at revision 3284
Sam Spilsbury: Approve on 2012-07-11
jenkins (community): Approve (continuous-integration) on 2012-07-11
lp:~vanvugt/compiz/fix-1019337.2
Merged into lp:compiz/0.9.8 at revision 3286
Łukasz Zemczak: Approve on 2012-07-16
jenkins (community): Approve (continuous-integration) on 2012-07-12
Dmitry Maruschenko (yojick) wrote :

Absolutely the same behaviour with PhpStorm (based on IntellyJ Idea) and Compiz 0.9.7.8 (1:0.9.7.8-0ubuntu1.1)

Dmitry Maruschenko (yojick) wrote :

As a temporary workaround I just switched off ubuntu-proposed, cleared apt cache and reinstalled compiz and all its dependencies using syntax like this:

sudo apt-get install compiz=1:0.9.7.8-0ubuntu1 compiz-core=1:0.9.7.8-0ubuntu1 ....

tags: added: regression-proposed
Changed in compiz (Ubuntu):
importance: Undecided → High
Scott Kitterman (kitterman) wrote :

The package just got copied to updates by mistake, but we're going to revert that shortly.

Hello Miklos, or anyone else affected,

Accepted into precise-proposed. The package will build now and be available in a few hours in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed

Note that the current package in -proposed reverts the previous changes.
There is still an intent to figure out this regression and retry the new fixes
once it is sorted out.

I tried to collect a stacktrace with --sync but I can't get more than what I attached ("No stack.").

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:0.9.7.8-0ubuntu1.2

---------------
compiz (1:0.9.7.8-0ubuntu1.2) precise-proposed; urgency=low

  * Revert SRU because of last minute regression being reported. (LP: #1019337)
 -- Stephane Graber <email address hidden> Tue, 10 Jul 2012 14:18:18 -0400

Changed in compiz (Ubuntu):
status: Confirmed → Fix Released
Vlad (vcosvic) wrote :

I confirm this bug in Jetbrains PhpStorm IDE. Literally each open popup can cause the crash of decorators... Same error as in the author's case. Can't wait for the fix, this soooo annoying.

Brian Murray (brian-murray) wrote :

Reopening the bug task as the upload was just a reversion of the fix that caused this bug.

Changed in compiz (Ubuntu):
status: Fix Released → Confirmed
Miklos Juhasz (mjuhasz) wrote :

[This was first uploaded to LP: #929989, sorry for the duplication]

Stacktrace with the dbg packages installed.

Changed in compiz:
milestone: none → 0.9.8.0
Changed in compiz-core:
milestone: none → 0.9.7.10
Changed in compiz:
importance: Undecided → High
Changed in compiz-core:
importance: Undecided → High
Changed in compiz:
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in compiz-core:
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in compiz:
status: New → In Progress
Changed in compiz-core:
status: New → In Progress
Daniel van Vugt (vanvugt) wrote :

Seems to be the same error and request code as bug 991552 and bug 993265. Maybe they're all the same issue.

summary: - gtk-window-decorator crashes with an X Window System error
+ gtk-window-decorator crashes with BadWindow (invalid Window parameter),
+ from XGetWindowProperty() from get_frame_type()
Changed in compiz:
status: In Progress → Fix Committed
Timo Jyrinki (timo-jyrinki) wrote :

12.04 LTS users, please test compiz from https://launchpad.net/~timo-jyrinki/+archive/compiz-precise-sru - it's the same as the previous proposed compiz Stable Release Upgrade, but with the patch fixing this bug added. Please report back, especially if you got the errors with the 1:0.9.7.8-0ubuntu1.1 release.

(note though that the amd64 build over there is not yet finished as of this writing)

Colan Schwartz (colan) wrote :

Wondering if bug #1019551 is related too?

Timo Jyrinki (timo-jyrinki) wrote :

Colan: probably, I can reproduce that even with the PPA mentioned.

Vlad (vcosvic) wrote :

I updated today from proposed and the crashes stopped, thanks guys for fixing :)

Looks like there was a similar crash in FreeCAD (Package: freecad; Version: 0.12.5284-dfsg-5ubuntu1; Architecture: amd64):
Just select Menu "Help" -> "About FreeCAD" and then press OK.

With new package out of proposed it is fixed. Thanks.

Phil Davidov (davidovp69) wrote :

Still receiving BadWindow from gtk-window-decorator after running patched amd64 build:

The program 'gtk-window-decorator' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 7855 error_code 3 request_code 20 minor_code 0)

Phil Davidov (davidovp69) wrote :

Additionally, this was also a Java GUI app (Thinkorswim) with a modal pop-up dialog box. Upon closing the dialog box, gtk-window-decorator crashed and all window decorations gone.

Miklos Juhasz (mjuhasz) wrote :

Tested compiz amd64 build from Timo's ppa: still crashes with IntelliJ the same way as I described in the bug description.

Daniel van Vugt (vanvugt) wrote :

Please provide stack traces of all crashes so we can tell if it's the same or a different bug. I am aware of several DIFFERENT crashes in gtk-window-decorator that will give: BadWindow (invalid Window parameter)
  (Details: serial 7855 error_code 3 request_code 20 minor_code 0)

To get a stack trace...

1. env DISPLAY=:0 gdb /usr/bin/gtk-window-decorator
2. (gdb) break _XError
3. (gdb) run --sync --replace
4. Trigger the crash.
5. (gdb) bt
6. Copy the output from gdb and paste it here, or a new bug.

Daniel van Vugt (vanvugt) wrote :

Fix committed to lp:compiz-core/0.9.7 at revision 3113.

Changed in compiz-core:
status: In Progress → Fix Committed
Miklos Juhasz (mjuhasz) wrote :
Daniel van Vugt (vanvugt) wrote :

Miklos, that's a different crash (bug 1023684).

It seems gdb is stopping prematurely, and showing us stacks that are actually not the bugs causing crashes. I'm not sure how to proceed just yet.

Timo Jyrinki (timo-jyrinki) wrote :

Miklos: if you refer to https://launchpad.net/~timo-jyrinki/+archive/compiz-precise-sru - there is now test3 packages available with additional fixes. Please test those if you are running precise.

Daniel van Vugt (vanvugt) wrote :

Miklos, sorry for the confusion. I've figured it out now.

Breaking on gdk_x_error doesn't work at all, because the symbol is static (hence not breakable in release builds).
Breaking on _XError gives false positives, showing harmless X errors that we do actually handle and are not fatal.

The correct place to break it seems is the "exit" function:
    break exit

Daniel van Vugt (vanvugt) wrote :

And if that doesn't work, try:
    break _exit

:)

Miklos Juhasz (mjuhasz) wrote :

Stacktrace with compiz_0.9.7.8-0ubuntu1.3~test3.

Daniel van Vugt (vanvugt) wrote :

Thanks Miklos. It seems my original fix was inadequate. But I know what to fix this time.

Changed in compiz:
status: Fix Committed → In Progress
Changed in compiz-core:
status: Fix Committed → In Progress
Timo Jyrinki (timo-jyrinki) wrote :

test5 packages for precise at https://launchpad.net/~timo-jyrinki/+archive/compiz-precise-sru now include also Daniel's fix-1019337.2 patch.

Miklos Juhasz (mjuhasz) wrote :

test5 packages resolve this bug. No more crashes with IntelliJ popups. Great job!

Paddy Landau (paddy-landau) wrote :

I have installed the changes, and tried several times to get it the window decorations to crash, but it seems to be fixed.

Thank you!

Phil Davidov (davidovp69) wrote :

The amd64 test5 package has resolved the 'gtk-window-decorator' crash (BadWindow error) in Thinkorswim as well.

Changed in compiz:
status: In Progress → Fix Committed
Daniel van Vugt (vanvugt) wrote :

Final fix committed into lp:compiz at revision 3286

Daniel van Vugt (vanvugt) wrote :

Final fix committed to lp:compiz-core/0.9.7 at revision 3114.

Changed in compiz-core:
status: In Progress → Fix Committed
Omer Akram (om26er) on 2012-07-17
Changed in compiz (Ubuntu):
status: Confirmed → Fix Committed
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu Precise):
status: New → Confirmed
dafreez (dafreez-gmail) wrote :

This happens intermittently when running PDF-xchange Viewer under Wine (the only thing I run under wine).
GTK-window-decorater exitst with following message:

The program 'gtk-window-decorator' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 106716 error_code 3 request_code 20 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Confirm that Timo Jyrinki compiz packages solved the problem.

Eromatic (eromatic) wrote :

I believe my issue may be related. In using Irfanview 4.32 under WINE 1.5.9 and after running and completing Irfanview's batch conversion, you will see a popup window indicating that the batch conversion is done. After once you select the "Exit batch" button, all window decoractions are lost for all applications (Missing title bars).

To Reproduce:

-Install WINE 1.5.9
-Install Irfanview to WINE
-Run Irfanview in WINE
-Select from Irfanview's menu: File -> Batch Conversion/Rename
-Batch conversion setup options are:

-Work as Batch conversion
-Batch conversion settings output format = PNG
-Output directory set to wherever you want to later locate the converted files.
-"Lookin" should allow you to browse for available image files (png, jpg, gif)
-Add at least two files to the Input files box below by select a image from above and then selecting the Add button.

-Click on Start Batch
-Once done, a popup window will appear that will indicate the status of the batch conversion.
-Click on within that popup window the "Exit batch" button

-The problem occurs after clicking on the "Exit batch" button.

A workaround for Irfanview users is to select the button "Return to batch" and then to exit out of the batch conversion window. That will prevent one from losing the title bars and close buttons on all applications.

(This happens with Ubuntu 12.04 32bit, unity 5.12-0ubuntu1.1, compiz 1:0.9.7.8-0ubuntu1.2, Kernel Linux 3.2.0-27-generic-pae, GNOME 3.4.2)

Colan Schwartz (colan) wrote :

I'm wondering if this is related to bug #956071 as I'm now getting that one instead. ;)

Daniel van Vugt (vanvugt) wrote :

Colan, I don't believe it could be related. That crash is in a completely different process/package.

Paddy Landau (paddy-landau) wrote :

Colan, this bug has been fixed, so if you are still having the problems described in bug #956071, it is not the same as this one.

Hello Miklos, or anyone else affected,

Accepted compiz into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/compiz/1:0.9.7.8-0ubuntu1.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in compiz (Ubuntu Precise):
importance: Undecided → High
status: Confirmed → Fix Committed
Eromatic (eromatic) on 2012-08-04
tags: added: verification-done
removed: verification-needed
Eromatic (eromatic) wrote :

Correction:
I upgraded to http://launchpad.net/ubuntu/+source/compiz/1:0.9.7.8-0ubuntu1.3 using precise-proposed. These packages fixed the issue seen with the above comment #39. No relation to comment #41.

Bracken (abdawson) wrote :

This fixes the crash I had which was provoked by operation of the menus at the top of an email in lotus notes, but those menus have regressed a little in function, you can no longer hover over the next button to open the next menu. But I'm happy enough with this not to raise it.

Tony Pursell (ajpursell) wrote :

This fixes the problem of losing window decoration, from all windows, that I have had when playing a simple Windows 3.1 game using WINE.

Thanks to all the devs for providing this fix, especially as it is being done as a fix in the current release.

Hello All,

The update from PPA fixed the window decorator issue, thanks for this. However, there is one 'itchy' issue. On the right side of Unity launcher, it seems there is 1px line separating the launcher and the desktop. The issue is clearly visible when maximizing gnome terminal (see attachment). FYI, I'm using propietary ATI graphic driver 12.6. The similar issue also occured on previous release (see bug #845325).

Thanks ^^

Daniel van Vugt (vanvugt) wrote :

alvonsius, that is bug 1001100. Please discuss it there.

Adam Conrad (adconrad) wrote :

Hello Miklos, or anyone else affected,

Accepted compiz into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/compiz/1:0.9.7.8-0ubuntu1.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-done
tags: added: verification-needed
Eromatic (eromatic) wrote :

Upgraded to https://launchpad.net/ubuntu/+source/compiz/1:0.9.7.8-0ubuntu1.4 through precise-proposed. No decorator crashes seen with Irfanview & WINE.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:0.9.7.8-0ubuntu1.4

---------------
compiz (1:0.9.7.8-0ubuntu1.4) precise-proposed; urgency=low

  [ Steve Langasek ]
  * debian/patches/compiz-package-gles2.patch: refresh to account for
    fix_1012956.patch, which introduces non-GLES2 objects that need to be
    patched back out for ARM. LP: #1032902.

compiz (1:0.9.7.8-0ubuntu1.3) precise-proposed; urgency=low

  [ Łukasz 'sil2100' Zemczak ]
  * Cherry-pick upstream patches:
    - CMake Error at FindCompiz.cmake:84 (include): include could not find load
      file: CompizDefaults (LP: #993608)
    - compiz (decor) - Warn: failed to bind pixmap to texture (LP: #929989)
    - gtk-window-decorator crashed with SIGFPE in
      _decor_blend_horz_border_picture() (LP: #963794)
    - [callgrind] compiz spends ~25% of its time constructing/destructing
      strings in PrivateScreen::handleActionEvent (LP: #1005569)
    - gtk-window-decorator crashed with SIGSEGV in meta_get_decoration_geometry
      (LP: #1007754)
    - composite refresh rate falls back to 50Hz, which is wrong in most cases
      (LP: #1009338)
    - [callgrind] compiz spends ~7% of its time inserting into and destructing
      the events list in PrivateScreen::processEvents() (LP: #1006335)
    - It is possible for a dock shadow to be painted even if the dock window
      isn't painted (LP: #1012956)

  [ Timo Jyrinki ]
  * Cherry-pick upstream patches:
    - gtk-window-decorator crashes with BadWindow (invalid Window parameter),
      from XGetWindowProperty() from get_frame_type() (LP: #1019337)
    - Fix gtk-window-decorator crash in meta_get_button_position
      (LP: #1015593)
    - Fix crash LP: #1019337 properly this time. The original fix did not
      handle the case where (win != NULL && xid != None && !valid_window(xid))
      so would still exit with an X error. Now we trap and handle such errors
      gracefully, instead of hitting the default handler which kills
      gtk-window-decorator.
 -- Timo Jyrinki <email address hidden> Tue, 07 Aug 2012 12:32:27 +0300

Changed in compiz (Ubuntu Precise):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (7.9 KiB)

This bug was fixed in the package compiz - 1:0.9.8+bzr3319-0ubuntu1

---------------
compiz (1:0.9.8+bzr3319-0ubuntu1) quantal-proposed; urgency=low

  [ Didier Roche ]
  * debian/patches/ubuntu-config.patch:
    - refresh with latest trunk
  * debian/*docs:
    - remove the TODO copy now removed upstream
  * debian/compiz-plugins.install:
    - install stackswitch, trip plugins
  * debian/rules, debian/control:
    - remove the compiz gnome-control-center key sedding through metacity.
      Compiz now directly ships them.
    - we do not need metacity-common anymore as a build-dep then
  * debian/compiz-gnome.migrations, debian/control:
    - build-dep on dh-migrations and ship gconf -> gsettings migration file

  [ Matthieu Baerts (matttbe) ]
  * Update apport hook for python3 ; thanks to Edward Donovan (LP: #1013171)

  [ Timo Jyrinki ]
  * New upstream snapshot.
    - Fix Compiz crash in movementWindowOnScreen (LP: #1015151)
    - Start window decorator when decor plugin starts (LP: #1014461)
    - Fixed: Crash in compiz::wall::movementWindowOnScreen (LP: #1015151)
    - Don't waste memory leaving /bin/sh running (LP: #1015422)
    - Add reliable detection of the compiz bin directory (LP: #1015898)
    - Check if the window would actually paint before painting the shadow,
      since it is possible that another plugin could be inhibiting paint of
      the dock window. (LP: #1012956)
    - Don't insert the window into the server list above the window it was
      created above. (LP: #1008020) (LP: #886605)
    - makes compiz enhanced zoom and show mouse plugins considerably
      smoother to use (LP: #930783)
    - Don't set decoration contexts on undecorated windows, since that
      might be read later and code will assume the window is decorated when
      it isn't. (LP: #1015593)
    - Fix potentially unterminated string leading to an uninitialized memory
      read (LP: #1018302)
    - Lift the 31/32 character restriction on key names that was causing so
      many warnings. It's now 1024 characters according to glib. (LP: #1018730)
    - Don't print the result of BUILD_DEB. It prevents ccsm et al from
      installing. (LP: #1018916)
    - Use the XDamage extension more efficiently (the way it was designed to be
      used). This dramatically reduces CPU usage, reduces wakeups, and
      increases frame rates. It also solves at least one observed performance
      bug (LP: #1007299) and probably several more.
    - Do the initial work to get libcompizconfig under test. (LP: #990690)
    - Add support for initiating window picker in other than nomal mode. For
      now added only the additional 'All windows' picker (LP: #933776)
      (LP: #955035)
    - Fixes (LP: #1018602) : An invalid read when using g_variant_iter_loop.
    - Don't allow unbinds of textures kept around for animations in any case,
      not just resizing. (LP: #1016366)
    - Wait for the server to finish processing requests before doing a bind
      (LP: #1016367)
    - Using the next/previous bindings the wall plugin didn't calculate
      correctly the next workspace when it reaches the begin or the end of a
      row of workspaces, so it didn't jump to the n...

Read more...

Changed in compiz (Ubuntu):
status: Fix Committed → Fix Released
Changed in compiz:
status: Fix Committed → Fix Released
Changed in compiz-core:
status: Fix Committed → Fix Released
Changed in compiz-core:
status: Fix Released → Fix Committed
Changed in compiz-core:
status: Fix Committed → Fix Released
Christopher (soft-kristal) wrote :

This bug has reared its head again in Saucy and Trusty.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers