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

Periodic ObjectNotExistException with Glacier2 categories

We are seeing intermittent failures when sending stringified callback proxies to the server. Glacier2 is producing categories that end in a single "\" which leads to a category-less server-side identity when calling stringToProxy.

See for modifications to "java/demo/Ice/callback" which reproduce this issue. After compiling, run "java Server" to start listening. "java Client" will create callbacks in a loop using the mkident method which simulates the Glacier2 code.

After a number of iterations, the server will fail with an ObjectNotExistException. E.g:
initiating callback:Y4i3gZcg$azF4*}93[<X/callbackReceiver -t -e 1.1:tcp -h -p 55324:tcp -h -p 55324
initiating callback:BC}`V?a\"ab;aj[Cxd(VC/callbackReceiver -t -e 1.1:tcp -h -p 55324:tcp -h -p 55324
initiating callback:,X2QNUAzSBcJ_e$AV;E\\/callbackReceiver -t -e 1.1:tcp -h -p 55324:tcp -h -p 55324
Ice.ObjectNotExistException = ",X2QNUAzSBcJ_e$AV;E\/callbackReceiver"
    id.category = ""
    facet = ""
    operation = "callback"
        at IceInternal.Outgoing.invoke(
        at Demo._CallbackReceiverDelM.callback(
        at Demo.CallbackReceiverPrxHelper.callback(
        at Demo.CallbackReceiverPrxHelper.callback(
        at CallbackSenderI.initiateCallbackByString(
        at Demo._CallbackSenderDisp.___initiateCallbackByString(
        at Demo._CallbackSenderDisp.__dispatch(
        at IceInternal.Incoming.invoke(
        at Ice.ConnectionI.invokeAll(
        at Ice.ConnectionI.dispatch(
        at Ice.ConnectionI.message(
        at IceInternal.ThreadPool.access$300(
        at IceInternal.ThreadPool$

The frequency of this happening is only a little over 1%:
$ cat
import random
import Ice
import Glacier2

def mkident():
    ident = Ice.Identity()
    ident.category = "" = "processor"
    for x in range(size):
        c = random.randint(0, 255)
        ident.category += chr(33+c%(127-33))
    return ident

for x in range(size):
    c = mkident().category
    if c[-1] == "\\" and c[-2] != "\\":
        found += 1
print "%2.4f%%" % (float(found)/size * 100)

$ python 

so it's taken us some time to track it down (~2 years). See

Suggested workarounds would be appreciated. Attempts to modify the server-side stringToProxy code weren't successful. For the moment, we're detecting that a client-category ends in "\" and are closing and re-opening the session.



  • benoit
    benoit Rennes, France

    Thanks for the bug report, we'll look into fixing this.

  • bernard
    bernard Jupiter, FL
    Hi Josh,

    It's actually a bug in stringToIdentity, which does not handle properly trailing escaped escapes in the category. Thanks again for reporting it! We will include a fix in the next Ice release.

    For now, you could:

    1) rework your code to avoid using an intermediary stringified representation of these proxies - in general, I would recommend not to stringify transient proxies such as these Glacier2 callback proxies.

    2) fix stringToIdentity in all language mappings where you perform these "un-stringifications" with stringToProxy, stringToIdentity, propertyToProxy.

    For example, in Java, replace line 243 in src/Ice/ (Ice 3.5.1)
                if(pos == 0 || s.charAt(pos - 1) != '\\')
                int escapes = 0;
                while(pos - escapes > 0 && s.charAt(pos - escapes - 1) == '\\')
                // We ignore escaped escapes
                if(escapes % 2 == 0)

    3) Change the Glacier2 random-category generation code to avoid generating these trailing backslashes (or backslashes in general).

    Best regards,