Archived

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

NullHandleException

Hi,

I've downloaded and installed Ice on Linux (LFS 4) without any obvious problems. I've tried building the Printer example from the docs. Compiles and links OK. When I try to run the server or client I get an exception:
../../include/IceUtil/Handle.h:44 IceUtil::NullHandleException
thrown in ic = Ice::initialize(argc,argv)

Running make test fails in test/Ice/exceptions, testing checked cast.

Any suggestions as to what might be wrong?
I've probably missed something obvious so prepared to be embarrassed!

Mike

Comments

  • mes
    mes California
    Hi Mike,

    We like to know what compiler version you're using, as well as the versions of any supporting libraries (STL, OpenSSL, etc.).

    Can you try to find out where in Ice the exception is occurring, either in a debugger or with judicious use of print statements?

    Thanks,
    - Mark
  • Mark,

    I'm using gcc 3.2, xerces-c++ 2.1.0, OpenSSL 0.9.6, e2fsprogs 1.27, bzip2 1.0.2, Berkeley DB 4.1.25. Are there any others I need to check?

    Putting in some print statements, I end up in DefaultsAndOverrides.cpp

    getProperty("Ice.Default.Host") succeeds
    defaultHost.empty() is true, if-block entered.

    const_cast<string&>(defaultHost) =getLocalHost(true); fails

    Does this help?

    Mike
  • mes
    mes California
    Originally posted by mike
    Mark,

    I'm using gcc 3.2, xerces-c++ 2.1.0, OpenSSL 0.9.6, e2fsprogs 1.27, bzip2 1.0.2, Berkeley DB 4.1.25. Are there any others I need to check?
    No, thanks.

    Putting in some print statements, I end up in DefaultsAndOverrides.cpp

    getProperty("Ice.Default.Host") succeeds
    defaultHost.empty() is true, if-block entered.

    const_cast<string&>(defaultHost) =getLocalHost(true); fails

    Does this help?

    Mike
    I might be missing something, but I don't see how getLocalHost can cause a NullHandleException. Can you narrow it down a bit further? The getLocalHost function is defined in src/Ice/Network.cpp.

    - Mark
  • mes
    mes California
    Sorry Mike, there's an easier way to diagnose a NullHandleException: set the property Ice.NullHandleAbort=1 and the program will abort when the exception is created, leaving a core file from which you can obtain a stack trace.

    - Mark
  • I didn't see your suggestion in time but I've got some more information anyway:

    In Network.cpp, IceInternal::getLocalHost(bool numeric)
    gethostbyname() returns 0

    (the machine doesn't have a DNS entry so I guess this could be the source of the problem)

    This results in the exception:
    Network.cpp:646: Ice::DNSException:
    DNS error: temporary error, try again

    Following the exception back up we go through:

    DefaultsAndOverrides.cpp - no try...catch

    Instance.cpp, IceInternal::Instance::Instance(...)
    Network.cpp:646: Ice::DNSException:
    DNS error: temporary error, try again

    CommunicatorI.cpp, Ice::CommunicatorI::CommunicatorI(...)
    ../../include/IceUtil/Handle.h:44: IceUtil::NullHandleException

    Initialize.cpp, Ice::initialize(...) - no try...catch

    Server.cpp
    ../../include/IceUtil/Handle.h:44: IceUtil::NullHandleException

    Does this explain what's going on?

    Mike