Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking .XCompose lead to ALL GTK4 compiled apps crash #537

Open
joihn opened this issue Jul 15, 2023 · 2 comments
Open

linking .XCompose lead to ALL GTK4 compiled apps crash #537

joihn opened this issue Jul 15, 2023 · 2 comments

Comments

@joihn
Copy link
Contributor

joihn commented Jul 15, 2023

thanks for this tool ,

to get unicode support (cf man page ), I did:
ln -s /usr/share/keyd/keyd.compose ~/.XCompose
Unicode key remap works well.

however, now all my gtk4 app crash (including the GTK4 demo) (including ubuntu 22 gnome-extension-app)

ENV: ubuntu 22.04, GTK 4.6.6, keyd v2.4.3

steps:

ln -s /usr/share/keyd/keyd.compose ~/.XCompose 
sudo apt install gtk-4-examples
gtk4-demo-application

would output

Gtk:ERROR:../../../gtk/gtkcomposetable.c:981:parser_get_compose_table: assertion failed: (data[first_pos + i] <= data[first_pos + i + 1])
Bail out! Gtk:ERROR:../.

full backtrace:

**
Gtk:ERROR:../../../gtk/gtkcomposetable.c:981:parser_get_compose_table: assertion failed: (data[first_pos + i] <= data[first_pos + i + 1])
Bail out! Gtk:ERROR:../../../gtk/gtkcomposetable.c:981:parser_get_compose_table: assertion failed: (data[first_pos + i] <= data[first_pos + i + 1])

Thread 4 "pool-gtk4-demo" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff202b640 (LWP 24197)]
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737253652032) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.



(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737253652032) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737253652032) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737253652032, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff62bd476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff62a37f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7692b57 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff76ec70f in g_assertion_message_expr () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff78c50e3 in parser_get_compose_table (parser=0x7fffe807dd60) at ../../../gtk/gtkcomposetable.c:981
#8  0x00007ffff79410b4 in gtk_compose_table_parse (found_include=<synthetic pointer>, compose_file=0x7fffe80e8450 "/home/maxime/.XCompose") at ../../../gtk/gtkcomposetable.c:1067
#9  gtk_compose_table_new_with_file (compose_file=0x7fffe80e8450 "/home/maxime/.XCompose") at ../../../gtk/gtkcomposetable.c:1143
#10 add_compose_table_from_file (compose_file=compose_file@entry=0x7fffe80e8450 "/home/maxime/.XCompose") at ../../../gtk/gtkimcontextsimple.c:220
#11 0x00007ffff79417b1 in gtk_im_context_simple_init_compose_table () at ../../../gtk/gtkimcontextsimple.c:296
#12 init_compose_table_thread_cb (task=<optimized out>, source_object=<optimized out>, task_data=<optimized out>, cancellable=<optimized out>) at ../../../gtk/gtkimcontextsimple.c:366
#13 0x00007ffff74ed194 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007ffff76fb6b4 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff76f8a51 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff630fb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff63a1a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) 

related threads:
https://gitlab.gnome.org/GNOME/gtk/-/issues/4990
https://bugs.launchpad.net/ubuntu/+source/gtk4/+bug/2027571

warning, XCompose file is very big and cat won't display it correctly

here is the fauy file from this repo :
https://github.com/rvaiya/keyd/blob/master/data/keyd.compose

removing the symlink solve the issue, but I lose unicode support

@joihn
Copy link
Contributor Author

joihn commented Jul 15, 2023

seems related to #273

@joihn
Copy link
Contributor Author

joihn commented Jul 17, 2023

I can confirm that after pruning ~/.XCompose to less than 1000 lines, GTK4 is happy (all the symbol that interrested me were in the beginning anyway).

For beginner struggling to find a tool capable of handling such a big file, I recommend vim.

Maybe keyd should ship be default with a pruned XCompose ? And let the user enable the longer one if desired ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants