Page MenuHomePhabricator

eo calls parent_set with null parent during construction
Closed, ResolvedPublic

Description

It seems to me like this call in eo.c:914 could be avoided if there is no parent passed?

#0  _efl_task_efl_object_constructor (obj=0x400000000157, pd=0x55555578a190) at lib/ecore/efl_task.c:399
#1  0x00007ffff7717939 in efl_constructor (obj=0x400000000157) at lib/eo/efl_object.eo.c:60
#2  0x00007ffff74a6fd1 in _efl_loop_efl_object_constructor (obj=0x400000000157, pd=0x55555578a1c0) at lib/ecore/efl_loop.c:308
#3  0x00007ffff7717939 in efl_constructor (obj=0x400000000157) at lib/eo/efl_object.eo.c:60
#4  0x00007ffff74a4407 in _efl_app_efl_object_constructor (obj=0x400000000157, pd=0x55555578a2f0) at lib/ecore/efl_app.c:143
#5  0x00007ffff7717939 in efl_constructor (obj=0x400000000157) at lib/eo/efl_object.eo.c:60
#6  0x00007ffff77095ee in _efl_add_internal_start (file=0x7ffff74e4bdc "lib/ecore/efl_app.c", line=114, klass_id=0x200000000008, parent_id=0x0, ref=1 '\001', is_fallback=0 '\000') at lib/eo/eo.c:917
#7  0x00007ffff74a4351 in _efl_app_loop_main_get (obj=0x200000000008, pd=0x0) at lib/ecore/efl_app.c:114
#8  0x00007ffff74a4e3d in efl_app_loop_main_get (obj=0x200000000008) at lib/ecore/efl_app.eo.c:16
#9  0x00007ffff74a65c5 in efl_main_loop_get () at lib/ecore/efl_loop.c:64
#10 0x00007ffff749da95 in _ecore_main_loop_init () at lib/ecore/ecore_main.c:1078
#11 0x00007ffff749166b in ecore_init () at lib/ecore/ecore.c:276
#12 0x00005555555638a5 in _efl_app_suite_init () at tests/ecore/efl_app_suite.c:62
#13 0x00007ffff7bd082a in srunner_run_setup (fixture_list=0x55555577fd80, fork_usage=CK_NOFORK, test_name=test_name@entry=0x555555566764 "App", setup_name=setup_name@entry=0x7ffff7bd219b "checked_setup") at check_run.c:308
#14 0x00007ffff7bd099f in tcase_run_checked_setup (tc=0x55555577fcb0, tc=0x55555577fcb0, sr=0x55555577fbc0) at check_run.c:352
#15 tcase_run_tfun_nofork (sr=sr@entry=0x55555577fbc0, tc=tc@entry=0x55555577fcb0, i=i@entry=0, tfun=<optimized out>, tfun=<optimized out>) at check_run.c:412
#16 0x00007ffff7bd0eee in srunner_iterate_tcase_tfuns (tc=0x55555577fcb0, sr=0x55555577fbc0) at check_run.c:259
#17 srunner_run_tcase (tc=0x55555577fcb0, sr=0x55555577fbc0) at check_run.c:401
#18 srunner_iterate_suites (print_mode=<optimized out>, exclude_tags=0x0, include_tags=0x0, tcname=<optimized out>, sname=0x0, sr=0x55555577fbc0) at check_run.c:218
#19 srunner_run_tagged (sr=0x55555577fbc0, sname=0x0, tcname=<optimized out>, include_tags=0x0, exclude_tags=0x0, print_mode=<optimized out>) at check_run.c:815
#20 0x0000555555563196 in _efl_suite_run_end (sr=0x55555577fbc0, name=0x0) at tests/ecore/../efl_check.h:241
#21 0x00005555555634ad in _efl_suite_build_and_run (argc=0, argv=0x7fffffffdce0, suite_name=0x555555566837 "Efl_App", etc=0x555555768d00 <etc>, init=0x555555563898 <_efl_app_suite_init>, shutdown=0x555555563914 <_efl_app_suite_shutdown>) at tests/ecore/../efl_check.h:329
#22 0x0000555555563a09 in main (argc=1, argv=0x7fffffffdcd8) at tests/ecore/efl_app_suite.c:84


