[omniORB] assertion failed only in debug version

Joerg Krause Jkrause@hdpp.de
Thu, 3 Sep 1998 09:01:12 +0200


Hi all,

I have a problem that only seems to occur in debug-mode not in release
mode.

I work with omniorb 2.5.0 and Visual C++5.0 on WinNT 4.0 SP3.

I am testing an OrbixWeb 3.0 Java Client connected to a C++ server. The=
re
is
a callback function called "MyCallback::Progress" which is called from =
the
server
to the client

I get a "Debug assertion failed" on the server side when the server cal=
ls
the callback function.

The following is the stack of my server:

NTDLL! 77f76148()
NTDLL! 77f830a0()
KERNEL32! 77f12d96()
_CrtIsValidHeapPointer(void * 0x004333b0) line 1612
_free_dbg(void * 0x004333b0, int 1) line 1011 + 9 bytes
operator delete(void * 0x004333b0) line 49 + 16 bytes
omniRopeAndKey::~omniRopeAndKey() line 206 + 18 bytes
_proxy_MyCallback::Progress(long 0) line 28 + 27 bytes
grid_i::runLong(MyCallback * 0x00cddb08) line 54
_sk_grid::dispatch(GIOP_S & {...}, char * 0x014eff18, unsigned char 1) =
line
 836
OMNIORB25_RT! 100085a1()
OMNIORB25_RT! 10007c3b()
OMNIORB25_RT! 10003c79()

// the following is the idl-code
interface MyCallback{
oneway void Progress(in long prog);
};
interface grid {
     void runLong(in MyCallback cbFunc);
};

// the following is the class declaration
class grid_i : public  virtual _sk_grid {
public:
     grid_i();
     virtual ~grid_i();

     virtual void runLong (MyCallback_ptr cbFunc);
};


//the following is the implementation code
#include "grid_i.h"

grid_i::grid_i() {
}
void grid_i::runLong (MyCallback_ptr cbFunc)
{
     if(!CORBA::is_nil(cbFunc))
     {
          for (CORBA::Long l =3D 0; l<=3D100; l+=3D10)
          {
               cbFunc->Progress (l);
               Sleep(2000);
          }
     }
}


the problem occurs during the delete[] operator in the destructor of th=
e
OmniOrb class "omniRopeAndKey"
// The following is the code of that class:

class omniRopeAndKey {
public:
  inline omniRopeAndKey(Rope *r,_CORBA_Octet *k, _CORBA_ULong ksize)
                 : pd_r(r), pd_keysize(0)
  {
    key(k,ksize);
  }

  inline omniRopeAndKey() : pd_r(0), pd_keysize(0) {}

  inline ~omniRopeAndKey() {
    if (pd_keysize > sizeof(omniObjectKey)) {
      delete [] pd_keyptr;
    }
  }


When debugging the code pd_keyptr  contain the data (-pd_keyptr0x004333=
b0
":\pc-joerg_krause:1615:0::IFR:MyCallback")

Any hints for help are appreciated.
Thank you in advance!

J=F6rg Krause
Heidelberger Druckmaschinen AG
Siemenswall
D-24107 Kiel
Germany
jkrause@hdpp.de
=