Re: [g-a-devel]checking Accessible* validity



Hi David,

On Fri, 2002-12-20 at 21:31, David Bolter wrote:
> Yes HEAD at-spi.  It's the only way to go ;-)

	:-) agreed.

> >	It won't solve the immediate issue. I'd recommend trying to binary chop
> >the problem out and/or auditing all cases of Accessible_unref but first
> >hack cspi/spi_main.c and #define DEBUG_OBJECTS which stops at-spi from
> >actually freeing the last ref - if that makes the problem go away - you
> >know you have a ref counting bug ;-) [ having said that we zap the
>
> The problem went away.  I will look into the reference counts (although 
> we already keep a close watch on this programmatically).

	OK - so there is almost certainly an evil reference counting problem
lurking somewhere within either your code or at-spi.

> It would be helpful for me to know the expected behavior for the 
> following situation:
>
> If we (gok) have an Accessible* (call it ac) for gedit's menu object, 
> and from our perspective the reference count is at least 1.  Then gedit 
> dies and we are not aware.  What is the expected behavior if if we 
> subsequently call one of the Accessible_XXXX(ac) methods?

	It depends on the method; eg. we do:

char *
Accessible_getName (Accessible *obj)
{
  char *retval;

  cspi_return_val_if_fail (obj != NULL, NULL);

  retval = Accessibility_Accessible__get_name (CSPI_OBJREF (obj),
cspi_ev ());

  cspi_return_val_if_ev ("getName", NULL); 

  return retval;
}

	the 'return_val_if_ev' occurs if there is an exception, so in that case
you get NULL returned.

>   (I suppose it 
> depends on whether the at-spi is also unaware gedit died.)

	It will always know, but particularly more so when you do a roundtrip
method call.

> Also what if we call these methods with bogus addresses?  E.g. 
> Accessible_getName(0x12345);  What is the expected behavior?

	Where did you get the bogus address from ? it will almost certainly
segv the application; it's not reasonable to make up memory locations
;-)

	The Accessible* will still be valid, and you should still obey the
reference counting semantics even on seemingly 'dead' references, since
you hold a client side resource handle (in real terms).

> thanks very much for your help so far,

	No problem,

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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