Last Comment Bug 499498 - BadWindow error upon first run of FF3.5 RC
: BadWindow error upon first run of FF3.5 RC
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: X-remote (show other bugs)
: unspecified
: All Linux
: -- normal (vote)
: mozilla1.9.3a1
Assigned To: Karl Tomlinson (back Dec 13 :karlt)
: Christopher Blizzard (:blizzard)
:
Mentors:
: 460572 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-20 13:06 PDT by Jason Quinn
Modified: 2010-09-17 14:57 PDT (History)
10 users (show)
mbeltzner: blocking1.9.2+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
beta4-fixed
.6-fixed


Attachments
1st band-aid patch with some debug output (5.56 KB, patch)
2009-07-23 06:22 PDT, Alexander Sack
no flags Details | Diff | Splinter Review
patch (11.72 KB, patch)
2009-08-28 13:32 PDT, Karl Tomlinson (back Dec 13 :karlt)
roc: review+
dveditz: approval1.9.1.6+
Details | Diff | Splinter Review

Description Jason Quinn 2009-06-20 13:06:08 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090616 Firefox/3.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090616 Firefox/3.5

The first time I ran FF3.5 RC, it crashed and I got the following console output:


The program 'firefox-bin' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 681 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.)


Reproducible: Always

Steps to Reproduce:
1. Start FF3.5 after using latest 3.0.x release
2. Observe crash
Actual Results:  
Crash.

Expected Results:  
No crash.

This started happening with the last beta release.
Comment 1 Ryan Hayle 2009-06-23 12:42:53 PDT
Dupe of 46057? I am experiencing this as well.
Comment 2 Wolfgang Rosenauer [:wolfiR] 2009-07-03 09:46:02 PDT
I got at least two of these reports on bugzilla.novell.com.
Searching bmo "BadWindow" seems to happen quite often in different trees and products.
Comment 3 Ryan Hayle 2009-07-03 10:03:54 PDT
Oops, I meat to say possible dupe of bug #460572, and was fixed for me by disabling Compiz.  I am no longer seeng this issue with 3.5.1~hg20090629r26036+nobinonly-0ubuntu2~umd1~jaunty.
Comment 4 Alexander Sack (Canonical) 2009-07-21 04:45:47 PDT
(In reply to comment #3)
> Oops, I meat to say possible dupe of bug #460572, and was fixed for me by
> disabling Compiz.  I am no longer seeng this issue with
> 3.5.1~hg20090629r26036+nobinonly-0ubuntu2~umd1~jaunty.

Did that daily really fix this for you even with compiz enabled? We seem to still get this with 3.5.1 final in karmic (and most likely jaunty?).
Comment 5 Alexander Sack 2009-07-21 04:53:41 PDT
ubuntu bug: https://bugs.edge.launchpad.net/bugs/401055

Stacktrace with --sync on ffox 3.5.1: http://launchpadlibrarian.net/29324303/StackTraceDebug.txt
...
#2  0x00007fda15006256 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
No symbol table info available.
#3  0x00007fda16f503d4 in _XError (dpy=0x7fda1a6ac000, rep=0x7fda1a6b8100) at ../../src/XlibInt.c:2924
        rtn_val = <value optimized out>
        event = {type = 0, xany = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819}, xkey = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, root = 4256530, subwindow = 550, time = 140574722708608, x = 549, y = 0, x_root = 443203584, y_root = 32730, state = 443252992, keycode = 32730, same_screen = 1}, xbutton = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, root = 4256530, subwindow = 550, time = 140574722708608, x = 549, y = 0, x_root = 443203584, y_root = 32730, state = 443252992, button = 32730, same_screen = 1}, xmotion = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, root = 4256530, subwindow = 550, time = 140574722708608, x = 549, y = 0, x_root = 443203584, y_root = 32730, state = 443252992, is_hint = -38 '\332', same_screen = 1}, xcrossing = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, root = 4256530, subwindow = 550, time = 140574722708608, x = 549, y = 0, x_root = 443203584, y_root = 32730, mode = 443252992, detail = 32730, same_screen = 1, focus = 0, state = 550}, xfocus = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, mode = 4256530, detail = 0}, xexpose = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, x = 4256530, y = 0, width = 550, height = 0, count = 443110528}, xgraphicsexpose = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, drawable = 140574715810819, x = 4256530, y = 0, width = 550, height = 0, count = 443110528, major_code = 32730, minor_code = 549}, xnoexpose = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, drawable = 140574715810819, major_code = 4256530, minor_code = 0}, xvisibility = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, state = 4256530}, xcreatewindow = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, parent = 140574715810819, window = 4256530, x = 550, y = 0, width = 443110528, height = 32730, border_width = 549, override_redirect = 0}, xdestroywindow = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530}, xunmap = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530, from_configure = 550}, xmap = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530, override_redirect = 550}, xmaprequest = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, parent = 140574715810819, window = 4256530}, xreparent = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530, parent = 550, x = 443110528, y = 32730, override_redirect = 549}, xconfigure = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530, x = 550, y = 0, width = 443110528, height = 32730, border_width = 549, above = 140574722801664, override_redirect = 443252992}, xgravity = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530, x = 550, y = 0}, xresizerequest = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, window = 140574715810819, width = 4256530, height = 0}, xconfigurerequest = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, parent = 140574715810819, window = 4256530, x = 550, y = 0, width = 443110528, height = 32730, border_width = 549, above = 140574722801664, detail = 443252992, value_mask = 1}, xcirculate = {type = 0, serial = 140574722801664, send_event = 83886083, display = 0x226, event = 140574715810819, window = 4256530, place = 550}, xci
        async = <value optimized out>
        next = 0x7fda1a6b8100
