Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UONSQ-0005W0-6M for pgsql-odbc@arkaria.postgresql.org; Sat, 06 Apr 2013 07:22:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UONSP-0003AI-JE for pgsql-odbc@arkaria.postgresql.org; Sat, 06 Apr 2013 07:22:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UONSN-0003AA-Pn for pgsql-odbc@postgresql.org; Sat, 06 Apr 2013 07:22:35 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UONSH-0000vk-2g for pgsql-odbc@postgresql.org; Sat, 06 Apr 2013 07:22:35 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UONSE-0004vs-AH for pgsql-odbc@postgresql.org; Sat, 06 Apr 2013 00:22:26 -0700 Date: Sat, 6 Apr 2013 00:22:26 -0700 (PDT) From: blegay To: pgsql-odbc@postgresql.org Message-ID: <1365232946306-5751040.post@n5.nabble.com> In-Reply-To: <1365133737522-5750890.post@n5.nabble.com> References: <1365106058286-5750832.post@n5.nabble.com> <1365133737522-5750890.post@n5.nabble.com> Subject: Re: psqlodbc 09.01.0200 - OS X 10.6 - memory leak ? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Hi, I tried to reproduce the problem with basic C code. Got the same problem after 17 millions inserts. create table : CREATE TABLE bug_127330 (urn integer,app varchar(2)) Note : I added this file to the project : /Library/Frameworks/iODBC.framework/Versions/3.52/iODBC // // main.c // odbctest // // Created by Bruno LEGAY on 05/04/13. // Copyright 2013 A&C Consulting. All rights reserved. // #include #include #include /* * see Retrieving ODBC Diagnostics * for a definition of extract_error(). */ static void extract_error( char *fn, SQLHANDLE handle, SQLSMALLINT type); int main (int argc, const char * argv[]) { SQLHENV env; SQLHDBC dbc; SQLHSTMT stmt; SQLRETURN ret; SQLCHAR outstr[1024]; SQLSMALLINT outstrlen; =20=20=20=20 int iters; =20=20=20=20 /* Allocate an environment handle */ SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); =20=20=20=20 /* We want ODBC 3 support */ SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0); =20=20=20=20 /* Allocate a connection handle */ SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc); =20=20=20=20 /* Connect to the DSN oncdPostgreSQL_Unicode */ ret =3D SQLDriverConnect(dbc, NULL, "DSN=3DoncdPostgreSQL_Unicode;UID=3Dpostgres;PWD=3Dpostgres;", SQL_NTS, outstr, sizeof(outstr), &outstrlen, SQL_DRIVER_COMPLETE); =20=20=20=20 if (SQL_SUCCEEDED(ret)) { printf("Connected\n"); =20=20=20=20=20=20=20=20 printf("Returned connection string was:\n\t%s\n", outstr); =20=20=20=20=20=20=20=20 if (ret =3D=3D SQL_SUCCESS_WITH_INFO) { printf("Driver reported the following diagnostics\n"); extract_error("SQLDriverConnect", dbc, SQL_HANDLE_DBC); } SQLCHAR* sqlStatement =3D "INSERT INTO bug_127330 (urn,app) VALUES (?,'C')"; /* Allocate a statement handle */ ret =3D SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt); =20=20=20=20=20=20=20=20 if (ret =3D=3D SQL_SUCCESS || ret =3D=3D SQL_SUCCESS_WITH_INFO) { // infinite loop... while (1) { =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 iters++; =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 // SQL FIXER PARAMETRE($vl_iters;SQL Param=C3=A8tre entr=C3= =A9e) ret =3D SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &iters, sizeof(iters), NULL);=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 // SQL EXECUTER($vt_sql) ret =3D SQLPrepare(stmt, sqlStatement, SQL_NTS); ret =3D SQLExecute(stmt); // log if(ret =3D=3D SQL_SUCCESS || ret =3D=3D SQL_SUCCESS_WITH_IN= FO) { printf("Insert data OK : %d\n",iters); } =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 // SQL ANNULER CHARGEMENT ret =3D SQLFreeStmt(stmt, SQL_RESET_PARAMS); }=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 SQLFreeHandle(SQL_HANDLE_STMT, stmt); } else {=20=20=20=20=20=20=20=20=20=20=20=20 printf("Error Allocating Handle: %d\n", ret); } =20=20=20=20=20=20=20=20 SQLDisconnect(dbc); /* disconnect from driver */ =20=20=20=20=20=20=20=20 } else { fprintf(stderr, "Failed to connect\n"); extract_error("SQLDriverConnect", dbc, SQL_HANDLE_DBC); } /* free up allocated handles */ SQLFreeHandle(SQL_HANDLE_DBC, dbc); SQLFreeHandle(SQL_HANDLE_ENV, env); =20=20=20=20 return 0; } static void extract_error( char *fn, SQLHANDLE handle, SQLSMALLINT type) { SQLINTEGER i =3D 0; SQLINTEGER native; SQLCHAR state[ 7 ]; SQLCHAR text[256]; SQLSMALLINT len; SQLRETURN ret; =20=20=20=20 fprintf(stderr, "\n" "The driver reported the following diagnostics whilst running " "%s\n\n", fn); =20=20=20=20 do { ret =3D SQLGetDiagRec(type, handle, ++i, state, &native, text, sizeof(text), &len ); if (SQL_SUCCEEDED(ret)) printf("%s:%ld:%ld:%s\n", state, i, native, text); } while( ret =3D=3D SQL_SUCCESS ); } Process: Xcode [22709] Path: /Developer/Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 4.1 (516) Build Info: IDEApplication-5160000~33 Code Type: X86-64 (Native) Parent Process: launchd [459] Date/Time: 2013-04-06 05:54:36.667 +0200 OS Version: Mac OS X 10.6.8 (10K549) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: ProductBuildVersion: 4B110f NSCFDictionary objc[22709]: garbage collection is ON ... -- View this message in context: http://postgresql.1045698.n5.nabble.com/psqlo= dbc-09-01-0200-OS-X-10-6-memory-leak-tp5750832p5751040.html Sent from the PostgreSQL - odbc mailing list archive at Nabble.com. --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc