Bug 486675 - Firefox exits on an X error for no particular reason
Summary: Firefox exits on an X error for no particular reason
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cairo
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Behdad Esfahbod
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-20 22:37 UTC by Derek Atkins
Modified: 2018-04-11 18:57 UTC (History)
5 users (show)

Fixed In Version: 1.1.91-6.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-09 04:21:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
backtrace from gdk_x_error with firefox --sync (21.53 KB, text/plain)
2009-02-24 21:57 UTC, Derek Atkins
no flags Details
X.Org conf file (609 bytes, text/plain)
2009-02-25 03:24 UTC, Derek Atkins
no flags Details
Xorg Logfile (352.33 KB, text/plain)
2009-02-25 03:26 UTC, Derek Atkins
no flags Details
Another backtrace from gdk_x_error (12.97 KB, text/plain)
2009-02-25 15:27 UTC, Derek Atkins
no flags Details

Description Derek Atkins 2009-02-20 22:37:39 UTC
Description of problem:

Going along quite happily and all of a sudden firefox just exits!  It's not a crash it just... exits.  So I decided to figure out why it's exiting.  What I discovered is that it IS calling exit() through gdk_x_error().  See the backtrace attached.

Version-Release number of selected component (if applicable):

firefox-3.0.6-1.fc10.i386

How reproducible:

It happens often, but I haven't figured out what causes it.  It seems to happen most often when I'm quickly moving back and forth between different workspaces, each with have a number of windows open.

Steps to Reproduce:
1. Start firefox
2. Open lots of windows
3. Swap between workspaces
  
Actual results:

Breakpoint 1, exit (status=1) at exit.c:39
39	  while (__exit_funcs != NULL)
Missing separate debuginfos, use: debuginfo-install libbeagle-0.3.5-1.fc9.i386 libthai-0.1.9-4.fc9.i386
(gdb) bt
#0  exit (status=1) at exit.c:39
#1  0x005a44a7 in gdk_x_error (display=0x9f48800, error=0xbfa651c8)
    at gdkmain-x11.c:645
#2  0x003be915 in bonobo_x_error_handler (display=0x9f48800, error=0x8020dc)
    at bonobo-ui-main.c:58
#3  0x009e3a99 in _XError (dpy=0x9f48800, rep=0x224c8580) at XlibInt.c:2905
#4  0x009eba38 in process_responses (dpy=0x9f48800, wait_for_first_event=0, 
    current_error=0x0, current_request=0) at xcb_io.c:138
#5  0x009ec3d5 in _XEventsQueued (dpy=0x9f48800, mode=1) at xcb_io.c:197
#6  0x009ec462 in _XFlush (dpy=0x9f48800) at xcb_io.c:260
#7  0x009c3b41 in XFlush (dpy=0x9f48800) at Flush.c:41
#8  0x0058d641 in IA__gdk_display_flush (display=0x9f50028)
    at gdkdisplay-x11.c:732
#9  0x00583cda in flush_all_displays () at gdkwindow.c:2618
#10 IA__gdk_window_process_all_updates () at gdkwindow.c:2673
#11 0x00583d2b in gdk_window_update_idle (data=0x0) at gdkwindow.c:2508
#12 0x0056716b in gdk_threads_dispatch (data=0x150aadd0) at gdk.c:473
#13 0x0768c301 in g_idle_dispatch (source=0x18baa428, callback=0x252, 
    user_data=0x150aadd0) at gmain.c:4235
#14 0x0768e238 in g_main_dispatch () at gmain.c:2144
#15 IA__g_main_context_dispatch (context=0x9f57780) at gmain.c:2697
#16 0x076918e3 in g_main_context_iterate (context=0x9f57780, block=0, 
    dispatch=1, self=0x9f37750) at gmain.c:2778
---Type <return> to continue, or q <return> to quit---
#17 0x07691aa1 in IA__g_main_context_iteration (context=0x9f57780, may_block=0)
    at gmain.c:2841
#18 0x04a63588 in nsAppShell::ProcessNextNativeEvent (this=0xa0428a8, 
    mayWait=0) at nsAppShell.cpp:144
#19 0x04a7a1a8 in nsBaseAppShell::DoProcessNextNativeEvent (this=0xa0428a8, 
    mayWait=0) at nsBaseAppShell.cpp:151
#20 0x04a7a3b1 in nsBaseAppShell::OnProcessNextEvent (this=0xa0428a8, 
    thr=0x9f99c88, mayWait=1, recursionDepth=0) at nsBaseAppShell.cpp:278
#21 0x04b4ced0 in nsThread::ProcessNextEvent (this=0x9f99c88, mayWait=1, 
    result=0xbfa65564) at nsThread.cpp:497
#22 0x04b19cf4 in NS_ProcessNextEvent_P (thread=0x252, mayWait=1)
    at nsThreadUtils.cpp:227
#23 0x04a7a488 in nsBaseAppShell::Run (this=0xa0428a8)
    at nsBaseAppShell.cpp:170
#24 0x0492de38 in nsAppStartup::Run (this=0xa10da48) at nsAppStartup.cpp:181
#25 0x042f7de0 in XRE_main (argc=1, argv=0xbfa68c74, aAppData=0x9f37258)
    at nsAppRunner.cpp:3193
#26 0x08049169 in main (argc=1, argv=0xbfa68c74) at nsXULStub.cpp:364
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) t a a bt

Thread 8 (Thread 0xb7e42b90 (LWP 19912)):
#0  0x001f6416 in __kernel_vsyscall ()
#1  0x0076a777 in __poll (fds=0xb7e41f58, nfds=7, timeout=65535000)
    at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0x0691cca4 in ?? () from /lib/libnspr4.so
#3  0x0435f59b in nsSocketTransportService::Poll (this=0xa0132c8, wait=1, 
    interval=0xb7e421d8) at nsSocketTransportService2.cpp:349
#4  0x0435fab0 in nsSocketTransportService::DoPollIteration (this=0xa0132c8, 
    wait=1) at nsSocketTransportService2.cpp:644
#5  0x0435fd6c in nsSocketTransportService::OnProcessNextEvent (
    this=0xa0132c8, thread=0xa0139a0, mayWait=1, depth=1)
    at nsSocketTransportService2.cpp:523
#6  0x04b4ced0 in nsThread::ProcessNextEvent (this=0xa0139a0, mayWait=1, 
    result=0xb7e42284) at nsThread.cpp:497
#7  0x04b19cf4 in NS_ProcessNextEvent_P (thread=0x7, mayWait=1)
    at nsThreadUtils.cpp:227
#8  0x0435f7c7 in nsSocketTransportService::Run (this=0xa0132c8)
    at nsSocketTransportService2.cpp:565
#9  0x04b4cf2c in nsThread::ProcessNextEvent (this=0xa0139a0, mayWait=1, 
    result=0xb7e42334) at nsThread.cpp:510
#10 0x04b19cf4 in NS_ProcessNextEvent_P (thread=0x7, mayWait=1)
    at nsThreadUtils.cpp:227
---Type <return> to continue, or q <return> to quit---
#11 0x04b4d7e2 in nsThread::ThreadFunc (arg=0xa0139a0) at nsThread.cpp:254
#12 0x069210d1 in ?? () from /lib/libnspr4.so
#13 0x0083f51f in start_thread (arg=0xb7e42b90) at pthread_create.c:297
#14 0x0077504e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 7 (Thread 0xb7441b90 (LWP 19913)):
#0  0x001f6416 in __kernel_vsyscall ()
#1  0x00843432 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:179
#2  0x06919f1e in ?? () from /lib/libnspr4.so
#3  0x0691ad40 in PR_WaitCondVar () from /lib/libnspr4.so
#4  0x04b505a0 in TimerThread::Run (this=0x9f9a760) at TimerThread.cpp:345
#5  0x04b4cf2c in nsThread::ProcessNextEvent (this=0xa155fc8, mayWait=1, 
    result=0xb7441334) at nsThread.cpp:510
#6  0x04b19cf4 in NS_ProcessNextEvent_P (thread=0x80, mayWait=1)
    at nsThreadUtils.cpp:227
#7  0x04b4d7e2 in nsThread::ThreadFunc (arg=0xa155fc8) at nsThread.cpp:254
#8  0x069210d1 in ?? () from /lib/libnspr4.so
#9  0x0083f51f in start_thread (arg=0xb7441b90) at pthread_create.c:297
#10 0x0077504e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 5 (Thread 0xb426fb90 (LWP 19918)):
#0  0x001f6416 in __kernel_vsyscall ()
---Type <return> to continue, or q <return> to quit---
#1  0x00843105 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0691adb7 in PR_WaitCondVar () from /lib/libnspr4.so
#3  0x049520c3 in nsSSLThread::Run (this=0xb30d330) at nsSSLThread.cpp:964
#4  0x049519da in nsPSMBackgroundThread::nsThreadRunner (arg=0xb30d330)
    at nsPSMBackgroundThread.cpp:44
#5  0x069210d1 in ?? () from /lib/libnspr4.so
#6  0x0083f51f in start_thread (arg=0xb426fb90) at pthread_create.c:297
#7  0x0077504e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 4 (Thread 0xb386eb90 (LWP 19919)):
#0  0x001f6416 in __kernel_vsyscall ()
#1  0x00843105 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0691adb7 in PR_WaitCondVar () from /lib/libnspr4.so
#3  0x04953231 in nsCertVerificationThread::Run (this=0xb30d590)
    at nsCertVerificationThread.cpp:138
#4  0x049519da in nsPSMBackgroundThread::nsThreadRunner (arg=0xb30d590)
    at nsPSMBackgroundThread.cpp:44
#5  0x069210d1 in ?? () from /lib/libnspr4.so
#6  0x0083f51f in start_thread (arg=0xb386eb90) at pthread_create.c:297
#7  0x0077504e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xb1a6bb90 (LWP 19922)):
#0  0x001f6416 in __kernel_vsyscall ()
---Type <return> to continue, or q <return> to quit---
#1  0x00843105 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0691adb7 in PR_WaitCondVar () from /lib/libnspr4.so
#3  0x0691ae37 in PR_Wait () from /lib/libnspr4.so
#4  0x04b4c055 in nsAutoMonitor::Wait ()
    at ../../dist/include/xpcom/nsAutoLock.h:340
#5  nsEventQueue::GetEvent (this=0xbc04930, mayWait=1, result=0xb1a6b2f4)
    at nsEventQueue.cpp:85
#6  0x04b4cf02 in nsThread::nsChainedEventQueue::GetEvent () at nsThread.h:112
#7  nsThread::ProcessNextEvent (this=0xbc04910, mayWait=1, result=0xb1a6b334)
    at nsThread.cpp:501
#8  0x04b19cf4 in NS_ProcessNextEvent_P (thread=0x80, mayWait=1)
    at nsThreadUtils.cpp:227
#9  0x04b4d7e2 in nsThread::ThreadFunc (arg=0xbc04910) at nsThread.cpp:254
#10 0x069210d1 in ?? () from /lib/libnspr4.so
#11 0x0083f51f in start_thread (arg=0xb1a6bb90) at pthread_create.c:297
#12 0x0077504e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb80436d0 (LWP 19911)):
#0  exit (status=1) at exit.c:39
#1  0x005a44a7 in gdk_x_error (display=0x9f48800, error=0xbfa651c8)
    at gdkmain-x11.c:645
#2  0x003be915 in bonobo_x_error_handler (display=0x9f48800, error=0x8020dc)
    at bonobo-ui-main.c:58
