Closed
Description
- What versions are you using?
- server : Oracle Database 19c
- client:
- Oracle Instant Client Basic 21.16.0.0.0
- python:
platform.platform: Linux-4.18.0-553.5.1.el8_10.x86_64-x86_64-with-glibc2.28
sys.maxsize > 2**32: True
platform.python_version: 3.13.0
oracledb.__version__: 2.5.0
-
Is it an error or a hang or a crash?
crash -
What error(s) or behavior you are seeing?
Segmentation fault when creating the connection pool usingoracledb==2.5.0
. This error does not happen when usingoracledb==2.4.1
.- using
oracledb==2.5.0
- using
$ PYTHONFAULTHANDLER=1 python test_oracle.py
platform.platform: Linux-4.18.0-553.5.1.el8_10.x86_64-x86_64-with-glibc2.28
sys.maxsize > 2**32: True
platform.python_version: 3.13.0
oracledb.__version__: 2.5.0
Fatal Python error: Segmentation fault
Thread 0x00007fb8ecc36700 (most recent call first):
File "/usr/local/lib/python3.13/threading.py", line 1092 in join
File "/usr/local/lib/python3.13/threading.py", line 992 in run
File "/usr/local/lib/python3.13/threading.py", line 1041 in _bootstrap_inner
File "/usr/local/lib/python3.13/threading.py", line 1012 in _bootstrap
Current thread 0x00007fb8f0efa740 (most recent call first):
File "/opt/app-root/lib/python3.13/site-packages/oracledb/connection.py", line 579 in __init__
File "/opt/app-root/lib/python3.13/site-packages/oracledb/connection.py", line 1194 in connect
File "/opt/app-root/lib/python3.13/site-packages/oracledb/pool.py", line 406 in acquire
File "/home/gdraelan/test_oracle.py", line 24 in main
File "/home/gdraelan/test_oracle.py", line 36 in <module>
Extension modules: oracledb.base_impl, oracledb.thick_impl, _cffi_backend, oracledb.thin_impl (total: 4)
Segmentation fault (core dumped)
- using
oracledb==2.4.1
$ PYTHONFAULTHANDLER=1 python test_oracle.py
platform.platform: Linux-4.18.0-553.5.1.el8_10.x86_64-x86_64-with-glibc2.28
sys.maxsize > 2**32: True
platform.python_version: 3.13.0
oracledb.__version__: 2.4.1
Database version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Database time: 2024-12-02 12:23:47.237628
-
Does your application call init_oracle_client()?
Yes -
Include a runnable Python script that shows the problem.
import faulthandler; faulthandler.enable()
import oracledb
import platform
import sys
def main() -> None:
print("platform.platform:", platform.platform())
print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
print("platform.python_version:", platform.python_version())
print("oracledb.__version__:", oracledb.__version__)
oracledb.init_oracle_client()
param = oracledb.PoolParams(
timeout=120,
getmode=oracledb.POOL_GETMODE_TIMEDWAIT,
wait_timeout=5000,
externalauth=True,
homogeneous=False
)
pool = None
try:
pool = oracledb.create_pool(dsn='xxx', params=param)
with pool.acquire() as conn:
with conn.cursor() as cursor:
row = cursor.execute("select * from v$version where banner like 'Oracle%'").fetchone()
print(f'Database version: {str(row[0])}')
row = cursor.execute("select systimestamp from dual").fetchone()
print(f'Database time: {str(row[0])}')
finally:
if pool is not None:
pool.close()
if __name__ == "__main__":
main()