-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
Description
- What versions are you using?
Oracle 19
Also run Python and show the output of:
>>> import sys
>>> import platform
>>>
>>> print("platform.platform:", platform.platform())
platform.platform: Linux-4.18.0-372.76.1.el8_6.x86_64-x86_64-with-glibc2.28
>>> print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
sys.maxsize > 2**32: True
>>> print("platform.python_version:", platform.python_version())
platform.python_version: 3.12.4
And:
>>> import oracledb
>>> print("oracledb.__version__:", oracledb.__version__)
oracledb.__version__: 2.2.1
-->
- Is it an error or a hang or a crash?
Crash
- What error(s) or behavior you are seeing?
Segmentation Fault
Cut and paste text showing the command you ran. No screenshots.
Use a gist for long screen output and logs: see https://gist.github.com/
-->
- Does your application call init_oracle_client()?
This bug only occurs in thin mode.
I cannot replicate it in thick mode.
- Include a runnable Python script that shows the problem.
import oracledb
conn = oracledb.connect(...)
cur = conn.cursor()
cursor_var = cur.var(oracledb.CURSOR)
cur.execute(
'''
DECLARE
l_cursor SYS_REFCURSOR;
BEGIN
OPEN l_cursor FOR
SELECT 1 foo
FROM dual
;
:cursor := l_cursor;
END;
''',
dict(
cursor=cursor_var
)
)
cursor = cursor_var.getvalue()
rows = cursor.fetchall()
assert rows == [(1,)]
cursor.close()
# Recalling cur.execute with the same cursor_var will result in the segmentation fault.
cur.execute(
'''
DECLARE
l_cursor SYS_REFCURSOR;
BEGIN
OPEN l_cursor FOR
SELECT 1 foo
FROM dual
;
:cursor := l_cursor;
END;
''',
dict(
cursor=cursor_var
)
)
Segmentation fault (core dumped)
No segfault offcurs when I instead instantiate a new cursor_var:
cursor.close()
cursor_var = cur.var(oracledb.CURSOR)
cur.execute(..., dict(cursor=cursor_var))
In thick mode, it works as expected.