---Type <return> to continue, or q <return> to quit---
#3  0x009e3a99 in _XError (dpy=0x9f48800, rep=0x224c8580) at XlibInt.c:2905
#4  0x009eba38 in process_responses (dpy=0x9f48800, wait_for_first_event=0, 
    current_error=0x0, current_request=0) at xcb_io.c:138
#5  0x009ec3d5 in _XEventsQueued (dpy=0x9f48800, mode=1) at xcb_io.c:197
#6  0x009ec462 in _XFlush (dpy=0x9f48800) at xcb_io.c:260
#7  0x009c3b41 in XFlush (dpy=0x9f48800) at Flush.c:41
#8  0x0058d641 in IA__gdk_display_flush (display=0x9f50028)
    at gdkdisplay-x11.c:732
#9  0x00583cda in flush_all_displays () at gdkwindow.c:2618
#10 IA__gdk_window_process_all_updates () at gdkwindow.c:2673
#11 0x00583d2b in gdk_window_update_idle (data=0x0) at gdkwindow.c:2508
#12 0x0056716b in gdk_threads_dispatch (data=0x150aadd0) at gdk.c:473
#13 0x0768c301 in g_idle_dispatch (source=0x18baa428, callback=0x252, 
    user_data=0x150aadd0) at gmain.c:4235
#14 0x0768e238 in g_main_dispatch () at gmain.c:2144
#15 IA__g_main_context_dispatch (context=0x9f57780) at gmain.c:2697
#16 0x076918e3 in g_main_context_iterate (context=0x9f57780, block=0, 
    dispatch=1, self=0x9f37750) at gmain.c:2778
#17 0x07691aa1 in IA__g_main_context_iteration (context=0x9f57780, may_block=0)
    at gmain.c:2841
#18 0x04a63588 in nsAppShell::ProcessNextNativeEvent (this=0xa0428a8, 
    mayWait=0) at nsAppShell.cpp:144
#19 0x04a7a1a8 in nsBaseAppShell::DoProcessNextNativeEvent (this=0xa0428a8, 
---Type <return> to continue, or q <return> to quit---
    mayWait=0) at nsBaseAppShell.cpp:151
#20 0x04a7a3b1 in nsBaseAppShell::OnProcessNextEvent (this=0xa0428a8, 
    thr=0x9f99c88, mayWait=1, recursionDepth=0) at nsBaseAppShell.cpp:278
#21 0x04b4ced0 in nsThread::ProcessNextEvent (this=0x9f99c88, mayWait=1, 
    result=0xbfa65564) at nsThread.cpp:497
#22 0x04b19cf4 in NS_ProcessNextEvent_P (thread=0x252, mayWait=1)
    at nsThreadUtils.cpp:227
#23 0x04a7a488 in nsBaseAppShell::Run (this=0xa0428a8)
    at nsBaseAppShell.cpp:170
#24 0x0492de38 in nsAppStartup::Run (this=0xa10da48) at nsAppStartup.cpp:181
#25 0x042f7de0 in XRE_main (argc=1, argv=0xbfa68c74, aAppData=0x9f37258)
    at nsAppRunner.cpp:3193
#26 0x08049169 in main (argc=1, argv=0xbfa68c74) at nsXULStub.cpp:364
(gdb) 
(gdb) 
(gdb) 
(gdb) 
(gdb) up
#1  0x005a44a7 in gdk_x_error (display=0x9f48800, error=0xbfa651c8)
    at gdkmain-x11.c:645
645		  exit (1);
(gdb) p *error
$1 = {type = 0, display = 0x9f48800, resourceid = 91246070, serial = 38879800, 
  error_code = 14 '\016', request_code = 149 '\225', minor_code = 4 '\004'}
(gdb) quit


Expected results:

Firefox shouldn't spontaneously exit.  If nothing else it should pop up a dialog warning me of something, but it shouldn't just exit.  Calling exit() from within libraris is BAD.

Additional info:

Comment 1 Christopher Aillon 2009-02-23 16:34:26 UTC
Well, firefox isn't calling exit directly.  That's coming from gdk_x_error since there's an X error.  Any application that encounters one will exit like you see.  It's like a result of a real bug in Firefox, but finding the cause of the X error will be a little tricky.... Can you quantify lots of windows?  Also, if you can run firefox with the --sync command line option, and then break on gdk_x_error and provide a backtrace there, it would be a little more useful.  (Please provide it as an attachment, not as a comment if you can).

Comment 2 Derek Atkins 2009-02-23 16:51:22 UTC
Lots of windows == 56
Total tabs... probably around 200 or so.

Next time it crashes I'll run with --sync and set that breakpoint.  I presume this will make performance suck hairy monkey balls?   I was breaking on exit to get that last backtrace, but I can break in gdx_x_error instead.

And sure, I can attach instead of comment.

Comment 3 Derek Atkins 2009-02-24 21:57:31 UTC
Created attachment 333095 [details]
backtrace from gdk_x_error with firefox --sync

It took a LOT longer to exhibit this problem under --sync, but I did eventually trap a call to gdk_x_error.  Here's the full backtrace and the error.

Comment 4 Matěj Cepl 2009-02-25 00:36:30 UTC
Looks like X issue. Could we get more information on that side of your computer? Please attach your X server config file (/etc/X11/xorg.conf, if available) and X server log file (/var/log/Xorg.*.log) to the bug report as individual uncompressed file attachments using the bugzilla file attachment link below.

Thanks in advance.

Comment 5 Derek Atkins 2009-02-25 03:24:25 UTC
Created attachment 333128 [details]
X.Org conf file

Comment 6 Derek Atkins 2009-02-25 03:26:16 UTC
Created attachment 333129 [details]
Xorg Logfile

Comment 7 Derek Atkins 2009-02-25 03:27:06 UTC
Done.  Heres the Xorg.conf and most recent Xorg.0.log file.

Comment 8 Derek Atkins 2009-02-25 15:27:11 UTC
Created attachment 333171 [details]
Another backtrace from gdk_x_error

This looks like a slightly different backtrace.  I also ran firefox from the commandline and got some interesting output:

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 258810104 error_code 14 request_code 149 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.)

Comment 9 Matěj Cepl 2009-02-25 17:46:21 UTC
Per discussion on IRC reassigning to cairo.

Comment 10 D. Hugh Redelmeier 2009-04-04 03:24:42 UTC
I keep getting firefox terminating with the BadIDChoice message (Fedora 10 x86_64).  The good news is that there is a fix.

The BadIDChoice error is a bug in libxcb.  I think that this means that either there are multiple bugs in this bz or cairo is the wrong assignment.

Please see upstream: http://bugs.freedesktop.org/show_bug.cgi?id=20254
(I started that one to record information discovered elsewhere.)
An actual fix exists.

This has more activity:
 https://bugzilla.mozilla.org/show_bug.cgi?id=458092

I also think that this bz is a different program provoking the same bug:
  https://bugzilla.redhat.com/show_bug.cgi?id=458657

Comment 11 D. Hugh Redelmeier 2009-04-04 04:45:11 UTC
I've created https://bugzilla.redhat.com/show_bug.cgi?id=494091 against libxcb.

There is a chance that some of the reports in the current bz entry are for a different problem.

Comment 12 Derek Atkins 2009-04-21 17:31:16 UTC
FYI, I've been running firefox against a libxcb with the patch in bug #494091 and I haven't seen an X Protocol Error.  I highly recommend getting this patch into libxcb, because it does seem to work for me!

Comment 13 Fedora Update System 2009-04-21 19:22:36 UTC
libxcb-1.1.91-6.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/libxcb-1.1.91-6.fc10

Comment 14 Fedora Update System 2009-04-22 01:11:02 UTC
libxcb-1.1.91-6.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libxcb'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-3865

Comment 15 Fedora Update System 2009-05-09 04:21:39 UTC
libxcb-1.1.91-6.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.


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