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

ibus-daemon crashed with SIGABRT in g_assertion_message() #12

Open
wants to merge 817 commits into
base: master
Choose a base branch
from

Conversation

caravena
Copy link

Hello,

Package: ibus 1.5.14-2ubuntu1

https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/1712902

"
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
set = {__val = {0, 139857005230431, 139856751807276, 139856751806976, 139856751807276, 18446604216704321185, 32, 343597383809, 4, 0, 472446402655, 0, 0, 532575944823, 139857005182976, 139857058211945}}
pid =
tid =
#1 0x00007f33023a13aa in __GI_abort () at abort.c:89
save_stage = 2
act = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {139857066330467, 139852725092352, 0, 101, 139856751716656, 102, 139857069096160, 139857005230896, 947518525792, 0, 139857057746268, 102, 139857069096160, 139857005230896, 947518525792, 0}}, sa_flags = -268342992, sa_restorer = 0x66}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00007f3302c2276d in g_assertion_message (domain=domain@entry=0xdc9c81467a "IBUS", file=file@entry=0xdc9c814ae4 "dbusimpl.c", line=line@entry=1473, func=func@entry=0xdc9c815160 <func.26387> "bus_dbus_impl_connection_filter_cb", message=message@entry=0x7f32f0030a90 "assertion failed: (connection != NULL)") at ../../../../glib/gtestutils.c:2433
lstr = "1473\000\177\000\000\000\240p\341\337U\237v\200\064\000\360\062\177\000\000\061K\201\234\334\000\000"
s = 0x7f32f0016930 ""
#3 0x00007f3302c227fa in g_assertion_message_expr (domain=domain@entry=0xdc9c81467a "IBUS", file=file@entry=0xdc9c814ae4 "dbusimpl.c", line=line@entry=1473, func=func@entry=0xdc9c815160 <func.26387> "bus_dbus_impl_connection_filter_cb", expr=expr@entry=0xdc9c814b31 "connection != NULL") at ../../../../glib/gtestutils.c:2456
s = 0x7f32f0030a90 "assertion failed: (connection != NULL)"
#4 0x000000dc9c804436 in bus_dbus_impl_connection_filter_cb (dbus_connection=, message=0xdc9eef8c00, incoming=0, user_data=0xdc9e975830) at dbusimpl.c:1473
func = "bus_dbus_impl_connection_filter_cb"
dbus = 0xdc9e975830
connection = 0x0
#5 0x00007f33031d20de in on_worker_message_about_to_be_sent (worker=, message=0xdc9eef8c00, user_data=0x7f32f4004800) at ../../../../gio/gdbusconnection.c:2348
connection = 0x7f32f4004800
filters = 0x7f32f0016ad0
n = 0
alive =
#6 0x00007f33031e6e5e in _g_dbus_worker_emit_message_about_to_be_sent (message=0xdc9eef8c00, worker=0x7f32f40062e0) at ../../../../gio/gdbusprivate.c:491
ret = 0x0
#7 continue_writing (worker=0x7f32f40062e0) at ../../../../gio/gdbusprivate.c:1482
old_message = 0xdc9eef8c00
new_blob =
new_blob_size = 139857066300748
error = 0x7f32f4004800
data = 0xdc9eefaf00
flush_async_data = 0x0
func = "continue_writing"
#8 0x00007f33031e745f in write_message_cb (source_object=, res=, user_data=0xdc9eefb460) at ../../../../gio/gdbusprivate.c:1340
data = 0xdc9eefb460
error = 0x7f32f001f650
func = "write_message_cb"
#9 0x00007f33031a4003 in g_task_return_now (task=0xdc9e9b93b0) at ../../../../gio/gtask.c:1145
No locals.
#10 0x00007f33031a4039 in complete_in_idle_cb (task=0xdc9e9b93b0) at ../../../../gio/gtask.c:1159
No locals.
#11 0x00007f3302bfbd55 in g_main_dispatch (context=0xdc9e9b5ab0) at ../../../../glib/gmain.c:3148
dispatch = 0x7f3302bf8690 <g_idle_dispatch>
prev_source = 0x0
was_in_call = 0
user_data = 0xdc9e9b93b0
callback = 0x7f33031a4030 <complete_in_idle_cb>
cb_funcs = 0x7f3302ec3280 <g_source_callback_funcs>
cb_data = 0x7f32f0068fd0
need_destroy =
source = 0x7f32f0068df0
current = 0xdc9e9b41a0
i = 0
#12 g_main_context_dispatch (context=context@entry=0xdc9e9b5ab0) at ../../../../glib/gmain.c:3813
No locals.
#13 0x00007f3302bfc118 in g_main_context_iterate (context=0xdc9e9b5ab0, block=block@entry=1, dispatch=dispatch@entry=1, self=) at ../../../../glib/gmain.c:3886
max_priority = 0
timeout = 0
some_ready = 1
nfds =
allocated_nfds = 14
fds = 0x7f32f003dd80
#14 0x00007f3302bfc432 in g_main_loop_run (loop=0xdc9e9b7b10) at ../../../../glib/gmain.c:4082
func = "g_main_loop_run"
#15 0x00007f33031e5836 in gdbus_shared_thread_func (user_data=0xdc9e9b7b70) at ../../../../gio/gdbusprivate.c:275
data = 0xdc9e9b7b70
#16 0x00007f3302c23595 in g_thread_proxy (data=0xdc9e98b370) at ../../../../glib/gthread.c:784
thread = 0xdc9e98b370
#17 0x00007f330273674a in start_thread (arg=0x7f32ff1dc700) at pthread_create.c:456
__res =
pd = 0x7f32ff1dc700
now =
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139857005233920, 7929176745542806555, 140734522604974, 140734522604975, 139857005234624, 139857005233920, -8038953895531254757, -8040019505670788069}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call =
pagesize_m1 =
sp =
freesize =
PRETTY_FUNCTION = "start_thread"
#18 0x00007f3302472caf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.
"

Regards,

Cristian

fujiwarat and others added 28 commits July 12, 2019 21:12
- dconf/config.c: Replaced dconf_client_write_fast() with
  dconf_client_write_sync() because
  dconf_client_write_fast() does not syn the data when
  ibus_config_get_values() is called immediately after
  ibus_config_set_value() is called.

- ibus-compose-locales.in returns the return value of ibus-compose

- ibus-compose: Set $NO_AT_BRIDGE to suppress a AT_SPI warning
  and call g_log_set_always_fatal() because GtkIMContextSimple
  does not support multiple compose outputs yet and the API can
  suppress a warning.

- ibus-config: Delete async watch testings which causes several errors
  with gnome-shell testing and the testing is now deprecated and
  GSettings is recommended.

- ibus-desktop-testing-runner.in: Support --output=log:stdout to
  cat the log to stdout and Use dbus-launch --exit-with-session instead of
  --sh-syntax and count PASS of test cases instead of PASS of
  gnome-desktop-testing and always run ibus exit and kill
  gnome-shell-calendar-server

- ibus-engine-switch.c: Set xkb:jp::jpn if gnome-shell sets xkb:us::eng

- ibus-inputcontext.c: Use ibus_bus_get_global_engine() instead of
  ibus_bus_list_active_engines() since ibus_bus_list_active_engines()
  does not work with gnome-shell and the API is now deprecated.

- ibus-keypress.c: Set $NO_AT_BRIDGE to suppress a AT_SPI warning
Update po/da.po po/fr.po po/hu.po po/id.po po/ja.po po/nl.po po/pa.po
       po/pl.po po/pt_BR.po po/sv.po po/uk.po po/zh_TW.po
Update LOCALES_STRING in locales.h from /usr/share/i18n/SUPPORTED on
Debian Buster.

BUG=#2110
I set g_log_set_always_fatal() before gtk_init() in ibus-compose for
a compose warning of GtkIMContextSimple but actually the warning is
output during gtk_main() due to GtkIMContextSimple.set_client_window()
so I moved g_log_set_always_fatal() before gtk_main() in ibus-compose.c.

Also set IFS in ibus-compose-locales to set the delimiter to '\n' for
for-loop arguments.
…runner

The wrong echo prevent from counting the test results in the direct
testing runner.
ibus-daemon can be restarted unexpectedly during logging out the session
and double ibus-x11 prevent from enabling XIM in XGetSelectionOwner()
for the "ibus" atom.
ibus-daemon always will exit the process when the parent process dies
to avoid this problem.
mutter 3.33.90 or later exits the session without loginctl.
Now ibus-desktop-testing-runner has XDG_SESSION_TYPE forcibly
not to exit gnome-shell.
Weston uses unstable v1 for input-method protocol.
Unfortunately weston-terminal does not enable input method and tested
the protocol with weston-editor:
https://github.com/wayland-project/weston/blob/master/clients/editor.c

BUG=#2030
ibus-wayland could terminate with "disconnected" signal.
Update po/es.po po/tr.po po/zh_CN.po
The latest distcheck requires uninstall-hook for install-data-hook
and missed wayland_scanner_rules with --disable-wayland.
I forgot to test the Makefile with autoconf and also missed to
add meta.test.in to EXTRA_DIST
G_DEFINE_TYPE_WITH_PRIVATE() and G_ADD_PRIVATE() have been available
since 2.38.
IBusService has custom GBaseInitFunc and GBaseFinalizeFunc in
ibus_service_get_type() and implements ibus_service_private_offset
and ibus_service_get_instance_private() directly without
G_DEFINE_TYPE_WITH_PRIVATE().
ibus uses a GDBusServer with G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS,
and doesn't set a GDBusAuthObserver, which allows anyone who can connect
to its AF_UNIX socket to authenticate and be authorized to send method calls.
It also seems to use an abstract AF_UNIX socket, which does not have
filesystem permissions, so the practical effect might be that a local
attacker can connect to another user's ibus service and make arbitrary
method calls.

BUGS=rhbz#1717958
g_dbus_server_new_sync() is failed with address "unix:tmpdir=/tmp/ibus"
in BSD systems because BSD systems do not support abstract socket files
and use the real files but no directory "/tmp/ibus". Now the default
directory will be an unique "unix:tmpdir=$XDG_RUNTIME_DIR/ibus" by user
in Linux and "unix:tmpdir=/tmp" in BSD and mkdir() runs with the directory
mode 0700 not to modify by malicious users.

BUG=#2116
Currently the address file is saved in XDG_CONFIG_DIR, however since it
is not a config or preferences file perhaps it should instead be saved
to XDG_RUNTIME_DIR.

BUG=#2128
If the compose output chars are more than two, IBusCompose calls
g_renew() but the size is not enough to insert '\0'.

BUG=#2123
Some users failed to run ibus-daemon with XDG_RUNTIME_DIR because
the directory is not created by `su` command.
Now the IBus socket files will be generated in XDG_CACHE_HOME.

BUG=#2135
Some IBus clients could access the ibus address file without using
ibus_get_socket_path().

BUG=#2128
simmon-nplob and others added 28 commits March 14, 2022 10:33
Commit 5a455b1 attempted to fix both GLib warnings around
floating references and other presumed refcounting issues. However
it missed 2 kinds of bugs:

- The places that take an IBusText created from a static string
  were made to avoid freeing it afterwards, but the staticness refers
  to the string content, not the object itself.
- The places that are documented to emit signals on floating object
  references used to do the following after signal emission:

  if (g_object_is_floating (object))
    g_object_unref (object)

  And did possibly trigger GLib warnings were changed to:

  if (g_object_is_floating (object))
    g_object_sink_ref (object);
  g_object_unref (object);

  Which fixes the GLib warning for floating references, but do
  unintendedly steal one reference away for non floating references.

This commit is essentially a revert of commit 5a455b1, but
addressing both things differently:

- All label/tooltip/symbol IBusText properties in IBusProperty do
  now always sink the reference of the stored object.

- All places documented as maybe using objects with a floating reference
  on signals changed to doing:

  if (g_object_is_floating (object)) {
    g_object_ref_sink (object);
    g_object_unref (object);
  }

  So the floating reference is owned and unreferenced without warnings,
  but already owned references are left unchanged.

This addresses the possible GLib warnings, fixes the possible double
unrefs happening on IBusText used in signals, and fixes the missing
unrefs on IBusText objects created from static strings.

BUG=#2393
BUG=#2387
The "[[ ... ]]" is bash's compound command not in POSIX sh. This style
is problematic in Xorg session in environments where sh is not bash,
suach as Debian and Ubuntu.

BUG=#2397
Currently ibus-ui-gtk3 runs the setxkbmap command internally to set
the XKB keymaps from XKB engines but setxkbmap does not work in Wayland
session.
The IBus XKB engines are disabled at the moment in Plamsa Wayland
and ibus-ui-gtk3 asks users to use systemsettings5.

Will use libinput and libxkbcommon later but it would be better
to implement IBus in Plamsa Wayland compositor.

BUG=#2408
XKB engine notification for Plasma Wayland is also added.
gnome-shell no longer launch ibus-daemon because gnome-session
launches ibus-daemon with IBus systemd file.
This is a workaround to call ibus-daemon after GNOME fails to
launch ibus-daemon since CI does not use graphical-session.target
systemd service.

BUG=https://gitlab.gnome.org/GNOME/gdm/-/issues/777
Since IBus keycode subtracts 8 from Linux keycode, keycodes from
gdk_keymap_get_entries_for_keyval() also have to be subtracted 8.
The keycodes will add 8 when they bring back the GDK event loop.
gtk_im_context_simple_add_table() is deprecated in GTK4.
I decide to delete gtk_im_context_simple_add_table() here because
the change 03c9e59 is no longer needed
because IBusEngineSimple has implemented to load pt_br compose key
by locale.

Fixes: 03c9e59

BUG=chromium-os:11421
BUG=http://codereview.appspot.com/3989060
Add more keyboard layouts which cannot produce ASCII to
data/dconf/org.freedesktop.ibus.gschema.xml
Remove "mal" and "mkd", there are no such layouts.

BUG=#2404
So that the theme list won't get too messy

BUG=#2327

Signed-off-by: Hollow Man <[email protected]>
IBus just cannot defer key events to the secondary input methods
to switch XKB keymaps in Plasma Wayland because IBus has to handle the
compose keys before defer the key events.

Also update the POT file.

BUG=rhbz#2088656
Some IMEs' behavior is different between the on-screen keyboard and
the direct physical keyboard and this flag is useful for the IMEs.

Also fix src/ibusaccelgroup.c for gtkdoc-mkhtml.
If the API comment of IBusCapabilite is updated, XML & HTML files
are rebuilt and gtk-doc-1.33.2 no longer accepts HTML tags in
the comments.
@fujiwarat fujiwarat deleted the branch phuang:master July 19, 2022 13:35
@fujiwarat fujiwarat deleted the master branch July 19, 2022 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.