Bug 590612 - [abrt] crash in ibus-anthy- engine.py:691:__update_anthy_convert_chars:IndexError: list index out of range
[abrt] crash in ibus-anthy- engine.py:691:__update_anth...
Product: Fedora
Classification: Fedora
Component: ibus-anthy (Show other bugs)
i686 Linux
low Severity medium
: ---
: ---
Assigned To: fujiwara
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2010-05-10 06:19 EDT by tk01
Modified: 2010-07-01 00:52 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-01 00:52:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
File: backtrace (755 bytes, text/plain)
2010-05-10 06:19 EDT, tk01
no flags Details

  None (edit)
Description tk01 2010-05-10 06:19:25 EDT
abrt 1.0.9 detected a crash.

architecture: i686
cmdline: python /usr/share/ibus-anthy/engine/main.py --ibus
component: ibus-anthy
executable: /usr/share/ibus-anthy/engine/main.py
package: ibus-anthy-
reason: engine.py:691:__update_anthy_convert_chars:IndexError: list index out of range
release: Fedora release 12 (Constantine)

engine.py:691:__update_anthy_convert_chars:IndexError: list index out of range

Traceback (most recent call last):
  File "/usr/share/ibus-anthy/engine/engine.py", line 706, in __update
  File "/usr/share/ibus-anthy/engine/engine.py", line 628, in __update_convert_chars
  File "/usr/share/ibus-anthy/engine/engine.py", line 691, in __update_anthy_convert_chars
    pos, pos + len(self.__segments[self.__cursor_pos][1])))
IndexError: list index out of range

Local variables in innermost frame:
i: 0
text: u'\u5148\u751f\u3092'
self: <Engine object at 0xb5e5bc5c (PYIBusObject at 0x977c2a0)>
pos: 3
attrs: <AttrList object at 0xb5e6cf04 (PYIBusAttrList at 0x977c300)>
seg_index: 0
Comment 1 tk01 2010-05-10 06:19:27 EDT
Created attachment 412785 [details]
File: backtrace
Comment 2 fujiwara 2010-05-10 22:09:40 EDT
How do you reproduce your problem?
I cannot reproduce it.

From your stack, I created the following test case:

% cat test.py
# -*- coding: utf-8 -*-

def __update_anthy_convert_chars(__cursor_pos):
    __convert_chars = u""
    pos = 0
    __segments = list()
    __segments.append((0, u"\u5148\u751f\u3092"))
    __segments.append((0, u"\u5148\u751f\u3092"))
    for i, (seg_index, text) in enumerate(__segments):
        __convert_chars += text
        if i < __cursor_pos:
            pos + len(text)
    print "i =", i
    print "text =", text
    print "pos =", pos
    print "seg_index =", seg_index
    print "__cursor_pos =", __cursor_pos
    print "len =", len(__segments)
    print __segments[__cursor_pos]

def main():
    print "#### possible situation"
    #print "#### impossible situation"


% python test.py

If I commented out the two lines of impossible situation in the script, I could see the same error.
But I think the '__cursor_pos' value is always within __segments[].
So I need to know how to reproduce your problem.

Maybe you typed something, something, "senseino", something..., moved the cursor with a special way and typed space key.

I tested several ways but the cursor position is always within the preedit segments and cannot reproduce your problem.
If I will add 'if self.__cursor_pos >= len(__segments):', the main problem will be fixed but I think the root cause should be fixed instead.
Comment 3 fujiwara 2010-05-10 22:13:17 EDT
Also your version ibus-anthy- is slightly old.
I'd ask if you can reproduce your problem with the latest ibus-anthy.

# yum install ibus-anthy
Comment 4 fujiwara 2010-05-13 21:05:38 EDT

Do you have any responses?
I'd like to close this as WORKSFORME.

Note You need to log in before you can comment on or make changes to this bug.