discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linux-x86-64 and cairo crash


From: Eric Wasylishen
Subject: Re: Linux-x86-64 and cairo crash
Date: Mon, 12 Sep 2011 13:17:30 -0600

Hi Riccardo,

On 2011-09-12, at 12:25 PM, Riccardo Mottola wrote:

> Hi Eric,
> 
> Eric Wasylishen wrote:
>> Hm..
>> The segfault in cairo_get_target is probably coming from passing NULL to 
>> that function. I made an adjustment to drawGState so it won't call 
>> cairo_get_target until after checking that the cairo context is non-NULL.
>> 
>> The thing I don't understand is "invalid value for stride" error. I attached 
>> a patch to apply to back which should print a warning at the source of the 
>> "invalid value for stride"… hopefully that narrows it down. btw, I tried but 
>> wasn't able to reproduce this on my x86-64 linux system with a 16-bit Xephyr 
>> display :-(
>>   
> With your patch, the result is the one pasted below. Interestingly, the 
> behaviour of the application Ink changed: it doesn't crash anymore, but it 
> displays a big black window as the document window and a black rect for the 
> menu with some garbage pixels in it. The menu is "responsive". I could even 
> quit.

Ok, well, at least the crash is gone. :-)

> 
> I can give acceso to this machien, but the display is not local, but 
> exported... this means that if you export it to your machine the problem will 
> not reproduce. I would need to start up both the X client and X server 
> machine. Possible, but I prefer to do it on a specified time/moment.

Based on what Fred said, it looks like the design of XGCairoXImageSurface is 
flawed and won't work on 16-bit displays. (But did it work for you in the 
past?) 

One thing you could try is switch to XGCairoSurface. In CairoContext.m, just 
adjust the comments so you have:
#    define _CAIRO_SURFACE_CLASSNAME XGCairoSurface

This will create a cairo xlib surface for the window buffer, instead of a cairo 
image surface. Interestingly enough it seems to work for me - I don't think it 
worked a few months ago.

as an aside, I would like to switch to XGCairoSurface by default at some point, 
rather than fixing XGCairoXImageSurface. It would have a number of benefits, 
like:
- enables subpixel antialising for fonts
- removes the need for using shared memory for the window buffer for good 
performance (from what I understand, cairo will automatically use shm to 
transfer bitmaps to the x server when needed).
- it may allow hardware acceleration for some operations?

Eric

> Riccardo
> 
> (moria:~) multix% Ink
> 2011-09-12 18:24:27.305 Ink[2906] No local time zone specified.
> 2011-09-12 18:24:27.305 Ink[2906] Using time zone with absolute offset 0.
> 2011-09-12 18:24:27.304 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:27.314 Ink[2906] XShm not supported, XShmAttach() failed.
> 2011-09-12 18:24:27.314 Ink[2906] Falling back to normal XImage (will be 
> slower).
> 2011-09-12 18:24:27.314 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:27.315 Ink[2906] The font specified for NSFont, FreeSans, 
> can't be found.
> 2011-09-12 18:24:27.355 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:27.357 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.361 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:27.364 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.419 Ink[2906] The font specified for NSFont, FreeSans, 
> can't be found.
> 2011-09-12 18:24:27.437 Ink[2906] The font specified for NSFont, FreeSans, 
> can't be found.
> 2011-09-12 18:24:27.443 Ink[2906] The font specified for NSFont, FreeSans, 
> can't be found.
> 2011-09-12 18:24:27.443 Ink[2906] The font specified for NSFont, FreeSans, 
> can't be found.
> 2011-09-12 18:24:27.628 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:27.634 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:27.637 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.637 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.637 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.637 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.638 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.638 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:27.760 Ink[2906] The font specified for NSFont, FreeSans, 
> can't be found.
> 2011-09-12 18:24:27.770 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:29.832 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.835 Ink[2906] Cairo status 'invalid value for stride' in 
> DPSinitgraphics
> 2011-09-12 18:24:29.838 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.840 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.840 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.840 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.841 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.841 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:29.841 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:30.655 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:30.656 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:30.656 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:30.656 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:30.656 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 2011-09-12 18:24:30.657 Ink[2906] WARNING: -drawGState called with a NULL 
> target context ((null)) or source context ((null))
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]