Page MenuHomePhabricator

fileselector unit test errors
Open, Showstopper IssuesPublic

Description

Some crazy stuff going on here: _itc_del is being reached with it_data->model as invalid because it was previously destroyed through the _noref_death mechanism.

zmike created this task.Aug 16 2018, 2:39 PM
zmike triaged this task as Normal priority.

@cedric could you verify this?

zmike raised the priority of this task from Normal to Showstopper Issues.Mon, Feb 4, 11:07 AM
zmike added a subscriber: bu5hm4n.

Something related to this is causing a deadlock in the unit test which occurs >50% of the time for me. This needs to be looked at urgently to verify that there isn't something wrong with model usage/implementation.

zmike added a project: Restricted Project.Mon, Feb 4, 11:07 AM

While working on cleaning up the child model lifecycle of Efl.Io.Model for task T7528 I have found a few possible error that could explain the problem reported here. Could you check with that patch set if that solve the problem?

zmike added a comment.Mon, Feb 4, 12:19 PM

It doesn't.

zmike added a comment.Mon, Feb 4, 1:56 PM

For documentation purposes, this is the deadlock backtrace:

#0  0x00007f7885908655 in pthread_spin_lock () at /lib64/libpthread.so.0
#1  0x00007f78861046d8 in eina_spinlock_take (spinlock=0x55dc24c6ba5c) at ../src/lib/eina/eina_inline_lock_posix.x:672
#2  0x00007f7886105d26 in ecore_thread_cancel (thread=0x55dc24c6b990) at lib/ecore/ecore_thread.c:751
#3  0x00007f788490a128 in eio_file_cancel (ls=0x55dc24c18e40) at lib/eio/eio_file.c:742
#4  0x00007f788490b9b1 in _efl_io_manager_future_cancel (o=0x40000000289f, data=0x55dc24c18e40, error=125) at lib/eio/eio_private.h:551
#5  0x00007f7886455ea6 in _efl_future_cb (data=0x55dc248b67d0, value=..., dead_future=0x55dc2481df40) at lib/eo/eo_base_class.c:2079
#6  0x00007f78864a7669 in _eina_future_cb_dispatch (f=0x55dc2481df40, value=...) at lib/eina/eina_promise.c:351
#7  0x00007f78864a7c27 in _eina_future_cancel (f=0x55dc2481df40, err=125) at lib/eina/eina_promise.c:468
#8  0x00007f78864a8f59 in eina_future_cancel (f=0x55dc2481dfc0) at lib/eina/eina_promise.c:767
#9  0x00007f7886450684 in _efl_pending_futures_clear (pd=0x55dc24c70590) at lib/eo/eo_base_class.c:124
#10 0x00007f78864506b0 in _efl_object_invalidate (obj_id=0x4000001922de, pd=0x55dc24c70590) at lib/eo/eo_base_class.c:131
#11 0x00007f7886457dd6 in efl_invalidate (obj=0x4000001922de) at lib/eo/efl_object.eo.c:76
#12 0x00007f7884918b6a in _efl_io_model_efl_object_invalidate (obj=0x4000001922de, priv=0x55dc24c705e0) at lib/eio/efl_io_model.c:1063
#13 0x00007f7886457dd6 in efl_invalidate (obj=0x4000001922de) at lib/eo/efl_object.eo.c:76
#14 0x00007f78864507bd in _efl_invalidate (obj=0x55dc24c70550) at lib/eo/eo_base_class.c:167
#15 0x00007f78864524ec in _efl_object_parent_set (obj=0x4000001922de, pd=0x55dc24c70590, parent_id=0x0) at lib/eo/eo_base_class.c:726
#16 0x00007f7886456cf5 in efl_parent_set (obj=0x4000001922de, parent=0x0) at lib/eo/efl_object.eo.c:12
#17 0x00007f78860ce3a1 in _efl_loop_consumer_efl_object_parent_set (obj=0x4000001922de, pd=0x55dc24c705e0, parent=0x0) at lib/ecore/efl_loop_consumer.c:36
#18 0x00007f7886456cf5 in efl_parent_set (obj=0x4000001922de, parent=0x0) at lib/eo/efl_object.eo.c:12
#19 0x00007f78864522d5 in efl_del (obj=0x4000001922de) at lib/eo/eo_base_class.c:678
#20 0x00007f78859fe070 in _noref_death (data=0x0, event=0x7ffd8280b080) at lib/elementary/elc_fileselector.c:167
#21 0x00007f7886454e2a in _event_callback_call (obj_id=0x4000001922de, pd=0x55dc24c70590, desc=0x7f78864619c0 <_EFL_EVENT_NOREF>, event_info=0x0, legacy_compare=0 '\000') at lib/eo/eo_base_class.c:1681
#22 0x00007f7886455106 in _efl_object_event_callback_call (obj_id=0x4000001922de, pd=0x55dc24c70590, desc=0x7f78864619c0 <_EFL_EVENT_NOREF>, event_info=0x0) at lib/eo/eo_base_class.c:1765
#23 0x00007f78864551ac in efl_event_callback_call (obj=0x4000001922de, desc=0x7f78864619c0 <_EFL_EVENT_NOREF>, event_info=0x0) at lib/eo/eo_base_class.c:1768
#24 0x00007f788644be2f in efl_unref (obj_id=0x4000001922de) at lib/eo/eo.c:1963
#25 0x00007f78859ff5bb in _listing_request_cleanup (lreq=0x55dc24c17b70) at lib/elementary/elc_fileselector.c:706
#26 0x00007f78859ff555 in _process_last (lreq=0x55dc24c17b70) at lib/elementary/elc_fileselector.c:695
#27 0x00007f7885a00055 in _process_children_cb (data=0x55dc24c17b70, v=..., dead_future=0x55dc2481e040) at lib/elementary/elc_fileselector.c:959
#28 0x00007f78864a7669 in _eina_future_cb_dispatch (f=0x55dc2481e040, value=...) at lib/eina/eina_promise.c:351
#29 0x00007f78864a7c27 in _eina_future_cancel (f=0x55dc2481e040, err=125) at lib/eina/eina_promise.c:468
#30 0x00007f78864a8f59 in eina_future_cancel (f=0x55dc2481e080) at lib/eina/eina_promise.c:767
#31 0x00007f7886450684 in _efl_pending_futures_clear (pd=0x55dc249b5340) at lib/eo/eo_base_class.c:124
#32 0x00007f78864506b0 in _efl_object_invalidate (obj_id=0x40000001dd0c, pd=0x55dc249b5340) at lib/eo/eo_base_class.c:131
#33 0x00007f7886457dd6 in efl_invalidate (obj=0x40000001dd0c) at lib/eo/efl_object.eo.c:76
#34 0x00007f78861c39bc in _efl_canvas_object_efl_object_invalidate (eo_obj=0x40000001dd0c, obj=0x55dc249b5390) at lib/evas/canvas/evas_object_main.c:1350
#35 0x00007f7886457dd6 in efl_invalidate (obj=0x40000001dd0c) at lib/eo/efl_object.eo.c:76
#36 0x00007f7885b32e4f in _efl_access_object_efl_object_invalidate (obj=0x40000001dd0c, pd=0x55dc249b5874) at lib/elementary/efl_access_object.c:641
#37 0x00007f7886457dd6 in efl_invalidate (obj=0x40000001dd0c) at lib/eo/efl_object.eo.c:76
#38 0x00007f7885c96c3a in _efl_ui_focus_composition_efl_object_invalidate (obj=0x40000001dd0c, pd=0x55dc249b5830) at lib/elementary/efl_ui_focus_composition.c:223
#39 0x00007f7886457dd6 in efl_invalidate (obj=0x40000001dd0c) at lib/eo/efl_object.eo.c:76
#40 0x00007f78864507bd in _efl_invalidate (obj=0x55dc249b5300) at lib/eo/eo_base_class.c:167
#41 0x00007f78864524ec in _efl_object_parent_set (obj=0x40000001dd0c, pd=0x55dc249b5340, parent_id=0x0) at lib/eo/eo_base_class.c:726
#42 0x00007f7886456cf5 in efl_parent_set (obj=0x40000001dd0c, parent=0x0) at lib/eo/efl_object.eo.c:12
#43 0x00007f78860ce3a1 in _efl_loop_consumer_efl_object_parent_set (obj=0x40000001dd0c, pd=0x55dc249b5390, parent=0x0) at lib/ecore/efl_loop_consumer.c:36
#44 0x00007f7886456cf5 in efl_parent_set (obj=0x40000001dd0c, parent=0x0) at lib/eo/efl_object.eo.c:12
#45 0x00007f78864522d5 in efl_del (obj=0x40000001dd0c) at lib/eo/eo_base_class.c:678
#46 0x00007f78861c2893 in evas_object_del (obj=0x40000001dd0c) at lib/evas/canvas/evas_object_main.c:1052
#47 0x00007f7885c260df in _efl_ui_widget_efl_canvas_group_group_del (obj=0x400000003ca4, sd=0x55dc2480ebc0) at lib/elementary/efl_ui_widget.c:833
#48 0x00007f78861d982e in efl_canvas_group_del (obj=0x400000003ca4) at lib/evas/canvas/evas_object_smart.c:1843
#49 0x00007f7885c45e48 in _efl_ui_win_efl_canvas_group_group_del (obj=0x400000003ca4, sd=0x55dc2480ed60) at lib/elementary/efl_ui_win.c:2989
#50 0x00007f78861d982e in efl_canvas_group_del (obj=0x400000003ca4) at lib/evas/canvas/evas_object_smart.c:1843
#51 0x00007f78861d816b in evas_object_smart_del (eo_obj=0x400000003ca4) at lib/evas/canvas/evas_object_smart.c:1291
#52 0x00007f78861c398a in _efl_canvas_object_efl_object_invalidate (eo_obj=0x400000003ca4, obj=0x55dc2480ea00) at lib/evas/canvas/evas_object_main.c:1347
#53 0x00007f7886457dd6 in efl_invalidate (obj=0x400000003ca4) at lib/eo/efl_object.eo.c:76
#54 0x00007f7885b32e4f in _efl_access_object_efl_object_invalidate (obj=0x400000003ca4, pd=0x55dc2480efb8) at lib/elementary/efl_access_object.c:641
#55 0x00007f7886457dd6 in efl_invalidate (obj=0x400000003ca4) at lib/eo/efl_object.eo.c:76
#56 0x00007f78864507bd in _efl_invalidate (obj=0x55dc2480e970) at lib/eo/eo_base_class.c:167
#57 0x00007f78864524ec in _efl_object_parent_set (obj=0x400000003ca4, pd=0x55dc2480e9b0, parent_id=0x0) at lib/eo/eo_base_class.c:726
#58 0x00007f7886456cf5 in efl_parent_set (obj=0x400000003ca4, parent=0x0) at lib/eo/efl_object.eo.c:12
#59 0x00007f78860ce3a1 in _efl_loop_consumer_efl_object_parent_set (obj=0x400000003ca4, pd=0x55dc2480ea00, parent=0x0) at lib/ecore/efl_loop_consumer.c:36
#60 0x00007f7886456cf5 in efl_parent_set (obj=0x400000003ca4, parent=0x0) at lib/eo/efl_object.eo.c:12
#61 0x00007f78864522d5 in efl_del (obj=0x400000003ca4) at lib/eo/eo_base_class.c:678
#62 0x00007f78861c2893 in evas_object_del (obj=0x400000003ca4) at lib/evas/canvas/evas_object_main.c:1052
#63 0x00007f7885c478ec in _elm_win_shutdown () at lib/elementary/efl_ui_win.c:3670
#64 0x00007f7885b6fb4a in elm_shutdown () at lib/elementary/elm_main.c:457
#65 0x000055dc22a89a0b in _elm_suite_shutdown () at tests/elementary/suite_helpers.c:46
#66 0x00007f7886513820 in srunner_run_teardown () at /lib64/libcheck.so.0
#67 0x00007f78865142e8 in srunner_run_tagged () at /lib64/libcheck.so.0
#68 0x000055dc22a8ae95 in _efl_suite_run_end (sr=0x55dc24981e80, name=0x55dc22ac233b "elm_fileselector") at tests/elementary/../efl_check.h:251

