Page MenuHomePhabricator

eina safety check failed, obj == NULL in evas_object_event_callback_del_full in lib/evas/canvas/evas_callbacks.c:539
Closed, ResolvedPublic

Description

The following is a demo program to trigger the error (tested with 4bdac206d27fc973c836730562ed07bb9f259bad = v1.21.0-beta1).

#include <Elementary.h>
// gcc -o safety safety.c $(pkg-config --cflags elementary) $(pkg-config --libs elementary)

static void on_done(void *data, Evas_Object *obj, void *event_info)
{
   fprintf(stdout, "Yis OK\n");
   elm_exit();
}

EAPI_MAIN int elm_main(int argc, char **argv)
{
   Evas_Object *win = elm_win_add(NULL, "Safety", ELM_WIN_BASIC);
   elm_win_title_set(win, "Safety");
   evas_object_smart_callback_add(win, "delete,request", on_done, NULL);

   Evas_Object *slid = elm_slider_add(win);
   evas_object_show(slid);

   evas_object_show(win);
   elm_run();
   elm_shutdown();

   return 0;
}
ELM_MAIN()

Running the program and then closing the window, will print several messages like

EERR<3705>:eina_safety lib/evas/canvas/evas_callbacks.c:539 evas_object_event_callback_del_full() safety check failed: obj == NULL
## Copy & Paste the below (until EOF) into a terminal, then hit Enter

eina_btlog << EOF
/usr/local/lib/libeina.so.1	 0x7ffff724758f 0x7ffff7214000
RR<3705>:eina_safety lib/evas/canvas/evas_callbacks.c:539 evas_object_event_callback_del_full() safety check failed: obj == NULL
## Copy & Paste the below (until EOF) into a terminal, then hit Enter

eina_btlog << EOF
/usr/local/lib/libeina.so.1	 0x7ffff724758f 0x7ffff7214000
[...]

A backtrace looks like this:

Thread 1 "safety" hit Breakpoint 1, evas_object_event_callback_del_full (eo_obj=0x40000002450b, type=EVAS_CALLBACK_DEL, func=0x7ffff5faaff5 <_edje_object_part_swallow_free_cb>, data=0x5555559ee860)
    at lib/evas/canvas/evas_callbacks.c:539
539	   EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
(gdb) print obj
$17 = (Evas_Object_Protected_Data *) 0x0
(gdb) bt
#0  evas_object_event_callback_del_full (eo_obj=0x40000002450b, type=EVAS_CALLBACK_DEL, func=0x7ffff5faaff5 <_edje_object_part_swallow_free_cb>, data=0x5555559ee860) at lib/evas/canvas/evas_callbacks.c:539
#1  0x00007ffff5fabcce in _edje_real_part_swallow_clear (ed=0x555555a7ea90, rp=0x5555559ee860) at lib/edje/edje_util.c:5974
#2  0x00007ffff5f75898 in _edje_file_del (ed=0x555555a7ea90) at lib/edje/edje_load.c:2000
#3  0x00007ffff5f93a2e in _efl_canvas_layout_efl_canvas_group_group_del (obj=0x40000001f0f6, ed=0x555555a7ea90) at lib/edje/edje_smart.c:180
#4  0x00007ffff6b612c6 in efl_canvas_group_del (obj=0x40000001f0f6) at lib/evas/canvas/evas_object_smart.c:1854
#5  0x00007ffff6b5fb63 in evas_object_smart_del (eo_obj=0x40000001f0f6) at lib/evas/canvas/evas_object_smart.c:1288
#6  0x00007ffff6b4aaf8 in _efl_canvas_object_efl_object_invalidate (eo_obj=0x40000001f0f6, obj=0x555555a7e8d0) at lib/evas/canvas/evas_object_main.c:1338
#7  0x00007ffff5c99e9c in efl_invalidate (obj=0x40000001f0f6) at lib/eo/efl_object.eo.c:72
#8  0x00007ffff5f93323 in _efl_canvas_layout_efl_object_invalidate (obj=0x40000001f0f6, ed=0x555555a7ea90) at lib/edje/edje_smart.c:57
#9  0x00007ffff5c99e9c in efl_invalidate (obj=0x40000001f0f6) at lib/eo/efl_object.eo.c:72
#10 0x00007ffff5c9269f in _efl_invalidate (obj=0x555555a7e840) at lib/eo/eo_base_class.c:171
#11 0x00007ffff5c9453b in _efl_object_parent_set (obj=0x40000001f0f6, pd=0x555555a7e880, parent_id=0x0) at lib/eo/eo_base_class.c:735
#12 0x00007ffff5c98ca0 in efl_parent_set (obj=0x40000001f0f6, parent=0x0) at lib/eo/efl_object.eo.c:12
#13 0x00007ffff5c94324 in efl_del (obj=0x40000001f0f6) at lib/eo/eo_base_class.c:687
#14 0x00007ffff6b499f2 in evas_object_del (obj=0x40000001f0f6) at lib/evas/canvas/evas_object_main.c:1043
#15 0x00007ffff7a2dea7 in _efl_ui_widget_efl_canvas_group_group_del (obj=0x40000001ecf5, sd=0x555555a7e4f0) at lib/elementary/efl_ui_widget.c:857
#16 0x00007ffff6b612c6 in efl_canvas_group_del (obj=0x40000001ecf5) at lib/evas/canvas/evas_object_smart.c:1854
#17 0x00007ffff795de60 in _efl_ui_layout_efl_canvas_group_group_del (obj=0x40000001ecf5, sd=0x555555a7e690) at lib/elementary/efl_ui_layout_object.c:808
#18 0x00007ffff6b612c6 in efl_canvas_group_del (obj=0x40000001ecf5) at lib/evas/canvas/evas_object_smart.c:1854
#19 0x00007ffff6b5fb63 in evas_object_smart_del (eo_obj=0x40000001ecf5) at lib/evas/canvas/evas_object_smart.c:1288
#20 0x00007ffff6b4aaf8 in _efl_canvas_object_efl_object_invalidate (eo_obj=0x40000001ecf5, obj=0x555555a7e330) at lib/evas/canvas/evas_object_main.c:1338
#21 0x00007ffff5c99e9c in efl_invalidate (obj=0x40000001ecf5) at lib/eo/efl_object.eo.c:72
#22 0x00007ffff79370cc in _efl_access_object_efl_object_invalidate (obj=0x40000001ecf5, pd=0x555555a7e7e4) at lib/elementary/efl_access_object.c:634
#23 0x00007ffff5c99e9c in efl_invalidate (obj=0x40000001ecf5) at lib/eo/efl_object.eo.c:72
#24 0x00007ffff5c9269f in _efl_invalidate (obj=0x555555a7e2a0) at lib/eo/eo_base_class.c:171
#25 0x00007ffff5c9453b in _efl_object_parent_set (obj=0x40000001ecf5, pd=0x555555a7e2e0, parent_id=0x0) at lib/eo/eo_base_class.c:735
#26 0x00007ffff5c98ca0 in efl_parent_set (obj=0x40000001ecf5, parent=0x0) at lib/eo/efl_object.eo.c:12
#27 0x00007ffff5c94324 in efl_del (obj=0x40000001ecf5) at lib/eo/eo_base_class.c:687
#28 0x00007ffff6b499f2 in evas_object_del (obj=0x40000001ecf5) at lib/evas/canvas/evas_object_main.c:1043
#29 0x00007ffff7a2dea7 in _efl_ui_widget_efl_canvas_group_group_del (obj=0x400000006493, sd=0x5555558e9380) at lib/elementary/efl_ui_widget.c:857
#30 0x00007ffff6b612c6 in efl_canvas_group_del (obj=0x400000006493) at lib/evas/canvas/evas_object_smart.c:1854
#31 0x00007ffff7a4e20c in _efl_ui_win_efl_canvas_group_group_del (obj=0x400000006493, sd=0x5555558e9520) at lib/elementary/efl_ui_win.c:2976
#32 0x00007ffff6b612c6 in efl_canvas_group_del (obj=0x400000006493) at lib/evas/canvas/evas_object_smart.c:1854
#33 0x00007ffff6b5fb63 in evas_object_smart_del (eo_obj=0x400000006493) at lib/evas/canvas/evas_object_smart.c:1288
#34 0x00007ffff6b4aaf8 in _efl_canvas_object_efl_object_invalidate (eo_obj=0x400000006493, obj=0x5555558e91c0) at lib/evas/canvas/evas_object_main.c:1338
#35 0x00007ffff5c99e9c in efl_invalidate (obj=0x400000006493) at lib/eo/efl_object.eo.c:72
#36 0x00007ffff79370cc in _efl_access_object_efl_object_invalidate (obj=0x400000006493, pd=0x5555558e9748) at lib/elementary/efl_access_object.c:634
#37 0x00007ffff5c99e9c in efl_invalidate (obj=0x400000006493) at lib/eo/efl_object.eo.c:72
#38 0x00007ffff5c9269f in _efl_invalidate (obj=0x5555558e9130) at lib/eo/eo_base_class.c:171
#39 0x00007ffff5c9453b in _efl_object_parent_set (obj=0x400000006493, pd=0x5555558e9170, parent_id=0x0) at lib/eo/eo_base_class.c:735
#40 0x00007ffff5c98ca0 in efl_parent_set (obj=0x400000006493, parent=0x0) at lib/eo/efl_object.eo.c:12
#41 0x00007ffff5c94324 in efl_del (obj=0x400000006493) at lib/eo/eo_base_class.c:687
#42 0x00007ffff6b499f2 in evas_object_del (obj=0x400000006493) at lib/evas/canvas/evas_object_main.c:1043
#43 0x00007ffff7a4f79b in _elm_win_shutdown () at lib/elementary/efl_ui_win.c:3644
#44 0x00007ffff7976429 in elm_shutdown () at lib/elementary/elm_main.c:436
#45 0x0000555555554cae in elm_main (argc=1, argv=0x7fffffffe9e8) at safety.c:21
#46 0x0000555555554cf7 in main (argc=1, argv=0x7fffffffe9e8) at safety.c:25

