Martin Husemann | 24 Oct 15:39 2012
Picon

Firefox failure with cairo 1.12.6 on NetBSD-current amd64

Hi folks,

pkgsrc recently updated cairo to version 1.12.6 and that causes my firefox
to crash at startup with:

###!!! ABORT: X_SendEvent: BadValue (integer parameter out of range for operation); 494 requests ago:
file /usr/pkgobj/devel/xulrunner/work/mozilla-release/toolkit/xre/nsX11ErrorHandler.cpp,
line 157

Setting a breakpoint on the X11Error handler in gdb shows:

Breakpoint 1, X11Error (display=0x7f7ff7b40000, event=0x7f7fffff5570)
    at /usr/pkgobj/devel/xulrunner/work/mozilla-release/toolkit/xre/nsX11ErrorHandler.cpp:20
20      X11Error(Display *display, XErrorEvent *event) {
(gdb) print *event
$3 = {type = 0, display = 0x7f7ff7b40000, resourceid = 205, serial = 3983, 
  error_code = 2 '\002', request_code = 25 '\031', minor_code = 0 '\000'}
(gdb) bt
#0  X11Error (display=0x7f7ff7b40000, event=0x7f7fffff5570)
    at /usr/pkgobj/devel/xulrunner/work/mozilla-release/toolkit/xre/nsX11ErrorHandler.cpp:20
#1  0x00007f7ff0074610 in _XError () from /usr/X11R7/lib/libX11.so.7
#2  0x00007f7ff004b0d7 in ?? () from /usr/X11R7/lib/libX11.so.7
#3  0x00007f7ff004b109 in ?? () from /usr/X11R7/lib/libX11.so.7
#4  0x00007f7ff004b6e3 in _XEventsQueued () from /usr/X11R7/lib/libX11.so.7
#5  0x00007f7ff0074ac5 in _XData32 () from /usr/X11R7/lib/libX11.so.7
#6  0x00007f7ff0804448 in XRenderAddGlyphs ()
   from /usr/X11R7/lib/libXrender.so.2
#7  0x00007f7ff0c872d9 in composite_glyphs () from /usr/pkg/lib/libcairo.so.2
#8  0x00007f7ff0c70b1a in clip_and_composite () from /usr/pkg/lib/libcairo.so.2
#9  0x00007f7ff0c70d4d in _cairo_traps_compositor_glyphs ()
(Continue reading)

Chris Wilson | 25 Oct 10:59 2012
Picon

Re: Firefox failure with cairo 1.12.6 on NetBSD-current amd64

On Wed, 24 Oct 2012 15:39:44 +0200, Martin Husemann <martin <at> duskware.de> wrote:
> Hi folks,
> 
> pkgsrc recently updated cairo to version 1.12.6 and that causes my firefox
> to crash at startup with:
> 
> ###!!! ABORT: X_SendEvent: BadValue (integer parameter out of range for operation); 494 requests ago:
file /usr/pkgobj/devel/xulrunner/work/mozilla-release/toolkit/xre/nsX11ErrorHandler.cpp,
line 157

This is the error that Soren predicted - BadVale of 205 corresponds to
the ShmCompletionEvent of 77 | 0x80.

Can you please take a look at src/cairo-xlib-surface-shm.c,
xorg_has_buggy_send_shm_completion_event() and add a necessary clause to
detect your XServer? Or attach your xdpyifo?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
--

-- 
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo

Uli Schlachter | 25 Oct 16:09 2012
Picon

Re: Firefox failure with cairo 1.12.6 on NetBSD-current amd64

Hi,

On 25.10.2012 10:59, Chris Wilson wrote:
> On Wed, 24 Oct 2012 15:39:44 +0200, Martin Husemann <martin <at> duskware.de> wrote:
>> pkgsrc recently updated cairo to version 1.12.6 and that causes my firefox
>> to crash at startup with:
>>
>> ###!!! ABORT: X_SendEvent: BadValue (integer parameter out of range for operation); 494 requests ago:
file /usr/pkgobj/devel/xulrunner/work/mozilla-release/toolkit/xre/nsX11ErrorHandler.cpp,
line 157
> 
> This is the error that Soren predicted - BadVale of 205 corresponds to
> the ShmCompletionEvent of 77 | 0x80.
> 
> Can you please take a look at src/cairo-xlib-surface-shm.c,
> xorg_has_buggy_send_shm_completion_event() and add a necessary clause to
> detect your XServer? Or attach your xdpyifo?

Chris, what do you think about the following alternative:

Instead of guessing, we should test the X11 server. When the
cairo_xlib_display_t is created, cairo once sends a SHMCompletion event to
itself and checks if it works (similar to how XShmAttach is already tested,
possibly even in the same function, can_use_shm()).

I feel bad for not attaching a patch to this mail, but I don't have the time
right now. So if anyone thinks that this might be a good idea and would like to
implement it, feel free.

Cheers,
(Continue reading)

Chris Wilson | 26 Oct 10:49 2012
Picon

Re: Firefox failure with cairo 1.12.6 on NetBSD-current amd64

On Thu, 25 Oct 2012 16:09:42 +0200, Uli Schlachter <psychon <at> znc.in> wrote:
> Hi,
> 
> On 25.10.2012 10:59, Chris Wilson wrote:
> > On Wed, 24 Oct 2012 15:39:44 +0200, Martin Husemann <martin <at> duskware.de> wrote:
> >> pkgsrc recently updated cairo to version 1.12.6 and that causes my firefox
> >> to crash at startup with:
> >>
> >> ###!!! ABORT: X_SendEvent: BadValue (integer parameter out of range for operation); 494 requests
ago: file
/usr/pkgobj/devel/xulrunner/work/mozilla-release/toolkit/xre/nsX11ErrorHandler.cpp, line 157
> > 
> > This is the error that Soren predicted - BadVale of 205 corresponds to
> > the ShmCompletionEvent of 77 | 0x80.
> > 
> > Can you please take a look at src/cairo-xlib-surface-shm.c,
> > xorg_has_buggy_send_shm_completion_event() and add a necessary clause to
> > detect your XServer? Or attach your xdpyifo?
> 
> Chris, what do you think about the following alternative:
> 
> Instead of guessing, we should test the X11 server. When the
> cairo_xlib_display_t is created, cairo once sends a SHMCompletion event to
> itself and checks if it works (similar to how XShmAttach is already tested,
> possibly even in the same function, can_use_shm()).

I like it, I'm just not sure if X always sends an error back. The commit
that fixed xorg-1.11.4 seemed to imply that X itself died...

The alternative is that we just whitelist servers that are known to
(Continue reading)

Martin Husemann | 26 Oct 11:57 2012
Picon

Re: Firefox failure with cairo 1.12.6 on NetBSD-current amd64

On Fri, Oct 26, 2012 at 09:49:39AM +0100, Chris Wilson wrote:
> I like it, I'm just not sure if X always sends an error back. The commit
> that fixed xorg-1.11.4 seemed to imply that X itself died...

The X server continues to run, but the app is killed hard.

Martin
--

-- 
cairo mailing list
cairo <at> cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo

Martin Husemann | 25 Oct 21:30 2012
Picon

Re: Firefox failure with cairo 1.12.6 on NetBSD-current amd64

On Thu, Oct 25, 2012 at 09:59:26AM +0100, Chris Wilson wrote:
> Can you please take a look at src/cairo-xlib-surface-shm.c,
> xorg_has_buggy_send_shm_completion_event() and add a necessary clause to
> detect your XServer? Or attach your xdpyifo?

Thanks for quick reply and pointer to easy solution - I mixed it with the
bzero Thomas just reported (haven't tried individually yet), and sure enough
this makes it work again.

Our server identifies as:

version number:    11.0
vendor string:    The Xorg Foundation
vendor release number:    11003000

Martin
--- src/cairo-xlib-surface-shm.c.orig	2012-10-21 10:13:41.000000000 +0200
+++ src/cairo-xlib-surface-shm.c	2012-10-25 21:11:57.000000000 +0200
 <at>  <at>  -1021,6 +1021,7  <at>  <at>  _cairo_xlib_shm_surface_mark_active (cai
     cairo_xlib_display_t *display = (cairo_xlib_display_t *) _shm->device;
     XShmCompletionEvent ev;

+    bzero(&ev, sizeof(ev));
     ev.type = display->shm->event;
     ev.drawable = display->shm->window;
     ev.major_code = display->shm->opcode;
 <at>  <at>  -1141,7 +1142,8  <at>  <at>  xorg_has_buggy_send_shm_completion_event
      *
(Continue reading)

Chris Wilson | 26 Oct 12:02 2012
Picon

Re: Firefox failure with cairo 1.12.6 on NetBSD-current amd64

On Thu, 25 Oct 2012 21:30:00 +0200, Martin Husemann <martin <at> duskware.de> wrote:
> On Thu, Oct 25, 2012 at 09:59:26AM +0100, Chris Wilson wrote:
> > Can you please take a look at src/cairo-xlib-surface-shm.c,
> > xorg_has_buggy_send_shm_completion_event() and add a necessary clause to
> > detect your XServer? Or attach your xdpyifo?
> 
> Thanks for quick reply and pointer to easy solution - I mixed it with the
> bzero Thomas just reported (haven't tried individually yet), and sure enough
> this makes it work again.
> 
> Our server identifies as:
> 
> version number:    11.0
> vendor string:    The Xorg Foundation
> vendor release number:    11003000

Hmm, that should have been caught by the existing Xorg blacklist. Do you
mind seeing where I made my mistake?

In the meantime, I've applied Uli's suggestion and perform an explicit
test in case X generates a BadValue error when we try to use XSendEvent.

Which is the bzero issue? I don't recall seeing that...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
--

-- 
cairo mailing list
cairo <at> cairographics.org
(Continue reading)


Gmane