elementary: atspi - fix dbus abort 66/153466/4
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 28 Sep 2017 11:46:44 +0000 (20:46 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Sat, 30 Sep 2017 08:25:13 +0000 (17:25 +0900)
This patch set fix following abort occured on dbus side.

(gdb) bt
0   __GI_raise (sig=sig@entry=6)
1   __GI_abort ()
2   _dbus_abort ()
3   _dbus_warn_check_failed
4   dbus_message_iter_append_basic
5   append_basic
6   eldbus_message_iter_basic_append
7   _bridge_signal_send
8   _text_text_removed_send
9   _bridge_accessible_event_dispatch
10  _elm_interface_atspi_accessible_event_emit
11  elm_interface_atspi_accessible_event_emit
12  _entry_changed_user_signal_cb

(gdb) f 12
(gdb) p *$1
$2 = {change = {insert = {content = 0x0, pos = 0, plain_length = 1},
                del = {content = 0x0, start = 0, end = 1}},
      insert = 0 '\000', merge = 0 '\000'}

The following patch set would fix the root cause of this problem.
https://phab.enlightenment.org/D5240

Change-Id: Ifea8c2fead631f06b7d54ce9a6517f795b3cbf06

src/lib/elm_atspi_bridge.c

index 9f517bf..56710b6 100644 (file)
@@ -5852,6 +5852,12 @@ _text_text_inserted_send(void *data, Eo *obj, const Eo_Event_Description *desc E
    if (!STATE_TYPE_GET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_TEXT_CHANGED))
      return EINA_TRUE;
 
+   if (!info->content)
+     {
+        WRN("Try to send signal with NULL value");
+        return EINA_TRUE;
+     }
+
    _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
                        &_event_obj_signals[ATSPI_OBJECT_EVENT_TEXT_CHANGED], "insert", info->pos, info->len, "s", info->content);
 
@@ -5868,6 +5874,12 @@ _text_text_removed_send(void *data, Eo *obj, const Eo_Event_Description *desc EI
    if (!STATE_TYPE_GET(pd->object_broadcast_mask, ATSPI_OBJECT_EVENT_TEXT_CHANGED))
      return EINA_TRUE;
 
+   if (!info->content)
+     {
+        WRN("Try to send signal with NULL value");
+        return EINA_TRUE;
+     }
+
    _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
                        &_event_obj_signals[ATSPI_OBJECT_EVENT_TEXT_CHANGED], "delete", info->pos, info->len, "s", info->content);