The call of evas_object_event_callback_del_full may also be at lib/edje/edje_util.c:5978
Something I noticed is, that the error appeared always when the following conditions are met at either lib/edje/edje_util.c:5974 or lib/edje/edje_util.c:5978 in the function _edje_real_part_swallow_clear :

ed->__in_list = {
    next = 0x0, 
    prev = 0x0, 
    last = 0x0
  }, 

rp->param1.state = 0

But I'm not sure if this is part of the reason for the problem.

The errors can also be reproduced like this:

Elementary_test:

  1. Run elementary_test
  2. Click "Layout2"
  3. Close Layout2 window.

Terminology:

  1. Run terminology
  2. Right Click
  3. Click 'Settings'
  4. Click 'Font'
escwyp created this task.Jul 29 2018, 2:25 PM
zmike triaged this task as Normal priority.
zmike edited projects, added efl: canvas, Restricted Project; removed efl (efl-1.21).

Since commit afb779bda5d2cea7afd1df553913ecbe2b94541f there are no more error messages form the demo program
and Elementary_test anymore. For the Terminology test case there is only one message left:

ERR<1293>:eina_safety lib/evas/canvas/evas_callbacks.c:540 evas_object_event_callback_del_full() safety check failed: obj == NULL

when Terminology is closed.

raster added a subscriber: raster.Jan 13 2019, 4:10 PM

oh = i didnt even know about this ticket. i was fixing error logs i found from running enlightenment so i could have some more peace and quiet... :) i'll flag this.

bu5hm4n closed this task as Resolved.Mar 17 2019, 8:38 AM
bu5hm4n claimed this task.
bu5hm4n added a subscriber: bu5hm4n.

Described usage does not error anymore.