Comment 20 for bug 401055

Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=28790)
StackTraceDebug.txt

Forwarding this bug reported for Firefox-3.5 in Ubuntu for Ubuntu reporter Matt Zimmerman:
https://bugs.edge.launchpad.net/ubuntu/+source/firefox-3.5/+bug/401055

[Problem]
The 'BadWindow' error is not documented as a possible return value for XQueryTree, yet it is being seen in Firefox-3.5 when the browser is launched.

[Original Report]
I have my default browser set to firefox-3.5, so when apport tries to launch a browser to display the Launchpad bug filing form, it opens firefox-3.5. The problem is that (about 80% of the time), it crashes with a BadWindow error, e.g.:

perseus:[~] ubuntu-bug firefox-3.5
perseus:[~]
Gdk-ERROR **: The program 'firefox-3.5' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 19 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.)
aborting...

If I keep trying, it eventually succeeds. I'm not able to reproduce the problem using "firefox-3.5 about:mozilla" so it may have something to do with the way that apport is invoking it.

In analyzing the problem, it appears to be that XQueryTree gives a BadWindow error, although it's unclear why it would do this (no mention of BadWindow in XQueryTree's man page, and grepping through the source code didn't reveal the code path that results in this being issued.)

The following patch was applied to firefox to bandaid over the issue:
http://bazaar.launchpad.net/~mozillateam/xulrunner/xulrunner-1.9.2.head/annotate/head%3A/debian/patches/lp401055_bz499498_debug_bandaid.patch

Asac noticed that he can trigger this more easily by using killall firefox-3.5 rather than shutting it down properly; from that it feels a bit like there is a window not properly removed from X. Others have reported that running 'firefox-3.5 -no-remote' hides the issue.

ProblemType: Bug
Architecture: amd64
Date: Sat Jul 18 12:19:56 2009
DistroRelease: Ubuntu 9.10
Package: firefox-3.5 3.5.1+build1+nobinonly-0ubuntu1
ProcEnviron:
 LC_COLLATE=C
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
ProcVersionSignature: Ubuntu 2.6.31-3.19-generic
SourcePackage: firefox-3.5
Uname: Linux 2.6.31-3-generic x86_64

Note that the attached stack trace is captured with --sync