[omniORB] Invalid pointer read/write errors

Jonathan Buchanan buchanan@olsen.ch
Fri, 23 Apr 1999 09:25:51 +0200


Hi,

I am running omniORB 2.7.1 on Solaris 2.5.1 with SPARCWorks C++ compiler
4.2.

I am doing some very simple stuff using a string sequence defined in IDL
as:

typedef sequence<string> MyStringSequence;

I use this type for out parameters in some methods.  On the server side
I dynamically allocate these sequences with new (ref OMG standard
20.13.3), as follows:

// myData was passed as an out param, type MyStringSequence*&
myData = new MyStringSequence( 12 );


It all works.  But... I ran it with Purify which produced some alarming
errors for this statement:


      IPW: Invalid pointer write (12 times)
      This is occurring while in thread 9:
            CORBA::String_member::String_member(void) [libopasCorba.a]
            _VeCtOr_nEw_   [libC.a]
            _vector_new_   [rtlib.o]
            static _CORBA_Sequence<CORBA::String_member>::allocbuf(unsigned long) [libopasCorba.a]
            _CORBA_Sequence<CORBA::String_member>::_CORBA_Sequence<CORBA::String_member>(unsigned long) [seqtemplates.h:84]
            _CORBA_Unbounded_Sequence<CORBA::String_member>::_CORBA_Unbounded_Sequence<CORBA::String_member>(unsigned long) [seqtemplates.h:155]
            OpasResultsImpl::allPlotData(const char*, const char*, char*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&) [OpasResultsImpl.cc:285]
            _sk_OpasResults::_0RL__allPlotData(const char*, const char*, char*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&) [libopasCorba.a]
            OpasResults::allPlotData(const char*, const char*, CORBA::String_OUT_arg, _CORBA_Sequence_OUT_arg<_CORBA_Unbounded_Sequence<CORBA::String_member>, _CORBA_Sequence_Var<_CORBA_Unbounded_Sequence<CORBA::String_member>, CORBA::String_member>>, _CORBA_Sequ... [libopasCorba.a]
            _sk_OpasResults::dispatch(GIOP_S&, const char*, unsigned char) [OpasResultsSK.cc:541]
            GIOP_S::HandleRequest(unsigned char) [libomniORB2.a]
            static GIOP_S::dispatcher(Strand*) [libomniORB2.a]
      Writing 4 bytes to 0xee50135c on the stack of thread 9.
      Address 0xee50135c is 68 bytes above frame pointer in function CORBA::String_member::String_member(void).

      IPR: Invalid pointer read (12 times)
      This is occurring while in thread 9:
            CORBA::String_member::String_member(void) [libopasCorba.a]
            _VeCtOr_nEw_   [libC.a]
            _vector_new_   [rtlib.o]
            static _CORBA_Sequence<CORBA::String_member>::allocbuf(unsigned long) [libopasCorba.a]
            _CORBA_Sequence<CORBA::String_member>::_CORBA_Sequence<CORBA::String_member>(unsigned long) [seqtemplates.h:84]
            _CORBA_Unbounded_Sequence<CORBA::String_member>::_CORBA_Unbounded_Sequence<CORBA::String_member>(unsigned long) [seqtemplates.h:155]
            OpasResultsImpl::allPlotData(const char*, const char*, char*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&) [OpasResultsImpl.cc:285]
            _sk_OpasResults::_0RL__allPlotData(const char*, const char*, char*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&, _CORBA_Unbounded_Sequence<CORBA::String_member>*&) [libopasCorba.a]
            OpasResults::allPlotData(const char*, const char*, CORBA::String_OUT_arg, _CORBA_Sequence_OUT_arg<_CORBA_Unbounded_Sequence<CORBA::String_member>, _CORBA_Sequence_Var<_CORBA_Unbounded_Sequence<CORBA::String_member>, CORBA::String_member>>, _CORBA_Sequ... [libopasCorba.a]
            _sk_OpasResults::dispatch(GIOP_S&, const char*, unsigned char) [OpasResultsSK.cc:541]
            GIOP_S::HandleRequest(unsigned char) [libomniORB2.a]
            static GIOP_S::dispatcher(Strand*) [libomniORB2.a]
      Reading 4 bytes from 0xee50135c on the stack of thread 9.
      Address 0xee50135c is 68 bytes above frame pointer in function CORBA::String_member::String_member(void).

I wonder if these can just be ignored?

Regards,
Jon

BTW, Purify also reports Unitialized Memory Reads at startup in:


static IOP::iorToEncapStr(const unsigned char*, const _CORBA_Unbounded_Sequence<IOP::TaggedProfile>*)

Hope these can be ignored too!