Обсуждение: Crashed libpq.dll in a multithreaded environment in case of SSLconnection + callstack

Поиск
Список
Период
Сортировка

Crashed libpq.dll in a multithreaded environment in case of SSLconnection + callstack

От
Ádám Maracska
Дата:
Hi,

I am working in a multithreaded environment with at least 5 threads on a windows 10 x64 OS. 
Postgresql server: 9.6.9 also the used libpq.dll in my application is 9.6.9. 
SSL Version: 1.0.2o (The issue also occures with 1.0.2n) 

CallStack:
libeay32.dll!ssleay_rand_bytes(unsigned char * buf=0x000002382a57a428, int num=6, int pseudo=0, int lock=1) Line 506 C
ssleay32.dll!tls1_enc(ssl_st * s=0x000002382a56ed20, int send=1) Line 785 C
ssleay32.dll!do_ssl3_write(ssl_st * s=0x000002382a56ed20, int type=23, const unsigned char * buf=0x000002382a3eb0e0, unsigned int len=12, int create_empty_fragment=0) Line 1046 C
ssleay32.dll!ssl3_write_bytes(ssl_st * s=0x000002382a56ed20, int type=23, const void * buf_=0x000002382a3eb0e0, int len) Line 834 C
ssleay32.dll!ssl3_write(ssl_st * s=0x000002382a56ed20, const void * buf=0x000002382a3eb0e0, int len=12) Line 4442 C
libpq.dll!pgtls_write(pg_conn * conn=0x0000023827d8c240, const void * ptr=0x000002382a3eb0e0, unsigned __int64 len=12) Line 307 C
libpq.dll!pqsecure_write(pg_conn * conn=0x0000023827d8c240, const void * ptr=0x000002382a3eb0e0, unsigned __int64 len=12) Line 289 C
libpq.dll!pqSendSome(pg_conn * conn=0x0000023827d8c240, int len=12) Line 863 C
libpq.dll!pqFlush(pg_conn * conn=0x0000023827d8c240) Line 972 C
libpq.dll!PQsendQuery(pg_conn * conn=0x0000023827d8c240, const char * query=0x00007ffe9231f578) Line 1167 C
libpq.dll!PQexec(pg_conn * conn=0x0000023827d8c240, const char * query=0x00007ffe9231f578) Line 1850 C
libpqxx.dll!pqxx::connection_base::Exec(const char * Query=0x00007ffe9231f578, int Retries=0) Line 723 C++
libpqxx.dll!pqxx::internal::gate::connection_transaction::Exec(const char * query=0x00007ffe9231f578, int retries=0) Line 18 C++
libpqxx.dll!pqxx::transaction_base::DirectExec(const char * C=0x00007ffe9231f578, int Retries=0) Line 409 C++
libpqxx.dll!pqxx::basic_transaction::do_commit() Line 41 C++
libpqxx.dll!pqxx::transaction_base::commit() Line 164 C++

Also let me highlight the fact that the crash do not occure when the SSL is not configured. 
As you suggested on your bugreport page I would not like to guess the issues, but at first I thought the issue is happening because of the SSL version, so I wrote a bug report to them also. (Link: https://github.com/openssl/openssl/issues/6393) where they suggested the following:
Then probably you need to first raise this issue with the postgres folks. The most likely cause of this issue is a problem with those locking callbacks.

Let me know if you need more info.

Best Regards,
Adam Maracska 
Hi,

OP here.

The issue was that I used a cipher that is not allowed in version 9.6:
ssl_ciphers = 'AES256-SHA256'.
With commenting out this settings which cipher version will pqlib use? Is
there any more info about this somewhere regarding cipher versions with
postgresql?

Thanks,
Best,
Adam



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html