[omniORB] purify

Randy Shoup rshoup@tumbleweed.com
Thu, 30 Jul 1998 11:01:39 -0700


Boris Khanales wrote:
> 
> I have following purify report.
> Any idea?
> 
> 1.
> 
>       IPR: Invalid pointer read
>       This is occurring while in thread 17:
>             ImrDiMessageNode::~ImrDiMessageNode(void) [bufferedStream.h:634]
> 
> 
>                  inline void *align_and_put_bytes(omni::alignment_t align,size_t
> nbytes) {
>             =>     omni::ptr_arith_t p1 =
> omni::align_to((omni::ptr_arith_t)pd_out_mkr,align);
>                    omni::ptr_arith_t p2 = p1 + nbytes;
>                    if ((void *)p2 > pd_bufend) {
>                      grow(p2 - (omni::ptr_arith_t)pd_out_mkr);
>             delete_vect(void*, unsigned int, int, void (*)(void*, char))
> [libC.a]
>             _VeCtOr_dElEtE_ [libC.a]
>             _vector_delete_ [rtlib.o]
>             static _CORBA_Sequence<ImrDiMessageNode>::freebuf(ImrDiMessageNode*)
> [seqtemplates.h:186]
>                  }
>                  static inline void freebuf(T * b)
>                  {
>             =>     if (b) delete [] b;
>                    return;
>                  }
>                  // omniORB2 extensions
> 
> _CORBA_Sequence<ImrDiMessageNode>::~_CORBA_Sequence<ImrDiMessageNode>(void)
> [seqtemplates.h:111]
>                  }
> 
>                  inline ~_CORBA_Sequence() {
>             =>     if (pd_rel && pd_buf) freebuf(pd_buf);
>                    pd_buf = 0;
>                    return;
>                  }
>       Reading 4 bytes from 0xed5015b0 on the stack of thread 17.
>       Address 0xed5015b0 is 72 bytes above frame pointer in function
> ImrDiMessageNode::~ImrDiMessageNode(void).
> 
> 2.
>       IPW: Invalid pointer write
>       This is occurring while in thread 17:
>             ImrDiMessageNode::~ImrDiMessageNode(void) [msg_hlp.c]
>             delete_vect(void*, unsigned int, int, void (*)(void*, char))
> [libC.a]
>             _VeCtOr_dElEtE_ [libC.a]
>             _vector_delete_ [rtlib.o]
>             static _CORBA_Sequence<ImrDiMessageNode>::freebuf(ImrDiMessageNode*)
> [seqtemplates.h:186]
>                  }
>                  static inline void freebuf(T * b)
>                  {
>             =>     if (b) delete [] b;
>                    return;
>                  }
>                  // omniORB2 extensions
> 
> _CORBA_Sequence<ImrDiMessageNode>::~_CORBA_Sequence<ImrDiMessageNode>(void)
> [seqtemplates.h:111]
>                  }
> 
>                  inline ~_CORBA_Sequence() {
>             =>     if (pd_rel && pd_buf) freebuf(pd_buf);
>                    pd_buf = 0;
>                    return;
>                  }
>       Writing 4 bytes to 0xed5015b0 on the stack of thread 17.
>       Address 0xed5015b0 is 72 bytes above frame pointer in function
> ImrDiMessageNode::~ImrDiMessageNode(void).

>From the looks of the stack, it looks like you are using Sun's
SPARCworks compiler on Solaris?  We have seen similar errors in Purify
using vector allocation and deletion.  FWIW, we have not experienced any
noticeable problems from this, so it appears to be benign.

We suspect that this is yet another in a long series of compiler bugs,
and not a bug in omniORB.  In the latest patch series we received
recently from Sun, they claim to have fixed a vector-delete bug that may
resolve this problem, but we have not been able to get this patch series
to work successfully :-(

-- Randy
_________________________________________________________________  
Randy Shoup                                     (650)569-3682  
Principal Engineer                              rshoup@tumbleweed.com  
Tumbleweed Software Corporation