ORA-07445 [slfipn()+3868] [SIGSEGV] When Running PL/SQL Code That Uses UTL_FILE (Doc ID 1458566.1)

Last updated on FEBRUARY 07, 2014

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.5 and later
Oracle Solaris on SPARC (64-bit)

Symptoms

On Oracle Solaris, from 10.2 onwards, when attempting to use UTL_FILE with "." on a database started with NLS_LANG set to multibyte (UTF8 for example),
an ORA-3113/ORA-3114 is reported with an ORA-7445 [slfipn()+2856] [SIGSEGV] [Address not mapped to object] [0x000000000] [] [] in the database alert.log file.

 

For example, the below sample of code will lead to this behavior :


DECLARE
OS_PATH all_directories.directory_path%Type := '/exp-imp-e2e';
ORA_DIR_NAME all_directories.directory_name%Type := 'PUBLIC';
REQD_ACCESS char(2) := 'RW';
tmp_dir_name all_directories.directory_name%Type;
dir_name all_directories.directory_name%Type;
fileHandle utl_file.file_type;
tmpFileName varchar2(50);
step varchar2(20);
cursor matchingDirCursor
(v_dir varchar2, v_grantor varchar2, v_grantee varchar2, v_path varchar2 ) is
select unique ad.directory_name
from all_directories ad,
all_tab_privs ap
where ad.directory_name = ap.table_name
and ad.directory_name like v_dir
and ap.grantor = v_grantor
and ap.grantee = v_grantee
and directory_path = v_path;
BEGIN
--
-- create temp file name to verify directory access
--
select '.writeCheck_' || dbms_random.string('A', 30) str into tmpFileName from dual;
dir_name := '';
if ORA_DIR_NAME = 'PUBLIC' then
dbms_output.put_line('Looking for public oracle dir for ' || OS_PATH);
open matchingDirCursor ( '%', 'SYS', 'PUBLIC', OS_PATH);
else
dbms_output.put_line('Looking for oracle dir ' || ORA_DIR_NAME || ' for ' || OS_PATH);
open matchingDirCursor ( ORA_DIR_NAME, 'OPS$ORACLE', user, OS_PATH);
end if;
LOOP
fetch matchingDirCursor into tmp_dir_name;
exit when matchingDirCursor%NOTFOUND;
dbms_output.put_line('Dir found: ' || tmp_dir_name);
--
-- check read access
--
BEGIN
step := 'read';
dbms_output.put_line('Check dir: ' || tmp_dir_name || ' read access' );


utl_file.fclose(fileHandle);
dbms_output.put_line('Read access OK');
--
-- check write access if RW required
--
if REQD_ACCESS = 'RW' then
step := 'write';
dbms_output.put_line('Check dir ' || tmp_dir_name || '/' || tmpFileName || ' write access' );
fileHandle := utl_file.fopen(tmp_dir_name, tmpFileName, 'w');
utl_file.fclose(fileHandle);
utl_file.fremove(tmp_dir_name, tmpFileName);
dbms_output.put_line('Write access OK');
dir_name := tmp_dir_name ;
end if;
EXCEPTION
when OTHERS then
dbms_output.put_line('ERROR: No ' || step || ' access to ' || tmp_dir_name);
END;
END LOOP;
if dir_name is null then
dbms_output.put_line( 'ERROR: No directory matching name:' || ORA_DIR_NAME || ' path:' || OS_PATH || ' access:' || REQD_ACCESS || ' found.');
else
dbms_output.put_line( 'STDOUT: ' || dir_name );
end if;
END;

ERROR

---------

ORA-07445: exception encountered: core dump [slfipn()+3868] [SIGSEGV] [Address not mapped to object] [0x000000000] [] []

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms