Archived

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

"out of bounds during unmarshaling" on ice_invoke() call (dynamic invocation)

Hi.

Recently, I'm making ice server-client application.

I has referred next url for making a client with dynamic Invocation.
(Dynamic Invocation and Dispatch in C++ - Ice 3.5 - ZeroC)

Ice Slice file is very simple.
and It is working fine without dynamic Invocation code.
(It was working fine when I call a rpc function directly via MockPrx.)
But When I launch dynamic allication client, below error message was occurred from gdb.


ERROR MESSAGE in GDB

terminate called after throwing an instance of 'Ice::UnknownLocalException'
what(): Outgoing.cpp:480: Ice::UnknownLocalException:
unknown local exception:
/usr/include/Ice/BasicStream.h:398: Ice::UnmarshalOutOfBoundsException:
protocol error: out of bounds during unmarshaling


Program received signal SIGABRT, Aborted.


[Switching to Thread 0xb56dfb40 (LWP 17207)]
0xb7fdd424 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fdd424 in __kernel_vsyscall ()
#1 0xb77601ef in raise () from /lib/i386-linux-gnu/libc.so.6
#2 0xb7763835 in abort () from /lib/i386-linux-gnu/libc.so.6
#3 0xb79a313d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#4 0xb79a0ed3 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#5 0xb79a0f0f in std::terminate() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#6 0xb79a105e in __cxa_throw () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#7 0xb7e56def in Ice::UnknownLocalException::ice_throw (this=0xb5501660) at LocalException.cpp:407
#8 0xb7ed0699 in IceProxy::Ice::Object::__handleExceptionWrapper (this=0xb5501558, delegate=..., ex=...) at Proxy.cpp:1264
#9 0xb7ed5bbd in IceProxy::Ice::Object::ice_invoke (this=0xb5501558, operation=..., mode=Ice::Normal, inParams=..., outParams=...,
context=0x0) at Proxy.cpp:511
#10 0xb7ed5cc8 in IceProxy::Ice::Object::ice_invoke (this=0xb5501558, operation=..., mode=Ice::Normal, inParams=..., outParams=...,
context=0x0) at Proxy.cpp:396
#11 0x080537d5 in IceProxy::Ice::Object::ice_invoke (this=0xb5501558, operation=..., mode=Ice::Normal, inParams=..., outParams=...)
at /usr/include/Ice/Proxy.h:372
#12 0x08052ba3 in worker (param=0xbffff280) at client_redis_retry.cpp:506
#13 0xb79e1d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#14 0xb781cace in clone () from /lib/i386-linux-gnu/libc.so.6




Please refer below code which was made by me.
And It will be very helpful, if somebody let me know the solution for resolve this issue.


My Client Code (Pseudo)

char endPoint[256] = "Mock:" + server endPoint;
Ice::ObjectPrx object = arg.comm->stringToProxy(endPoint);

std::vector<Ice::Byte> inParams;
std::vector<Ice::Byte> outParams;

Ice::outputStreamPtr out = Ice::createOutputStream(arg.comm);
out->startEncapsulation();
out->writeInt(arg.delay);
out->endEncapsulation();
out->finished(inParams);

if(object->ice_invoke("waiter", Ice::Normal, inParams, outParams)) // This line make error
{
Ice::InputStreamPtr in = Ice::createInputStream(arg.comm, outParams);
int result = 0;
in->startEncapsulation();
result = in->readInt();
in->endEncapsulation();
}


Ice slice
//very simple

module Tester
{
interface Mock
{
int waiter(int sec);
};
}

Comments

  • mes
    mes California
    Hi,

    Your code looks correct. The fact that ice_invoke raises an UnknownLocalException means that the UnmarshalOutOfBoundsException occurs on the server side. Are you also using dynamic invocation in the server? If so, can you post that code?

    Regards,
    Mark