Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257431 - dev-db/oracle-instantclient-basic-10.2.0.3-r1: linking with libocci, a program crashes when releasing memory in std::vector functions
Summary: dev-db/oracle-instantclient-basic-10.2.0.3-r1: linking with libocci, a progra...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tobias Scherbaum (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-02 21:12 UTC by kunitoki (Lucio Asnaghi)
Modified: 2009-12-31 10:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kunitoki (Lucio Asnaghi) 2009-02-02 21:12:24 UTC
If you write a program and link with the libocci provided with the instantclient package (which is compiled with gcc 3.2 and linking with libstdc++.so.5) you will get into trouble with memory management of the c++ std:: objects (namely vector, list) cause of mixing with different libstdc++ libraries and gcc versions.

We should consider in replace the libocci.so with the one provided here (http://www.oracle.com/technology/tech/oci/occi/occidownloads.html) cause it will be compatible with 

Reproducible: Always

Steps to Reproduce:
1. Compile and run a simple occi program accessing some Metadata of the database.
Actual Results:  
Program is crashing upon deallocating std::vector returned from some occi functions.

Expected Results:  
It should free the objects correctly

Replacing libocci.* with this version makes the program run fine:

http://www.oracle.com/technology/tech/oci/occi/occidownloads.html
Comment 1 kunitoki (Lucio Asnaghi) 2009-02-03 10:31:05 UTC
Testing program:

int test(int argc, char **argv)
{
  const string userName = ".........";
  const string password = "....";
  const string connectString = "..";

  Environment *env = Environment::createEnvironment();
  {
    Connection *conn = env->createConnection(userName, password, connectString);
    Statement *stmt = conn->createStatement("SELECT * FROM TEST_TABLE");
    ResultSet *rs = stmt->executeQuery();

    vector<MetaData> md = rs->getColumnListMetaData();
    for (int i = 0; i < md.size(); i++)
      cout << "Column name: " << md[i].getString(MetaData::ATTR_NAME) << endl;

    stmt->closeResultSet(rs);
    conn->terminateStatement(stmt);
    env->terminateConnection(conn);
  }
  Environment::terminateEnvironment(env);

  return 0;
}


this produce:

Column name: ID
*** glibc detected *** double free or corruption (!prev): 0x08c52568 ***
Aborted


applying OCCI libraries compiled with gcc 3.4.5 (from the link) this runs as expected.
Comment 2 Tobias Scherbaum (RETIRED) gentoo-dev 2009-12-31 10:52:04 UTC
Please try again w/ 11.2*. Please re-open if this still an issue then.