Flash/XComposite crasher in X11
This one has been around for a while: When you enable the XComposite extension in X11 and run your desktop using a 15 or 16bit screen depth, the Flash Player will always crash with this error message:
The fix? It's as simple as prepending this code to the above loop:
The program 'firefox' received an X Window System error.There are two workarounds for this:
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
(Details: serial 115 error_code 8 request_code 143 minor_code 3)
(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 (core dumped)
- Set the screen depth to 24bit. If you have enough VRAM available this is a good move anyway since you'll get much better performance and quality in general when using Flash. Other applications probably also benefit, there should be less color banding in general.
- Set the XLIB_SKIP_ARGB_VISUALS environment variable to 1 in one of your init scripts before X11 is started.
int depth = 0;If XComposite is turned on and your screen depth is 16bit this loop will break when the depth is 32. That depth is used to create the XImage the Flash Player will use for its backbuffer. The actual crash occurs when XPutImage or XShmPutImage is called. At this point X11 will bail out when given an XImage with a depth of 32bit.
int mode = 0;
XVisualInfo vi;
static struct
{
int depth, mode;
} formats[] = {
{ 24, TrueColor},
{ 32, TrueColor},
{ 16, TrueColor},
{ 15, TrueColor},
{ 8, PseudoColor},
{ 0, 0}
};
for (int i=0;formats[i].depth; i++ )
{
if(XMatchVisualInfo(display,
DefaultScreen(display),
formats[i].depth,
formats[i].mode,
&vi;)) {
depth = formats[i].depth;
mode = formats[i].mode;
break;
}
}
The fix? It's as simple as prepending this code to the above loop:
XWindowAttributes attribs;Pretty much every distribution has complained about this issue over the past few years, so I am happy that we finally resolved this for good. Is this fix in the current beta of the Flash Player (9.0.21.55)? No, I just changed this Friday, so you'll have to wait for a newer build. It also needs to go through QE before this change gets the final approval.
if(XGetWindowAttributes(display,window,&attribs;)) {
if(XMatchVisualInfo(display,
DefaultScreen(display),
attribs.depth,
TrueColor,
&vi;) {
depth = attribs.depth;
mode = TrueColor;
}
}
if(!depth){
...
}
Labels: linux bug
2 Comments:
This one didn't affect me, but it's awesome to see bugs get fixed =)
I like articles like this. Thanks!
Post a Comment
<< Home