psycopg / psycopg2

PostgreSQL database adapter for the Python programming language
https://www.psycopg.org/
Other
3.31k stars 503 forks source link

execute randomly causes segmentation faults with Python 3.12.4 #1708

Closed stollero closed 2 months ago

stollero commented 2 months ago

Please complete the following information:

Describe the bug

Our web application randomly crashes with segmentation fault errors. Not very often, maybe 1 in 1000 queries.

Even with environment variable PYTHONFAULTHANDLER=1 set, this is currently all we see.

  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 924 in do_execute
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967 in _exec_single_context
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1846 in _execute_context
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1640 in _execute_clauseelement
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515 in _execute_on_connection
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418 in execute
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/orm/context.py", line 293 in orm_execute_statement
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2236 in _execute_internal
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2351 in execute
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/orm/scoping.py", line 778 in execute

Please advice what we could do to get more detailed information to better triage the error.

1: what you did Update Python 3.12.3 to 3.12.4 2: what you expected to happen No Segmentation faults 3: what happened instead Segmentation faults

Unfortunately no luck reproducing the issue in a small example environment.

dvarrazzo commented 2 months ago

You should obtain a core file if we want us to debug it. Not a chance to debug it this way.