pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: Help with hang on empty query (PG 7.3.2,
9+ messages / 5 participants
[nested] [flat]
* Re: Help with hang on empty query (PG 7.3.2,
@ 2003-11-07 20:30 Steve Wampler <swampler@noao.edu>
2003-11-08 04:30 ` Re: Help with hang on empty query (PG 7.3.2, Jeff Eckermann <jeff_eckermann@yahoo.com>
0 siblings, 1 reply; 9+ messages in thread
From: Steve Wampler @ 2003-11-07 20:30 UTC (permalink / raw)
To: Jeff Eckermann <jeff_eckermann@yahoo.com>; +Cc: pgsql-odbc
On Fri, 2003-11-07 at 11:38, Jeff Eckermann wrote:
> --- Steve Wampler <swampler@noao.edu> wrote:
> >
> > I recently upgraded a system from RedHat 8 to RedHat
> > 9, which
> > meant an upgrade of PG 7.2 to 7.3.2. Several
> > applications
> > that are written in a language that relies upon dbc
> > to access
> > postgresql have stopped working.
> >
> > I've installed from source psqlodbc-07.03.0200
> > (pthread
> > and iodbc support). From the logs it looks as
> > though the
> > connection is succeeding up to the point that an
> > empty query is sent (dunno why the empty query is
> > being
> > sent - it appears to be part of the connection
> > procedure).
> > At this point the connection hangs - no messages, or
> > errors.
> > Killing the client program causes postgresql to log
> > a:
> >
> > LOG: pq_recvbuf: unexpected EOF on client
> > connection
> >
> > message.
> >
> > These programs had all been working with the odbc
> > RPM that was
> > available for 7.2.3, so I assume it's something to
> > do with
> > how I configured the build.
> >
> > (Can someone tell me why the odbc RPM was dropped
> > with 7.3?)
> >
> > Thanks for any help!
>
> Someone posted a similar problem to the list not long
> ago. Turned out to be a connection problem, i.e. they
> could not connect to the server from the new client
> machine at all. Can you successfully connect and
> issue queries from this machine using psql or any
> other interface?
Yes, with no problem, both psql and jdbc.
--
Steve Wampler -- swampler@noao.edu
Quantum materiae materietur marmota monax si marmota
monax materiam possit materiari?
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-07 20:30 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
@ 2003-11-08 04:30 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
0 siblings, 0 replies; 9+ messages in thread
From: Jeff Eckermann @ 2003-11-08 04:30 UTC (permalink / raw)
To: swampler@noao.edu; +Cc: pgsql-odbc
--- Steve Wampler <swampler@noao.edu> wrote:
> On Fri, 2003-11-07 at 11:38, Jeff Eckermann wrote:
> > --- Steve Wampler <swampler@noao.edu> wrote:
> > >
> > > I recently upgraded a system from RedHat 8 to
> RedHat
> > > 9, which
> > > meant an upgrade of PG 7.2 to 7.3.2. Several
> > > applications
> > > that are written in a language that relies upon
> dbc
> > > to access
> > > postgresql have stopped working.
> > >
> > > I've installed from source psqlodbc-07.03.0200
> > > (pthread
> > > and iodbc support). From the logs it looks as
> > > though the
> > > connection is succeeding up to the point that an
> > > empty query is sent (dunno why the empty query
> is
> > > being
> > > sent - it appears to be part of the connection
> > > procedure).
> > > At this point the connection hangs - no
> messages, or
> > > errors.
> > > Killing the client program causes postgresql to
> log
> > > a:
> > >
> > > LOG: pq_recvbuf: unexpected EOF on client
> > > connection
> > >
> > > message.
> > >
> > > These programs had all been working with the
> odbc
> > > RPM that was
> > > available for 7.2.3, so I assume it's something
> to
> > > do with
> > > how I configured the build.
> > >
> > > (Can someone tell me why the odbc RPM was
> dropped
> > > with 7.3?)
> > >
> > > Thanks for any help!
> >
> > Someone posted a similar problem to the list not
> long
> > ago. Turned out to be a connection problem, i.e.
> they
> > could not connect to the server from the new
> client
> > machine at all. Can you successfully connect and
> > issue queries from this machine using psql or any
> > other interface?
>
> Yes, with no problem, both psql and jdbc.
That's me out of ideas, then. I believe the driver
issues an empty query as part of the connection
routine to get a response back from the server, just
to test that someone is listening. In principle, if
that doesn't work, other queries wouldn't work either.
I don't remember whether you posted your odbc log (I
deleted the message), so please post it if you didn't
before: maybe someone can make something out of it.
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
@ 2003-11-08 15:48 Steve Wampler <swampler@noao.edu>
2003-11-08 16:18 ` Re: Help with hang on empty query (PG 7.3.2, Tom Lane <tgl@sss.pgh.pa.us>
2003-11-08 23:33 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <inoue@tpf.co.jp>
0 siblings, 2 replies; 9+ messages in thread
From: Steve Wampler @ 2003-11-08 15:48 UTC (permalink / raw)
To: pgsql-odbc
On Fri, 2003-11-07 at 09:05, Steve Wampler wrote:
> I recently upgraded a system from RedHat 8 to RedHat 9, which
> meant an upgrade of PG 7.2 to 7.3.2. Several applications
> that are written in a language that relies upon odbc to access
> postgresql have stopped working.
I've now verified that the same hang occurs when using the
odbctest program that comes with libiodbc.
Can anyone suggest a way to track this down further? Thanks!
> I've installed from source psqlodbc-07.03.0200 (pthread
> and iodbc support). From the logs it looks as though the
> connection is succeeding up to the point that an
> empty query is sent (dunno why the empty query is being
> sent - it appears to be part of the connection procedure).
> At this point the connection hangs - no messages, or errors.
> Killing the client program causes postgresql to log a:
>
> LOG: pq_recvbuf: unexpected EOF on client connection
>
> message.
>
> These programs had all been working with the odbc RPM that was
> available for 7.2.3, so I assume it's something to do with
> how I configured the build.
>
> (Can someone tell me why the odbc RPM was dropped with 7.3?)
>
> Thanks for any help!
>
> Various logs and traces:
>
> odbc.trace:
>
> SQLAllocEnv ( ... )
> SQL_SUCCESS
>
> SQLAllocConnect ( ... )
> SQL_SUCCESS
>
> SQLConnect ( ... )
>
> psqlodbc_swampler17169.log:
>
> conn = 135226032, PGAPI_Connect(DSN='swampler', UID='swampler',
> PWD='xxxxx')
> Global Options: Version='07.03.0200', fetch=100, socket=4096,
> unknown_sizes=0, max_varchar_size=254,
> max_longvarchar_size=8190
> disable_optimizer=1, ksqo=1, unique_index=1,
> use_declarefetch=0
> text_as_longvarchar=1, unknowns_as_longvarchar=0,
> bools_as_char=1 NAMEDATALEN=64
> extra_systable_prefixes='dd_;', conn_settings=''
> conn_encoding='OTHER'
> conn=135226032, query=' '
>
> mylog_swampler17169.log:
>
> [1075229312]CC_connect: entering...
> [1075229312]CC_connect(): DSN = 'swampler', server = 'weaver',
> port = '5432', database = 'swampler', username = 'swampler',
> password='xxxxx'
> [1075229312]connecting to the server socket...
> [1075229312]connection to the server socket succeeded.
> [1075229312]sizeof startup packet = 292
> [1075229312]sent the authentication block.
> [1075229312]sent the authentication block successfully.
> [1075229312]gonna do authentication
> [1075229312]read 15, global_socket_buffersize=4096
> [1075229312]auth got 'R'
> [1075229312]areq = 0
> [1075229312]auth got 'K'
> [1075229312]auth got 'Z'
> [1075229312]sending an empty query...
> [1075229312]send_query(): conn=135226032, query=' '
--
Steve Wampler -- swampler@noao.edu
Quantum materiae materietur marmota monax si marmota
monax materiam possit materiari?
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
@ 2003-11-08 16:18 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 9+ messages in thread
From: Tom Lane @ 2003-11-08 16:18 UTC (permalink / raw)
To: swampler@noao.edu; +Cc: pgsql-odbc
Steve Wampler <swampler@noao.edu> writes:
>> I've installed from source psqlodbc-07.03.0200 (pthread
>> and iodbc support). From the logs it looks as though the
>> connection is succeeding up to the point that an
>> empty query is sent (dunno why the empty query is being
>> sent - it appears to be part of the connection procedure).
>> At this point the connection hangs - no messages, or errors.
I'm just guessing, but my first guess is that the empty-query path in
the driver fails to do an fflush() to push out the query to the backend.
You could possibly confirm this by sniffing the connection with a packet
monitor to see what is the last data sent by the client side.
regards, tom lane
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
@ 2003-11-08 23:33 ` Hiroshi Inoue <inoue@tpf.co.jp>
2003-11-09 17:15 ` Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
1 sibling, 1 reply; 9+ messages in thread
From: Hiroshi Inoue @ 2003-11-08 23:33 UTC (permalink / raw)
To: swampler@noao.edu; +Cc: pgsql-odbc
> -----Original Message-----
> From: Steve Wampler
>
> On Fri, 2003-11-07 at 09:05, Steve Wampler wrote:
> > I recently upgraded a system from RedHat 8 to RedHat 9, which
> > meant an upgrade of PG 7.2 to 7.3.2. Several applications
> > that are written in a language that relies upon odbc to access
> > postgresql have stopped working.
>
> I've now verified that the same hang occurs when using the
> odbctest program that comes with libiodbc.
>
> Can anyone suggest a way to track this down further? Thanks!
Could you try to remove ENTER_CONN_CS in CC_send_query
in connection.c and change all RETURN_AFTER_LEAVE_CS(self, ..)
to "return ..(the 2nd parameter) "?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-08 23:33 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <inoue@tpf.co.jp>
@ 2003-11-09 17:15 ` Steve Wampler <swampler@noao.edu>
2003-11-10 07:20 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <Inoue@tpf.co.jp>
2003-11-10 16:47 ` Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
0 siblings, 2 replies; 9+ messages in thread
From: Steve Wampler @ 2003-11-09 17:15 UTC (permalink / raw)
To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc
On Sat, 2003-11-08 at 16:33, Hiroshi Inoue wrote:
> > -----Original Message-----
> > From: Steve Wampler
> >
> > On Fri, 2003-11-07 at 09:05, Steve Wampler wrote:
> > > I recently upgraded a system from RedHat 8 to RedHat 9, which
> > > meant an upgrade of PG 7.2 to 7.3.2. Several applications
> > > that are written in a language that relies upon odbc to access
> > > postgresql have stopped working.
> >
> > I've now verified that the same hang occurs when using the
> > odbctest program that comes with libiodbc.
> >
> > Can anyone suggest a way to track this down further? Thanks!
>
> Could you try to remove ENTER_CONN_CS in CC_send_query
> in connection.c and change all RETURN_AFTER_LEAVE_CS(self, ..)
> to "return ..(the 2nd parameter) "?
Hi Hiroshi,
Thanks for the suggestion. I get the same behavior, but
the mylog file has more information in it (the other logs
are unchanged):
-------------------------------------------------------
->cat mylog*
[1074087680]CC_connect: entering...
[1074087680]CC_connect(): DSN = 'swampler', server = 'weaver', port =
'5432', database = 'swampler', username = 'swampler', password='xxxxx'
[1074087680]connecting to the server socket...
[1074087680]connection to the server socket succeeded.
[1074087680]sizeof startup packet = 292
[1074087680]sent the authentication block.
[1074087680]sent the authentication block successfully.
[1074087680]gonna do authentication
[1074087680]read 15, global_socket_buffersize=4096
[1074087680]auth got 'R'
[1074087680]areq = 0
[1074087680]auth got 'K'
[1074087680]auth got 'Z'
[1074087680]sending an empty query...
[1074087680]send_query(): conn=134528568, query=' '
[1074087680]send_query: done sending query
[1074087680]in QR_Constructor
[1074087680]exit QR_Constructor
[1074087680]read 3, global_socket_buffersize=4096
[1074087680]send_query: got id = 'I'
[1074087680]send_query: got id = 'Z'
[1074087680]QResult: in DESTRUCTOR
[1074087680]QResult: free memory in, fcount=0
[1074087680]QResult: free memory out
[1074087680]QResult: exit DESTRUCTOR
[1074087680]empty query seems to be OK.
[1074087680]CC_lookup_pg_version: entering...
[1074087680]PGAPI_AllocStmt: entering...
[1074087680]**** PGAPI_AllocStmt: hdbc = 134528568, stmt = 134552160
[1074087680]CC_add_statement: self=134528568, stmt=134552160
[1074087680]PGAPI_ExecDirect: entering...
[1074087680]**** PGAPI_ExecDirect: hstmt=134552160, statement='select
version()'
[1074087680]PGAPI_ExecDirect: calling PGAPI_Execute...
[1074087680]PGAPI_Execute: entering...
[1074087680]PGAPI_Execute: clear errors...
[1074087680]recycle statement: self= 134552160
[1074087680]Exec_with_parameters_resolved: copying statement params:
trans_status=1, len=16, stmt='select version()'
[1074087680] stmt_with_params = 'select version()'
--------------------------------------------------------------
--
Steve Wampler -- swampler@noao.edu
Quantum materiae materietur marmota monax si marmota
monax materiam possit materiari?
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-08 23:33 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <inoue@tpf.co.jp>
2003-11-09 17:15 ` Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
@ 2003-11-10 07:20 ` Hiroshi Inoue <Inoue@tpf.co.jp>
1 sibling, 0 replies; 9+ messages in thread
From: Hiroshi Inoue @ 2003-11-10 07:20 UTC (permalink / raw)
To: swampler@noao.edu; +Cc: pgsql-odbc
Steve Wampler wrote:
>
> On Sat, 2003-11-08 at 16:33, Hiroshi Inoue wrote:
> > > -----Original Message-----
> > > From: Steve Wampler
> > >
> > > On Fri, 2003-11-07 at 09:05, Steve Wampler wrote:
> > > > I recently upgraded a system from RedHat 8 to RedHat 9, which
> > > > meant an upgrade of PG 7.2 to 7.3.2. Several applications
> > > > that are written in a language that relies upon odbc to access
> > > > postgresql have stopped working.
> > >
> > > I've now verified that the same hang occurs when using the
> > > odbctest program that comes with libiodbc.
> > >
> > > Can anyone suggest a way to track this down further? Thanks!
> >
> > Could you try to remove ENTER_CONN_CS in CC_send_query
> > in connection.c and change all RETURN_AFTER_LEAVE_CS(self, ..)
> > to "return ..(the 2nd parameter) "?
>
> Hi Hiroshi,
>
> Thanks for the suggestion. I get the same behavior, but
> the mylog file has more information in it (the other logs
> are unchanged):
OK I can reproduce the phenomenon here.
Please try the attached patch.
regards,
Hiroshi Inoue
http://www.geocities.jp/inocchichichi/psqlodbc/
Attachments:
thread.diff (application/x-unknown-content-type-hidemaru.diff, 5.8K) download
*** connection.h.save Mon Sep 15 17:25:03 2003
--- connection.h Mon Nov 10 14:22:07 2003
***************
*** 93,99 ****
#define LEAVE_CONN_CS(x) LeaveCriticalSection(&((x)->cs))
#define DELETE_CONN_CS(x) DeleteCriticalSection(&((x)->cs))
#elif defined(POSIX_MULTITHREAD_SUPPORT)
! #define INIT_CONN_CS(x) pthread_mutex_init(&((x)->cs),0)
#define ENTER_CONN_CS(x) pthread_mutex_lock(&((x)->cs))
#define LEAVE_CONN_CS(x) pthread_mutex_unlock(&((x)->cs))
#define DELETE_CONN_CS(x) pthread_mutex_destroy(&((x)->cs))
--- 93,99 ----
#define LEAVE_CONN_CS(x) LeaveCriticalSection(&((x)->cs))
#define DELETE_CONN_CS(x) DeleteCriticalSection(&((x)->cs))
#elif defined(POSIX_MULTITHREAD_SUPPORT)
! #define INIT_CONN_CS(x) pthread_mutex_init(&((x)->cs), getMutexAttr())
#define ENTER_CONN_CS(x) pthread_mutex_lock(&((x)->cs))
#define LEAVE_CONN_CS(x) pthread_mutex_unlock(&((x)->cs))
#define DELETE_CONN_CS(x) pthread_mutex_destroy(&((x)->cs))
*** psqlodbc.h.save Wed Aug 27 19:17:53 2003
--- psqlodbc.h Mon Nov 10 13:41:28 2003
***************
*** 5,11 ****
*
* Comments: See "notice.txt" for copyright and license information.
*
! * $Id: psqlodbc.h,v 1.78 2003/08/27 10:17:53 hinoue Exp $
*
*/
--- 5,11 ----
*
* Comments: See "notice.txt" for copyright and license information.
*
! * $Id: psqlodbc.h,v 1.79 2003/10/25 04:19:22 hinoue Exp $
*
*/
***************
*** 279,295 ****
#include "misc.h"
#ifdef UNICODE_SUPPORT
UInt4 ucs2strlen(const SQLWCHAR *ucs2str);
char *ucs2_to_utf8(const SQLWCHAR *ucs2str, Int4 ilen, UInt4 *olen, BOOL tolower);
UInt4 utf8_to_ucs2_lf(const char * utf8str, Int4 ilen, BOOL lfconv, SQLWCHAR *ucs2str, UInt4 buflen);
#define utf8_to_ucs2(utf8str, ilen, ucs2str, buflen) utf8_to_ucs2_lf(utf8str, ilen, FALSE, ucs2str, buflen)
#endif /* UNICODE_SUPPORT */
/*#define _MEMORY_DEBUG_ */
#ifdef _MEMORY_DEBUG_
! void *debug_alloc(size_t);
! void *debug_realloc(void *, size_t);
! char *debug_strdup(const char *);
void debug_free(void *);
void debug_memory_check(void);
--- 279,300 ----
#include "misc.h"
+ int initialize_global_cs(void);
+ #ifdef POSIX_MULTITHTREAD_SUPPORT
+ const pthread_mutexattr_t *getMutexAttr(void);
+ #endif /* POSIX_MULTITHTREAD_SUPPORT */
#ifdef UNICODE_SUPPORT
UInt4 ucs2strlen(const SQLWCHAR *ucs2str);
char *ucs2_to_utf8(const SQLWCHAR *ucs2str, Int4 ilen, UInt4 *olen, BOOL tolower);
UInt4 utf8_to_ucs2_lf(const char * utf8str, Int4 ilen, BOOL lfconv, SQLWCHAR *ucs2str, UInt4 buflen);
#define utf8_to_ucs2(utf8str, ilen, ucs2str, buflen) utf8_to_ucs2_lf(utf8str, ilen, FALSE, ucs2str, buflen)
#endif /* UNICODE_SUPPORT */
+
/*#define _MEMORY_DEBUG_ */
#ifdef _MEMORY_DEBUG_
! void *debug_alloc(size_t);
! void *debug_realloc(void *, size_t);
! char *debug_strdup(const char *);
void debug_free(void *);
void debug_memory_check(void);
*** psqlodbc.c.save Tue Dec 17 00:01:34 2002
--- psqlodbc.c Mon Nov 10 15:21:25 2003
***************
*** 25,38 ****
RETCODE SQL_API SQLDummyOrdinal(void);
- #ifdef WIN32
- HINSTANCE NEAR s_hModule; /* Saved module handle. */
#if defined(WIN_MULTITHREAD_SUPPORT)
extern CRITICAL_SECTION qlog_cs, mylog_cs, conns_cs;
#elif defined(POSIX_MULTITHREAD_SUPPORT)
extern pthread_mutex_t qlog_cs, mylog_cs, conns_cs;
#endif /* WIN_MULTITHREAD_SUPPORT */
/* This is where the Driver Manager attaches to this Driver */
BOOL WINAPI
DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
--- 25,78 ----
RETCODE SQL_API SQLDummyOrdinal(void);
#if defined(WIN_MULTITHREAD_SUPPORT)
extern CRITICAL_SECTION qlog_cs, mylog_cs, conns_cs;
#elif defined(POSIX_MULTITHREAD_SUPPORT)
extern pthread_mutex_t qlog_cs, mylog_cs, conns_cs;
+ static pthread_mutexattr_t recur_attr;
+ const pthread_mutexattr_t* getMutexAttr(void)
+ {
+ static int init = 1;
+
+ if (init)
+ {
+ if (0 != pthread_mutexattr_init(&recur_attr))
+ return NULL;
+ if (0 != pthread_mutexattr_settype(&recur_attr, PTHREAD_MUTEX_RECURSIVE_NP))
+ return NULL;
+ }
+ init = 0;
+
+ return &recur_attr;
+ }
#endif /* WIN_MULTITHREAD_SUPPORT */
+ int initialize_global_cs(void)
+ {
+ static int init = 1;
+
+ if (!init)
+ return 0;
+ init = 0;
+ #ifdef POSIX_MULTITHREAD_SUPPORT
+ getMutexAttr();
+ #endif /* POSIX_MULTITHREAD_SUPPORT */
+ INIT_QLOG_CS;
+ INIT_MYLOG_CS;
+ INIT_CONNS_CS;
+
+ return 0;
+ }
+
+ static void finalize_global_cs(void)
+ {
+ DELETE_CONNS_CS;
+ DELETE_QLOG_CS;
+ DELETE_MYLOG_CS;
+ }
+
+ #ifdef WIN32
+ HINSTANCE NEAR s_hModule; /* Saved module handle. */
/* This is where the Driver Manager attaches to this Driver */
BOOL WINAPI
DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
***************
*** 59,67 ****
return FALSE;
}
! INIT_QLOG_CS;
! INIT_MYLOG_CS;
! INIT_CONNS_CS;
getCommonDefaults(DBMS_NAME, ODBCINST_INI, NULL);
break;
--- 99,105 ----
return FALSE;
}
! initialize_global_cs();
getCommonDefaults(DBMS_NAME, ODBCINST_INI, NULL);
break;
***************
*** 69,77 ****
break;
case DLL_PROCESS_DETACH:
! DELETE_CONNS_CS;
! DELETE_QLOG_CS;
! DELETE_MYLOG_CS;
WSACleanup();
return TRUE;
--- 107,113 ----
break;
case DLL_PROCESS_DETACH:
! finalize_global_cs();
WSACleanup();
return TRUE;
***************
*** 104,109 ****
--- 140,146 ----
__attribute__((constructor))
init(void)
{
+ initialize_global_cs();
getCommonDefaults(DBMS_NAME, ODBCINST_INI, NULL);
return TRUE;
}
***************
*** 117,122 ****
--- 154,160 ----
BOOL
_init(void)
{
+ initialize_global_cs();
getCommonDefaults(DBMS_NAME, ODBCINST_INI, NULL);
return TRUE;
}
***************
*** 124,129 ****
--- 162,168 ----
BOOL
_fini(void)
{
+ finalize_global_cs();
return TRUE;
}
#endif /* not __GNUC__ */
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-08 23:33 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <inoue@tpf.co.jp>
2003-11-09 17:15 ` Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
@ 2003-11-10 16:47 ` Steve Wampler <swampler@noao.edu>
2003-11-11 03:33 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <Inoue@tpf.co.jp>
1 sibling, 1 reply; 9+ messages in thread
From: Steve Wampler @ 2003-11-10 16:47 UTC (permalink / raw)
To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc
On Sun, 2003-11-09 at 10:15, Steve Wampler wrote:
> On Sat, 2003-11-08 at 16:33, Hiroshi Inoue wrote:
> > > -----Original Message-----
> > > From: Steve Wampler
> > >
> > > On Fri, 2003-11-07 at 09:05, Steve Wampler wrote:
> > > > I recently upgraded a system from RedHat 8 to RedHat 9, which
> > > > meant an upgrade of PG 7.2 to 7.3.2. Several applications
> > > > that are written in a language that relies upon odbc to access
> > > > postgresql have stopped working.
> > >
> > > I've now verified that the same hang occurs when using the
> > > odbctest program that comes with libiodbc.
> > >
> > > Can anyone suggest a way to track this down further? Thanks!
> >
> > Could you try to remove ENTER_CONN_CS in CC_send_query
> > in connection.c and change all RETURN_AFTER_LEAVE_CS(self, ..)
> > to "return ..(the 2nd parameter) "?
>
> Hi Hiroshi,
>
> Thanks for the suggestion. I get the same behavior, but
> the mylog file has more information in it (the other logs
> are unchanged):
I've done a bit more digging and the apps are hanging in
a call to pthread_mutex_lock() inside SC_execute(). (I had
configured the pgsqlodbc library with pthread support.)
Dropping pthread support has fixed the problem, whatever it
was...
--
Steve Wampler -- swampler@noao.edu
Quantum materiae materietur marmota monax si marmota
monax materiam possit materiari?
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Help with hang on empty query (PG 7.3.2,
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-08 23:33 ` Re: Help with hang on empty query (PG 7.3.2, Hiroshi Inoue <inoue@tpf.co.jp>
2003-11-09 17:15 ` Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-10 16:47 ` Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
@ 2003-11-11 03:33 ` Hiroshi Inoue <Inoue@tpf.co.jp>
0 siblings, 0 replies; 9+ messages in thread
From: Hiroshi Inoue @ 2003-11-11 03:33 UTC (permalink / raw)
To: swampler@noao.edu; +Cc: pgsql-odbc
Steve Wampler wrote:
>
> On Sun, 2003-11-09 at 10:15, Steve Wampler wrote:
> > On Sat, 2003-11-08 at 16:33, Hiroshi Inoue wrote:
> > > > -----Original Message-----
> > > > From: Steve Wampler
> > > >
> > > > On Fri, 2003-11-07 at 09:05, Steve Wampler wrote:
> > > > > I recently upgraded a system from RedHat 8 to RedHat 9, which
> > > > > meant an upgrade of PG 7.2 to 7.3.2. Several applications
> > > > > that are written in a language that relies upon odbc to access
> > > > > postgresql have stopped working.
> > > >
> > > > I've now verified that the same hang occurs when using the
> > > > odbctest program that comes with libiodbc.
> > > >
> > > > Can anyone suggest a way to track this down further? Thanks!
> > >
> > > Could you try to remove ENTER_CONN_CS in CC_send_query
> > > in connection.c and change all RETURN_AFTER_LEAVE_CS(self, ..)
> > > to "return ..(the 2nd parameter) "?
> >
> > Hi Hiroshi,
> >
> > Thanks for the suggestion. I get the same behavior, but
> > the mylog file has more information in it (the other logs
> > are unchanged):
>
> I've done a bit more digging and the apps are hanging in
> a call to pthread_mutex_lock() inside SC_execute(). (I had
> configured the pgsqlodbc library with pthread support.)
>
> Dropping pthread support has fixed the problem, whatever it
> was...
The pthread_mutex_lock call is blocking the thread itself.
I changed the behavior of the mutex in my patch I sent you
in another posting.
regards,
Hiroshi Inoue
http://www.geocities.jp/inocchichichi/psqlodbc/
^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~2003-11-11 03:33 UTC | newest]
Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-07 20:30 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-08 04:30 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2003-11-08 15:48 Re: Help with hang on empty query (PG 7.3.2, Steve Wampler <swampler@noao.edu>
2003-11-08 16:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-11-08 23:33 ` Hiroshi Inoue <inoue@tpf.co.jp>
2003-11-09 17:15 ` Steve Wampler <swampler@noao.edu>
2003-11-10 07:20 ` Hiroshi Inoue <Inoue@tpf.co.jp>
2003-11-10 16:47 ` Steve Wampler <swampler@noao.edu>
2003-11-11 03:33 ` Hiroshi Inoue <Inoue@tpf.co.jp>
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