abnormal termination slice2py

in Comments
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
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é
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 likeomero/model/Experimenter.ice
are programmatically generated. Until ice 3.7 it was not necessary to declare them inCollections.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
Hi Jose
I should have been a bit clearer.
The slice
Experimenter.ice
is not "directly" included inCollections.ice
but via another fileModelF.ice
This approach has worked until 3.7.
Jean-marie
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
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
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
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
Then start slice2py with GDB and get a backtrace of the exception
Cheers,
José
Hello I finally managed to reproduce the error with a small example using a simple file
ModelF.ice
Then run
I hope this is useful
Jmarie
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