Bug 80394 - pgAdminII Windows client crashes when connecting to RH's PostgreSQL 7.3
Summary: pgAdminII Windows client crashes when connecting to RH's PostgreSQL 7.3
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: postgresql
Version: phoebe
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Andrew Overholt
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-25 19:59 UTC by Didier
Modified: 2007-04-18 16:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-01-05 07:04:13 UTC

Attachments (Terms of Use)
RH8 - psql connection (6.57 KB, application/x-gzip)
2002-12-26 18:53 UTC, Didier
no flags Details
RH8 - Successful pgAdminII connection (38.11 KB, application/x-gzip)
2002-12-26 18:53 UTC, Didier
no flags Details
Phoebe - psql connection (7.01 KB, application/x-gzip)
2002-12-26 18:54 UTC, Didier
no flags Details
Phoebe - Failed pgAdminII connection (8.92 KB, application/x-gzip)
2002-12-26 18:55 UTC, Didier
no flags Details

Description Didier 2002-12-25 19:59:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130

Description of problem:
pgAdminII (http://pgadmin.postgresql.org) is the preferred Windows client
application for connecting to PostgreSQL servers.

When connecting to RH's version of PostgreSQL 7.3, pgAdmin crashes.

Version-Release number of selected component (if applicable):
7.3-2 and higher.

How reproducible:

Steps to Reproduce:
1. start RH's PostgreSQL 7.3 on server
2. start pgAdminII on client
3. connect to server

Actual Results:  pgAdminII crashes

Expected Results:  pgAdminII should continue to operate, obviously. :)

Additional info:

- pgAdminII (hereafter referred to as pgAdm) fully interoperates with PostgreSQL
(pgSQL) 7.2, either RedHat or PGDG (PostgreSQL Global Development Group) RPM

- pgAdm also works with the RPM's compiled by PGDG (for RedHat 8.0).

- pgAdm crashes with RedHat's RawHide pgSQL version (7.3-2) on a RHL 8.0
platform, and it crashes with 7.3-6 on RHL 8.0.92 (this bug report).

- I recompiled RawHide 7.3-2 on a stock RHL 8.0, and pgAdm connects just fine.

I suspect there is a component in the latest build environnments (glibc ?) which
causes incompatibilities with pgAdm, as a recompiled 7.3 on RHL 8.0 works just fine.

Please inform me of any extensive logs to be produced, which could be helpful in
tracing the culprit.

Comment 1 Warren Togami 2002-12-25 20:55:34 UTC
Out of curiosity, if you add the Windows client IP address to a /etc/hosts entry
does it work?

Comment 2 Didier 2002-12-26 10:01:39 UTC
Comment #1 : no, adding IP addresses doesn't make a difference (no resolver
issue, I guess). I'll try to add some DEBUG logs from both PostgreSQL 7.2.x and
7.3 later today.

Comment 3 Didier 2002-12-26 18:50:54 UTC
In attachment, four logs.

A/ Two logs per server config : 

- a standard psql connection ('psql template1 -U postgres) from the localhost,
for comparative purposes ;
- a pgAdminII connection, from a VMWare Win2K client.

The Windows client has been tested with combinations of WinMe/Win2K/WinXP,
pgAdminII 1.4.0/1.4.12, psqlODBC 7.2.x/7.2.5.

B/ Two server configs :

- Phoebe (P-200, 64MB), with the latest pre-compiled PostgreSQL 7.3-6 RPM ;
- RH8 (P3-1200, 768MB), with a recompiled PostgreSQL 7.3-2 SRPM (as the original
RawHide pre-compiled 7.3-2 RPM fails too).

As you can see, the pre-compiled connection fails, where the recompiled one runs

Anything else I can do to trace the problem ?

Comment 4 Didier 2002-12-26 18:53:16 UTC
Created attachment 88915 [details]
RH8 - psql connection

All logs are DEBUG5 level.

Comment 5 Didier 2002-12-26 18:53:59 UTC
Created attachment 88916 [details]
RH8 - Successful pgAdminII connection

Comment 6 Didier 2002-12-26 18:54:40 UTC
Created attachment 88917 [details]
Phoebe - psql connection

Comment 7 Didier 2002-12-26 18:55:17 UTC
Created attachment 88918 [details]
Phoebe - Failed pgAdminII connection

Comment 8 Dave Page 2002-12-28 20:58:43 UTC
Initial testing in pgAdmin is pointing to an incompatibility with Microsoft's 
MDAC or psqlODBC and the Redhat build of PostgreSQL causing this bug, rather 
than pgAdmin itself. I will post further test results once I have access to a 
Redhat system to reproduce it in a debugger.

Dave (pgAdmin lead developer).

Comment 9 Dave Page 2003-01-02 12:30:42 UTC
This is caused by a buffer overflow in psqlODBC's SQLGetInfo function (info.c) 
for SQL_DBMS_VER calls. The overlength string in this case is:

07.02.0005 PostgreSQL 7.3 on i386-redhat-linux-gnu, compiled by GCC i386-
redhat-linux-gcc (GCC) 3.2.1 20021207 (Red Hat Linux 8.0 3.2.1-2)

I have increased MAX_INFO_STRING to 256 in psqlodbc.h for the time being. The 
fix will be in the next release of psqlODBC.

Note You need to log in before you can comment on or make changes to this bug.