pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=0 causes Windows gpf in Unicode Driver versions > 08.04.0200
8+ messages / 4 participants
[nested] [flat]

* UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=0 causes Windows gpf in Unicode Driver versions > 08.04.0200
@ 2013-04-21 17:56  ljwilson <ljwilson@digitalav.com>
  0 siblings, 2 replies; 8+ messages in thread

From: ljwilson @ 2013-04-21 17:56 UTC (permalink / raw)
  To: pgsql-odbc

I've been upgrading some Windows servers from PostgreSQL 8.3.18 to 9.2.4.
Along with that I upgraded psqlODBC for the Windows clients from 8.0x.xxxx
to 09.01.0200.

All was fine until I had a customer who could consistently get a gpf in
psqlodbc35w.dll when doing an export.

Getting a copy of their database, I could reproduce as well.

Trying different driver versions, I've found no crashes with the 8.0x
psqlODBC series, but I can reproduce the gpf starting with 09.00.xxxx
through the latest 9.01.02?? that I compiled yesterday (2013/04/20) from the
git repository.

I've used UseDeclareFetch=1 and Fetch=100 since I started with PostgreSQL
back in 2008.

Now with the 09.xx.xxxx drivers I don't get a crash if I:

1. Set UseDeclareFetch=0
or
2. Set UseServerSidePrepare=1

I've got a 31MB mylog file (zipped) of an entire client session. I can
uploaded somewhere if that would help The bulk of that could be
stripped-out; probably just the first and last 1000 lines are relevant. The
actual sql is doing an update one record at a time of a numeric(14,0) value.
It updates the first two records, executes a fetch, then crashes (when
UseDeclareFetch=1 and UseServerSidePrepare=0).

These are the last lines in mylog before the gpf occurs:

[14028-1870.117][SQLExtendedFetch][14028-1870.117]PGAPI_ExtendedFetch:
stmt=03988330 rowsetSize=20
[14028-1870.117]SQL_FETCH_NEXT: num_tuples=500, currtuple=460, rowst=460
[14028-1870.118]PGAPI_ExtendedFetch: new currTuple = 479
[14028-1870.118]fetch_cursor=1, 054FEF28->total_read=500
[14028-1870.118]**** SC_fetch: non-cursor_result
[14028-1870.118]fetch: cols=42, lf=0, opts = 039883B8, opts->bindings =
03A36758, buffer[] = 03C607C8
[14028-1870.119]type = 23, atttypmod = -1

Obviously I can start using UseServerSidePrepare=1, but I'm concerned that
would be masking a bug that should be addressed.

Thanks...jack



--
View this message in context: http://postgresql.1045698.n5.nabble.com/UseDeclareFetch-1-Fetch-100-UseServerSidePrepare-0-causes-Wi...
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


-- 
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] 8+ messages in thread

* Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=0 causes Windows gpf in Unicode Driver versions > 08.04.0200
@ 2013-04-22 06:40  Heikki Linnakangas <hlinnakangas@vmware.com>
  parent: ljwilson <ljwilson@digitalav.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Heikki Linnakangas @ 2013-04-22 06:40 UTC (permalink / raw)
  To: ljwilson <ljwilson@digitalav.com>; +Cc: pgsql-odbc

On 21.04.2013 20:56, ljwilson wrote:
> I've been upgrading some Windows servers from PostgreSQL 8.3.18 to 9.2.4.
> Along with that I upgraded psqlODBC for the Windows clients from 8.0x.xxxx
> to 09.01.0200.
>
> All was fine until I had a customer who could consistently get a gpf in
> psqlodbc35w.dll when doing an export.
>
> Getting a copy of their database, I could reproduce as well.
>
> Trying different driver versions, I've found no crashes with the 8.0x
> psqlODBC series, but I can reproduce the gpf starting with 09.00.xxxx
> through the latest 9.01.02?? that I compiled yesterday (2013/04/20) from the
> git repository.
>
> I've used UseDeclareFetch=1 and Fetch=100 since I started with PostgreSQL
> back in 2008.
>
> Now with the 09.xx.xxxx drivers I don't get a crash if I:
>
> 1. Set UseDeclareFetch=0
> or
> 2. Set UseServerSidePrepare=1
>
> I've got a 31MB mylog file (zipped) of an entire client session. I can
> uploaded somewhere if that would help The bulk of that could be
> stripped-out; probably just the first and last 1000 lines are relevant. The
> actual sql is doing an update one record at a time of a numeric(14,0) value.
> It updates the first two records, executes a fetch, then crashes (when
> UseDeclareFetch=1 and UseServerSidePrepare=0).

If you could reduce it to a small self-contained test program, that 
would help a lot. Or if you could narrow it down to the commit that 
introduced the problem, using "git bisect".

- Heikki


-- 
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] 8+ messages in thread

* Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=0 causes Windows gpf in Unicode Driver versions > 08.04.0200
@ 2013-04-22 20:15  ljwilson <ljwilson@digitalav.com>
  parent: Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 0 replies; 8+ messages in thread

From: ljwilson @ 2013-04-22 20:15 UTC (permalink / raw)
  To: pgsql-odbc

Using git bisect, where "good" is defined as not crashing the PostgreSQL
server nor causing a gpf in the client program, and "bad" does one or the
other):

Last "good" commit:
http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=3cf4dedfbb435f653785a967e951956046f0a8cb
<http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=3cf4dedfbb435f653785a967e951956046f0a8cb;  

The commit right after that actually crashes the PostgreSQL 9.2.4 server--I
don't get a chance to get a gpf at the client when running my test:

(this is in the server log)
2013-04-22 15:47:04 EDT	LOG	server process (PID 13732) was terminated by
exception 0xC0000005	

First "bad" commit:
http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=6e45dcb08093d81f244ad6321cbd529d0a7efe61
<http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=6e45dcb08093d81f244ad6321cbd529d0a7efe61;  

Note that this "bad" commit requires 09.00 headers to compile (though
version is still at 08.04), otherwise get two unresolved externals:

loadlib.obj : error LNK2019: unresolved external symbol _PQescapeLiteral
referenced in function _connect_with_param_available
loadlib.obj : error LNK2019: unresolved external symbol _PQconnectdbParams
referenced in function _CALL_PQconnectdbParams
.\Release\psqlodbc35w.dll : fatal error LNK1120: 2 unresolved externals

Apparently those two symbols were introduced in the 09.00 code stream.

Thanks...jack





--
View this message in context: http://postgresql.1045698.n5.nabble.com/UseDeclareFetch-1-Fetch-100-UseServerSidePrepare-0-causes-Wi...
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


-- 
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] 8+ messages in thread

* Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=0 causes Windows gpf in Unicode Driver versions > 08.04.0200
@ 2013-04-22 23:47  Inoue, Hiroshi <inoue@tpf.co.jp>
  parent: ljwilson <ljwilson@digitalav.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Inoue, Hiroshi @ 2013-04-22 23:47 UTC (permalink / raw)
  To: ljwilson <ljwilson@digitalav.com>; +Cc: pgsql-odbc

Hi Jack,

(2013/04/22 2:56), ljwilson wrote:
> I've been upgrading some Windows servers from PostgreSQL 8.3.18 to 9.2.4.
> Along with that I upgraded psqlODBC for the Windows clients from 8.0x.xxxx
> to 09.01.0200.
>
> All was fine until I had a customer who could consistently get a gpf in
> psqlodbc35w.dll when doing an export.
>
> Getting a copy of their database, I could reproduce as well.
>
> Trying different driver versions, I've found no crashes with the 8.0x
> psqlODBC series, but I can reproduce the gpf starting with 09.00.xxxx
> through the latest 9.01.02?? that I compiled yesterday (2013/04/20) from the
> git repository.
>
> I've used UseDeclareFetch=1 and Fetch=100 since I started with PostgreSQL
> back in 2008.
>
> Now with the 09.xx.xxxx drivers I don't get a crash if I:
>
> 1. Set UseDeclareFetch=0
> or
> 2. Set UseServerSidePrepare=1
>
> I've got a 31MB mylog file (zipped) of an entire client session. I can
> uploaded somewhere if that would help

Could you please upload it somewhere?

regards,
Hiroshi Inoue



-- 
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] 8+ messages in thread

* UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang
@ 2013-05-27 22:38  ljwilson <ljwilson@digitalav.com>
  0 siblings, 2 replies; 8+ messages in thread

From: ljwilson @ 2013-05-27 22:38 UTC (permalink / raw)
  To: pgsql-odbc

This weekend I tested at a client site the psqlODBC Windows drivers as of
2013/05/21 (what will eventually be 09.02.0100) from the github source. When
printing invoices, intermittently a client (I could reproduce on all three
of the test machines) would hang (freeze--must kill with taskmanager). The
client might have to print just one, or 13, or as high as 61 individual jobs
before the hang would occur. The fix is to set the UseServerSidePrepare back
to 0--then no hangs can be reproduced. Enabling mylog makes it much harder
to reproduce the hang, but I have been able to produce 4 mylog files using
my own test machine that log up to the hang.

Here is the end of one of the mylogs when the hang happened:

[2228-302.275][SQLFreeStmt][2228-302.275]PGAPI_FreeStmt:
entering...hstmt=01B3AA70, fOption=0
[2228-302.275]SC_recycle_statement: self= 01B3AA70
[2228-302.276]QResult: enter DESTRUCTOR
[2228-302.276]QResult: in QR_close_result
[2228-302.276]CC_cursor_count: self=00B7A6A0, num_stmts=64
[2228-302.276]CC_cursor_count: returning 13
[2228-302.276]CC_send_query: conn=00B7A6A0, query='close "SQL_CUR01B3AA70"'
[2228-302.277]in QR_Constructor
[2228-302.277]exit QR_Constructor
[2228-302.277]SOCK_get_id has to eat 1578 bytes
[2228-302.277]SC_set_Result(1c961c0, 1b68380)[2228-302.277]QResult: enter
DESTRUCTOR
[980-302.277]read 6, global_socket_buffersize=4096
[980-302.278]read -1, global_socket_buffersize=4096
[980-302.278]Lasterror=10035

Thanks...jack



--
View this message in context: http://postgresql.1045698.n5.nabble.com/UseDeclareFetch-1-Fetch-100-UseServerSidePrepare-1-causes-Wi...
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


-- 
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] 8+ messages in thread

* Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang
@ 2013-06-01 22:39  ljwilson <ljwilson@digitalav.com>
  parent: ljwilson <ljwilson@digitalav.com>
  1 sibling, 0 replies; 8+ messages in thread

From: ljwilson @ 2013-06-01 22:39 UTC (permalink / raw)
  To: pgsql-odbc

To bring some closure: Hiroshi Inoue-san created a patch based on the mylogs.
It passed my in-house tests, and today I tested it at the same client site
where I originally discovered the issue, and no problems.

...jack





--
View this message in context: http://postgresql.1045698.n5.nabble.com/UseDeclareFetch-1-Fetch-100-UseServerSidePrepare-1-causes-Wi...
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


-- 
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] 8+ messages in thread

* Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang
@ 2013-06-03 15:02  Joshua Berry <yoberi@gmail.com>
  parent: ljwilson <ljwilson@digitalav.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Joshua Berry @ 2013-06-03 15:02 UTC (permalink / raw)
  To: ljwilson <ljwilson@digitalav.com>; +Cc: pgsql-odbc

Hi Jack,

On Mon, May 27, 2013 at 5:38 PM, ljwilson <ljwilson@digitalav.com> wrote:

> This weekend I tested at a client site the psqlODBC Windows drivers as of
> 2013/05/21 (what will eventually be 09.02.0100) from the github source.
> When
> printing invoices, intermittently a client (I could reproduce on all three
> of the test machines) would hang (freeze--must kill with taskmanager). The
> client might have to print just one, or 13, or as high as 61 individual
> jobs
> before the hang would occur. The fix is to set the UseServerSidePrepare
> back
> to 0--then no hangs can be reproduced. Enabling mylog makes it much harder
> to reproduce the hang, but I have been able to produce 4 mylog files using
> my own test machine that log up to the hang.
>

When the client system would hang, would it cause the PG backend to crash
and restart? Also, were other clients concurrently connected to the same
backend affected as well?

I'm hoping that the issue that you're having is related to the issue I've
been having such that a single patch will cure both!

Kind Regards,
-Joshua

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

* Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang
@ 2013-06-03 15:39  ljwilson <ljwilson@digitalav.com>
  parent: Joshua Berry <yoberi@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: ljwilson @ 2013-06-03 15:39 UTC (permalink / raw)
  To: pgsql-odbc

Joshua,

> When the client system would hang, would it cause the PG backend to crash
> and restart? 

No, the PG backend was unaffected.


> Also, were other clients concurrently connected to the same
> backend affected as well?

No, other clients were not impacted.


> I'm hoping that the issue that you're having is related to the issue I've
> been having such that a single patch will cure both!
> Kind Regards,
> -Joshua

Me too!

...jack



--
View this message in context: http://postgresql.1045698.n5.nabble.com/UseDeclareFetch-1-Fetch-100-UseServerSidePrepare-1-causes-Wi...
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


-- 
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] 8+ messages in thread


end of thread, other threads:[~2013-06-03 15:39 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-04-21 17:56 UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=0 causes Windows gpf in Unicode Driver versions > 08.04.0200 ljwilson <ljwilson@digitalav.com>
2013-04-22 06:40 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2013-04-22 20:15   ` ljwilson <ljwilson@digitalav.com>
2013-04-22 23:47 ` Inoue, Hiroshi <inoue@tpf.co.jp>
2013-05-27 22:38 UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang ljwilson <ljwilson@digitalav.com>
2013-06-01 22:39 ` Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang ljwilson <ljwilson@digitalav.com>
2013-06-03 15:02 ` Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang Joshua Berry <yoberi@gmail.com>
2013-06-03 15:39   ` Re: UseDeclareFetch=1, Fetch=100, UseServerSidePrepare=1 causes Windows client to intermittently hang ljwilson <ljwilson@digitalav.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