Bug 1704156

Summary: [abrt] ibus-m17n: m17n_object_unref(): ibus-engine-m17n killed by SIGSEGV
Product: [Fedora] Fedora Reporter: Fatmice <rdirective>
Component: ibus-m17nAssignee: Mike FABIAN <mfabian>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: hacrot3000, i18n-bugs, mfabian, pnemade, shawn.p.huang
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/aae39bbd01fee92c4bda4e1d621c1e13a1c1d64e
Whiteboard: abrt_hash:4b1ea4bae35844c156898b862e03cf9cd449a4ca;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-10 00:47:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: cpuinfo
none
File: dso_list
none
File: environ
none
File: exploitable
none
File: limits
none
File: maps
none
File: mountinfo
none
File: open_fds
none
File: proc_pid_status
none
typing-booster-vi-telex.png
none
Fix-segmentation-fault-when-using-ibus-m17n-with-vi-telex-in-gedit-in-wayland.patch none

Description Fatmice 2019-04-29 08:48:35 UTC
Description of problem:
I was trying to type some Vietnamese text in Gnome Text-Editor through Vietnamese(telex(m17n)) input.  There was a notification that m17n crashed following completion of the first word and hitting spacebar.  I did not encounter such a crash while typing Vietnamese at Gnome Terminal or while using vim.

Version-Release number of selected component:
ibus-m17n-1.4.1-1.fc29

Additional info:
reporter:       libreport-2.10.0
backtrace_rating: 4
cmdline:        /usr/libexec/ibus-engine-m17n --ibus
crash_function: m17n_object_unref
executable:     /usr/libexec/ibus-engine-m17n
journald_cursor: s=19398682d6cf44d887f8be3b65f5a979;i=4a2c2;b=0f26bd5cf96a4178810f20ab364d8495;m=1640596f9;t=587a72cf11209;x=43dc55abbb3f7630
kernel:         5.0.9-200.fc29.x86_64
rootdir:        /
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 m17n_object_unref at m17n-core.c:933
 #1 ibus_m17n_engine_callback at engine.c:1041
 #2 minput_callback at input.c:6949
 #3 get_surrounding_text at input.c:605
 #4 get_preceding_char at input.c:645
 #5 integer_value at input.c:754
 #6 resolve_expression at input.c:808
 #7 take_action_list at input.c:3480
 #8 handle_key at input.c:3619
 #9 filter at input.c:4205

Comment 1 Fatmice 2019-04-29 08:48:37 UTC
Created attachment 1559815 [details]
File: backtrace

Comment 2 Fatmice 2019-04-29 08:48:37 UTC
Created attachment 1559816 [details]
File: cgroup

Comment 3 Fatmice 2019-04-29 08:48:38 UTC
Created attachment 1559817 [details]
File: core_backtrace

Comment 4 Fatmice 2019-04-29 08:48:39 UTC
Created attachment 1559818 [details]
File: cpuinfo

Comment 5 Fatmice 2019-04-29 08:48:40 UTC
Created attachment 1559819 [details]
File: dso_list

Comment 6 Fatmice 2019-04-29 08:48:41 UTC
Created attachment 1559820 [details]
File: environ

Comment 7 Fatmice 2019-04-29 08:48:42 UTC
Created attachment 1559821 [details]
File: exploitable

Comment 8 Fatmice 2019-04-29 08:48:43 UTC
Created attachment 1559822 [details]
File: limits

Comment 9 Fatmice 2019-04-29 08:48:43 UTC
Created attachment 1559823 [details]
File: maps

Comment 10 Fatmice 2019-04-29 08:48:44 UTC
Created attachment 1559824 [details]
File: mountinfo

Comment 11 Fatmice 2019-04-29 08:48:45 UTC
Created attachment 1559825 [details]
File: open_fds

Comment 12 Fatmice 2019-04-29 08:48:45 UTC
Created attachment 1559826 [details]
File: proc_pid_status

Comment 13 Mike FABIAN 2019-04-29 17:45:10 UTC
The problem occurs only in Gnome Wayland, not in Gnome Xorg.

Probably because surrounding text does not work correctly in Gnome Wayland, see: https://bugzilla.redhat.com/show_bug.cgi?id=1625626

Comment 14 Mike FABIAN 2019-04-29 18:00:12 UTC
*** Bug 1702937 has been marked as a duplicate of this bug. ***

Comment 15 Mike FABIAN 2019-04-29 18:02:26 UTC
Created attachment 1560013 [details]
typing-booster-vi-telex.png

As a workaround, you can use ibus-typing-booster with the setting as shown in this screenshot. In ibus-typing-booster, the vi-telex input method works both in Gnome Wayland and Gnome Xorg.

Comment 16 Fatmice 2019-04-30 04:17:35 UTC
Yes the workaround does work.  Is there a reason why the bug only manifested itself outside of Gnome Terminal while under Wayland?  Should I close this bug report given that the workaround?

Comment 17 Mike FABIAN 2019-04-30 07:40:19 UTC
I think Gnome Terminal does not support surrounding text. Gedit claims to support surrounding text, but under Wayland it doesn’t work right. Of course, ibus-m17n should not crash in these conditions, it should work around it somehow. As ibus-typing-booster works even in gedit in Gnome Wayland, it should be possible to make a workaround for ibus-m17n as well.

Comment 18 Fatmice 2019-04-30 09:12:53 UTC
Please excuse my ignorance but I don't know the practical meaning of "surrounding text".  I do know that Vietnamese(telex(m17n)) input does work under wayland but only while within gnome terminal or in a vim session.  I assume it should also work within a screen session but I haven't tried.  Below are two clips attesting to that claim.  Your workaround works in all situations (thank you) although the dictionary lookup is a tad slow but that is not a problem.  I usually prefer the m17n as it is quicker if I need to type up a small paragraph, which can just be done within vim.

Gnome-terminal: https://streamable.com/4o7yb
Vim: https://streamable.com/q0sa3

Comment 19 Mike FABIAN 2019-04-30 09:25:13 UTC
"Surrounding text" means that the input method can ask the application what text is already there in the application. I.e. the input method can ask gedit what text is already there in the line one is typing in and even modify that already existing text. This feature can be helpful in some cases. Some input methods  like ibus-m17n and ibus-typing-booster try to use that feature. They first check if the application currently typed into supports this feature or not. In case of gnome-terminal, this feature is not supported, so ibus-m17n and ibus-typing-booster try to work without it. But in case  of gedit, the check returns  that  this feature *is* supported, so ibus-m17n and ibus-typing-booster try to use it. In case  of gedit running  in  Gnome under Xorg this is no problem because in that case surrounding text actually works. But in case of gedit running in Gnome under Wayland, the surrounding text feature is broken. 
  
See for example this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1625626

That this surrounding feature is broken does not necessarily mean that the input method crashes, in case of ibus-typing-booster input using vi-telex works nevertheless (maybe just by accident, but it happens to work). But in case  of ibus-m17n, the broken surrounding text support in Gnome Wayland causes a crash.

Comment 20 Mike FABIAN 2019-04-30 09:30:31 UTC
(In reply to Fatmice from comment #18)
 
> Below are two clips attesting to that claim.  Your workaround works in all
> situations (thank you) although the dictionary lookup is a tad slow but that
> is not a problem.

You may avoid the  dictinary lookup by using the option "Enable suggestions by key (Default is Tab key)"  in ibus-typing-booster. If that option is used, dictionary lookups are not done until you press the Tab key. That way you can have higher speed if you don't need the dictionary lookups but can still try to complete a word from the dictionary by typing Tab if it makes sense for that word. 

If you never ever want any dictionary lookups, you could use the option "Enable suggestions by key (Default is Tab key)" *and* go to the key bindings settings and set the key binding for the "enable_lookup" command to empty.

Comment 21 Mike FABIAN 2019-04-30 09:31:52 UTC
Created attachment 1560207 [details]
Fix-segmentation-fault-when-using-ibus-m17n-with-vi-telex-in-gedit-in-wayland.patch

Patch to fix the crash in m17n-lib.

Comment 22 Fedora Update System 2019-04-30 10:35:28 UTC
m17n-lib-1.8.0-5.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-bebe0df670

Comment 23 Fedora Update System 2019-04-30 10:35:56 UTC
m17n-lib-1.8.0-3.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-81623a624c

Comment 24 Fedora Update System 2019-04-30 10:48:03 UTC
m17n-lib-1.8.0-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-15acb7c928

Comment 25 Fedora Update System 2019-05-01 01:43:58 UTC
m17n-lib-1.8.0-5.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-bebe0df670

Comment 26 Fedora Update System 2019-05-01 02:28:20 UTC
m17n-lib-1.8.0-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-15acb7c928

Comment 27 Fedora Update System 2019-05-01 03:21:32 UTC
m17n-lib-1.8.0-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-81623a624c

Comment 28 Fatmice 2019-05-01 13:31:35 UTC
I've tried the patch.  Seems to be working.  I can use telex-m17n now in Gnome Text or LibreOffice.

Comment 29 Mike FABIAN 2019-05-02 08:44:45 UTC
(In reply to Fatmice from comment #28)
> I've tried the patch.  Seems to be working.  I can use telex-m17n now in
> Gnome Text or LibreOffice.

Thank you!

by the way, I am also interested in any feedback about ibus-typing-booster.

Comment 30 Fatmice 2019-05-02 10:54:47 UTC
ibus-typing-booster works great now without the constant dictionary lookup after I've tweaked as you suggested to use only tab for lookup.  I've used ibus-typing-booster with both vni and telex.  The patch has been working without a hitch though it did cause a crash right after patching (sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2019-93e8185425) when it complained about libm17n.so.0.4.2 being deleted...I've been unable to reproduce that crash so maybe it was only a fluke.

Comment 31 Fatmice 2019-05-02 11:01:20 UTC
I meant to say (sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2019-81623a624c) not (sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2019-93e8185425)...The former is yours while the latter is for lifeograph, which I had accidentally copy and pasted.

Comment 32 hacrot3000 2019-05-02 13:26:27 UTC
Thank You for you all when working on this item. I cannot verify but I think it has been fixed on Fedora 30.

Comment 33 Mike FABIAN 2019-05-02 14:39:13 UTC
(In reply to Fatmice from comment #30)
> ibus-typing-booster works great now without the constant dictionary lookup
> after I've tweaked as you suggested to use only tab for lookup.  I've used
> ibus-typing-booster with both vni and telex. 

Great, thank you!

> The patch has been working
> without a hitch though it did cause a crash right after patching (sudo dnf
> upgrade --enablerepo=updates-testing --advisory=FEDORA-2019-93e8185425) when
> it complained about libm17n.so.0.4.2 being deleted...I've been unable to
> reproduce that crash so maybe it was only a fluke.

Yes, probably.

Comment 34 Fedora Update System 2019-05-10 00:47:15 UTC
m17n-lib-1.8.0-5.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 35 Fedora Update System 2019-05-10 01:35:12 UTC
m17n-lib-1.8.0-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 36 Fedora Update System 2019-05-10 02:22:01 UTC
m17n-lib-1.8.0-3.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.