it seems at the end was a missing "#define ..._PROTECTED" in the .c file that includes the generated .eo.c.
I wonder: shouldn't the generated .eo.c write: #ifndef ..._PROTECTED #define ..._PROTECTED #endif On Mon, Aug 15, 2016 at 7:03 PM, Gustavo Sverzut Barbieri <barbi...@gmail.com> wrote: > Hi all, > > If you get my branch devs/barbieri/efl-io-interfaces [1] you can see > that the example efl_io_copier_example will fail to run with a strange > error as below. > > The class hierarchy is: > > - Efl.Io.Reader (interface), defines "can_read" property. > - Efl.Io.Reader.Fd (mixin on top of Efl.Io.Reader), implements "can_read" > - Efl.Io.Stdin (class on top of Efl.Loop.Fd and Efl.Io.Reader.Fd), > links Efl.Loop.Fd "read" event to set "can_read = True". > > It is analogous for Efl.Io.Stdout, replacing "read" with "write". > There is also a "Efl.Io.File" that goes much beyond that and use all > the interfaces and open(2) a file. > > Now to the error: > > $ ./src/examples/ecore/efl_io_copier_example - - # run stdin -> stdout > > # ignore "ERROR: unknown option -. > > ERR<4202>:eo lib/eo/eo.c:581 _eo_class_funcs_set() Class > 'Efl_Io_Reader_Fd': NULL API not allowed (NULL->0x7f9d238c3c30 > 'efl_io_reader_can_read_get'). > ERR<4202>:eo lib/eo/eo.c:549 _efl_object_api_op_id_get() Unable to > resolve op for api func 0x7f9d238c3940 > ERR<4202>:eo lib/eo/eo.c:581 _eo_class_funcs_set() Class > 'Efl_Io_Writer_Fd': NULL API not allowed (NULL->0x7f9d238c4710 > 'efl_io_writer_can_write_get'). > ERR<4202>:eo lib/eo/eo.c:549 _efl_object_api_op_id_get() Unable to > resolve op for api func 0x7f9d238c4450 > INFO: copy source=0x4000000030000004 (Efl_Io_Stdin) to > destination=0x4000000040000005 (Efl_Io_Stdout) > > As you can see, efl_io_reader_can_read_get() fails to be detected > although it was present in the Efl.Io.Reader.Fd [3][4]. Then when > Efl.Loop.Fd triggers event "read", it will set > efl_io_reader_can_read_set() [5] and it crashes when the signal > activates: > > ==11923== Jump to the invalid address stated on the next line > ==11923== at 0x0: ??? > ==11923== by 0x4E53A30: _efl_io_stdin_event_read (efl_io_stdin.c:16) > ==11923== by 0x508FC97: _efl_object_event_callback_call > (eo_base_class.c:1176 > ) > ==11923== by 0x508E7A3: efl_event_callback_call (in > /home/gustavo/Development > /git/efl/src/lib/eo/.libs/libeo.so.1.18.99) > ==11923== by 0x4E51B98: _efl_loop_fd_read_cb (efl_loop_fd.c:34) > ==11923== by 0x4E4FF11: _ecore_call_fd_cb (ecore_private.h:333) > ==11923== by 0x4E4FF11: _ecore_main_fd_handlers_call (ecore_main.c:1974) > ==11923== by 0x4E4FF11: _ecore_main_loop_iterate_internal > (ecore_main.c:2339) > ==11923== by 0x4E503E6: ecore_main_loop_begin (ecore_main.c:1286) > ==11923== by 0x109B1F: main (efl_io_copier_example.c:254) > ==11923== Address 0x0 is not stack'd, malloc'd or (recently) free'd > ==11923== > ==11923== > ==11923== Process terminating with default action of signal 11 > (SIGSEGV): dumping core > ==11923== Bad permissions for mapped region at address 0x0 > ==11923== at 0x0: ??? > ==11923== by 0x4E53A30: _efl_io_stdin_event_read (efl_io_stdin.c:16) > ==11923== by 0x508FC97: _efl_object_event_callback_call > (eo_base_class.c:1176) > ==11923== by 0x508E7A3: efl_event_callback_call (in > /home/gustavo/Development/git/efl/src/lib/eo/.libs/libeo.so.1.18.99) > ==11923== by 0x4E51B98: _efl_loop_fd_read_cb (efl_loop_fd.c:34) > ==11923== by 0x4E4FF11: _ecore_call_fd_cb (ecore_private.h:333) > ==11923== by 0x4E4FF11: _ecore_main_fd_handlers_call (ecore_main.c:1974) > ==11923== by 0x4E4FF11: _ecore_main_loop_iterate_internal > (ecore_main.c:2339) > ==11923== by 0x4E503E6: ecore_main_loop_begin (ecore_main.c:1286) > ==11923== by 0x109B1F: main (efl_io_copier_example.c:254) > > If you try with the Efl.Io.File version by giving the example some > real file, you get a similar error with the other class: > > $ ./src/examples/ecore/efl_io_copier_example /tmp/src /tmp/dst > ERR<12045>:eo lib/eo/eo.c:581 _eo_class_funcs_set() Class 'Efl_Io_Writer_Fd': > NU > LL API not allowed (NULL->0x4e53710 'efl_io_writer_can_write_get'). > ERR<12045>:eo lib/eo/eo.c:581 _eo_class_funcs_set() Class 'Efl_Io_Reader_Fd': > NU > LL API not allowed (NULL->0x4e52c30 'efl_io_reader_can_read_get'). > ERR<12045>:eo lib/eo/eo.c:626 _eo_class_funcs_set() Class 'Efl_Io_File': > Can't f > ind api func description in class hierarchy (0x5d918f0->0x4e54c70) > (efl_io_reade > r_read). > ERR<12045>:eo lib/eo/eo.c:549 _efl_object_api_op_id_get() Unable to > resolve op for api func 0x4e543d0 > ERROR: could not open '/tmp/src' for read. > > This was due efl_io_reader_read() not found. > > Then clearly I'm missing some detail with eolian/.eo files, advices? > > BR, > > > [1] > https://git.enlightenment.org/core/efl.git/log/?h=devs/barbieri/efl-io-interfaces > [2] > https://git.enlightenment.org/core/efl.git/tree/src/examples/ecore/efl_io_copier_example.c?h=devs/barbieri/efl-io-interfaces > [3] > https://git.enlightenment.org/core/efl.git/tree/src/lib/ecore/efl_io_reader_fd.eo?h=devs/barbieri/efl-io-interfaces > [4] > https://git.enlightenment.org/core/efl.git/tree/src/lib/ecore/efl_io_reader_fd.c?h=devs/barbieri/efl-io-interfaces > [5] > https://git.enlightenment.org/core/efl.git/tree/src/lib/ecore/efl_io_stdin.c?h=devs/barbieri/efl-io-interfaces#n16 > > > -- > Gustavo Sverzut Barbieri > -------------------------------------- > Mobile: +55 (16) 99354-9890 -- Gustavo Sverzut Barbieri -------------------------------------- Mobile: +55 (16) 99354-9890 ------------------------------------------------------------------------------ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel