Archived

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

Seg. Fault returning an empty sequence

Hello,

I have a sequence definition inside a Slice file:
sequence<Shape> ShapeList;

and the next interface in the same file:
interface GrDebugProvider
{
   ShapeList getGrDebug();
};

I generate the C++ code and the class that implements the previous interface contains the following code:
bica::ShapeList
Debug::getGrDebug(const Ice::Current& c)
{
	bica::ShapeList shapeList;

	// (*) Add a dummy shape first, if the list is empty Ice crashes ¿?
	//shapeList.push_back(getTestShape());

	return shapeList;
}

When I call this method from a proxy (written in Java) I obtain segmentation fault inside the ice object called. This is the gdb output:
0x00faeb66 in IceInternal::BasicStream::WriteEncaps::ObjectWriteEncaps::toBeMarshaledMap (this=0x0) at ../../include/IceE/BasicStream.h:743
743	            PtrToIndexMap* toBeMarshaledMap() { return reinterpret_cast<PtrToIndexMap*>(_toBeMarshaledMap); }

However, uncommenting the line marked with (*) everything goes smooth. So, the problem seems to be return an empty sequence. I am using Ice 3.3.1 in the client side (Java) and Icee 1.3.0 in the server side (C++), Ubuntu 10.10 and gcc 4.4.5.

Any ideas for how to solve this issue? Is there any kind of limitation related with empty sequences?

Thanks in advance,
Carlos

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Carlos,

    The problem is caused by a bug in IceE-1.3.0 BasicStream implementation.

    I have posted a patch that solves the issue here.

    Thanks for reporting the problem.

    Bests Regards,
    Jose
  • Thanks for the patch Jose.

    Best,
    Carlos