#0  _efl_task_efl_object_parent_set (obj=0x40000000015f, pd=0x55555578a190, parent=0x0) at lib/ecore/efl_task.c:419
#1  0x00007ffff7716c8f in efl_parent_set (obj=0x40000000015f, parent=0x0) at lib/eo/efl_object.eo.c:12
#2  0x00007ffff77095e2 in _efl_add_internal_start (file=0x7ffff74e4bdc "lib/ecore/efl_app.c", line=114, klass_id=0x200000000008, parent_id=0x0, ref=1 '\001', is_fallback=0 '\000') at lib/eo/eo.c:914
#3  0x00007ffff74a4351 in _efl_app_loop_main_get (obj=0x200000000008, pd=0x0) at lib/ecore/efl_app.c:114
#4  0x00007ffff74a4e3d in efl_app_loop_main_get (obj=0x200000000008) at lib/ecore/efl_app.eo.c:16
#5  0x00007ffff74a65c5 in efl_main_loop_get () at lib/ecore/efl_loop.c:64
#6  0x00007ffff749da95 in _ecore_main_loop_init () at lib/ecore/ecore_main.c:1078
#7  0x00007ffff749166b in ecore_init () at lib/ecore/ecore.c:276
#8  0x00005555555638a5 in _efl_app_suite_init () at tests/ecore/efl_app_suite.c:62
#9  0x00007ffff7bd082a in srunner_run_setup (fixture_list=0x55555577ffc0, fork_usage=CK_NOFORK, test_name=test_name@entry=0x555555566768 "Loop", setup_name=setup_name@entry=0x7ffff7bd219b "checked_setup") at check_run.c:308
#10 0x00007ffff7bd099f in tcase_run_checked_setup (tc=0x55555577fef0, tc=0x55555577fef0, sr=0x55555577fbc0) at check_run.c:352
#11 tcase_run_tfun_nofork (sr=sr@entry=0x55555577fbc0, tc=tc@entry=0x55555577fef0, i=i@entry=0, tfun=<optimized out>, tfun=<optimized out>) at check_run.c:412
#12 0x00007ffff7bd0eee in srunner_iterate_tcase_tfuns (tc=0x55555577fef0, sr=0x55555577fbc0) at check_run.c:259
#13 srunner_run_tcase (tc=0x55555577fef0, sr=0x55555577fbc0) at check_run.c:401
#14 srunner_iterate_suites (print_mode=<optimized out>, exclude_tags=0x0, include_tags=0x0, tcname=<optimized out>, sname=0x0, sr=0x55555577fbc0) at check_run.c:218
#15 srunner_run_tagged (sr=0x55555577fbc0, sname=0x0, tcname=<optimized out>, include_tags=0x0, exclude_tags=0x0, print_mode=<optimized out>) at check_run.c:815
#16 0x0000555555563196 in _efl_suite_run_end (sr=0x55555577fbc0, name=0x0) at tests/ecore/../efl_check.h:241
#17 0x00005555555634ad in _efl_suite_build_and_run (argc=0, argv=0x7fffffffdce0, suite_name=0x555555566837 "Efl_App", etc=0x555555768d00 <etc>, init=0x555555563898 <_efl_app_suite_init>, shutdown=0x555555563914 <_efl_app_suite_shutdown>) at tests/ecore/../efl_check.h:329
#18 0x0000555555563a09 in main (argc=1, argv=0x7fffffffdcd8) at tests/ecore/efl_app_suite.c:84
zmike created this task.Jun 18 2018, 10:35 AM
zmike triaged this task as High priority.

I tested and it seems that making this check conditional has no adverse effects...

Well, theoretical it should not. As eo_base_class.c returns straight away, however, if someone was prepared to get parent_set called on the beginning of a object, then he has a problem now. However, he should never expect a parent_set to NULL tbh. :)

zmike added a comment.Jun 19 2018, 7:20 AM

I think parent_set(NULL) is fine conceptually, but having an extra call like that during the constructor seems useless...