Bug 590612 - [abrt] crash in ibus-anthy- engine.py:691:__update_anthy_convert_chars:IndexError: list index out of range
Summary: [abrt] crash in ibus-anthy- engine.py:691:__update_anth...
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus-anthy
Version: 12
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: fujiwara
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:8a0d316c
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-10 10:19 UTC by tk01
Modified: 2010-07-01 04:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-07-01 04:52:47 UTC
Type: ---

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

Description tk01 2010-05-10 10:19:25 UTC
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 10:19:27 UTC
Created attachment 412785 [details]
File: backtrace

Comment 2 fujiwara 2010-05-11 02:09:40 UTC
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-11 02:13:17 UTC
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-14 01:05:38 UTC

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.