clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
518 stars 29 forks source link

ibus-libpinyin can't input any chinese characters in GTK3 apps but works in QT apps #760

Open psun3x opened 5 years ago

psun3x commented 5 years ago

swupd bundle-add desktop

swupd bundle-add devpkg-libpinyin

Go to "Settings"->"Region & Language"->"Language" change to Chinese and add "Chinese(Intelligent Pinyin)" to "Input Sources". Restart Clear Linux OS and open any application with text entries. Switch the input method to "Chinese(Intelligent Pinyin)" and trying to input. Still English characters can be input, but no Chinese characters at all.

ZhongbaoShi commented 5 years ago

The root cause is segfault within libpinyin.so.13.0.0. And, all call back function is related with ibus-engine-libpinyin. This issue need be fixed by upstream. https://github.com/libpinyin/ibus-libpinyin/issues

lebensterben commented 5 years ago

The root cause is segfault within libpinyin.so.13.0.0. And, all call back function is related with ibus-engine-libpinyin. This issue need be fixed by upstream. libpinyin/ibus-libpinyin/issues

Screenshot from 2019-05-21 22-09-12

@psun3x @ZhongbaoShi

The ibus input method is not completely broken, as you can see from the image attached above. Another app in which I am able to type Chinese characters via ibus input method is RStudio.

psun3x commented 5 years ago

The root cause is segfault within libpinyin.so.13.0.0. And, all call back function is related with ibus-engine-libpinyin. This issue need be fixed by upstream. https://github.com/libpinyin/ibus-libpinyin/issues

Thanks for the analysis, could you please show me the call stack of the segfault that you noticed?

ZhongbaoShi commented 5 years ago

Jan 29 13:41:56 mesiment-mobl3.zpn.intel.com dbus-daemon[682]: [system] Activating via systemd: service name='org.freedesktop.locale1' unit='dbus-org.freedesktop.locale1.service' requested by ':1.3420' (uid=1000 pid=7144 comm="gnome-control-center region ") Jan 29 13:41:56 mesiment-mobl3.zpn.intel.com systemd[1]: Starting Locale Service...
Jan 29 13:41:57 mesiment-mobl3.zpn.intel.com dbus-daemon[682]: [system] Successfully activated service 'org.freedesktop.locale1'
Jan 29 13:41:57 mesiment-mobl3.zpn.intel.com systemd[1]: Started Locale Service.
Jan 29 13:42:23 mesiment-mobl3.zpn.intel.com gnome-shell[1244]: Ignoring length property that isn't a number at line 751, col 24
Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com audit[7165]: ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=7165 comm="ibus-engine-lib" exe="/usr/libexec/ibus-engine-libpinyin" sig=11 res=1
Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com kernel: ibus-engine-lib[7165]: segfault at 30 ip 00007f05cb23a931 sp 00007ffd7af50d20 error 4 in libpinyin.so.13.0.0[7f05cb219000+6c000]
Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com kernel: Code: fd ff 48 c7 43 20 00 00 00 00 bf 10 00 00 00 48 89 43 08 e8 71 e9 fd ff ba 0c 00 00 00 be 01 00 00 00 bf 01 00 00 00 49 89 c4 <49> 8b 45 30 49 89 44 24 08 e8 31 e9 fd ff 4c 89 63 28 ba 04 00 00 Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com kernel: audit: type=1701 audit(1548790946.389:25): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=7165 comm="ibus-engine-lib" exe="/usr/libexec/ibus-engine-libpinyin" sig=11 res=1
Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com systemd[1]: Created slice system-systemd\x2dcoredump.slice.
Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com systemd[1]: Started Process Core Dump (PID 7172/UID 0).
Jan 29 13:42:26 mesiment-mobl3.zpn.intel.com systemd[1]: Started Clear Linux debuginfo daemon.
Jan 29 13:42:36 mesiment-mobl3.zpn.intel.com systemd[1]: Started Telemetrics Daemon.
Jan 29 13:42:36 mesiment-mobl3.zpn.intel.com systemd-coredump[7175]: Failed to compress (unnamed temporary file): Protocol not supported
Jan 29 13:42:36 mesiment-mobl3.zpn.intel.com systemd[1]: Started Telemetrics Post Daemon.
Jan 29 13:42:37 mesiment-mobl3.zpn.intel.com systemd-coredump[7175]: Process 7165 (ibus-engine-lib) of user 1000 dumped core.

                                                                 Stack trace of thread 7165:                                                                                                                                             
                                                                 #0  0x00007f05cb23a931 _ZN6pinyin26ForwardPhoneticConstraintsC4EPNS_17FacadePhraseIndexE (libpinyin.so.13)                                                              
                                                                 #1  0x0000000000414ebc n/a (ibus-engine-libpinyin)
                                                                 #2  0x000000000041863b n/a (ibus-engine-libpinyin)                                                                                                                      
                                                                 #3  0x000000000040a367 n/a (ibus-engine-libpinyin)
                                                                 #4  0x00007f05cb44f17f g_object_new_with_custom_constructor (libgobject-2.0.so.0)                                                                                       
                                                                 #5  0x00007f05cb44ff21 g_object_new_valist (libgobject-2.0.so.0)                                                                                                        
                                                                 #6  0x00007f05cb450269 g_object_new (libgobject-2.0.so.0)                                                                                                               
                                                                 #7  0x00007f05cb6612a4 ibus_engine_new_with_type (libibus-1.0.so.5)                                                                                                     
                                                                 #8  0x00007f05cb665c2c ibus_factory_real_create_engine (libibus-1.0.so.5)                                                                                               
                                                                 #9  0x00007f05cb673190 _ibus_marshal_OBJECT__STRING (libibus-1.0.so.5)                                                                                                  
                                                                 #10 0x00007f05cb453bf5 g_closure_invoke (libgobject-2.0.so.0)                                                                                                           
                                                                 #11 0x00007f05cb439cc7 signal_emit_unlocked_R (libgobject-2.0.so.0)                                                                                                     
                                                                 #12 0x00007f05cb43b43a g_signal_emit_valist (libgobject-2.0.so.0)                                                                                                       
                                                                 #13 0x00007f05cb43bfdd g_signal_emit (libgobject-2.0.so.0)                                                                                                              
                                                                 #14 0x00007f05cb665a04 ibus_factory_service_method_call (libibus-1.0.so.5)                                                                                              
                                                                 #15 0x00007f05cb516b0d call_in_idle_cb (libgio-2.0.so.0)                                                                                                                
                                                                 #16 0x00007f05cb13ac39 g_main_dispatch (libglib-2.0.so.0)                                                                                                               
                                                                 #17 0x00007f05cb13b098 g_main_context_iterate (libglib-2.0.so.0)
                                                                 #18 0x00007f05cb13b342 g_main_loop_run (libglib-2.0.so.0)
                                                                 #19 0x00007f05cb6571c3 ibus_main (libibus-1.0.so.5)
                                                                 #20 0x0000000000408dbc n/a (ibus-engine-libpinyin)
                                                                 #21 0x00007f05cad31153 __libc_start_main (libc.so.6)
                                                                 #22 0x0000000000408f9e n/a (ibus-engine-libpinyin)

                                                                 Stack trace of thread 7167:
                                                                 #0  0x00007f05cae1efa4 __GI___poll (libc.so.6)
                                                                 #1  0x00007f05cb13affe g_main_context_poll (libglib-2.0.so.0)
                                                                 #2  0x00007f05cb13b342 g_main_loop_run (libglib-2.0.so.0)
                                                                 #3  0x00007f05cb50021e gdbus_shared_thread_func (libgio-2.0.so.0)
                                                                 #4  0x00007f05cb108ce6 g_thread_proxy (libglib-2.0.so.0)
                                                                 #5  0x00007f05cac69160 start_thread (libpthread.so.0)
                                                                 #6  0x00007f05cae2ba53 __clone (libc.so.6)

                                                                 Stack trace of thread 7166:
                                                                 #0  0x00007f05cae1efa4 __GI___poll (libc.so.6)
                                                                 #1  0x00007f05cb13affe g_main_context_poll (libglib-2.0.so.0)
                                                                 #2  0x00007f05cb13b1db g_main_context_iteration (libglib-2.0.so.0)
                                                                 #3  0x00007f05cb108ce6 g_thread_proxy (libglib-2.0.so.0)
                                                                 #4  0x00007f05cac69160 start_thread (libpthread.so.0)
                                                                 #5  0x00007f05cae2ba53 __clone (libc.so.6)

                                                                 Stack trace of thread 7169:
                                                                 #0  0x00007f05cae1efa4 __GI___poll (libc.so.6)
                                                                 #1  0x00007f05cb13affe g_main_context_poll (libglib-2.0.so.0)
                                                                 #2  0x00007f05cb13b12f g_main_context_iteration (libglib-2.0.so.0)
                                                                 #3  0x00007f05c9708050 dconf_gdbus_worker_thread (libdconfsettings.so)
                                                                 #4  0x00007f05cb108ce6 g_thread_proxy (libglib-2.0.so.0)
                                                                 #5  0x00007f05cac69160 start_thread (libpthread.so.0)
                                                                 #6  0x00007f05cae2ba53 __clone (libc.so.6)
AnwarShah commented 5 years ago

Same thing happened with ibus-avro for bengali language. Can't input bengali characters. But it works in dash search and Telegram, which i think is a qt application

lebensterben commented 5 years ago

Same thing happened with ibus-avro for bengali language. Can't input bengali characters. But it works in dash search and Telegram, which i think is a qt application

That makes sense. RStudio is also a Qt app.

huangli812 commented 5 years ago

I found the package ibus-libpinyin-data in https://download.clearlinux.org/current/x86_64/os/Packages/ will not be installed in desktop bundle(only have ibus-libpinyin), that will result in an error when switch to libpinyin input method. However, after I installed the data package manually, no errors thrown anymore, I still can't input Chinese in gnome3.

fenrus75 commented 5 years ago

this is odd lbus-libpinyin is fully pulled into the desktop bundle, so supposed to be with its data files

On Sun, Jun 30, 2019 at 6:11 AM huangli812 notifications@github.com wrote:

I found the package ibus-libpinyin-data in https://download.clearlinux.org/current/x86_64/os/Packages/ will not be installed in desktop bundle(only have ibus-libpinyin), that will result in an error when switch to libpinyin input method. However, after I installed the data package manually, no errors thrown anymore, I still can't input Chinese in gnome3.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clearlinux/distribution/issues/760?email_source=notifications&email_token=AAJ54FL3IEGBSDCBZV4TSW3P5CWH5A5CNFSM4HN32NN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4L5EA#issuecomment-507035280, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ54FLWNE7QQG7JIHTQJVDP5CWH5ANCNFSM4HN32NNQ .

huangli812 commented 5 years ago

@fenrus75
` (ibus-engine-libpinyin:2226): WARNING : 03:40:46.032: can't open english word list database.

(ibus-engine-libpinyin:2226): WARNING : 03:40:46.032: can't open strokes database. ` I tried the latest liveCD, still no database.

lebensterben commented 5 years ago

@fenrus75 ` (ibus-engine-libpinyin:2226): WARNING : 03:40:46.032: can't open english word list database.

(ibus-engine-libpinyin:2226): WARNING : 03:40:46.032: can't open strokes database. ` I tried the latest liveCD, still no database.

They're indeed installed and are located in /usr/lib64/libpinyin/data

huangli812 commented 5 years ago

Yes, you are right.I found I can input Chinese with these warnings. The Problem is that we can't input in GTK3 program, like Firefox or Gnome terminal. ibus in QT program like VLC works very well. The strange thing is that we can input in Gnome Shell Search Box or Alt+F2 run dialog.

lebensterben commented 5 years ago

@huangli812 This is also what I observed and mentioned earlier in this thread.

huangli812 commented 5 years ago

@lebensterben @fenrus75 I solved this problem by following https://wiki.archlinux.org/index.php/IBus#GTK+_applications and https://github.com/ibus/ibus/wiki/Install. The key of this problem is the lack of immodules.cache for gtk3. I solved this problem with these steps. 1.switch language to Chinese.(may not necessary) 2.generate immodules.cache with sudo gtk-query-immodules-3.0 --update-cache 3.export GTK_IM_MODULE_FILE=/usr/lib64/gtk-3.0/3.0.0/immodules.cache 4.open gedit or libreoffice in the same terminal, I found I can input Chinese in GTK3 program now.

lebensterben commented 5 years ago

@fenrus I can confirm the solution by @huangli812 works for me. And you don't need to change system language, but you do need to sudo gtk-query-immodules-3.0 --update-cache for once and add export GTK_IM_MODULE_FILE=/usr/lib64/gtk-3.0/3.0.0/immodules.cache to ~/.profile, ~/.bash_profile or ~/.zprofile (for zsh).

To fix this, we may have a one time hotfix to create this cache and adding this to default profiles.

fenrus75 commented 5 years ago

his is great diagnostics and points exactly at what we need to do.. thanks a lot!

@william douglas william.r.douglas@gmail.com we likely want an update trigger to make this cache in /var somewhere

On Wed, Jul 3, 2019 at 1:16 PM Lucius Hu notifications@github.com wrote:

@fenrus https://github.com/fenrus I can confirm the solution by @huangli812 https://github.com/huangli812 works for me. And you don't need to change system language, but you do need to sudo gtk-query-immodules-3.0 --update-cache for once and add export GTK_IM_MODULE_FILE=/usr/lib64/gtk-3.0/3.0.0/immodules.cache to ~/.profile, ~/.bash_profile or ~/.zprofile (for zsh).

To fix this, we may have a one time hotfix to create this cache and adding this to default profiles.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clearlinux/distribution/issues/760?email_source=notifications&email_token=AAJ54FLII6HXMWEDKDMXLY3P5UCIJA5CNFSM4HN32NN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZFR7QA#issuecomment-508239808, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ54FOS4GVXVTT2PJPDS2TP5UCIJANCNFSM4HN32NNQ .

bryteise commented 5 years ago

Yep, agreed.

spicyguoba commented 4 years ago

Can confirm @huangli812 @lebensterben solution worked. I ran cd /usr/lib/x86_64-linux-gnu/libgtk-3-0/ && sudo ./gtk-query-immodules-3.0 --update-cache