#4  0x00007fda16f56e76 in _XReply (dpy=0x7fda1a6ac000, rep=<value optimized out>, extra=0, discard=0) at ../../src/xcb_io.c:506
        ext = 0x0
        ret_code = <value optimized out>
        error = 0x7fda1a6b8100
        c = 0x7fda1a6ad000
        __PRETTY_FUNCTION__ = "_XReply"
#5  0x00007fda16f343e7 in XGetWindowProperty (dpy=0x7fda1a6ac000, w=<value optimized out>, property=327, offset=0, length=0, delete=1870209126, req_type=0, actual_type=0x7fffa6752e70, actual_format=0x7fffa6752e7c, nitems=0x7fffa6752e68, bytesafter=0x7fffa6752e60, prop=0x7fffa6752e58) at ../../src/GetProp.c:64
        reply = {type = 0 '\0', format = 3 '\3', sequenceNumber = 550, length = 83886083, propertyType = 1310720, bytesAfter = 0, nItems = 78567008, pad1 = 0, pad2 = 3, pad3 = 0}
        error = {type = 0 '\0', errorCode = 192 '\300', sequenceNumber = 550, resourceID = 32730, minorCode = 28514, majorCode = 245 '\365', pad1 = 22 '\26', pad3 = 32730, pad4 = 443171200, pad5 = 32730, pad6 = 443207680, pad7 = 32730}
#6  0x00007fda18c36450 in XRemoteClient::CheckWindow (this=0x7fffa6753050, aWindow=0) at XRemoteClient.cpp:273
        type = 0
        nitems = 140735986085968
        data = <value optimized out>
        format = 32767
        bytesafter = 0
        innerWindow = <value optimized out>
#7  0x00007fda18c36578 in XRemoteClient::FindBestWindow (this=0x7fffa6753050, aProgram=<value optimized out>, aUsername=<value optimized out>, aProfile=<value optimized out>, aSupportsCommandLine=<value optimized out>) at XRemoteClient.cpp:489
        type = 0
        nitems = 0
        data_return = 0x0
        w = 0
        status = 464016024
        username = 0x1 <Address 0x1 out of bounds>
        format = 0
        bytesafter = 0
        version = 0
        bestWindow = 77594697
        parent = 0
        nkids = 154
        i = <value optimized out>
        root2 = 292
        kids = 0x7fda1a69f800
#8  0x00007fda18c36b98 in XRemoteClient::SendCommandLine (this=0x1, aProgram=0x0, aUsername=0x7fda1ba85298 "\235\216\377\377Ȏ\377\377\210\216\377\377\235\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377\350\216\377\377\200\217\377\377\350\216\377\377\350\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377Џ\377\377\30\220\377\377Џ\377\377Џ\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377m\216\377\377Џ\377\377\350\220\377\377"..., aProfile=0xc <Address 0xc out of bounds>, argc=2, argv=0x726220756f792066, aDesktopStartupID=0x0, aResponse=0x7fffa6753348, aWindowFound=0x7fffa67534b0) at XRemoteClient.cpp:228
        w = <value optimized out>
        rv = 0
