-
Notifications
You must be signed in to change notification settings - Fork 364
Description
I have written a python program able to "replay" Oracle requests captured in the Shared Pool of an Oracle Database. This program is using the last version of cx_Oracle (7.1.2)
[oracle@oraee122 ~]$ python
Python 2.7.5 (default, Nov 1 2018, 03:12:47)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import cx_Oracle
cx_Oracle.version
'7.1.2'
In this example the version of Python used is 2.7 but the same problem occurs when python is in version 3.
To realize a test case, you have just to install the demo located in any Oracle Database at $ORACLE_HOME/demo/schema/human_resources.
After installation (run hr_main.sql under sqlplus), a HR schema is created and in this schema an "EMPLOYEE" table is also created.
The following python program produces a SEGMENTATION FAULT:
[oracle@oraee122 ~]$ cat x.py
import cx_Oracle, logging, coloredlogs
coloredlogs.install(milliseconds=True)
conn = cx_Oracle.connect('hr/hr@localhost:1521/orclpdb1')
curs = conn.cursor()
curs.execute("select e.rowid from employees e, employees")
columns = [i[0] for i in curs.description]
logging.info('Cursor description: ' + str(columns))
for row in curs:
logging.info(str(row))
[oracle@oraee122 ~]$ python x.py
2019-06-04 10:30:32,324 oraee122 root[2256] INFO Cursor description: ['ROWID']
2019-06-04 10:30:32,325 oraee122 root[2256] INFO ('AAAR6pAAMAAAADNABD',)
2019-06-04 10:30:32,325 oraee122 root[2256] INFO ('AAAR6pAAMAAAADNABD',)
Segmentation fault
The database version (here ORACLE 12.2) and the Oracle Instant client used are not involved in the problem.
I will join later the stack produced in the core dump, but clearly the problem is tightly coupled with the rowid handling in a cursor.