Thanks Ginn for the advice. I've revised the patch

Chris

Ginn Chen wrote:
> It doesn't look right to me.
> If XGetWindowAttributes returns 0, you did 
> meta_error_trap_push_with_return() but not 
> meta_error_trap_pop_with_return().
>
> Shouldn't push and pop be paired?
>
> Ginn
>
> On Apr 29, 2008, at 12:53 PM, C Wang wrote:
>
>> Metacity dump core when remote log in to a Sparc S10 machine from a 
>> Nv 82+ Sparc box, and then run radiance. The root cause is
>> XError occurred when create certain window.
>>
>> This patch add the routine to check the return value of 
>> XGetWindowAttribute, and will make metacity not to dump the core when 
>> XGetWindowAttributes failed. However, the fix is not fix the bug from 
>> the root, we need Xserver people to look at it then.
>>
>> Chris
>>
>> --- core/window.c.old    2008-04-29 12:05:42.314074000 +0800
>> +++ core/window.c    2008-04-29 12:06:50.985668000 +0800
>> @@ -220,10 +220,8 @@
>>
>>   meta_error_trap_push_with_return (display);
>>
>> -  XGetWindowAttributes (display->xdisplay,
>> -                        xwindow, &attrs);
>> -
>> -  if (meta_error_trap_pop_with_return (display, TRUE) != Success)
>> +  if (!XGetWindowAttributes (display->xdisplay,xwindow, &attrs) ||
>> +      (meta_error_trap_pop_with_return (display, TRUE) != Success))
>>     {
>>       meta_verbose ("Failed to get attributes for window 0x%lx\n",
>>                     xwindow);
>
> --------
> Ginn Chen
> Software Engineer, Browser Team
> Sun Microsystems, Inc.
> Phone: x82869 / +86-10-62673869
> Fax: +86-10-62780969
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows.diff
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/jds-review/attachments/20080429/39394832/attachment.bin>

Reply via email to