C++ server bug - valuetype as in argument & valuetype as exception class member

Michal Strnad michal.strnad at nic.cz
Wed Dec 30 08:42:01 GMT 2015


Hello,

my IDL file looks like:

module Bug
{
    enum Value
    {
        CORRECT_VALUE,
        MISSING_VALUE,
        BAD_VALUE
    };

    valuetype OptionalValue Value;

    interface Demo
    {
        exception WRONG_DATA
        {
            OptionalValue value;
        };

        void call(in OptionalValue value)raises(WRONG_DATA);
    };
};

server C++ code looks like:

void Demo_impl::call(Bug::OptionalValue *value)
{
    throw Bug::Demo::WRONG_DATA(new Bug::OptionalValue(Bug::BAD_VALUE));
}

snd client C++ code looks like:

for (int cnt = 0; cnt < 3; ++cnt) {
    try {
        Bug::OptionalValue_var value(new
Bug::OptionalValue(Bug::BAD_VALUE));
        s_ptr->call(value.in());
    }
    catch (const Bug::Demo::WRONG_DATA &e) {
        ...
    }
    catch (const CORBA::SystemException &e) {
        ...
    }
    catch (...) {
        ...
    }
}

My C++ server is based on this IDL file. When I call Bug::Demo::call for
the first time it throws exception Bug::Demo::WRONG_DATA. It's correct.
But when I call it for the second time it throws CORBA::UNKNOWN exception
and for the third time it doesn't return and server and client consume one
core of CPU each. It occurs only if the function is called with not null
value and together it throws exception with not null value. In other cases
it doesn't occur. I tried to use Python server and its behavior was correct,
it threw the correct exception Bug::Demo::WRONG_DATA under any
circumstances.

I think it's a bug in C++ server!?

I tested it on Ubuntu 12.04 with omniorb packages 4.1.6-1 and on Ubuntu
14.04
with omniorb packages 4.1.6-2 and finally I tried the current version r6315
from svn repository and with the same behavior. Can you help me please
to solve
this problem?

Attachment is client log with ORBtraceLevel=40.

You can obtain my code from gitlab:
git clone git at gitlab.com:mistr/omniorb-bug.git
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client_to_cpp_server.log
Type: text/x-log
Size: 4818 bytes
Desc: not available
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20151230/42157455/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client_to_py_server.log
Type: text/x-log
Size: 3052 bytes
Desc: not available
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20151230/42157455/attachment-0001.bin>


More information about the omniORB-list mailing list