pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Barry Bell <Barry.Bell@hartehanks.com>
To: Jade Koskela <jkoskela0@gmail.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Problem in SQLFreeHandle (Statement)
Date: Tue, 17 Jun 2014 20:13:25 +0000
Message-ID: <f01105eae4c84d7da75fc2a423b92290@BY2PR08MB281.namprd08.prod.outlook.com> (raw)
In-Reply-To: <CAN5ZvqxmLiUzZjbEdNjmhYWZ9sHkf7Y8RJi=DxRR8-3Jj56_Qg@mail.gmail.com>
References: <CAN5Zvqz3WRSWFzNAZ0J3ftEib+u85g1GBqb=GMve3tHFz0jkLA@mail.gmail.com>
	<5399AB65.5040608@vmware.com>
	<CAN5ZvqxmLiUzZjbEdNjmhYWZ9sHkf7Y8RJi=DxRR8-3Jj56_Qg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

I was able to login with the olddominion login and download the file
(This is normal FTP  , this is NOT SFTP)
Using port 21
Which port are you using?

Barry Bell
Senior Developer/Analyst
Logistics
Harte Hanks
1525 NW 3rd ST
Deerfield Beach FL, 33442
954-429-3771 Ext 267 office
954-281-1464 fax
[https://4b2685446389bc779b46-5f66fbb59518cc4fcae8900db28267f5.ssl.cf2.rackcdn.com/email-sig-hh.png]<http://www.hartehanks.com/;
hartehanks.com<http://www.hartehanks.com; / linkedin<http://www.linkedin.com/company/hartehanks; / twitter<http://www.twitter.com/HarteHanks; / facebook<http://www.facebook.com/HarteHanks;

From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Jade Koskela
Sent: Tuesday, June 17, 2014 4:06 PM
To: Heikki Linnakangas; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Problem in SQLFreeHandle (Statement)

I couldn't reproduce the behavior using the test program, or a similar one.
I recompiled the driver to enable extra logging.
Here is the grep on ENTER_CONN_CS, the second address is the address of the mutex (pthread recursive).
This was compiled on OSX with Clang, and then also with GCC with the same result. Behavior doesn't reproduce on Windows.



[140735257568016][[SQLFreeHandle]]

[140735257568016]*** ENTER_CONN_CS [140210608634616] ***

[140735257568016]*** ENTER_CONN_CS [140210608634616] ***

[140735257568016]*** LEAVE_CONN_CS [140210608634616] ***

[140735257568016]*** LEAVE_CONN_CS [140210608634616] ***

[140735257568016]*** LEAVE_CONN_CS [140210608634616] ***

[140735257568016][SQLGetConnectAttrW]

[140735257568016]*** ENTER_CONN_CS [140210608634616] ***

[140735257568016]*** LEAVE_CONN_CS [140210608634616] ***

[140735257568016][SQLGetConnectAttrW]

[140735257568016]*** ENTER_CONN_CS [140210608634616] ***

[140735257568016]*** LEAVE_CONN_CS [140210608634616] ***

[140735257568016][SQLGetConnectAttrW]

[140735257568016]*** ENTER_CONN_CS [140210608634616] ***

[140735257568016]*** LEAVE_CONN_CS [140210608634616] ***

[4466282496][[SQLAllocHandle]]

[4466282496]*** ENTER_CONN_CS [140210608634616] ***    <- new thread grabbed mutex, count=1

[4466282496]**** PGAPI_AllocStmt: hdbc = 0x7f8553857000, stmt = 0x7f8552d17100

[4466282496]*** LEAVE_CONN_CS [140210608634616] ***    <- count=0

[4466282496]**** PGAPI_Prepare: STMT_ALLOCATED, copy

[4466282496]*** ENTER_CONN_CS [140210608634616] ***    <- count=1

[4466282496]*** ENTER_CONN_CS [140210608634616] ***    <- count=2

[140735257568016]*** LEAVE_CONN_CS [140210608634616] *** <- this thread doesn't own, count=2

[4466282496]*** LEAVE_CONN_CS [140210608634616] ***      <- count=1

[4466282496]*** LEAVE_CONN_CS [140210608634616] ***      <- count=0

[4466282496]*** LEAVE_CONN_CS [140210608634616] ***      <- count=0

[140735257568016][[SQLFreeHandle]]

[140735257568016]*** ENTER_CONN_CS [140210608634616] ***  <-thread blocks on mutex here, should be unlocked?

On Thu, Jun 12, 2014 at 6:30 AM, Heikki Linnakangas <hlinnakangas@vmware.com<mailto:hlinnakangas@vmware.com>> wrote:
On 06/12/2014 05:30 AM, Jade Koskela wrote:
Hello,
I am using psql-odbc 9.3 on OSX.

Which version, exactly? There were some changes to locking in SQLFreeHandle in 09.03.0200. Not sure if those changes might've fixed this, or caused it.

Can easily you test on another platform, or with different version of unixODBC?

I have one thread running a query, and
another thread cancels the query using SQLCancel. The thread running the
query successfully cancels and exits the driver code. When we try to free
the statement handle, it blocks on a mutex doing ENTER_CONN_CS, or
something similar in SQLFreeHandle.

Does anyone have any input on this problem? I don't see who is holding the
mutex, the thread running the query is done.

I tried to reproduce this with the attached little test program. It works fine. Can you post the test program you're using, or modify the attached so that it exhibits the behavior you're seeing, please?

- Heikki



Attachments:

image001.png (image/png, 7.9K) download view image

view thread (7+ messages)  latest in thread

Message-ID: <f01105eae4c84d7da75fc2a423b92290@BY2PR08MB281.namprd08.prod.outlook.com>
Permalink:  ../f01105eae4c84d7da75fc2a423b92290@BY2PR08MB281.namprd08.prod.outlook.com/
Also on:    postgresql.org/message-id/f01105eae4c84d7da75fc2a423b92290@BY2PR08MB281.namprd08.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: Barry.Bell@hartehanks.com, jkoskela0@gmail.com, hlinnakangas@vmware.com
  Subject: Re: Problem in SQLFreeHandle (Statement)
  In-Reply-To: <f01105eae4c84d7da75fc2a423b92290@BY2PR08MB281.namprd08.prod.outlook.com>
  References: <CAN5Zvqz3WRSWFzNAZ0J3ftEib+u85g1GBqb=GMve3tHFz0jkLA@mail.gmail.com> <5399AB65.5040608@vmware.com> <CAN5ZvqxmLiUzZjbEdNjmhYWZ9sHkf7Y8RJi=DxRR8-3Jj56_Qg@mail.gmail.com> <f01105eae4c84d7da75fc2a423b92290@BY2PR08MB281.namprd08.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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