Fix abrt with cache dir

- Bug 1785276 - Fix abrt without XDG_CACHE_HOME/ibus
- Bug 1788754 - Fix abrt with NULL output of compose keys
- Bug 1787732 - Fix abrt in exit handlers in ibus-x11
- Bug 1795499 - Fix abrt in bus monitor handlers when ibus-daemon restarts
- Fix greek cases
- Increase sleep 3 to wait for running ibus-config in CI.
This commit is contained in:
Takao Fujiwara 2020-02-13 19:38:11 +09:00
parent d8ca7214e0
commit 8884c3400a
3 changed files with 327 additions and 6 deletions

View File

@ -1,6 +1,6 @@
From 018a0f889d18c41e314f0b1297d1dc559603142b Mon Sep 17 00:00:00 2001
From fd19aaaa097e71e7589bdb3627971dc10bf3873e Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 5 Feb 2019 18:36:04 +0900
Date: Thu, 13 Feb 2020 19:33:32 +0900
Subject: [PATCH] Fix SEGV in bus_panel_proxy_focus_in()
rhbz#1349148, rhbz#1385349
@ -28,6 +28,12 @@ WIP: Added a GError to get the error message to check why the SEGV happened.
rhbz#1663528 SEGV in g_mutex_clear() in bus_dbus_impl_destroy()
If the mutex is not unlocked, g_mutex_clear() causes assert.
rhbz#1767691 SEGV in client/x11/main.c:_sighandler().
Do not call atexit functions in _sighandler().
rhbz#1795499 SEGV in ibus_bus_get_bus_address() because of no _bus->priv.
_changed_cb() should not be called after ibus_bus_destroy() is called.
BUG=rhbz#1349148
BUG=rhbz#1385349
BUG=rhbz#1350291
@ -35,11 +41,15 @@ BUG=rhbz#1406699
BUG=rhbz#1432252
BUG=rhbz#1601577
BUG=rhbz#1663528
BUG=rhbz#1767691
BUG=rhbz#1795499
---
bus/dbusimpl.c | 70 +++++++++++++++++++++++++++++++++++++++++------
bus/engineproxy.c | 9 +++++-
bus/ibusimpl.c | 21 ++++++++++++--
3 files changed, 88 insertions(+), 12 deletions(-)
client/x11/main.c | 8 +++++-
src/ibusbus.c | 5 ++++
5 files changed, 100 insertions(+), 13 deletions(-)
diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c
index b54ef817..fb38faf0 100644
@ -236,7 +246,7 @@ index 2d98995c..2176e0c9 100644
if (layout != NULL && layout[0] != '\0') {
engine->keymap = ibus_keymap_get (layout);
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index bbbb5770..77fcf42f 100644
index 85761d30..f0dbccd1 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -464,13 +464,16 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
@ -289,6 +299,48 @@ index bbbb5770..77fcf42f 100644
bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name);
}
diff --git a/client/x11/main.c b/client/x11/main.c
index c9ee174d..768b91f0 100644
--- a/client/x11/main.c
+++ b/client/x11/main.c
@@ -40,6 +40,7 @@
#include <iconv.h>
#include <signal.h>
#include <stdlib.h>
+#include <unistd.h>
#include <getopt.h>
@@ -1104,7 +1105,12 @@ _atexit_cb ()
static void
_sighandler (int sig)
{
- exit(EXIT_FAILURE);
+ /* rhbz#1767691 _sighandler() is called with SIGTERM
+ * and exit() causes SEGV during calling atexit functions.
+ * _atexit_cb() might be broken. _exit() does not call
+ * atexit functions.
+ */
+ _exit(EXIT_FAILURE);
}
static void
diff --git a/src/ibusbus.c b/src/ibusbus.c
index b7ffbb47..668c8a26 100644
--- a/src/ibusbus.c
+++ b/src/ibusbus.c
@@ -689,6 +689,11 @@ ibus_bus_destroy (IBusObject *object)
_bus = NULL;
if (bus->priv->monitor) {
+ /* rhbz#1795499 _changed_cb() causes SEGV because of no bus->priv
+ * after ibus_bus_destroy() is called.
+ */
+ g_signal_handlers_disconnect_by_func (bus->priv->monitor,
+ (GCallback) _changed_cb, bus);
g_object_unref (bus->priv->monitor);
bus->priv->monitor = NULL;
}
--
2.20.1
2.24.1

View File

@ -3121,3 +3121,264 @@ index ac5de809..30585403 100644
--
2.21.0
From ecc3465a585448486b2ce68bcefc11d6aebae755 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 23 Jan 2020 16:13:05 +0900
Subject: [PATCH 1/5] client/gtk2: Fix some format sentences
---
client/gtk2/ibusimcontext.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index 30585403..50290c55 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -73,7 +73,9 @@ struct _IBusIMContext {
GCancellable *cancellable;
GQueue *events_queue;
+#if !GTK_CHECK_VERSION (3, 93, 0)
gboolean use_button_press_event;
+#endif
};
struct _IBusIMContextClass {
@@ -137,12 +139,12 @@ static void ibus_im_context_set_surrounding
/* static methods*/
static void _ibus_context_update_preedit_text_cb
- (IBusInputContext *ibuscontext,
- IBusText *text,
- gint cursor_pos,
- gboolean visible,
- guint mode,
- IBusIMContext *ibusimcontext);
+ (IBusInputContext *ibuscontext,
+ IBusText *text,
+ gint cursor_pos,
+ gboolean visible,
+ guint mode,
+ IBusIMContext *ibusimcontext);
static void _create_input_context (IBusIMContext *context);
static gboolean _set_cursor_location_internal
(IBusIMContext *context);
@@ -172,7 +174,6 @@ static void _create_fake_input_context (void);
static gboolean _set_content_type (IBusIMContext *context);
-
static GType _ibus_type_im_context = 0;
static GtkIMContextClass *parent_class = NULL;
@@ -313,7 +314,6 @@ _process_key_event_done (GObject *object,
{
IBusInputContext *context = (IBusInputContext *)object;
GdkEventKey *event = (GdkEventKey *) user_data;
-
GError *error = NULL;
gboolean retval = ibus_input_context_process_key_event_async_finish (
context,
@@ -362,12 +362,10 @@ _process_key_event (IBusInputContext *context,
retval = TRUE;
}
- if (retval) {
+ if (retval)
event->state |= IBUS_HANDLED_MASK;
- }
- else {
+ else
event->state |= IBUS_IGNORED_MASK;
- }
return retval;
}
@@ -1508,6 +1506,7 @@ _key_is_modifier (guint keyval)
return FALSE;
}
}
+
/* Copy from gdk */
static GdkEventKey *
_create_gdk_event (IBusIMContext *ibusimcontext,
--
2.24.1
From afc0a89c74950351c32df3d60abb343a0dbc06cc Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Fri, 24 Jan 2020 15:37:01 +0900
Subject: [PATCH 2/5] Handle small final sigma in ibus_keyval_convert_case
lowercase: GREEK SMALL LETTER FINAL SIGMA (U+03C2)
uppercase: GREEK CAPITAL LETTER SIGMA (U+03A3)
This mapping was correct in UCSConvertCase, but the "legacy" mapping
must also be correct for Caps Lock to work with the final sigma key.
https://gitlab.freedesktop.org/xorg/lib/libx11/commit/7f46a38139
BUG=https://github.com/ibus/ibus/pull/2176
---
src/ibuskeynames.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/ibuskeynames.c b/src/ibuskeynames.c
index 08505598..544c6ade 100644
--- a/src/ibuskeynames.c
+++ b/src/ibuskeynames.c
@@ -331,8 +331,9 @@ ibus_keyval_convert_case (guint symbol,
xupper -= (IBUS_KEY_Greek_alphaaccent - IBUS_KEY_Greek_ALPHAaccent);
else if (symbol >= IBUS_KEY_Greek_ALPHA && symbol <= IBUS_KEY_Greek_OMEGA)
xlower += (IBUS_KEY_Greek_alpha - IBUS_KEY_Greek_ALPHA);
- else if (symbol >= IBUS_KEY_Greek_alpha && symbol <= IBUS_KEY_Greek_omega &&
- symbol != IBUS_KEY_Greek_finalsmallsigma)
+ else if (symbol == IBUS_KEY_Greek_finalsmallsigma)
+ xupper = IBUS_KEY_Greek_SIGMA;
+ else if (symbol >= IBUS_KEY_Greek_alpha && symbol <= IBUS_KEY_Greek_omega)
xupper -= (IBUS_KEY_Greek_alpha - IBUS_KEY_Greek_ALPHA);
break;
}
--
2.24.1
From 74863851e83972e86a5bdb3da3d99784fc8d4955 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 28 Jan 2020 18:46:13 +0900
Subject: [PATCH 3/5] src/tests: Increase sleep to 3 waiting for IBusConfig
Sleep 1 would be too short for ibus-daemon which could run all components.
ibus-config test requires the running IBusConfig and the test could fail
in some slow systems.
Sleep time will be increased to 3 to run all components.
BUG=https://github.com/ibus/ibus/issues/2170
---
src/tests/ibus-config.c | 4 ++++
src/tests/ibus-desktop-testing-runner.in | 2 +-
src/tests/runtest | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/tests/ibus-config.c b/src/tests/ibus-config.c
index 5e845f10..0d9812a3 100644
--- a/src/tests/ibus-config.c
+++ b/src/tests/ibus-config.c
@@ -16,6 +16,10 @@ finish_create_config_async_success (GObject *source_object,
IBusConfig *config =
ibus_config_new_async_finish (res, &error);
+ if (error) {
+ g_message ("Failed to generate IBusConfig: %s", error->message);
+ g_error_free (error);
+ }
g_assert (IBUS_IS_CONFIG (config));
/* Since we reuse single D-Bus connection, we need to remove the
diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
index 981941d5..0d9a847c 100755
--- a/src/tests/ibus-desktop-testing-runner.in
+++ b/src/tests/ibus-desktop-testing-runner.in
@@ -190,7 +190,7 @@ run_desktop()
HAS_GNOME=`echo $DESKTOP_COMMAND | grep gnome-session`
if [ x"$HAS_GNOME" = x ] ; then
ibus-daemon --daemonize --verbose
- sleep 1
+ sleep 3
fi
}
diff --git a/src/tests/runtest b/src/tests/runtest
index ed38992f..a6e4194b 100755
--- a/src/tests/runtest
+++ b/src/tests/runtest
@@ -180,7 +180,7 @@ run_test_case()
fi
# Wait until all necessary components are up.
- sleep 1
+ sleep 3
export GTK_IM_MODULE=ibus
fi
--
2.24.1
From cd4fef5a3290869fc1c36392f5d404fa09932926 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 31 Jan 2020 15:35:02 +0900
Subject: [PATCH 4/5] src: Fix SEGV to access NULL GError when compose length
is zero
BUG=rhbz#1788754
---
src/ibuscomposetable.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
index e4e3a7cd..3f439134 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
@@ -127,12 +127,14 @@ parse_compose_value (IBusComposeData *compose_data,
compose_data->values[0] = g_ascii_strtoll(p, NULL, 8);
compose_data->values[1] = 0;
} else {
- if (!(uchars = g_utf8_to_ucs4 (ustr, -1, NULL, NULL, &error)) ||
- !uchars[0]) {
+ if (!(uchars = g_utf8_to_ucs4 (ustr, -1, NULL, NULL, &error))) {
g_warning ("Invalid Unicode: %s: %s in %s:",
error->message, ustr, line);
g_error_free (error);
goto fail;
+ } else if (!uchars[0]) {
+ g_warning ("Invalid Unicode: \"\" in %s:", line);
+ goto fail;
}
for (up = uchars; *up; up++) {
--
2.24.1
From a1705ad7e5f90cf8d87caf32d7b7acc7125e6778 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 13 Feb 2020 16:49:12 +0900
Subject: [PATCH 5/5] bus: Fix recursive mkdir is failed in
/var/lib/gdm/.cache/ibus
If the parent directory (/var/lib/gdm/.cache) is not created,
mkdir childdir (/var/lib/gdm/.cache/ibus) is failed by the parentdir
with mode_t = 0.
BUG=https://github.com/ibus/ibus/issues/2177
---
bus/server.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/bus/server.c b/bus/server.c
index a7554a88..6c9e2c02 100644
--- a/bus/server.c
+++ b/bus/server.c
@@ -277,17 +277,13 @@ bus_server_init (void)
socket_address);
}
if (!g_file_test (unix_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
- /* Require mkdir for BSD system. */
- if (g_mkdir_with_parents (unix_dir, 0) != 0) {
- g_error ("mkdir is failed in: %s: %s",
- unix_dir, g_strerror (errno));
- }
- /* The mode 0700 can eliminate malicious users change the mode.
+ /* Require mkdir for BSD system.
+ * The mode 0700 can eliminate malicious users change the mode.
* `chmod` runs for the last directory only not to change the modes
* of the parent directories. E.g. "/tmp/ibus".
*/
- if (g_chmod (unix_dir, 0700) != 0) {
- g_error ("chmod(700) is failed in: %s: %s",
+ if (g_mkdir_with_parents (unix_dir, 0700) != 0) {
+ g_error ("mkdir is failed in: %s: %s",
unix_dir, g_strerror (errno));
}
}
--
2.24.1

View File

@ -35,7 +35,7 @@
Name: ibus
Version: 1.5.21
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
@ -464,6 +464,14 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
* Thu Feb 13 2020 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.21-9
- Bug 1785276 - Fix abrt without XDG_CACHE_HOME/ibus
- Bug 1788754 - Fix abrt with NULL output of compose keys
- Bug 1787732 - Fix abrt in exit handlers in ibus-x11
- Bug 1795499 - Fix abrt in bus monitor handlers when ibus-daemon restarts
- Fix greek cases
- Increase sleep 3 to wait for running ibus-config in CI.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.21-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild