[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interesting error in GWorkspace
From: |
Eric Wasylishen |
Subject: |
Re: Interesting error in GWorkspace |
Date: |
Sun, 11 Sep 2011 13:01:16 -0600 |
On 2011-09-11, at 10:24 AM, Riccardo Mottola wrote:
> Hi Eric,
>
> On 09/09/11 21:53, Eric Wasylishen wrote:
>> Hi Riccardo,
>> I think I found the problem. Sorry about this, it was a sloppy mistake on my
>> part.
>>
>> When I modified _doImageCache:, I was assuming the rep parameter would be
>> non-nil, so I sent [rep size] to it and used that when setting up the cache.
>> But in fact, the rep parameter is nil when you lock focus on an image with
>> no representations (which the Dock.m code was doing.) I guess we should add
>> a test case for that in the gui test suite, since it would have caught this
>> mistake.
> It works fine for me again!
Great!
> Very good. I wonder why it happened only on certain computers I had...
> actually only on my laptop.
I think it was just a coincidence - the code with the bug was able to handle
[rep size] returning (0, 0), so if rep was nil on platforms where [nil size] is
(0, 0), it would silently work.
I was just thinking a bit how we can detect and avoid mistakes like this in the
future. According to
http://www.gnustep.org/resources/documentation/Developer/Base/ProgrammingManual/manual_2.html#Messages
, the return value of a message send to nil is only defined when the selector
return types is an object.
I wonder if the clang static analyzer can find places where we send a message
returning something other than an object to something that might be nil?
Eric
> My workstation runs a different OS, but still, the same backend and about the
> same setup, with desktop and backdrop.
>
> Good work. With GWorkspace running again I can test the service stuff much
> better now.
>
> Riccardo
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
- Interesting error in GWorkspace, Riccardo Mottola, 2011/09/07
- Re: Interesting error in GWorkspace, Eric Wasylishen, 2011/09/07
- Re: Interesting error in GWorkspace, Riccardo Mottola, 2011/09/07
- Re: Interesting error in GWorkspace, Eric Wasylishen, 2011/09/07
- Re: Interesting error in GWorkspace, Riccardo Mottola, 2011/09/08
- Re: Interesting error in GWorkspace, Eric Wasylishen, 2011/09/08
- Re: Interesting error in GWorkspace, Riccardo Mottola, 2011/09/09
- Re: Interesting error in GWorkspace, Eric Wasylishen, 2011/09/09
- Re: Interesting error in GWorkspace, Riccardo Mottola, 2011/09/11
- Re: Interesting error in GWorkspace,
Eric Wasylishen <=
- Re: Interesting error in GWorkspace, David Chisnall, 2011/09/12