...
Comment 6 Ryan Hayle 2009-07-21 08:15:12 PDT
Alex, I am not seeing it anymore, and I switched to 3.5.1 final in jaunty instead of the daily build.
Comment 7 Alexander Sack 2009-07-23 06:19:24 PDT
my comment from Ubuntu Bug - https://bugs.launchpad.net/ubuntu/+source/firefox-3.5/+bug/401055/comments/4:

band-aid with some debugging output should be available on trunk dailies (firefox-3.6 and xulrunner-1.9.2) in https://edge.launchpad.net/~ubuntu-mozilla-daily/+archive/ppa

  - http://bazaar.launchpad.net/~mozillateam/xulrunner/xulrunner-1.9.2.head/annotate/head%3A/debian/patches/lp401055_bz499498_debug_bandaid.patch

Problem appears to be that XQueryTree somehow gives us a bad window; I haven't looked yet how that can happen or if that indicates a bug in X.

I noticed that i 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.
Comment 8 Alexander Sack 2009-07-23 06:22:38 PDT
Created attachment 390216 [details] [diff] [review]
1st band-aid patch with some debug output

attaching the patch referred to in comment 7
Comment 9 Karl Tomlinson (back Dec 13 :karlt) 2009-08-27 14:49:07 PDT
There's a race condition between getting window XIDs and accessing them.
BadWindow would result if an window being checked has been destroyed.
Comment 10 Karl Tomlinson (back Dec 13 :karlt) 2009-08-28 13:32:46 PDT
Created attachment 397329 [details] [diff] [review]
patch
Comment 11 Karl Tomlinson (back Dec 13 :karlt) 2009-08-28 13:37:56 PDT
*** Bug 460572 has been marked as a duplicate of this bug. ***
Comment 12 Karl Tomlinson (back Dec 13 :karlt) 2009-09-02 19:57:51 PDT
http://hg.mozilla.org/mozilla-central/rev/7bdfa4dfef47
Comment 13 Karl Tomlinson (back Dec 13 :karlt) 2009-09-16 20:33:30 PDT
Comment on attachment 397329 [details] [diff] [review]
patch

I see this frequently enough.  Requesting approval1.9.2.

Usually I just try again and then it succeeds, but sometimes when opening some
links from KDE applications the failure is repeated; I give up, open a new
window and try again.  What's happening is that KDE is putting up a progress
window while determining the mime type, and the remoting process takes long
enough (bug 222051) that there's are reasonable period of time in which the
process can get caught by KDE's window getting destroyed.

Automated testing is difficult, possibly involving X server emulators or
proxies.  I tested the patch by adding sleep()s to the code and manually
destroying windows.

I've submitted bug 517133 for a way on getting stats on how often these errors
are happening.
Comment 14 Alexander Sack 2009-10-06 03:12:19 PDT
This is a top crash for us in ubuntu still. Karl, do you see any reason why this shouldn't go to 1.9.1 branch too?
Comment 15 Karl Tomlinson (back Dec 13 :karlt) 2009-10-06 19:52:29 PDT
I've been using this for 3 weeks with Firefox 3.5.3 and it has made a world of difference for me.  If others are also suffering then this seems a good candidate for 1.9.1.
Comment 16 Alexander Sack 2009-10-07 01:12:44 PDT
Comment on attachment 397329 [details] [diff] [review]
patch

also requesting approval on 1.9.1 branch. this is the main blocker for us in ubuntu karmic.
Comment 17 Daniel Veditz [:dveditz] 2009-11-06 11:38:54 PST
Comment on attachment 397329 [details] [diff] [review]
patch

Approved for 1.9.1.6, a=dveditz for release-drivers
Comment 18 Samuel Sidler (old account; do not CC) 2009-11-06 11:40:51 PST
If this is a topcrash on Ubuntu, it should really block 1.9.2. (And we're taking it on 1.9.1, so if it's not fixed on 1.9.2, it'll be a regression.)
Comment 19 Karl Tomlinson (back Dec 13 :karlt) 2009-11-08 18:39:19 PST
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/e36315323d29
Comment 20 Mike Beltzner [:beltzner, not reading bugmail] 2009-11-13 10:31:09 PST
Now a blocker, so you're good to land this on 1.9.2, you can remove the approval request.
Comment 21 Karl Tomlinson (back Dec 13 :karlt) 2009-11-15 22:22:01 PST
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/052ce95caebf

Note You need to log in before you can comment on or make changes to this bug.