pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQLFreeHandle() takes eons when running debug
3+ messages / 2 participants
[nested] [flat]

* SQLFreeHandle() takes eons when running debug
@ 2014-12-05 18:56  Eric Hill <Eric.Hill@jmp.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Eric Hill @ 2014-12-05 18:56 UTC (permalink / raw)
  To: pgsql-odbc

Hey,

Not sure how this could be the PostgreSQL ODBC driver's fault, but when I run a debug build of my application, calls to SQLFreeHandle() to free a statement can have for quite a long time (we're talking a 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 paused:

                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 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=0x000000001f032030)  Line 1644 + 0x14 bytes      C++

Running a release build, no such delay.  We don't see anything like this for SQL Server, Oracle, DB2, Teradata, or MySQL ODBC drivers.  Anyone run into this before that can suggest a fix or workaround?

Thanks,

Eric

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: SQLFreeHandle() takes eons when running debug
@ 2014-12-05 19:01  Nikhil Deshpande <ndeshpande@vmware.com>
  parent: Eric Hill <Eric.Hill@jmp.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Nikhil Deshpande @ 2014-12-05 19:01 UTC (permalink / raw)
  To: pgsql-odbc

On 12/5/14 10:56 AM, Eric Hill wrote:
> Not sure how this could be the PostgreSQL ODBC driver’s fault, but when
> I run a debug build of my application, calls to SQLFreeHandle() to free
> a statement can have for quite a long time (we’re talking a 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 paused:
>
>                  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
> 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=0x000000001f032030)  Line 1644 + 0x14 bytes      C++
>
> Running a release build, no such delay.  We don’t see anything like this
> for SQL Server, Oracle, DB2, Teradata, or MySQL ODBC drivers.  Anyone
> run into this before that can suggest a fix or workaround?

Perhaps this might be relevant (setting _NO_DEBUG_HEAP=1 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 changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: SQLFreeHandle() takes eons when running debug
@ 2014-12-05 19:15  Eric Hill <Eric.Hill@jmp.com>
  parent: Nikhil Deshpande <ndeshpande@vmware.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Eric Hill @ 2014-12-05 19:15 UTC (permalink / raw)
  To: Nikhil Deshpande <ndeshpande@vmware.com>; pgsql-odbc

That solved it!  Thanks, Nikhil!

Eric

-----Original Message-----
From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] 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 
> when I run a debug build of my application, calls to SQLFreeHandle() 
> to free a statement can have for quite a long time (we're talking a 
> 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 paused:
>
>                  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 
> 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=0x000000001f032030)  Line 1644 + 0x14 bytes      C++
>
> Running a release build, no such delay.  We don't see anything like 
> this for SQL Server, Oracle, DB2, Teradata, or MySQL ODBC drivers.  
> Anyone run into this before that can suggest a fix or workaround?

Perhaps this might be relevant (setting _NO_DEBUG_HEAP=1 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 changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2014-12-05 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05 18:56 SQLFreeHandle() takes eons when running debug Eric Hill <Eric.Hill@jmp.com>
2014-12-05 19:01 ` Nikhil Deshpande <ndeshpande@vmware.com>
2014-12-05 19:15   ` Eric Hill <Eric.Hill@jmp.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox