[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference pamsrc::objectbroker_development

Title:ObjectBroker Development - BEA Systems' CORBA
Notice:See note 2 for kit locations; note 4 for training
Moderator:RECV::GUMBELd
Created:Thu Dec 27 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2482
Total number of notes:13057

2473.0. "obbcomp bug" by NNTPD::"[email protected]" (Paul Healy) Thu May 01 1997 11:56

obbquick (2.7.11 on DU 3.2) barfs on this interface:

interface Bar {
   typedef octet buf[1000];
   
   long Read(out buf b);
};

with:
...

*** Creating Server Method Template File ***
obbcomp -lcxx -Qm BarMethod.cxx  Bar.udl Bar.iml
*** Segmentation fault

while this one works:

interface Foo {
   typedef octet buf[999];
   
   long Read(out buf b);
};

Can I safely do a global replace on 999 in all generated files with
something larger? (e.g. 8192)

Also while I am it, is there any particular reason I should see this:

$ ladebug ./FooClient
Welcome to the Ladebug Debugger Version 4.0-14A
------------------ 
object file name: ./FooClient 
Reading symbolic information ...done
(ladebug) run

...
b[998]: 1

Thread received signal SEGV
stopped at [void Object::OBB__delete(Object_ptr, Environment&):962
0x120026f7c]
    962     delete Obj;
(ladebug) where
>0  0x120026f7c in Object::OBB__delete(Obj=0x140012600, Ev={ ... })
/usr/lib/ObjectBroker/cxxsrc/object.cxx:962
#1  0x12002244c in CORBA::release(Obj=0x140012600, Ev={ ... })
/usr/lib/ObjectBroker/cxxsrc/corba.cxx:297
#2  0x12001c52c in ((Foo_var*)0x11ffff8b8)->free(ev={ ... }) Foo.hxx:90
#3  0x12001c3f8 in ((Foo_var*)0x11ffff8b8)->~Foo_var() Foo.hxx:77
#4  0x12001ca0c in FooInvoke() FooClient.cxx:81
#5  0x12001c72c in main(argc=1, argv=0x11ffff988) FooClient.cxx:52

This is with FooServer and FooClient produced by obbquick and after
I recompiled the cxx library for debugging - DEC C++ 5.5. I know
about 5.0, but I can't use it. 

Thanks,

Paul
[Posted by WWW Notes gateway]
T.RTitleUserPersonal
Name
DateLines
2473.1how about using a sequence (basically a variable size array) instead?VAXCPU::michaudJeff Michaud - ObjectBrokerThu May 01 1997 13:0028
> interface Bar {
>    typedef octet buf[1000];
>    
>    long Read(out buf b);
> };

	I don't have answers for the core dumps, but I do have a question
	and possible suggestion that may end up working around the problem.

	It looks like you are trying to mimic the read() system call?  And
	the return value of Bar::Read is the length of how much was actaully
	read (ie. how much of "buf" is actually valid data)?

	If the answer is "yes", then using a fixed length array as a
	parameter (in or out) will result in a 1,000 octet array being
	marshalled and passed across the wire, and unmarshalled, even
	though only 10 octets are valid.

	If you instead used a sequence, it would not only be more efficient
	(as far as how many octets are being transfered), but Bar::Read also
	would then not be limited by the "max" (ie. 1,000 octets) it could
	return (unless you define it to be a bounded sequence).  Ex.

interface Bar {
   typedef sequence<octet> buf;
   
   void Read(out buf b);
};
2473.2blobsNNTPD::&quot;[email protected]&quot;Paul HealyThu May 01 1997 13:4710
Thanks for the suggestion. The point of the read method is to move
binary large objects (10MB-100MB+), so a couple of k at the end
wasn't an issue.

I stayed away from sequences for this because of the element by
element access limitation (operator[]). But right now I would be 
happy to have anything working..!

Paul
[Posted by WWW Notes gateway]
2473.3You could code in C instead :-)VAXCPU::michaudJeff Michaud - ObjectBrokerThu May 01 1997 21:1720
> I stayed away from sequences for this because of the element by
> element access limitation (operator[]).

	Hmm, you're right, the C++ language binding does not allow the
	user to get directly at the array (at least not portably :-),
	you can only do it using the C language binding.  Another OMG
	oversight I guess as one of the generated constructors takes
	an array :-(

	If you wanted to do something non-portable, you could edit the
	generated include file and make the "T *_data" member public, or
	get a the pointer to the array by taking the address of the first
	sequence element, ie.

		&foo[0]

	where foo is an instance of your octet sequence.

	Luckily no hacking is needed to convert an array into a sequence
	using the appropriate generated constructor.