abnormal termination slice2py

jbureljburel Member jean marie burelOrganization: University of DundeeProject: Data management platform for imaging data.

Hello

I am trying to upgrade the OME project to support ice 3.7
I am using Ubuntu 18.04/Ice 3.7.1 in a docker container
When running the slice2py command:
I enter in a loop and the following error is displayed

/usr/bin/slice2py: error: include/IceUtil/Handle.h:46: ::IceUtil::NullHandleException
/tmp/omero-build/omero-blitz/src/generated/slice/omero/Collections.ice:31: value type refers to undefined type `::omero::model::Experimenter'
/
where Collections.ice has the following lines (I have extracted a small part of the full file)

module omero {

module api {

   ["java:type:java.util.ArrayList<omero.model.Experimenter>:java.util.List<omero.model.Experimenter>"]
        sequence<omero::model::Experimenter> ExperimenterList;

```

This looks similar to https://forums.zeroc.com/discussion/4301/circular-includes-cause-abnormal-termination-since-slice-generators

Cheers

Jean-marie

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    Hi Jean,

    The issue you linked was fixed a while ago it was related to circular includes.

    I cannot reproduce this using your sample code. Can you give us a complete sample that allow to reproduce the issue? Also if you can attach to slice2py when it enter a loop and get a stack trace of all threads will be helpful.

    Cheers,
    José

  • jbureljburel Member jean marie burelOrganization: University of DundeeProject: Data management platform for imaging data.

    Hi Jose

    i figured out what is happening
    The slice Collections.ice does not have any include e.g. #include <omero/model/Experimenter.ice>. The slices like omero/model/Experimenter.ice are programmatically generated. Until ice 3.7 it was not necessary to declare them in Collections.ice.
    If this is now mandatory, we will have to review all the slice generations and definitions.
    Is there a way around it?
    Cheers

    Jean-marie

  • jbureljburel Member jean marie burelOrganization: University of DundeeProject: Data management platform for imaging data.

    Hi Jose
    I should have been a bit clearer.
    The slice Experimenter.ice is not "directly" included in Collections.ice but via another file ModelF.ice

    #ifndef OMERO_MODELF_ICE
    #define OMERO_MODELF_ICE
    
    module omero {
    
        module model {
    
            class Experimenter;
    
    

    This approach has worked until 3.7.

    Jean-marie

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    Hi Jean-Marie,

    The slice2py compiler should never crash, even if you give it invalid Slice definitions, so please open a bug on GitHub.

    It would be helpful if you could attach a small test-case that we can use to reproduce it.

    If class Experimenter is never defined, slice2py should not allow you to marshal or unmarshal it, and it should report an error (but not crash). This is a new constraint in Ice 3.7, but it's unclear if this is related to the error you're getting. See https://github.com/zeroc-ice/ice/issues/97 for details.

    Best regards,
    Bernard

  • jbureljburel Member jean marie burelOrganization: University of DundeeProject: Data management platform for imaging data.

    Hi Bernard

    The GitHub issue mentioned above seems related to the problem we are currently having
    I have not been able yet to generate a simple example triggering the error noticed while using slice2py.

    Regards

    Jmarie

  • jbureljburel Member jean marie burelOrganization: University of DundeeProject: Data management platform for imaging data.

    After re-organising the slices after following the forward declarations changes cf. https://github.com/zeroc-ice/ice/issues/97, I am still not able to build using slice2py, the command seems to iterate over the files several times and the following error /usr/bin/slice2py: error: include/IceUtil/Handle.h:46: ::IceUtil::NullHandleException is printed out in the console at regular intervals.
    Still trying to narrow it down, any hints welcome

    Regards

    Jmarie

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    Hi Jean,

    Can you run slice2py under gdb set a catchpoint for the throwing of C++ exceptions using gdb catch throw command and get a back trace, something like this should work:

    If you are using the ZeroC 3.7.1 binary packages first install the symbols for slice compilers with

    sudo apt-get install zeroc-ice-compilers-dbgsym
    

    Then start slice2py with GDB and get a backtrace of the exception

    gdb /usr/bin/slice2py
    cath throw
    run Experimenter.ice <Slice compiler args>
    
    bt
    

    Cheers,
    José

  • jbureljburel Member jean marie burelOrganization: University of DundeeProject: Data management platform for imaging data.

    Hello I finally managed to reproduce the error with a small example using a simple file ModelF.ice

    #ifndef OMERO_MODELF_ICE
    #define OMERO_MODELF_ICE
    
    /*
     * Defines various classes for more simplified imports.
     */
    module omero {
    
        module model {
     class NamedValue;
    };
    };
    
    #endif
    

    Then run

     slice2py -I. ModelF.ice 
    slice2py: error: include/IceUtil/Handle.h:46: ::IceUtil::NullHandleException
    

    I hope this is useful

    Jmarie

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    Hi,

    Thanks for the test case, that was caused for a bug in slice2py, that was trigger by a forward declaration without definition.

    A fix for this will be included in upcoming 3.7.2 release, I push the fix to github https://github.com/zeroc-ice/ice/commit/f4f1c45b1fe339a72b10454d5d8d4de05a4ca7d4

Sign In or Register to comment.