Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwyMK-0007TP-4j for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 19:16:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XwyMJ-0000rg-L8 for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 19:16:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XwyMI-0000rP-MA for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 19:16:06 +0000 Received: from mail-by2on0603.outbound.protection.outlook.com ([2a01:111:f400:fc0c::603] helo=na01-by2-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XwyME-0002ER-DF for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 19:16:04 +0000 Received: from BY2PR05CA043.namprd05.prod.outlook.com (10.141.250.33) by DM2PR05MB509.namprd05.prod.outlook.com (10.141.99.12) with Microsoft SMTP Server (TLS) id 15.1.26.15; Fri, 5 Dec 2014 19:15:55 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::176) by BY2PR05CA043.outlook.office365.com (2a01:111:e400:2c5f::33) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Fri, 5 Dec 2014 19:15:54 +0000 Received: from mercav05r.na.sas.com (149.173.6.149) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (TLS) id 15.1.26.17 via Frontend Transport; Fri, 5 Dec 2014 19:15:54 +0000 X-TM-IMSS-Message-ID: <388cf90a0004177e@mercav05r.na.sas.com> Received: from MERCMBX40D.na.SAS.com ([10.36.20.48]) by mercav05r.na.sas.com ([10.16.10.186]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 AES128-SHA (128/128)) id 388cf90a0004177e ; Fri, 5 Dec 2014 14:15:53 -0500 Received: from MERCMBX41R.na.SAS.com (10.16.20.110) by MERCMBX40D.na.SAS.com (10.36.20.48) with Microsoft SMTP Server (TLS) id 15.0.995.29; Fri, 5 Dec 2014 14:15:52 -0500 Received: from MERCMBX41R.na.SAS.com ([10.16.20.110]) by MERCMBX41R.na.SAS.com ([10.16.20.110]) with mapi id 15.00.0995.028; Fri, 5 Dec 2014 14:15:52 -0500 From: Eric Hill To: Nikhil Deshpande , "pgsql-odbc@postgresql.org" Subject: Re: SQLFreeHandle() takes eons when running debug Thread-Topic: [ODBC] SQLFreeHandle() takes eons when running debug Thread-Index: AdAQsSACAZONOqo3QOyYxRQM76xwzAANrWIAAAoCipA= Date: Fri, 5 Dec 2014 19:15:52 +0000 Message-ID: <4fe3a14c740b4dd39e71da188cc8fcec@MERCMBX41R.na.SAS.com> References: <5482011E.4050800@vmware.com> In-Reply-To: <5482011E.4050800@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.44.16.137] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.173.6.149; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(24454002)(164054003)(51704005)(479174003)(199003)(13464003)(189002)(377454003)(50986999)(450100001)(107886001)(107046002)(106466001)(33646002)(99396003)(33186001)(46102003)(120916001)(15975445007)(102836002)(64706001)(47776003)(20776003)(87936001)(4396001)(23726002)(1720100001)(19580395003)(77096005)(19580405001)(46406003)(76176999)(54356999)(6806004)(15395725005)(77156002)(92566001)(21056001)(62966003)(50466002)(97756001)(86362001)(108616004)(31966008)(2656002)(92726002)(24736002)(72026002)(460985004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR05MB509; H:mercav05r.na.sas.com; FPR:; SPF:Pass; MLV:sfv; PTR:mercav05r.na.sas.com; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB509; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601002); SRVR:DM2PR05MB509; X-Forefront-PRVS: 04163EF38A Received-SPF: Pass (protection.outlook.com: domain of jmp.com designates 149.173.6.149 as permitted sender) receiver=protection.outlook.com; client-ip=149.173.6.149; helo=mercav05r.na.sas.com; Authentication-Results: spf=pass (sender IP is 149.173.6.149) smtp.mailfrom=Eric.Hill@jmp.com; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB509; X-OriginatorOrg: jmp.com X-Pg-Spam-Score: -1.9 (-) 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 That solved it! Thanks, Nikhil! Eric -----Original Message----- From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.o= rg] On Behalf Of Nikhil Deshpande Sent: Friday, December 05, 2014 2:02 PM To: pgsql-odbc@postgresql.org Subject: Re: [ODBC] SQLFreeHandle() takes eons when running debug On 12/5/14 10:56 AM, Eric Hill wrote: > Not sure how this could be the PostgreSQL ODBC driver's fault, but=20 > when I run a debug build of my application, calls to SQLFreeHandle()=20 > to free a statement can have for quite a long time (we're talking a=20 > minute or > two) before proceeding. This is Windows, 64-bit Unicode, version > 9.03.03 of the PG ODBC driver. The call stack looks like this when paus= ed: > > ntdll.dll!RtlCompareMemoryUlong() + 0x10 bytes > > ntdll.dll!RtlpFreeHeap() + 0x113f bytes > > ntdll.dll!RtlFreeHeap() + 0x1df bytes > > ntdll.dll!RtlDebugFreeHeap() + 0x23f bytes > > ntdll.dll!RtlpFreeHeap() + 0x7d5b7 bytes > > ntdll.dll!RtlFreeHeap() + 0x1df bytes > > msvcr100.dll!free() + 0x1c bytes > > psqlodbc35w.dll!00007ff97bc7c827() > > [Frames below may be incorrect and/or missing, no=20 > symbols loaded for psqlodbc35w.dll] > > psqlodbc35w.dll!00007ff97bc7656b() > > psqlodbc35w.dll!00007ff97bc76044() > > psqlodbc35w.dll!00007ff97bc761c7() > > psqlodbc35w.dll!00007ff97bc88781() > > psqlodbc35w.dll!00007ff97bc66bda() > > odbc32.dll!FreeStmt() + 0x2c5 bytes > > odbc32.dll!SQLFreeHandle() + 0x2a0 bytes > > > Jmp.exe!DBContext::freeStmt(void * & > hstmt=3D0x000000001f032030) Line 1644 + 0x14 bytes C++ > > Running a release build, no such delay. We don't see anything like=20 > this for SQL Server, Oracle, DB2, Teradata, or MySQL ODBC drivers.=20=20 > Anyone run into this before that can suggest a fix or workaround? Perhaps this might be relevant (setting _NO_DEBUG_HEAP=3D1 env var to skip = heap validation): http://stackoverflow.com/a/18753164 Thanks, Nikhil -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make change= s to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc