[omniORB] OMNIORB compiled in gcc 4.8.3 version is leaking memory

Sendil_Natarajan at amat.com Sendil_Natarajan at amat.com
Thu May 3 08:08:41 BST 2018


Hi All,

I have a CORBA based client and server created using OmniORB. My Omni version is 4.2.0 (libomniORB420.a) and I have built the Omni using gcc version GNU gcc-4.8.3. I'm running the Omni in AIX 6.1 platform. I'm seeing memory leak in the Omni server. The same OMNI code built using xlc compiler version xlc_r 13.1.3 is running fine without the memory issue. So, I wonder if there is any bug in OMNI specific to the gcc version

Here is my sample code. Please let me know what is wrong here. There are some suggestion found in internet to define TestResult as TestResult_var in server. Even after changing it, I still find the memory leak happening.

Omni IDL:

Typedef sequence<string> Columns;
Typedef sequence< Columns > Rows;

Struct TestResult
{
      Rows table_rows;
}

Interface GPSServerManager
{
       TestResult getTableInfo(in string tableName);
}

Omni Client:

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

GPSServerManager _var gpsServer;
gpsServer = GPSServerManager::_narrow(obj);
string tableName = "testable";

TestResult* testResult = gpsServer->getTableInfo(tableName);

If(testResult)
{
   // print table info
   delete testResult;
}

orb->destroy();
free(apfServer);
}

Omni Server:

TestResult* GPSServerManager:: getTableInfo(const char* tableName)
{

TestResult* testResult = new TestResult;

// get the database table info for the give table
int columns = getDataBaseTableColumnCount(tableName);
int rows = getDataBaseTableRowCount(tableName);

testResult -> Rows.length(rows);

for(int i = 0; Ii < rows; i++)
{
      testResult -> Rows[i].length(columns);

     for(int j = 0; j < columns; j++)
     {
                testResult-> Rows[i][j] = CORBA::string_dup(getDataBaseTableValue(tableName, i, j));
      }
}

return testResult;
}

Thanks,
Sendil

The content of this message is APPLIED MATERIALS CONFIDENTIAL. If you are not the intended recipient, please notify me, delete this email and do not use or distribute this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20180503/cad6fc43/attachment.html>


More information about the omniORB-list mailing list