On Sat, 3 Dec 2016 09:58:20 -0200 Gustavo Sverzut Barbieri <barbi...@gmail.com>
said:

> On Sat, Dec 3, 2016 at 12:31 AM, Carsten Haitzler <ras...@rasterman.com>
> wrote:
> > On Sat, 03 Dec 2016 01:45:30 +0000 Gustavo Sverzut Barbieri
> > <barbi...@gmail.com> said:
> >
> >> Well, I did force and it "worked". Not much test, like I've noticed some
> >> cases check for class using just the eo_id...
> >
> > how can you force it? literally there's missing non-eoid code paths. eo will
> > mess up the pointer by mucking about with the bits in it... i'm amazed it
> > worked at all.. but i guarantee you it wont be correct either way.
> 
> go to eo_private.h and do:
> 
> #undef HAVE_EO_ID
> 
> I've tested with efl_net_dialer_simple_example, which does lots of
> objects and classes and inheritance. You get the following log when
> using that and the double free case:
> 
> $ LD_PRELOAD=src/lib/eo/.libs/libeo_dbg.so \
>    EO_LIFECYCLE_NO_DEBUG=Efl_Loop_Timer,Efl_Promise,Efl_Future \
>    EO_LIFECYCLE_DEBUG=1 \
>    EINA_LOG_LEVELS=eo:3,eo_lifecycle:4 \
>    libtool --mode=execute valgrind
> ./src/examples/ecore/efl_net_dialer_simple_example tcp localhost:1234
> 
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2736 _eo_log_obj_init() will log
> all object allocation and free
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2812 _eo_log_obj_init() will NOT
> log class 'Efl_Future'
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2812 _eo_log_obj_init() will NOT
> log class 'Efl_Promise'
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2812 _eo_log_obj_init() will NOT
> log class 'Efl_Loop_Timer'
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x9723470 obj_id=0x9723470 class=0x9722bb0 (Efl_Vpath_Core)
> [0.1132]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x9738a90 obj_id=0x9738a90 class=0x9737800 (Efl_Loop) [0.1645]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x9782250 obj_id=0x9782250 class=0x97809f0 (Efl_Net_Dialer_Simple)
> [0.5570]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x9782650 obj_id=0x9782650 class=0x977c210 (Efl_Net_Dialer_Tcp)
> [0.5736]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x9783de0 obj_id=0x9783de0 class=0x9782930 (Efl_Io_Queue) [0.5963]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x9786360 obj_id=0x9786360 class=0x97841a0 (Efl_Io_Copier)
> [0.6090]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x978bb70 obj_id=0x978bb70 class=0x9782930 (Efl_Io_Queue) [0.6553]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2689 _eo_log_obj_new() new
> obj=0x978bf30 obj_id=0x978bf30 class=0x97841a0 (Efl_Io_Copier)
> [0.6588]
> INFO: sending 'Hello World!'
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x978bb70 obj_id=0x978bb70 class=0x9782930 (Efl_Io_Queue) [0.7322]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x978bf30 obj_id=0x978bf30 class=0x97841a0 (Efl_Io_Copier)
> [0.7472]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x9783de0 obj_id=0x9783de0 class=0x9782930 (Efl_Io_Queue) [0.7504]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x9786360 obj_id=0x9786360 class=0x97841a0 (Efl_Io_Copier)
> [0.7536]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x9782650 obj_id=0x9782650 class=0x977c210 (Efl_Net_Dialer_Tcp)
> [0.7730]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x9782250 obj_id=0x9782250 class=0x97809f0 (Efl_Net_Dialer_Simple)
> [0.7936]
> CRI<13298>: ../src/lib/eo/efl_object.eo.c:78 efl_del() *** Eina Magic
> Check Failed at 0x9782250 !!!
>     Input handle is wrong type
>     Expected: a186bc32 - Eo
>     Supplied: 00000000 - (unknown)
> *** NAUGHTY PROGRAMMER!!!
> *** SPANK SPANK SPANK!!!
> *** Now go fix your code. Tut tut tut!
> 
> 
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> obj_id=0x9782250 created obj=0x9782250, class=0x97809f0
> (Efl_Net_Dialer_Simple) [0.5570s, 0.2536 ago]:
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e3ff1a: libeo_dbg.so+0x8f1a (in
> src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e3fbdd: _efl_add_internal_start+0x1cd (in
> src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x0000000010a85f: lt-efl_net_dialer_simple_example+0x285f (in
> /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example
> 0x108000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000005c79291: __libc_start_main+0xf1 (in /usr/lib/libc.so.6
> 0x5c59000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x0000000010a38a: _start+0x2a (in
> /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example
> 0x108000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> obj_id=0x9782250 deleted obj=0x9782250, class=0x97809f0
> (Efl_Net_Dialer_Simple) [0.7936s, 0.0169 ago]:
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e406ea: libeo_dbg.so+0x96ea (in
> src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e40541: libeo_dbg.so+0x9541 (in
> src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e3ef78: libeo_dbg.so+0x7f78 (in
> src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e3f12e: _efl_object_call_end+0x4e (in
> src/lib/eo/.libs/libeo_dbg.so 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000004e47415: efl_del+0x105 (in src/lib/eo/.libs/libeo_dbg.so
> 0x4e37000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x0000000010ac2c: lt-efl_net_dialer_simple_example+0x2c2c (in
> /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example
> 0x108000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x00000005c79291: __libc_start_main+0xf1 (in /usr/lib/libc.so.6
> 0x5c59000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> 0x0000000010a38a: _start+0x2a (in
> /home/gustavo/Development/git/efl/src/examples/ecore/.libs/lt-efl_net_dialer_simple_example
> 0x108000)
> ERR<13298>:eo_lifecycle ../src/lib/eo/efl_object.eo.c:78 efl_del()
> obj_id=0x9782250 was already deleted 0.0169 seconds ago!
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x9738a90 obj_id=0x9738a90 class=0x9737800 (Efl_Loop) [0.9533]
> DBG<13298>:eo_lifecycle lib/eo/eo.c:2712 _eo_log_obj_free() free
> obj=0x9723470 obj_id=0x9723470 class=0x9722bb0 (Efl_Vpath_Core)
> [0.9792]
> 
> 
> I've noticed no valgrind kicks in and that's due the freeq... that one
> must mark the object as dead... will do it now

well i am telling you the eo has code that literally checks specific bits in
the pointer value and we need at lease 4 bits of it right now and stuff will
mess up based on pointer values. you just got lucky i guess.


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to