dbTalk Databases Forums  

[BUGS] PG 7.3.1 with ssl on linux hangs (testcase available)

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hans-Jürgen Hay
 
Posts: n/a

Default [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) - 08-01-2003 , 10:59 AM






since I moved from postgres 7.1 to 7.3 I get hangs when executing a
select on certaint rows with binary data using psql

The problem is reproducible and affects only single rows in the table .
The hangs happen only when I connect via network unsing psql -h
localhost template1

And the problem is gone, when ssl is switched off in postgresql.conf
But the problem seems to be on the client side, cause its the same using
a 7.1 server.

I have generated a testcase with 2 rows, one works the other not:

The table looks like this

create table testy (
id integer,
data bytea
);

(I can send a dump of the table with the offending rows to anybody
interessted by mail -- its about 130 K )

select * from testy where id=28162 --> works
select * from testy where id=28163 --> hangs + process goes up to
99% utilisation

The offending row is much larger, that might trigger.

I use a debian system with:
postgresql 7.3.3-1 client and server


--
Hans-Jürgen Hay <hjh (AT) alterras (DOT) de>


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) - 08-01-2003 , 11:57 AM






=?ISO-8859-1?Q?Hans-J=FCrgen?= Hay <hjh (AT) alterras (DOT) de> writes:
Quote:
The hangs happen only when I connect via network unsing psql -h
localhost template1
And the problem is gone, when ssl is switched off in postgresql.conf
We have heard a couple of reports of problems with SSL connections,
but so far I've not been able to reproduce any trouble here. Details
about your SSL installation might help.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #3  
Old   
Andreas Pflug
 
Posts: n/a

Default Re: [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) - 08-01-2003 , 02:39 PM



Tom Lane wrote:

Quote:
Andreas Pflug <pgadmin (AT) pse-consulting (DOT) de> writes:


I currently don't have a system to reproduce this, because I didn't
succeed making my 7.4 server accepting ssl-connections. I posted for
installation help on pgsql-admin but didn't get a reaction so far. RTFM
up and down I couldn't see what I configured wrong (--with-openssl,
ssl=true). Can you give me a hint?



No, I didn't see what you did wrong either. Try looking in the
postmaster log to see if any useful error messages appear.

I pushed client_min_messages and log_min_messages to debug5, and the
only suspicious message at startup is

LOG: could not load root cert file "/usr/data/pgsql-7.4/root.crt": No
such file or directory
DETAIL: Will not verify client certificates.

which shouldn't be a problem (pg_hba.conf is configured to trust).

Any connect attempt will log
DEBUG: forked new backend, pid=1826 socket=8
DEBUG: proc_exit(0)
DEBUG: shmem_exit(0)
DEBUG: exit(0)
DEBUG: reaping dead processes
DEBUG: child process (pid 1826) exited with exit code 0

with the client side message "server does not support SSL, but SSL was
required". OpenSSL is 0.9.6g

Regards,
Andreas




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) - 08-01-2003 , 06:03 PM



Andreas Pflug <pgadmin (AT) pse-consulting (DOT) de> writes:
Quote:
the attached file is a tcpdump of a connect attempt.
Hm. The postmaster is sending back 'N' indicating that it does not want
to do SSL.

Are you sure you are connecting to an SSL-enabled postmaster?

Also, is your connection by any chance IPV6? It doesn't look like it
from the tcpdump, but I'm not sure I know how to tell.

The relevant bit of code in the postmaster is

#ifdef USE_SSL
/* No SSL when disabled or on Unix sockets */
if (!EnableSSL || port->laddr.addr.ss_family != AF_INET)
SSLok = 'N';
else
SSLok = 'S'; /* Support for SSL */
#else
SSLok = 'N'; /* No support for SSL */
#endif

so one of the paths that chooses 'N' is being followed. The test on
AF_INET is broken, since it should allow for IPV6, but otherwise I
don't see what's getting you.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #5  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) - 08-01-2003 , 06:28 PM



Andreas Pflug <pgadmin (AT) pse-consulting (DOT) de> writes:
Quote:
reducing the traced conversation to its essence it's just a ssl-request
to a non-ssl server :-(
Yeah, I had just come to the same conclusion. Either you're connecting
to the wrong server (check those port numbers?) or there's something
wrong with the bit of postmaster code I just showed you.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #6  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] PG 7.3.1 with ssl on linux hangs (testcase available) - 08-01-2003 , 06:33 PM



Andreas Pflug <pgadmin (AT) pse-consulting (DOT) de> writes:
Quote:
According to the comment, it should be
if (!EnableSSL || port->laddr.addr.ss_family == AF_UNIX)
and after changing this it works!
Right. I've committed the fix. One bug less, now to find the next one
....

Quote:
Dave reported this failing on snake.pgadmin.org, which uses a
different openssl (0.9.7a), I'll see if I can check that version (won't
be before monday, need some sleep now).
Sounds good, see you then.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.