[MASTER] firefox-3.0b5 received an X Window System error: 'BadIDChoice'

Bug #220628 reported by U. B. on 2008-04-22
186
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Medium
libxcb
Fix Released
Medium
firefox-3.0 (Ubuntu)
Undecided
Unassigned
Declined for Intrepid by Timo Aaltonen
Hardy
Undecided
Unassigned
Jaunty
Undecided
Unassigned
gtk-qt-engine (Ubuntu)
Undecided
Unassigned
Declined for Intrepid by Timo Aaltonen
Hardy
Undecided
Unassigned
Jaunty
Undecided
Unassigned
libxcb (Ubuntu)
Medium
Alexander Sack
Declined for Intrepid by Timo Aaltonen
Hardy
Undecided
Unassigned
Jaunty
Medium
Alexander Sack

Bug Description

Binary package hint: firefox-3.0

Starting a few days ago, maybe a week or so, FF3 started crashing randomly,
after 1h or so, usually when there are tens of windows and tabs open. It
probably happened after some update of the X server, come to think of it.

Calling it from a terminal and not from the window manager yields the following
trace:

The program 'firefox' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 73442980 error_code 14 request_code 153 minor_code 4)
  (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.)

I am not sure what to do with that? Is firefox the program I should run with
the --sync command line option?

Relevant packages (hardy up-to-date):
ii xserver-xorg 1:7.3+10ubuntu10 the X.Org X server
ii xserver-xorg-core 2:1.4.1~git20080131-1ubuntu9 Xorg X server - core server
ii kdm-kde4 4:4.0.3-0ubuntu2 X display manager for KDE 4
ii firefox-3.0 3.0~b5+nobinonly-0ubuntu3 safe and easy web browser from Mozilla

Tell me what to do to help you investigate this issue.

U. B. (u710bts) wrote :

Update. No core file is produced, and running firefox under gdb gives nothing. The "apt-cache search firefox debug" command does not show any package related to firefox-3.
The problem reproduces fairly regularly. Example of a gdb session:

$ ulimit -c
10000
$ gdb
[...]
(gdb) file /usr/lib/firefox-3.0b5/firefox
Reading symbols from /usr/lib/firefox-3.0b5/firefox...(no debugging symbols found)...done.
(gdb) break gdk_x_error
Function "gdk_x_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (gdk_x_error) pending.
(gdb) run --sync
[...]
[New Thread 0x40c5d950 (LWP 24772)]
[Thread 0x40c5d950 (LWP 24772) exited]
[New Thread 0x40c5d950 (LWP 24773)]
The program 'firefox' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 147095966 error_code 14 request_code 153 minor_code 4)
  (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.)

Program exited with code 01.
(gdb) quit

I'm still confused as to what I could or should do to help pin down the source of the trouble.

Gabriel de Perthuis (g2p) wrote :

You can install debug packages and get a backtrace by following the instructions there: https://wiki.ubuntu.com/MozillaTeam/Bugs#head-c576e78d92cb3c959c271158b6ace98be835de83
Beware: the packages are in an external repository, and unsigned :-(

Changed in firefox:
status: Unknown → Confirmed

I have this issue too.

ii firefox 3.0.1+build1+nobinonly-0ubuntu0.8.04.3 meta package for the popular mozilla web browser
ii firefox-3.0 3.0.1+build1+nobinonly-0ubuntu0.8.04.3 safe and easy web browser from Mozilla
ii kdm-kde4 4:4.0.3-0ubuntu2 X display manager for KDE 4
ii xserver-xorg 1:7.3+10ubuntu10.2 the X.Org X server
ii xserver-xorg-core 2:1.4.1~git20080131-1ubuntu9.2 Xorg X server - core server

The program 'firefox' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 16193363 error_code 14 request_code 55 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.)
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb653f767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb653f81e]
#2 /usr/lib/libX11.so.6 [0xb6acb518]
#3 /usr/lib/libX11.so.6(XFreeCursor+0x25) [0xb6aa78f5]
#4 /usr/lib/libqt-mt.so.3(_ZN11QCursorDataD1Ev+0x3f) [0xb4ee3389]
#5 /usr/lib/libqt-mt.so.3(_ZN7QCursorD1Ev+0x5a) [0xb4ee358e]
#6 /usr/lib/libqt-mt.so.3 [0xb4ee35d5]
#7 /lib/tls/i686/cmov/libc.so.6(exit+0xd4) [0xb7d0c084]
#8 /usr/lib/libgdk-x11-2.0.so.0 [0xb66b1637]
#9 /usr/lib/libbonoboui-2.so.0 [0xb62ca665]
#10 /usr/lib/libX11.so.6(_XError+0xfe) [0xb6ac473e]
#11 /usr/lib/libX11.so.6 [0xb6acbe5c]
#12 /usr/lib/libX11.so.6(_XEventsQueued+0x4f) [0xb6acc71f]
#13 /usr/lib/libX11.so.6(XPending+0x62) [0xb6ab59d2]
#14 /usr/lib/libgdk-x11-2.0.so.0 [0xb66a604d]
#15 /usr/lib/libgdk-x11-2.0.so.0 [0xb66a6141]
#16 /usr/lib/libglib-2.0.so.0(g_main_context_prepare+0x190) [0xb6bb53e0]
#17 /usr/lib/libglib-2.0.so.0 [0xb6bb5b09]
#18 /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x6c) [0xb6bb63ac]
#19 /usr/lib/xulrunner-1.9.0.1/libxul.so [0xb782287c]

a-r-k-i-b-o-t-t (arkibott-ray) wrote :

(firefox:16185): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(firefox:16185): Gtk-CRITICAL **: gtk_drag_set_icon_pixbuf: assertion `GDK_IS_DRAG_CONTEXT (context)' failed
The program 'firefox' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 183275268 error_code 14 request_code 154 minor_code 4)
  (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.)
Segmentation fault

This is also with 8.04.1 LTS Ubuntu and the up to date Packages. Firefox3.0.1 etc.

Only ONE Window will be restored after a new start. Other Windows and Tabs are lost.

Do you use firefox in kde?

On Tue, Jul 29, 2008 at 08:47:27PM -0000, Kimbotha wrote:
> The program 'firefox' received an X Window System error.
> This probably reflects a bug in the program.
> The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
> (Details: serial 16193363 error_code 14 request_code 55 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.)
> Locking assertion failure. Backtrace:
> #0 /usr/lib/libxcb-xlib.so.0 [0xb653f767]
> #1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb653f81e]
> #2 /usr/lib/libX11.so.6 [0xb6acb518]
> #3 /usr/lib/libX11.so.6(XFreeCursor+0x25) [0xb6aa78f5]
> #4 /usr/lib/libqt-mt.so.3(_ZN11QCursorDataD1Ev+0x3f) [0xb4ee3389]
> #5 /usr/lib/libqt-mt.so.3(_ZN7QCursorD1Ev+0x5a) [0xb4ee358e]
> #6 /usr/lib/libqt-mt.so.3 [0xb4ee35d5]
> #7 /lib/tls/i686/cmov/libc.so.6(exit+0xd4) [0xb7d0c084]
> #8 /usr/lib/libgdk-x11-2.0.so.0 [0xb66b1637]
> #9 /usr/lib/libbonoboui-2.so.0 [0xb62ca665]
> #10 /usr/lib/libX11.so.6(_XError+0xfe) [0xb6ac473e]
> #11 /usr/lib/libX11.so.6 [0xb6acbe5c]
> #12 /usr/lib/libX11.so.6(_XEventsQueued+0x4f) [0xb6acc71f]
> #13 /usr/lib/libX11.so.6(XPending+0x62) [0xb6ab59d2]
> #14 /usr/lib/libgdk-x11-2.0.so.0 [0xb66a604d]
> #15 /usr/lib/libgdk-x11-2.0.so.0 [0xb66a6141]
> #16 /usr/lib/libglib-2.0.so.0(g_main_context_prepare+0x190) [0xb6bb53e0]
> #17 /usr/lib/libglib-2.0.so.0 [0xb6bb5b09]
> #18 /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x6c) [0xb6bb63ac]
> #19 /usr/lib/xulrunner-1.9.0.1/libxul.so [0xb782287c]
>

 - Alexander

Hi Alexander,

Yes, I run Firefox on Kubuntu using KDE 3.

Regards,

Kim

a-r-k-i-b-o-t-t (arkibott-ray) wrote :

I see this error using gnome 2.22.3.

As the Error Message suggests, i tried running firefox with the --sync parameter. It still crashes randomly with it.

A funny detail: Sometimes the icon of a bookmark shows the wrong icon. I thought this was related to this X --sync problem, but actually its another random glitch.. but not so serious.

Download full text (3.8 KiB)

This may be the same as bug 454677, but it started happening quite often to me only in the last few days, so I suspect it's different.

In the past four days, I've crashed three times with a BadIdChoice X error:
2008-09-28 12:42:13
2008-09-29 18:47:44
2008-10-01 10:39:24

The first two times the error looked like this:

The program 'firefox-bin' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 158749545 error_code 14 request_code 155 minor_code 4)
  (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.)

(different serial the second time)

But the third time it gave me more information:

The program 'firefox-bin' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 150818044 error_code 14 request_code 155 minor_code 4)
  (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.)
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x7f833992297c]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x15) [0x7f8339922a15]
#2 /usr/lib/libX11.so.6 [0x7f833d7e4323]
#3 /usr/lib/libXrender.so.1(XRenderFreePicture+0x46) [0x7f833abd87c6]
#4 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/libthebes.so [0x7f83327bd8f4]
#5 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/libthebes.so(_moz_cairo_surface_finish+0x3b) [0x7f83327a51cb]
#6 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/libthebes.so(_moz_cairo_surface_destroy+0x58) [0x7f83327a5248]
#7 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/libthebes.so(_ZN11gfxASurface7ReleaseEv+0x36) [0x7f83327676c6]
#8 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/components/libgkgfxthebes.so [0x7f832eed9c6f]
#9 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/components/libgkgfxthebes.so [0x7f832eeda2ba]
#10 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/components/libgkgfxthebes.so [0x7f832eee5544]
#11 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/components/libgkgfxthebes.so [0x7f832eee584f]
#12 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/libxpcom_core.so(_ZN15nsCOMArray_baseD2Ev+0x3b) [0x7f833fd9b0eb]
#13 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/components/libimglib2.so [0x7f832f30ed41]
#14 /home/dbaron/builds/mozilla-central/obj/firefox-debugopt/dist/bin/components/libimglib2.so [0x7f832f30cccf]
#15 /home/dbaron...

Read more...

Created attachment 341309
fixed version of stack, with line numbers

Was the stack trace from running with --sync?

This happens about once a day, seemingly randomly, so I can't just rerun with --sync and make it crash again.

Likely not -- the minor number corresponds to RenderCreatePicture, not FreePicture. Might have to dig into the X code to see what generates BadID; owen was suggesting that it might be due due to IDs getting out of sync somehow:

13:03 < otaylor> vlad_: Trying to create two resources with the ID of the
                 second less than the ID of the first would cause that

But I have no idea how we'd get into that situation, unless the IDs wrapped around?

Created attachment 341701
stack with --sync

Created attachment 341790
second stack with --sync

This one has better symbols and is quite different from the first.

Assigning blocking+ and over to me until we figure out what's going on.

Created attachment 342157
third stack with --sync

I've now installed better debug symbols for libcairo.so.2, so I should get a better stack next time.

Created attachment 342987
fourth stack with --sync

Some of the Mozilla filenames / line numbers might be off, since I'd rebuilt some things since starting.

It keeps failing randomly with 3.0.3+build1+nobinonly-0ubuntu0.8.04.1.
I guess this happens when there are many windows/tabs open and the computer is short on memory, but it's hard to tell.
I would test more if I got explicit and comprehensive steps, involving nothing but official packages.

*** Bug 454678 has been marked as a duplicate of this bug. ***

(In reply to comment #10)
> *** Bug 454678 has been marked as a duplicate of this bug. ***

Note that unlike the crashes mentioned in both this bug and bug 454677 (which have request_code 155 minor_code 4), bug 454678 has request_code 53 minor_code 0. Since the day when I reported bugs 454677 and 454678 (and actually maybe a week or more before), I'm getting them approximately once or twice a day (14/155/4 much more often than 14/53/0), and only after SeaMonkey has run some hours since last restart. I suspect bug 454677 is due to the same cause as this one but I have doubts about bug 454678. We'll see when (and if) this one gets fixed.

Currently running

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081020 SeaMonkey/2.0a2pre - Build ID: 20081020000453

and I've had a case of this problem (14/155/4) on it. I'm keeping sysout/syserr logs (available on request) but I don't know how to catch a usable stack trace with gdb. (Breakpad is never triggered by these crashes.)

The requests will be different -- it's being triggered by anything that allocates an ID. dbaron has some good stack traces showing that happening inside this bug, but from reading the X source I don't know what could be causing it.

*** Bug 454677 has been marked as a duplicate of this bug. ***

Is this a GTK bug?
Recently I got a similar error with thunderbird.

The Mozilla guys told me it's a GTK thing.. but I wonder why it only occurs with Mozilla programs.

Alexander Sack (asac) wrote :

most likely a gtk qt engine thing. have you tested if this still happens on kde4?

Changed in gtk-qt-engine:
status: New → Triaged

Gonna take this off the blocking list for now; I haven't been able to reproduce it in a VM, and David says he hasn't seen it for a while. From reading the X source and talking to X developers, the two things that could cause it are either a corrupt ID making it over, or running out of XIDs on the X side. The latter would be odd, because we'd probably have run out of memory well before we got to running out of XIDs. The former is possible, but again odd..

Useful information to get if it happens again would be the ID in _XIDHandler, and xrestop information.

(In reply to comment #14)
> Gonna take this off the blocking list for now; I haven't been able to reproduce
> it in a VM, and David says he hasn't seen it for a while. [...]

I used to get these almost every day; the latest case I see is recorded in a logfile with a datestamp of 2008-10-23 13:54 +0200.

Created attachment 347218
xrestop -b -m 1

Recorded shortly after OpenOffice received:

  X-Error: BadIDChoice (invalid resource ID chosen for this connection)
  Major opcode: 53 (X_CreatePixmap)

Then, ten minutes later the firefox process listed here (version 3.0.3)
received:

  BadIDChoice (invalid resource ID chosen for this connection)
  Details: serial 85482098 error_code 14 request_code 153

I don't see any large XID users.

Two different apps crashing the same way suggests that the bug is at a low
level. I have xorg-server-1.4.2, libxcb-1.0, libX11-1.1.4, cairo-1.6.4-r1.

(In reply to comment #16)
[...]
> Two different apps crashing the same way suggests that the bug is at a low
> level. I have xorg-server-1.4.2, libxcb-1.0, libX11-1.1.4, cairo-1.6.4-r1.

I'm on openSUSE 11.0, currently with:
xorg-x11-7.3-96.2
xorg-x11-server-7.3-110.9
xorg-x11-libxcb-7.3-48.1
xorg-x11-libX11-7.3-56.1
cairo-1.4.14-32.1

I just checked my SeaMonkey saved logs (20 of them, the oldest one dated October 24). Neither of the strings "BadIdChoice" and "X Window" happens in any of them, which means the bug (and its dupes bug 454677 and bug 454678, which I reported) have disappeared some time ago on my system. I haven't particularly noted if and when any "SuSE Online Updates" were applied to any Xorg-X11 packages, but I check at least once a day for any available upgrades (and apply them if there are).

However I had a "BadWindow (invalid window parameter)" X-error (error 3 request 20 minor 0) yesterday in BonEcho (Firefox 2 nightly). At the moment, this is an isolated case.

My current builds:
-- SeaMonkey:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081112 SeaMonkey/2.0a2pre - Build ID: 20081112033648
-- Firefox:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19pre) Gecko/20081112 BonEcho/2.0.0.19pre - Build ID: 2008111203

FWIW, same issue with
firefox-3.0.4, xorg-server-1.5.2, libxcb-1.1.90.1, libX11-1.1.5.

I haven't seen this for quite a while... perhaps it was fixed when I upgraded to Ubuntu 8.10 from 8.04.

I just started getting this bug on KDE4.2 Beta 2. The problem occurs in Firefox when copying and pasting in an input box or the location bar. Selected style is QTCurve, although I believe it also happened with Oxygen style. GTK Styles is set to Use my KDE style.

lessoffensive (lessoffensive) wrote :

After a large amount of testing and finally correlating logs, I determined this to be caused by installing version 1.3.10a of the flashblock extension though apt. I use amd64, kubuntu intrepid, Kde 4.1 (and 4.2), nvidia drivers, and QtCurve. I think the last two looked like they may have been related, but probably aren't.

1.3.10a in the repositories is too old; I switched to version 1.5.7.1 from addons.mozilla.org and my problems have finally resolved.

Lesson: don't install Firefox extensions from apt.

Thomas Riccardi (kiwiiii) wrote :

I have the same issue on debian lenny 64bits with firefox (iceweasel) 3.0.4-1.
I also use the flashblock extension, but with the last version 1.5.7.1, and I have the issue...
So lessoffensive, flashblock version 1.5.7.1 does not solve the issue in every case. (I also use nvidia drivers from nvidia.com)

I tried without flashplugin-nonfree and without flashblock, but it crashes again.

lessoffensive (lessoffensive) wrote :

Thomas, you're right, flashblock wasn't it. It's strange though that it worked for me for about two weeks with that new upgraded version but now I have the same crash again. Are you using KDE 4.X? What may be involved is that I just changed nvidia drivers last night and it's started crashing since. I'm using the nvidia 180.22 drivers, upgraded from 180.16.

I still haven't ruled out QtCurve though, so I'm upgrading to the latest (0.60 from the notz ppa) and will see how that works. I'm shocked so few people have this problem and it's persisted as long as it has being as totally intermittent as it has been, as well.

It also seems to only happen when I get enough tabs to have to scroll through them on the tab bar on the window (the last crash was 2 windows, 140 tabs); that doesn't seem to cause the crash, but it never seems to be able to get off the ground after it either crashes unrelatedly or being closed.

I'm also using an nvidia geforce 8600 GT. What card and drivers are you using? I've had problems with the 8XXX series and the nvidia drivers for about the last year--maybe the bug is somewhere in the combination of bad driver version(s) and 8XXX series of cards.

Thomas Riccardi (kiwiiii) wrote :

lessoffensive, it is probably an issue related to the nvidia proprietary driver.
I use gnome 2.22 so it's probably not KDE related.
I once thought it was related to x86_64 : I made a chroot yesterday and used firefox 3.04 i686, and it also crashed... So it's probably neither 64b.
For information I use firefox with ~10 windows and a total of ~120 tabs.

I have a 9800GT (which is in fact a 8800GT renamed), and currently use the beta drivers 180.18.
As your firefox crashes with the new 180.22 and not with 180.16, I'll try to use 180.16 for a while to see if it crashes or not.

So now I don't really know what to do, maybe a bugreport to nvidia?

lessoffensive (lessoffensive) wrote :

I tested out the 180.16 drivers again and it crashed without effort. I also just tested firefox in safe mode and it crashed as well.

I'm very willing to believe this has to do with nvidia binary drivers and 8XXX series cards as I've only had continued, unaddressed problems with the combination over the past year. Looking over my install logs again it also occurs to me that it could be possible that it's my xorg server version. I'm running 1.5.2(-2ubuntu3) of xserver-xorg-core, which I upgraded to in mid october, which is around when these problems started occurring (a dramatic shift from firefox never crashing!). I think I'm going to try a 1.5.3 release from the xorg-edgers ppa and see if that fixes anything. Other than that, it seems like filing a bug report, buying a new card, or upgrading to jaunty are among my next options.

I'll keep you posted.

zen0 (a-neuron) wrote :

I am seeing this also, several times per day.
I have ATI video though, using proprietary driver on amd64.

lessoffensive (lessoffensive) wrote :

well xorg server 1.5.3 didn't fix it. Still debating upgrading to Jaunty.

zen0: so you're getting a BadIDChoice x server error as well? With how many windows and tabs? Are you running KDE? What widget style are you using (QtCurve?)? Do you have flash installed and if so, what version? Are you running Intrepid ibex?

Thomas Riccardi (kiwiiii) wrote :

So as it seems to be not specific to nvidia drivers, it is probably a Xorg bug...
I'll try to run firefox in gdb, it may be useful.

The bugreport is already in the mozilla bugtrack (https://bugzilla.mozilla.org/show_bug.cgi?id=430091) but it seems to be quite inactive.

Maybe a bugreport on Xorg would be useful.

Changed in firefox:
status: Confirmed → Invalid
Changed in firefox:
status: Invalid → Unknown
Changed in firefox:
status: Unknown → Confirmed
Alexander Sack (asac) on 2009-02-11
Changed in gtk-qt-engine:
status: New → Incomplete
summary: - firefox-3.0b5 received an X Window System error: 'BadIDChoice'
+ [MASTER] firefox-3.0b5 received an X Window System error: 'BadIDChoice'
Alexander Sack (asac) on 2009-03-22
Changed in libxcb:
importance: Undecided → Unknown
status: New → Unknown
Changed in libxcb (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in gtk-qt-engine (Ubuntu):
status: Incomplete → Invalid
Changed in firefox-3.0 (Ubuntu):
status: Triaged → Invalid
Changed in libxcb:
status: Unknown → Confirmed
Changed in libxcb:
status: Confirmed → Fix Released
Changed in firefox:
status: Confirmed → Fix Released
52 comments hidden view all 132 comments

A version of the fixes to libxcb for Intrepid would be highly appreciated. Anyone have a patched package for me to test out?

Timo Aaltonen (tjaalton) wrote :

I've seen this myself, and will make sure the patch is SRU'd to jaunty and likely to hardy. Not sure about intrepid, jaunty will be released this week anyway..

Changed in libxcb (Ubuntu Jaunty):
assignee: nobody → Timo Aaltonen (tjaalton)
milestone: none → jaunty-updates
Alexander Sack (asac) wrote :

taking over as i already have the package in my ppa.

Changed in libxcb (Ubuntu Jaunty):
assignee: Timo Aaltonen (tjaalton) → Alexander Sack (asac)
Joel Ebel (jbebel) wrote :

We've now discovered some crashes in emacs that this patch also fixes. This is under hardy, so I encourage this patch to be released to hardy as well.

Download full text (6.2 KiB)

Keep experiencing crashes on Intrepid and Hardy we don't have a patched libxcb for Intrepid and Hardy LTS.

matthew@Priapus:~/bug-report$ firefox -g --sync &
[1] 809
matthew@Priapus:~/bug-report$ /home/matthew/bin/backtrace.sh /usr/lib/firefox-3.0.10/firefox -x /tmp/mozargs.WpE811
outputting trace to '/tmp/gdb-firefox.txt'

matthew@Priapus:~/bug-report$
matthew@Priapus:~/bug-report$ FoxyProxy settingsDir = /home/matthew/.mozilla/firefox/hpelwq2p.default
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
!!! [Hook] hook(): title not found

matthew@Priapus:~/bug-report$ [FDLProc] canHandle()
[FDLProc] canHandle()
[FDLProc] canHandle()
[FDLProc] canHandle()
[FDLProc] canHandle()
[FDLProc] canHandle()
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
Removing DOMNodeRemoved listener
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: totemPlugin [0x2147ecc0]
** Message: Init mimetype 'application/x-mplayer2' mode 1
** Message: Base URI is 'http://home.51.com/prettywinnie'
** Message: Real mimetype for 'application/x-mplayer2' is 'video/x-msvideo'
argv[0] src http://pic.51.com/mid/20040505143457.mid
argv[1] name Player
argv[2] type application/x-mplayer2
argv[3] pluginspage http://home.51.com/prettywinnie
argv[4] showcontrols 1
argv[5] showpositioncontrols 0
argv[6] showaudiocontrols 1
argv[7] showtracker 1
argv[8] showdisplay 0
argv[9] showstatusbar 1
argv[10] autosize 0
argv[11] showgotobar 0
argv[12] showcaptioning 0
argv[13] autostart 1
argv[14] autorewind 0
argv[15] animationatstart 0
argv[16] transparentatstart 0
argv[17] allowscan 1
argv[18] enablecontextmenu 1
argv[19] clicktoplay 0
argv[20] defaultframe datawindow
argv[21] invokeurls 0
argv[22] align baseline
argv[23] border 0
argv[24] height 68
argv[25] width 100%
** Message: Stream requested (force viewer: 0)
** Message: mSrcURI: http://pic.51.com/mid/20040505143457.mid
** Message: mCache: 0
** Message: mControllerHidden: 0
** Message: mShowStatusbar: 1
** Message: mHidden: 0
** Message: mAudioOnly: 0
** Message: mAutoPlay: 1, mRepeat: 0
** Message: Launching: /usr/lib/totem/gstreamer/totem-plugin-viewer --plugin-type gmp --user-agent Mozilla/5.0 (X11; U; Linux i686; zh-TW; rv:1.9.0.10) Gecko/2009042523 Ubuntu/8.10 (intrepid) Firefox/3.0.10 --mimetype video/x-msvideo --statusbar
** Message: Viewer spawned, PID 16952
** Message: Initial window set, XID 483f74e size 200x68
** Message: No viewer proxy yet, deferring SetWindow
** Message: GetScriptableNPObject [0x2147ecc0]
** Message: totemGMPPlayer [0x316df588]
** Message: Viewer DBus interface name is 'org.gnome.totem.PluginViewer_16952'
** Message: NameOwnerChanged old-owner '' new-owner ':1.539'
** Message: Viewer now connected to the bus
** Message: ViewerSetup
** Message: Calling SetWindow
Viewer: SetWindow XID 75757390 size 200:68
TotemEmbedded-Message: Viewer state: STOPPED
** Message: NewStream mimetype 'audio/midi' URL 'http://pic.51.com/mid/20040505143457.mid'
** Message: Not expe...

Read more...

Any plans on porting this fix to the 1.9.0 branch? I've had it yesterday (2009-05-14) on a GranParadiso nightly (Fx 3.0.11pre).

The bug is in a system library, not our code; you need to talk to your distributor about getting the fix into their copy of libxcb.

(In reply to comment #44)
> The bug is in a system library, not our code; you need to talk to your
> distributor about getting the fix into their copy of libxcb.

I see. Well, my distributor is Novell/SuSE (but I get Mozilla products straight from Mozilla in .tar.bz2 form) and I diligently apply all "online updates" to their distribution (currently openSUSE 11.1). Let's hope they'll upgrade their X libraries some day.

Tony Mechelynck:
Report this bug to Novell. Some other distro's have already released updates for it. https://bugs.freedesktop.org/show_bug.cgi?id=20254

(In reply to comment #46)
> Tony Mechelynck:
> Report this bug to Novell. Some other distro's have already released updates
> for it. https://bugs.freedesktop.org/show_bug.cgi?id=20254

I did, by commenting on what looked like an appropriate existing bug, see https://bugzilla.novell.com/show_bug.cgi?id=423740#c1

I did not search for duplicates, however. If you think that it is indeed the appropriate Novell bug, you may (or may not) want to add a crossref for it on your freedesktop bug.

Timo Aaltonen (tjaalton) wrote :

uploaded to jaunty-proposed.

Changed in libxcb (Ubuntu Jaunty):
status: Triaged → Fix Committed
Martin Karpinski (mkarpinski) wrote :

Can anyone give me a timeframe for when this patch might be available? I've switched to Ubuntu from Vista about two months ago and have had to deal with daily crashes from this bug.

Martin Pitt (pitti) wrote :

Please upload to karmic ASAP

Changed in libxcb (Ubuntu):
milestone: jaunty-updates → karmic-alpha-3
tags: added: verification-needed
Martin Pitt (pitti) wrote :

Accepted libxcb into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Timo Aaltonen (tjaalton) wrote :

Karmic already has 1.3-2, which includes the fix.

Changed in libxcb (Ubuntu):
status: Triaged → Fix Released
Àlex Magaz (rivaldi8) wrote :

It works for me (tested with Firefox 3.5).

Martin Pitt (pitti) on 2009-07-05
tags: added: verification-done
removed: verification-needed
Damian Frick (dafrick) wrote :
Download full text (3.2 KiB)

I've had the same problem and the patch works so far, however it seems, that it also introduced a new bug.
It occurs under the same conditions as the bug that is now fixed.
So when trying to reproduce it I opened a lot (200+) tabs from Digg an Youtube and at some point a tab openes in an Untitled window outside of firefox and I get the following errors:

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c71753 unexpectedly destroyed

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c71752 unexpectedly destroyed

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c71780 unexpectedly destroyed

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c7179f unexpectedly destroyed

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c7179e unexpectedly destroyed

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c71771 unexpectedly destroyed

(firefox:9845): Gdk-WARNING **: GdkWindow 0x4c71770 unexpectedly destroyed

(firefox:9845): Gdk-CRITICAL **: gdk_window_new: assertion `window != NULL' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): GLib-GObject-CRITICAL **: g_object_set_data: assertion `G_IS_OBJECT (object)' failed

(firefox:9845): GLib-GObject-CRITICAL **: g_object_set_data: assertion `G_IS_OBJECT (object)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_move_resize: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_hide: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_new: assertion `window != NULL' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): GLib-GObject-CRITICAL **: g_object_set_data: assertion `G_IS_OBJECT (object)' failed

(firefox:9845): GLib-GObject-CRITICAL **: g_object_set_data: assertion `G_IS_OBJECT (object)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_move_resize: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_hide: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_show_unraised: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_new: assertion `window != NULL' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_set_back_pixmap: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): GLib-GObject-CRITICAL **: g_object_set_data: assertion `G_IS_OBJECT (object)' failed

(firefox:9845): GLib-GObject-CRITICAL **: g_object_set_data: assertion `G_IS_OBJECT (object)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_move_resize: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_hide: assertion `GDK_IS_WINDOW (window)' failed

(firefox:9845): Gdk-CRITICAL **: gdk_window_show_unraised: assertion `GDK_IS_WINDOW (window)' failed

Whe I close that window firefox crashes, if I...

Read more...

Alexander Sack (asac) wrote :

Damian, you sure this problem goes away when downgrading? maybe it was just hidden because the other bug was too frequent.

Timo Aaltonen (tjaalton) wrote :

Uploaded to hardy-proposed, including a bunch of other fixes.

Changed in gtk-qt-engine (Ubuntu Hardy):
status: New → Invalid
Changed in firefox-3.0 (Ubuntu Hardy):
status: New → Invalid
Changed in libxcb (Ubuntu Hardy):
status: New → Fix Committed
Damian Frick (dafrick) wrote :

@Alexander
It is entirely possible, but there is no way for me to find out, since firefox will crash a lot sooner without the patch. So if any one of you doesn't get this kind of behaviour, please just ignore my comment as it probably isn't related to this bug, but if you have a little time try it out and if it comes up its possible they're related.

The bug Damian is seeing has existed for a long time.
It is more likely to occur in the same conditions (short XID range response) as lead to this bug.

The cause is described here:
http://bugzilla.gnome.org/show_bug.cgi?id=581526

Damian Frick (dafrick) wrote :

Thank you for pointing that out, Karl.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libxcb - 1.1.93-0ubuntu3.1

---------------
libxcb (1.1.93-0ubuntu3.1) jaunty-proposed; urgency=low

  [ Alexander Sack ]
  * debian/patches/lp220628_xid_fixes.patch: add fix for LP: #220628 - fix
    BadIDChoice issues reported against firefox
  * debian/rules: in turn enable simple patchsys

 -- Timo Aaltonen <email address hidden> Wed, 10 Jun 2009 12:33:39 +0300

Changed in libxcb (Ubuntu Jaunty):
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

verification-done tag removed for the hardy update. Does this really need to be fixed in hardy as well? For firefox 3.5 backports?

tags: removed: verification-done

On Thu, Jul 09, 2009 at 01:22:11PM -0000, Martin Pitt wrote:
> verification-done tag removed for the hardy update. Does this really
> need to be fixed in hardy as well? For firefox 3.5 backports?

no. the verification is done. the other problem is a slightly
different bug and should be tracked differently imo.

 - Alexander

Martin Pitt (pitti) wrote :

Alexander Sack [2009-07-09 14:27 -0000]:
> On Thu, Jul 09, 2009 at 01:22:11PM -0000, Martin Pitt wrote:
> > verification-done tag removed for the hardy update. Does this really
> > need to be fixed in hardy as well? For firefox 3.5 backports?
>
> no. the verification is done.

Misunderstanding? The verification was done for jaunty, and I copied
jaunty-proposed to jaunty-updates. But there is no hardy-proposed
version for libxcb; since the task is still open, I assumed that you
want to fix it there as well. But we need to test the hardy update
separately.

> the other problem is a slightly different bug and should be tracked
> differently imo.

Yes, I agree.

Martin Pitt (pitti) wrote :

Accepted libxcb into hardy-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed

This apparently landed on Ubuntu jaunty 9.04 (the current stable release) on July 9th (2009).

https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/220628

Still happens for me with Firefox 3.5.2

The program 'firefox-bin' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 178785760 error_code 14 request_code 156 minor_code 4)
  (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.)
libxcb: WARNING! Program tries to lock an already locked connection,
        which indicates a programming error.
        There will be no further warnings about this issue.

Please ignore last comment, I use an old SuSE 10.3, and didn't realize that I need to update X11.

Martin Pitt (pitti) wrote :

Anyone who could test the packages in hardy-proposed?

Joel Ebel (jbebel) wrote :

Tested under hardy. Firefox fails to start with:

firefox: ../../src/xcb_lock.c:33: _XCBUnlockDisplay: Assertion `xcb_get_request_sent(dpy->xcb->connection) == dpy->request' failed.

