discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Interesting error in GWorkspace


From: Riccardo Mottola
Subject: Re: Interesting error in GWorkspace
Date: Fri, 09 Sep 2011 13:13:02 +0200
User-agent: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.2.17) Gecko/20110601 Lightning/1.0b3pre Lanikai/3.1.10

Hi,

some updates

On 09/08/11 21:04, Eric Wasylishen wrote:
I added two extra checks: one against creating a NSCachedImageRep with a size 
of zero (it looks like that is where the NSView with size 0,0 was coming from), 
and a check against locking focus on an image with a size of 0,0.

Maybe those will help isolate the problem a bit..

Actually, I just looked at Dock.m:

- (void)setBackImage
{
   NSImage *image = [[manager desktopView] backImage];
   int i;

   DESTROY (backImage);

   if (image) {
     NSRect r = [self bounds];

     backImage = [[NSImage alloc] initWithSize: r.size];
     [backImage lockFocus];
     [image compositeToPoint: NSZeroPoint
                    fromRect: r
                   operation: NSCompositeCopy];

I bet "r" has a size of (0, 0).. I wonder why the bounds would be zero?

The exceptions in the console are now more terse after your fix.

2011-09-09 10:07:12.568 GWorkspace[2677] Problem posting notification: <NSException: 0xb9eab664> NAME:NSInvalidArgumentException REASON:NSCachedImageRep created with size {width = -1.49882; height = 1.28695e-41} pixelsWide -1 pixelsHigh 0 INFO:(null)

a negative width and a near-zero height :)

Except wondering why "problem posting" the contents is bad.

Now I can see the dock, I attach a screen shot. It seems that the dock has a reasonable width/height as expected (Everything worked here before my departure in August...) and some icons are drawn on top of each other. I smell something dishy but difficult to understand what.

I put a breakpoint in Dock.m. Interestingly, I never break into line 419, but I put it in 412.

At the first occurrence,
(gdb) p r
$3 = {origin = {x = 0, y = 0}, size = {width = 64, height = 192}}

It is also the only run I get in that breakpoint. Thus it is not caused by r = 0.
backImage gets alloc'd... and then te lock gets called.

I tried stepping through:

(gdb) finish
Run till exit from #0  0xbb8ac305 in -[NSImage lockFocusOnRepresentation:] (
    self=0xb901a674, _cmd=0xbba8bc98, imageRep=0x0) at NSImage.m:1063

2011-09-09 13:11:03.790 GWorkspace[1942] Problem posting notification: <NSException: 0xb901d9a4> NAME:NSInvalidArgumentException REASON:NSCachedImageRep created with size {width = -0.00359415; height = 1.28695e-41} pixelsWide 0 pixelsHigh 0 INFO:(null)
2011-09-09 13:11:05.728 GWorkspace[1942] Unable to obtain lock (null)

So it appears that the image is alloc'd but at least one representation is invalid (imageRep=0x0) and we are calling a lock on it.

Riccardo

Attachment: broken_dock.gif
Description: GIF image


reply via email to

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