Closed charliejacobsen closed 2 years ago
Thanks for the details.
Looks like I can replicate it with an even simpler set of code:
data = "A" * (1024 * 1024 * 5)
cursor.execute("""
declare
t_Clob clob;
begin
select :data into t_Clob from dual;
end;""",
data=data)
Let me see if I can correct that!
I have added the patch to ODPI-C. It is quite simple. You can apply the patch yourself and build cx_Oracle...or you can ensure that instead of passing a string to the PL/SQL block you pass a temporary LOB that you have created and populated yourself.
Thanks 👍 For me this is just in my dev env and I can fix the issue by just making sure there's sufficient tablespace and stuff :)
Just posting it here for community to pick up any fix.
Thanks for reporting it!
ODPI-C 4.4 contains this fix.
What version of ODPI-C are you using (see dpi.h)? v4.0.2 (via cx_Oracle 8.0.1)
What OS (and version) is your application on? CentOS 8
What compiler (and version) did you use? Using the build incorporated into cx_Oracle 8.0.1.
What is your version of the Oracle Client (e.g. Instant Client)? How was it installed? Where it is installed? Oracle Instant Client 19.5, installed from public Oracle repo. Installed under standard location, /usr/lib/oracle.
What is your Oracle Database version? Oracle 21c XE
What is the
PATH
environment variable (on Windows) orLD_LIBRARY_PATH
(on Linux) set to?LD_LIBRARY_PATH
is empty (but I do have some /etc/ld.so.conf files, one of which contains /usr/lib/oracle/19.5, so I guess you could say it's not really empty). I suspect this is N/A though.What environment variables did you set? How exactly did you set them? This is probably N/A.
What problem or error(s) you are seeing? My Python3 program encounters a segfault when it tries to execute a PL/SQL anonymous block that involves a BLOB. The segfault seems to happen after an error is thrown, and inside a
finally
where I try to close thecursor
.This is the error backtrace in
gdb
, noticeptr=0x0
indpiGen__setRefCount
:conn = cx_Oracle.connect(...) cursor = conn.cursor()
try: cursor.execute(""" DECLARE v_file_handle UTL_FILE.FILE_TYPE; v_buffer RAW(32767); v_amount INTEGER := 32767; v_pos INTEGER := 1; v_blob_len INTEGER; v_blob BLOB; BEGIN -- Open destination file: v_file_handle := UTL_FILE.FOPEN(:directory, :filename, 'wb');
finally: cursor.close() conn.close()
include