On Thu, Oct 29, 2009 at 12:13:38AM -0000, Joel Ebel wrote:
> Tested under hardy. Firefox fails to start with:
>
> firefox: ../../src/xcb_lock.c:33: _XCBUnlockDisplay: Assertion
> `xcb_get_request_sent(dpy->xcb->connection) == dpy->request' failed.

So you tested hardy-proposed bits? or just confirmed that you see this bug
in hardy without having hardy-proposed enabled?

 - Alexander

Joel Ebel (jbebel) wrote :

That was with the package in hardy proposed. Firefox failing to start was not a symptom of the original bug.

Martin Pitt (pitti) wrote :

Joel, can you confirm that downgrading libxcb to hardy final fixes the assertion failure?

Joel Ebel (jbebel) wrote :

Correct. The problem doesn't occur with libxcb1 1.1-1ubuntu1. I did notice that this is exposed by the fact that we divert /usr/bin/firefox to /usr/bin/firefox.distrib. The problem doesn't occur if /usr/bin/firefox-3.0 is called directly. I also discovered a similar error starting gnome-screensaver with the new libxcb that is not present with the original version.

 $ gnome-screensaver
gnome-screensaver: ../../src/xcb_lock.c:33: _XCBUnlockDisplay: Assertion `xcb_get_request_sent(dpy->xcb->connection) == dpy->request' failed.
Aborted

Martin Pitt (pitti) wrote :

This proposed update has been in hardy-proposed for almost half a year without any positive feedback, and it was reported to cause a regression here. Therefore it was removed from hardy-proposed again.

tags: added: regression-proposed verification-failed
removed: verification-needed
Changed in libxcb (Ubuntu Hardy):
status: Fix Committed → Won't Fix
André Pirard (a.pirard) wrote :

I'm surprised that I'm only the 6th person to tick the "me too".
I'm really pested with exactly the same problem.
Every half an hour or so, Firefox disappears when active with many windows and tabs.
I also experienced Thunderbird disappearing, but far less often.
Even Pidgin disappeared a couple of times.
At first I thought it was IP related.
Until I saw that same X BadIDChoice message and I came here.
Should I also mention that Gnome (GDM I suppose) most often cannot switch to another session because of an X failure? It rarely fails when a second attempt is made.
I didn't check any message except in the Firefox case, though.

Ubuntu 8.10 (Gnome). Firefox 3.0.15. libxcb1 is 1.1-1.1, which seems to be what matters.

What should I do to get rid of such a nasty problem?
Shouldn't bug summaries explain the procedure to follow in terms that can be understood by everybody?

How do I get to using 1.1-1ubuntu1 instead if it's true there's no problem with it?

If the importance is "unknown", I can help: it's high for active people using the Web a lot.

Thanks.

Changed in libxcb:
importance: Unknown → Medium
Changed in firefox:
importance: Unknown → Medium
Changed in libxcb:
importance: Medium → Unknown
Steven Shaw (steshaw) wrote :

Having a fix for this bug was pretty important to me. I'm a heavy browser of the internet with multiple windows with multiple tabs. I was hit with this bug quite frequently (and over and over and over again when I tried to restore my previous browsing sessions). I switched to Google Chrome.

Changed in libxcb:
importance: Unknown → Medium
Displaying first 40 and last 40 comments. View all 132 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.