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 354230 - gail_window_get_index_in_parent will crash if root is not GAIL_TOPLEVEL
gail_window_get_index_in_parent will crash if root is not GAIL_TOPLEVEL
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: gail
git master
Other All
: Normal critical
: ---
Assigned To: bill.haneman
bill.haneman
Depends on:
Blocks:
 
 
Reported: 2006-09-04 06:56 UTC by Ginn Chen
Modified: 2006-09-12 17:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
workaround the crash (758 bytes, patch)
2006-09-04 07:07 UTC, Ginn Chen
needs-work Details | Review
patch to fix crash and implement method for non-GailToplevel implementations (1.35 KB, patch)
2006-09-12 17:46 UTC, bill.haneman
committed Details | Review

Description Ginn Chen 2006-09-04 06:56:43 UTC
Steps to reproduce:
1. Open LSR behind and start Firefox
2. Use File->Open File or File->Save page as in Firefox to popup file-picker
3. Close the file-picker.
4. Firefox will crash.

See also https://bugzilla.mozilla.org/show_bug.cgi?id=348898

Stack trace:
Stack trace is as follows:

  • #0 g_list_index
    from /usr/lib/libglib-2.0.so.0
  • #1 gail_window_new
    from /usr/lib/gtk-2.0/modules/libgail.so
  • #2 atk_object_get_index_in_parent
    from /usr/lib/libatk-1.0.so.0
  • #3 spi_accessible_new
    from /usr/lib/libspi.so.0
  • #4 _ORBIT_skel_small_Accessibility_Accessible_getIndexInParent
    from /usr/lib/libspi.so.0

Other information:
Firefox uses native GTK+2 file-picker, which accessible is created by libgail.
LSR trys to call get_index_in_parent, but the root accessible of Firefox is *not* managed by libgail.
The root can not be casted to GailToplevel, not doesn't have a window_list member.
Comment 1 Ginn Chen 2006-09-04 07:07:10 UTC
Created attachment 72182 [details] [review]
workaround the crash

If we really want to get the correct index, we can traversal its parent's children.
But I don't know if we need to do so.

Anyway, we should not crash it.
Comment 2 bill.haneman 2006-09-08 16:20:21 UTC
Ginn: 

I am not sure why mozilla doesn't re-use GailToplevel here.  Since you do use libgail for some things, why not derive the mozilla toplevel class from GailTopLevel?

I expect other problems if atk_object_get_root isn't a GailToplevel, don't you need to keep a window list in your root object?
Comment 3 bill.haneman 2006-09-08 16:23:14 UTC
also Ginn - minor problem, your patch isn't ANSI C compliant since it adds logic before the declaration of 'toplevel'.
Comment 4 Ginn Chen 2006-09-10 05:01:43 UTC
Bill:

Currently, mozilla doesn't include gail headers.
So the mozilla toplevel class doesn't derive GailTopLevel.
It has an array for the window list.

Perhaps we can let it use GailTopLevel in the future.

Thanks for your help!
Comment 5 bill.haneman 2006-09-11 12:28:38 UTC
Why not just use the existing atk_object_get_root from gail?  Is it because you need to override the atk_object_ref_child implementation for it?

Comment 6 Ginn Chen 2006-09-12 09:34:17 UTC
(In reply to comment #5)
> Why not just use the existing atk_object_get_root from gail?  Is it because you
> need to override the atk_object_ref_child implementation for it?
> 

Correct.

For mozilla window, we creates mozilla accessible instead of gail window.
We need to make it a child of the root.
Comment 7 bill.haneman 2006-09-12 17:46:22 UTC
Created attachment 72631 [details] [review]
patch to fix crash and implement method for non-GailToplevel implementations
Comment 8 bill.haneman 2006-09-12 17:51:28 UTC
Thanks for the bug report Ginn.  Please reopen if this doesn't solve your problem.