I have a python application which uses postgres and works fine in a conda envirnment based on python 3.7.3. I am trying to update its conda environment to use a newer python version. I built the new environment ground up by repeatedly running the application to find missing packages and the installing them. Executing this script in the new environment:
import psycopg2 conn = psycopg2.connect("dbname='template1' user='dbuser' host='localhost' password='dbpass'")
Produces: double free or corruption (out) Aborted (core dumped) in the connect.
The postgres version is 10. I see this in /var/log/postgressql/postgresql-10-main.log evey time it's run: 2023-12-07 10:05:52.855 GMT [6618] [unknown]@[unknown] FATAL: no PostgreSQL user name specified in startup packet
psycopg2.version '2.9.9 (dt dec pq3 ext lo64)' python --version Python 3.11.6
Whether or not the username is correct, it shouldn't cause a core dump. Any help appreciated.
I had the same issue, a workaround for me was downgrading openssl from 3.2.0 to 3.1.4:
conda install openssl=3.1.4
https://github.com/psycopg/psycopg2/issues/1658
Don't know why this is happening, maybe someone has more details.
Another workaround: install psycopg2-binary (or psycopg[binary] if you use psycopg version 3). That version has inbuilt ssl and libpq