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

NullHandleException on server exit with CommunicationObserver


I'm experimenting with CommunicatorObserver and it works but I can't get my server to exit cleanly. To track it down I've modified the Hello demo server and I'm getting the same result.

I define a CommunicatorObserverImpl which returns zeros for all observers and pass an instance of it to Ice::Application.
class CommunicatorObserverImpl : public Ice::Instrumentation::CommunicatorObserver
    ::Ice::Instrumentation::ObserverPtr getConnectionEstablishmentObserver(const ::Ice::EndpointPtr&, const ::std::string&) { return 0; }
    void setObserverUpdater(const ::Ice::Instrumentation::ObserverUpdaterPtr& updater) {}

class HelloServer : public Ice::Application

    virtual int run(int, char*[]);

main(int argc, char* argv[])
    HelloServer app;

//    return app.main(argc, argv, "config.server");

    Ice::InitializationData id; = new CommunicatorObserverImpl;
    return app.main(argc, argv, id);

The server works as expected but throws an exception on Ctrl-C. Any ideas on what's happening?
$ ./server --Ice.Config=config.server
Hello World!
Hello World!

^C!! 05/31/15 12:02:02.894 ./server: error: (while destroying in response to signal 2): ../../include/IceUtil/Handle.h:46: IceUtil::NullHandleException
     0 IceUtil::Exception::Exception(char const*, int) in /opt/Ice-3.5.1/lib/
     1 IceUtil::NullHandleException::NullHandleException(char const*, int) in /opt/Ice-3.5.1/lib/
     2 IceUtil::HandleBase<IceInternal::CommunicatorObserverI>::throwNullHandleException(char const*, int) const in /opt/Ice-3.5.1/lib/
     3 IceUtil::HandleBase<IceInternal::CommunicatorObserverI>::operator->() const in /opt/Ice-3.5.1/lib/
     4 IceInternal::Instance::destroy() in /opt/Ice-3.5.1/lib/
     5 Ice::CommunicatorI::destroy() in /opt/Ice-3.5.1/lib/
     6 /opt/Ice-3.5.1/lib/ [0x7f979f44890a]
     7 /opt/Ice-3.5.1/lib/ [0x7f979ee9b88e]
     8 /lib/x86_64-linux-gnu/ [0x7f979e4220ca]
     9 clone() in /lib/x86_64-linux-gnu/

Thanks, Matt.


  • benoit
    benoit Rennes, France
    Hi Matt,

    This is a known problem with custom observers. I recommend to try out Ice 3.6b instead which has a fix for this problem. The final version will be released in few days.