After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664822 - gnome-shell crashes often when an AT is launched
gnome-shell crashes often when an AT is launched
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-atk
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
Depends on:
Blocks:
 
 
Reported: 2011-11-25 16:04 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2011-11-26 21:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (6.44 KB, text/plain)
2011-11-25 16:04 UTC, Joanmarie Diggs (IRC: joanie)
  Details
Possible fix (2.86 KB, patch)
2011-11-25 19:11 UTC, Mike Gorse
none Details | Review

Description Joanmarie Diggs (IRC: joanie) 2011-11-25 16:04:57 UTC
Created attachment 202142 [details]
backtrace

Steps to reproduce:

1. Launch Accerciser or Orca in gnome-shell
2. If it gnome-shell doesn't crash, repeat step 1

I get a crash at least once per session. Some days I get a crash every few launches of an AT.

(backtrace from coredump attached)
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2011-11-25 16:08:23 UTC
As I mentioned to Joanie via IRC, although crash happens on the bridge, I will try to check if the real problem is any issue with the ATK implementation at clutter/st. Anyway, if any at-spi2-atk expert (Mike?) have any other kind of idea, you are invited to solve it ;)
Comment 2 Mike Gorse 2011-11-25 19:11:47 UTC
Created attachment 202151 [details] [review]
Possible fix

Joanie, could you please try the attached patch and let me know if it fixes the crash? I can't reproduce it, although Matthias mentioned what I think is the same bug.

The code implementing GetItems seems unsafe, now that I look at it--if querying one accessible has the side effect of dereferncing a different accessible, then I'm guessing we might still iterate over the latter accessible, causing a crash if it had been finalized, since the cache only holds a weak reference to it. I saw a similar issue a long time ago with Firefox and calling ref_state_set on an accessible having the side-effect of the accessible's reference count being decremented, since apparently Firefox lazily realized at that point that the accessible had gone away and it could unreference it somewhere, but this would cause a crash when at-spi2-atk tried to query it again in the same function.

So it seems better to ref all accessibles in the cache first.
Comment 3 Joanmarie Diggs (IRC: joanie) 2011-11-26 10:57:00 UTC
(In reply to comment #2)
> Created an attachment (id=202151) [details] [review]
> Possible fix
> 
> Joanie, could you please try the attached patch and let me know if it fixes the
> crash? I can't reproduce it, although Matthias mentioned what I think is the
> same bug.

Mike thanks so much for doing this! I gave it a quick spin and didn't see gnome-shell crash. Yay! :) I'll keep using it over the days to come and let you know if it seems stable (or get you a new backtrace).
Comment 4 Mike Gorse 2011-11-26 21:14:07 UTC
I think that the patch is safe, so I've committed, and I'm marking this resolved. Please re-open if you see it again. I'll probably roll a 2.2.3 of at-spi2-atk soon if you don't see the crash again.