BUG #2724: Could not check connection status with "ssl=on"

From: "Alexey Zayats" <alexey(dot)zayats(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2724: Could not check connection status with "ssl=on"
Date: 2006-10-27 07:41:05
Message-ID: 200610270741.k9R7f59E031895@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches


The following bug has been logged online:

Bug reference: 2724
Logged by: Alexey Zayats
Email address: alexey(dot)zayats(at)gmail(dot)com
PostgreSQL version: 8.1.5
Operating system: SuSE 10.0 Linux 2.6.13 x86-64
Description: Could not check connection status with "ssl=on"
Details:

I'm wrote a programm using libpq.
Postgres(8.1.5) build and configured with ssl(OpenSSL 0.9.7g 11 Apr 2005)
support.

Os: SuSE Linux 10.0
Kernel: 2.6.13
Arch: x86-64

In case until postgresql backend restarted, all is work fine, but if it
happens, i could not get correct connection status,
programm recieve SIGPIPE and crush.

I've got next backtrace from core file:
--------------------------
Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 46912549615488 (LWP 28743)]
0x00002aaaad07ae32 in __write_nocancel () from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x00002aaaad07ae32 in __write_nocancel () from
/lib64/tls/libpthread.so.0
#1 0x00002aaaad9e2187 in BIO_sock_should_retry ()
from /usr/lib64/libcrypto.so.0.9.7
#2 0x00002aaaad9e0751 in BIO_write () from /usr/lib64/libcrypto.so.0.9.7
#3 0x00002aaaad82b8a4 in ssl3_change_cipher_state ()
from /usr/lib64/libssl.so.0.9.7
#4 0x00002aaaad82b9a2 in ssl3_dispatch_alert ()
from /usr/lib64/libssl.so.0.9.7
#5 0x00002aaaad82a084 in ssl3_shutdown () from /usr/lib64/libssl.so.0.9.7
#6 0x00002aaaaaec4095 in close_SSL () from /usr/local/lib/libpq.so.4
#7 0x00002aaaaaebd408 in pqReadData () from /usr/local/lib/libpq.so.4
#8 0x00002aaaaaebb132 in PQgetResult () from /usr/local/lib/libpq.so.4
#9 0x00002aaaaaebb20e in PQexecFinish () from /usr/local/lib/libpq.so.4
#10 0x00002aaaaabee6b4 in QPSQLResult::reset (this=0x840d10,
query=(at)0x7fffffcc17d0) at qsql_psql.cpp:332
#11 0x00002aaaaad4c014 in QSqlQuery::exec (this=0x7fffffcc17b0,
query=(at)0x7fffffcc17d0) at qsqlquery.cpp:355
--

Before any queries send, i'm using isOpen method that looks like:
--
bool QPSQLDriver::isOpen() const
{
return PQstatus(d->connection) == CONNECTION_OK;
}
--

if "ssl=on", PQstatus(d->connection) always return CONNECTION_OK, even if
connection is closed by postgresql

if "ssl=off" in postgresql.conf, all wroks fine.
Using sigaction impossible, because i'm wrote on c++ with Qt library as a
base. Qt library itself used libpq as interface to postgresql.

Is there a bug on libpq?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas H. 2006-10-27 14:30:57 Re: BUG #2712: could not fsync segment: Permission
Previous Message Stefan Kaltenbrunner 2006-10-26 17:23:22 Re: BUG #2719: configure script does not accept --enable-locale

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2006-10-27 08:24:51 Re: bug in on_error_rollback !?
Previous Message Albe Laurenz 2006-10-27 07:23:12 Re: Deadlock with pg_dump?

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2006-10-27 13:59:45 Re: GUC description cleanup
Previous Message Jaime Casanova 2006-10-27 04:42:17 Re: Tablespace for temporary objects and sort files