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 346464 - gedit crashes when LDTP gettextproperty is used on text that is underlined in squiggly lines
gedit crashes when LDTP gettextproperty is used on text that is underlined in...
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: atk
unspecified
Other All
: Normal normal
: ---
Assigned To: bill.haneman
bill.haneman
Depends on:
Blocks:
 
 
Reported: 2006-07-03 13:38 UTC by srinivas
Modified: 2006-09-14 10:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description srinivas 2006-07-03 13:38:27 UTC
Please describe the problem:
In gedit, when automatic spell checking is on, misspelled words are underlined with a squiggly red line.. When you try to get properties of such text using gettextproperty() function, gedit crashes.


Steps to reproduce:
1. Enable automatic spell checking in gedit (Enable spell-checker plugin in edit->preferences, and then enable the checking in tools->automatic spell checking).
2. Type some misspelled word like teh. Gedit will underline the word in red
3. Open a python shell, and give the commands from ldtp import * and then gettextproperty('*gedit','txt0',0,2) (assuming you typed teh in a new document.If not, change parameters accordingly)


Actual results:
Gedit crashes, and gettextproperty returns a "Unable to get property"

Expected results:
Some or no output from gettextproperty(Not "unable to get property"). Atleast, gedit should not crash.

Does this happen every time?
Yes, everytime

Other information:
Comment 1 Nagappan Alagappan 2006-07-03 16:20:10 UTC
Srinivas: Attach gedit crash report with debugging symbols.
Comment 2 srinivas 2006-07-11 07:55:24 UTC
My gedit was not compiled with debugging symbols .. Here is the stack trace :
http://pastebin.ca/84711
Comment 3 Nagappan Alagappan 2006-07-11 11:06:23 UTC
Thanks to Srinivas for getting this trace:

Thread 1 (process 7164)

  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #2 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #3 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #4 g_log
    from /usr/lib/libglib-2.0.so.0
  • #5 g_assert_warning
    from /usr/lib/libglib-2.0.so.0
  • #6 atk_text_attribute_get_value
    at atktext.c line 1132
  • #7 gail_misc_add_to_attr_set
    from /usr/lib/libgailutil.so.17
  • #8 gail_misc_buffer_get_run_attributes
    from /usr/lib/libgailutil.so.17
  • #9 gail_text_view_new
    from /usr/lib/gtk-2.0/modules/libgail.so
  • #10 atk_text_get_run_attributes
    at atktext.c line 612
  • #11 impl_getAttributes
    at text.c line 302
  • #12 _ORBIT_skel_small_Accessibility_Text_getAttributes
  • #13 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #14 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #15 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #16 ORBit_POAObject_post_invoke
    from /usr/lib/libORBit-2.so.0
  • #17 ORBit_POAObject_post_invoke
    from /usr/lib/libORBit-2.so.0
  • #18 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #19 ORBit_handle_request
    from /usr/lib/libORBit-2.so.0
  • #20 giop_connection_handle_input
    from /usr/lib/libORBit-2.so.0
  • #21 link_connection_set_max_buffer
    from /usr/lib/libORBit-2.so.0
  • #22 link_servers_move_io_T
    from /usr/lib/libORBit-2.so.0
  • #23 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #24 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #25 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #26 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #27 main

Comment 4 Nagappan Alagappan 2006-07-14 07:11:36 UTC
Steps to reproduce the bug using LDTP scripts:

from ldtp import *
selectmenuitem ('*-gedit', 'mnuEdit;mnuPreferences')
waittillguiexist ('dlgPreferences')
selecttab ('dlgPreferences', 'ptl0', 'Plugins')
checkrow ('dlgPreferences', 'tbl1', 9) # Assuming that 'Spell Checker' is 10th plugin
click ('dlgPreferences', 'btnClose')
waittillguinotexist ('dlgPreferences')
menucheck ('*-gedit', 'mnuTools;mnuAutocheckSpelling')
settextvalue ('*-gedit', 'txt0', 'catchbugs byusing ldtp')
gettextproperty('*gedit','txt0',0,8)

To install LDTP package:
http://ldtp.freedesktop.org/wiki/Downloads
Comment 5 bill.haneman 2006-07-14 09:40:30 UTC
>settextvalue ('*-gedit', 'txt0', 'catchbugs byusing ldtp')
>gettextproperty('*gedit','txt0',0,8)

Nagappan, can you explain the last two lines?  I don't know what API calls this corresponds to (i.e. what settextvalue is doing).  Knowing that will help me evaluate whether the assertion is correct.
Comment 6 Nagappan Alagappan 2006-07-14 10:03:06 UTC
Bill:

settextvalue function internally calls Accessible_isEditableText and if its true, AccessibleEditableText_setTextContents function is called.

In gettextproperty, AccessibleText_getAttributes function is called to get the text properties.

Additional info:
  We have added this comment in our code.
        /* AccessibleText_getAttributes doesn't seem to be taking the
        end position i.e. the diff value into account. It only checks
        from the start position */
  So, we are calling this way
text_prop = AccessibleText_getAttributes (accessibleText, start_pos, &zero, &diff);
Here,
start_pos = zero = 0; end position is 8 with this example.
diff = end_pos - start_pos;
Comment 7 Paolo Borelli 2006-08-17 20:40:54 UTC
This doesn't look like gedit fault. Moving to atk.
Comment 8 bill.haneman 2006-09-14 10:36:47 UTC
Found the problem; it turns out that ATK checks the value of the underline attribute in GTK+.  Current code throws assert if PANGO_UNDERLINE_ERROR is found, but PANGO_UNDERLINE_ERROR doesn't mean "error condition hit" but rather means "underline style used to indicate possible error", i.e. mis-spelled word.

Fixing in cvs.