Discussion:
[omniORB] omni::omniCodeSet::TCS_C_8bit::unmarshalString () : 'CORBA::MARSHAL'
JiangWei
2006-06-06 20:51:33 UTC
Permalink
omniORB 4.1.0beta2,
i386 Linux,
gcc 4.1

Source:
--------begin------
#include <omniORB4/CORBA.h>

int main (int argc, char* argv[])
{
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);

cdrMemoryStream stream;

* stream.setByteSwapFlag(0);*

CORBA::Any any;
any <<= "something";

any >>= stream;
* any <<= stream;
*
orb->destroy();

return 0;
}

-------end---------

(gdb) run
Starting program: /home/jw/test/omni/a.out
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xd00000
[Thread debugging using libthread_db enabled]
[New Thread -1208670512 (LWP 13167)]
terminate called after throwing an instance of 'CORBA::MARSHAL'

Program received signal SIGABRT, Aborted.
[Switching to Thread -1208670512 (LWP 13167)]
0x00d00410 in __kernel_vsyscall ()
(gdb) bt
#0 0x00d00410 in __kernel_vsyscall ()
#1 0x0044b069 in raise () from /lib/libc.so.6
#2 0x0044c671 in abort () from /lib/libc.so.6
#3 0x03ee9c30 in __gnu_cxx::__verbose_terminate_handler () from
/usr/lib/libstdc++.so.6
#4 0x03ee7655 in std::set_unexpected () from /usr/lib/libstdc++.so.6
#5 0x03ee7692 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0x03ee77ca in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0x005dd5fa in omni::omniExHelper::MARSHAL () from
/usr/local/lib/libomniORB4.so.1
#8 0x006616ed in omni::omniCodeSet::TCS_C_8bit::unmarshalString () from
/usr/local/lib/libomniORB4.so.1
#9 0x00238420 in omni::copyUsingTC () from
/usr/local/lib/libomniDynamic4.so.1
#10 0x00239304 in omni::tcParser::copyStreamToStream () from
/usr/local/lib/libomniDynamic4.so.1
#11 0x001dc54a in CORBA::Any::operator<<= () from
/usr/local/lib/libomniDynamic4.so.1
#12 0x08048b25 in main (argc=Cannot access memory at address 0x336f
) at x.cpp:15



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060606/49c1a897/attachment.htm
JiangWei
2006-06-06 21:19:36 UTC
Permalink
[***@dell omni]$ ./a.out write x.bin
[***@dell omni]$ ./a.out read x.bin
unmarshal...
Segmentation fault

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 2004 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060606/74174f5a/main.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyValue.idl
Type: text/x-idl
Size: 250 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060606/74174f5a/MyValue.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x.bin
Type: application/octet-stream
Size: 388 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060606/74174f5a/x.bin
Duncan Grisby
2006-06-06 22:44:19 UTC
Permalink
On Tuesday 6 June, JiangWei wrote:

[...]
Post by JiangWei
* stream.setByteSwapFlag(0);*
[...]
Post by JiangWei
terminate called after throwing an instance of 'CORBA::MARSHAL'
Thanks for the bug report. The problem was that the fast case of string
marshalling was failing to byte-swap the length field, so when you came
to read it again, the data was invalid. I've fixed it in CVS. It's quite
an obscure problem, since nothing in omniORB marshals with byte-swapping
by default. It's always the unmarshalling side that does the
byte-swapping.

Having fixed this issue, your other program works fine for me too.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...