Also, somewhat interesting is that I tried with eina thread debug enabled and the test passed every time with no errors. So I guess this is some timing issue.

zmike added a comment.Tue, Feb 5, 8:17 AM

Here's a new one, I got a crash today:

Thread 1 "elm_suite" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ebac26 in _efl_object_call_resolve (eo_id=0x40000012a72f, func_name=0x7ffff7ecee04 "efl_event_callback_array_del", call=0x7fffffffc4e0, op=33, file=0x7ffff7ece8fd "lib/eo/eo_base_class.c", line=1595) at lib/eo/eo.c:471
471	        vtable = EO_VTABLE(obj);
(gdb) bt
#0  0x00007ffff7ebac26 in _efl_object_call_resolve (eo_id=0x40000012a72f, func_name=0x7ffff7ecee04 "efl_event_callback_array_del", call=0x7fffffffc4e0, op=33, file=0x7ffff7ece8fd "lib/eo/eo_base_class.c", line=1595) at lib/eo/eo.c:471
#1  0x00007ffff7ec7a12 in efl_event_callback_array_del (obj=0x40000012a72f, array=0x7ffff7e96a60 <internal>, user_data=0x555555ac12c0) at lib/eo/eo_base_class.c:1592
#2  0x00007ffff7c0b5bb in evas_object_callback_shutdown (eo_obj=0x40000012a72f, obj=0x555555ac12c0) at lib/evas/canvas/evas_callbacks.c:869
#3  0x00007ffff7c4867f in evas_object_free (obj=0x555555ac12c0, clean_layer=0 '\000') at lib/evas/canvas/evas_object_main.c:549
#4  0x00007ffff7c23c27 in evas_layer_free_objects (lay=0x5555559cff10) at lib/evas/canvas/evas_layer.c:113
#5  0x00007ffff7c25c70 in _evas_canvas_efl_object_invalidate (eo_e=0x400000004696, e=0x5555558ded30) at lib/evas/canvas/evas_main.c:419
#6  0x00007ffff7ecadd6 in efl_invalidate (obj=0x400000004696) at lib/eo/efl_object.eo.c:76
#7  0x00007ffff7ec37bd in _efl_invalidate (obj=0x5555558deca0) at lib/eo/eo_base_class.c:167
#8  0x00007ffff7ec54ec in _efl_object_parent_set (obj=0x400000004696, pd=0x5555558dece0, parent_id=0x0) at lib/eo/eo_base_class.c:726
#9  0x00007ffff7ec9cf5 in efl_parent_set (obj=0x400000004696, parent=0x0) at lib/eo/efl_object.eo.c:12
#10 0x00007ffff7b55461 in _efl_loop_consumer_efl_object_parent_set (obj=0x400000004696, pd=0x5555558ded30, parent=0x0) at lib/ecore/efl_loop_consumer.c:36
#11 0x00007ffff7ec9cf5 in efl_parent_set (obj=0x400000004696, parent=0x0) at lib/eo/efl_object.eo.c:12
#12 0x00007ffff7ec52d5 in efl_del (obj=0x400000004696) at lib/eo/eo_base_class.c:678
#13 0x00007ffff7c25587 in evas_free (eo_e=0x400000004696) at lib/evas/canvas/evas_main.c:264
#14 0x00007ffff7b0db68 in _ecore_evas_free (ee=0x5555557b38a0) at lib/ecore_evas/ecore_evas.c:3497
#15 0x00007ffff7b05836 in ecore_evas_free (ee=0x5555557b38a0) at lib/ecore_evas/ecore_evas.c:1107
#16 0x00007ffff76caf8f in _deferred_ecore_evas_free (data=0x5555557b38a0) at lib/elementary/efl_ui_win.c:2274
#17 0x00007ffff7b4831a in _ecore_job_event_handler (data=0x0, type=15, ev=0x555555b90ef0) at lib/ecore/ecore_job.c:95
#18 0x00007ffff7b4ed47 in _ecore_event_message_handler_efl_loop_message_handler_message_call (obj=0x400000000e88, pd=0x55555587be50, message=0x4000001a6520) at lib/ecore/ecore_event_message_handler.c:360
#19 0x00007ffff7b58d42 in efl_loop_message_handler_message_call (obj=0x400000000e88, message=0x4000001a6520) at lib/ecore/efl_loop_message_handler.eo.c:14
#20 0x00007ffff7b535c7 in _efl_loop_message_process (obj=0x400000000285, pd=0x55555594d3d0) at lib/ecore/efl_loop.c:630
#21 0x00007ffff7b537b8 in efl_loop_message_process (obj=0x400000000285) at lib/ecore/efl_loop.c:660
#22 0x00007ffff7b4c85b in _ecore_main_loop_iterate_internal (obj=0x400000000285, pd=0x55555594d3d0, once_only=1) at lib/ecore/ecore_main.c:2458
#23 0x00007ffff7b49dcb in _ecore_main_loop_iterate (obj=0x400000000285, pd=0x55555594d3d0) at lib/ecore/ecore_main.c:1111
#24 0x00007ffff7b51d8f in _efl_loop_iterate (obj=0x400000000285, pd=0x55555594d3d0) at lib/ecore/efl_loop.c:70
#25 0x00007ffff7b5425e in efl_loop_iterate (obj=0x400000000285) at lib/ecore/efl_loop.eo.c:20
#26 0x00007ffff7b4a064 in ecore_main_loop_iterate () at lib/ecore/ecore_main.c:1258
#27 0x00007ffff75f6b56 in elm_shutdown () at lib/elementary/elm_main.c:460
#28 0x0000555555562a0b in _elm_suite_shutdown () at tests/elementary/suite_helpers.c:46
#29 0x00007ffff7f86820 in srunner_run_teardown () at /lib64/libcheck.so.0
#30 0x00007ffff7f86d54 in tcase_run_tfun_nofork.isra () at /lib64/libcheck.so.0
#31 0x00007ffff7f8736e in srunner_run_tagged () at /lib64/libcheck.so.0
#32 0x0000555555563e95 in _efl_suite_run_end (sr=0x555555925830, name=0x0) at tests/elementary/../efl_check.h:251
#33 0x00005555555643d4 in _efl_suite_build_and_run (argc=1, argv=0x7fffffffe0b0, suite_name=0x55555559b534 "Elementary", etc=0x5555555c35e0 <etc>, init=0x5555555628cc <_elm2_suite_init>, shutdown=0x5555555629fe <_elm_suite_shutdown>) at tests/elementary/../efl_check.h:386
#34 0x00005555555644e5 in main (argc=2, argv=0x7fffffffe0a8) at tests/elementary/elm_suite.c:100
zmike added a comment.Tue, Feb 5, 11:33 AM

After spending most of the day on this:

  1. _noref_death() is reached on a model
  2. _invalidate() is called in elc_fileselector.c on the model
  3. this cancels the underlying model's future in eio
  4. eio triggers its "thread done" callback for the model
  5. _properties_changed() is called on this model
  6. the (dead) model is added as a genlist item in _process_model()
  7. the fileselector is destroyed
  8. the model is killed again and either deadlocks or crashes