Bug 1944546

Summary: anthy: missing EOL in records file causes infinite loop
Product: [Fedora] Fedora Reporter: hkoba <buribullet>
Component: anthyAssignee: Akira TAGOH <tagoh>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 39CC: prigupta, tagoh, tfujiwar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description hkoba 2021-03-30 07:21:45 UTC
Description of problem:

I found my anthy-agent always enters an infinite loop over read_1_token().

  (gdb) bt
  #0  0x00007f793aa578d4 in __uflow () from /lib64/libc.so.6
  #1  0x00007f793a996b9d in read_1_token (fp=fp@entry=0x560d0379ca00, eol=eol@entry=0x7ffd2be5e5ec) at record.c:1013
  #2  0x00007f793a9982ab in read_add_row (rsc=<optimized out>, rst=0x560d037ee7d0, fp=0x560d0379ca00) at record.c:1083
  #3  read_1_row (op=0x560d038382d0 "ADD", fp=0x560d0379ca00, rst=0x560d037ee7d0) at record.c:1152
  #4  read_journal_record (rs=rs@entry=0x560d037ee7d0) at record.c:1191
  #5  0x00007f793a999ac4 in anthy_create_record (id=id@entry=0x560d037ede70 "default") at record.c:2064
  #6  0x00007f793a99288d in anthy_dic_set_personality (id=0x560d037ede70 "default") at word_dic.c:730
  #7  0x00007f793aba4183 in get_personality () at context.c:70
  #8  anthy_do_create_context (encoding=1) at context.c:233
  #9  0x00007f793aba38f9 in anthy_create_context () at main.c:149
  #10 0x00007f793abbde75 in enter_conv_state (ictx=0x560d037edbd0) at input.c:233
  #11 0x0000560d023ab824 in dispatch_command (cmd=0x560d037edb40, ictx=0x560d037edbd0) at agent.c:1013
  #12 main_loop () at agent.c:1063
  #13 main (argc=<optimized out>, argv=<optimized out>) at agent.c:1150
  (gdb) 

After some googling, I found this issue in Debian BTS:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777689

I removed ~/.anthy/last-record2_default.utf8 and anthy-agent start working again.

Also, locally applying the patch solved this issue for me.

Version-Release number of selected component (if applicable):

anthy-9100h-39.fc32.x86_64

How reproducible:


Steps to Reproduce:
1. Truncate ~/.anthy/last-record2_default.utf8 to 4096 bytes.
2. Start Emacs and enter some texts for Anthy
3. Enter <SPACE> to transform it.

Alternatively, you can test it from command line:

./anthy-agent <<EOF
henkannnotesuto
(space)
EOF


Actual results:

anthy-agent enters an infinite loop.


Expected results:

Inputs are transformed.

Additional info:

Comment 1 fujiwara 2021-04-06 08:26:18 UTC
I think anthy does not sync the output and this issue always could happen when users kill or shutdown the session suddenly.
Currently ibus-anthy detects the incomplete last-record2_default.utf8 and outputs a warning dialog to delete the file.

anthy is no longer maintained in upstream and it would be good to report the issue to anthy-unicode:
https://github.com/fujiwarat/anthy-unicode

Comment 2 Fedora Program Management 2021-04-29 16:58:33 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Priyam Gupta 2021-05-11 09:30:29 UTC
As discussed with @akira tagoh , moving this to F34

Comment 4 Ben Cotton 2022-05-12 16:36:48 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Ben Cotton 2022-08-09 13:11:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 6 Fedora Release Engineering 2023-08-16 08:07:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.