Archived

This forum has been archived. Please start a new discussion on GitHub.

slice2cpp.exe terminates with IceUtil::NullHandleException on Windows32 and 64-bit

We use Ice-3.5.0 on Linux (64-bit), MacOSX, Windows (Server 2008) 32 and 64-bit platforms.

Only on Windows 32 and 64-bit platforms, we see slice2cpp.exe abnormally terminating on a random slice file with an error message:
slice2cpp.exe: error:C:\IceBuild\Release-x64\cpp\include\IceUtil/Handle.h:46: IceUtil::NullHandleException

Also, this error does not also occur on any specific slice file. It seems to be random. The slice files are in the local file system. Any ideas on how we can fix this?

The same slice files compile without problems on Linux and Mac OSX.

Thanks.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Do you have the same problem using the Ice binaries we provide with the Ice 3.5.x installer?

    Can you tell us a little more about your Ice build? Did you also build the 3rd parties or did you use the binaries from our 3rd party installer? If you built the 3rd parties yourself, it's important to ensure that you have applied the mcpp patch.

    If you are confident you built everything correctly, the easiest to investigate this problem would be to get slice2cpp to abort on the IceUtil::NullHandleException, this can be achieved by making the following changes to the slice2cpp source code (Ice-3.5.0), edit cpp/src/slice2cpp/Main.cpp and add:
    // Line 48:
    namespace IceUtilInternal
    {
    
    extern bool ICE_DECLSPEC_IMPORT nullHandleAbort;
    
    };
    
    // line 321 right after main():
    int
    main(int argc, char* argv[])
    {
        IceUtilInternal::nullHandleAbort = true;
    ...
    

    This should cause slice2cpp to abort when it encounters an IceUtil::NullHandleException. You should be able to attach the debugger and get a stack trace of the abort when this occurs (assuming you built slice2cpp with debugging information).

    Cheers,
    Benoit.
  • Thanks for the reply, Benoit.

    I built Ice 3.5 from sources, but used the 3rd party binaries from the ZeroC 3rd party installer.

    I will try out your recommendation of trying to debug slice2cpp, and post an update about what I find.

    -Shankar