Hi,
I'm using perl to read LONG RAW data from an Oracle
8.1.6 database, my operating system is Solaris 2.6
Whilst trying to read LONG RAW data of about 30Mb from
Oracle 8.1.6, I get a core dump.
The perl script I have written is ok for reading data
into files of about 5MB in size, but fails when I
prepare the select for the 30Mb.
Is this an issue with the size of the data, which is
big but not approaching the maximum for Oracle, or
should I think of another method. Is it even a BUG?
I've tried several re-installs of PERL with various
options and DBI/DBD.
Any help would be appreciated.
Cheers,
Simon.
perl -V
Summary of my perl5 (revision 5.0 version 6 subversion
1) configuration:
Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris
uname='sunos silverstone 5.6 generic_105181-26
sun4u sparc sunw,ultra-enterprise '
config_args='-Uusemymalloc'
hint=recommended, useposix=true,
d_sigaction=define
usethreads=undef use5005threads=undef
useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
usesocks=undef
use64bitint=undef use64bitall=undef
uselongdouble=undef
Compiler:
cc='gcc', ccflags ='-I/usr/local/include
-I/opt/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-I/usr/local/include
-I/opt/local/include'
ccversion='', gccversion='2.7.2.3',
gccosandvers='solaris2.6'
intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=4321
d_longlong=define, longlongsize=8,
d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double',
nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib
-L/opt/local/lib '
libpth=/usr/ccs/lib /usr/local/lib /opt/local/lib
/usr/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false,
libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib
-L/opt/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Apr 27 2001 09:10:26
@INC:
/usr/local/lib/perl5/5.6.1/sun4-solaris
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
.
OUTPUT ON FAILURE:
kghalo bad size 0x04701414
********** Internal heap ERROR KGHALO2 addr=0x0
*********
******************************************************
HEAP DUMP heap name="Alloc statemen" desc=0x31753c
extent sz=0x1024 alt=32767 het=32767 rec=0 flg=2
opc=3
parent=2d29d4 owner=0 nex=0 xsz=0xbf0
EXTENT 0
Chunk 3165ec sz= 1540 perm "perm
" alo=184
Chunk 316bf0 sz= 864 free "
"
Chunk 316f50 sz= 232 freeable assoc with
mark prv=0 nxt=0
Chunk 317038 sz= 32 freeable assoc with
mark prv=0 nxt=0
Chunk 317058 sz= 188 freeable assoc with
mark prv=0 nxt=0
Chunk 317114 sz= 20 free "
"
Chunk 317128 sz= 120 freeable assoc with
mark prv=0 nxt=0
Chunk 3171a0 sz= 52 freeable assoc with
mark prv=0 nxt=0
Total heap size = 3048
FREE LISTS:
Bucket 0 size=272
Chunk 317114 sz= 20 free "
"
Bucket 1 size=528
Chunk 316bf0 sz= 864 free "
"
Bucket 2 size=1040
Total free space = 884
UNPINNED RECREATABLE CHUNKS (lru first):
PERMANENT CHUNKS:
Chunk 3165ec sz= 1540 perm "perm
" alo=184
Permanent space = 1540
MARKS:
Mark 316680
Mark 31666c
Mark 3165fc
******************************************************
Hla: 0
ORA-00000: normal, successful completion
Errors in file :
ORA-00000: normal, successful completion
----- Call Stack Trace -----
NOTE: <PLT>+offset is used to represent that the
function being called is offset bytes from
the _PROCEDURE_LINKAGE_TABLE_.
calling call entry
argument values in hex
location type point (?
means dubious value)
-------------------- -------- --------------------
----------------------------
EEDA21E8 CALL <PLT>+17772
EFFFEC60 ? EFFFE7E4 ?
EF1FF634 ? EFFFE288 ?
EFFFE26C ? 0 ?
Segmentation Fault (core dumped)
TRACE FILE
DBI::db=HASH(0x2e2354) trace level set to 6 in DBI
1.15-nothread
-> prepare for DBD::Oracle::db
(DBI::db=HASH(0x2e2300)~0x2e2354 'select mmd_data from
mm_data where mmd_mm_id = 'NC01060
7SU01D' and mmd_filename = 'nc010607su01d.exe'')
dbih_setup_handle(DBI::st=HASH(0x2e2174)=>DBI::st=HASH(0x1a47ac),
DBD::Oracle::st, 2e2150, Null!)
dbih_make_com(DBI::db=HASH(0x2e2354),
DBD::Oracle::st, 204)
dbih_setup_attrib(DBI::st=HASH(0x1a47ac), Err,
DBI::db=HASH(0x2e2354)) SCALAR(0x107de4) (already
defined)
dbih_setup_attrib(DBI::st=HASH(0x1a47ac), State,
DBI::db=HASH(0x2e2354)) SCALAR(0x1a1c8c) (already
defined)
dbih_setup_attrib(DBI::st=HASH(0x1a47ac), Errstr,
DBI::db=HASH(0x2e2354)) SCALAR(0x107db4) (already
defined)
dbih_setup_attrib(DBI::st=HASH(0x1a47ac),
Handlers, DBI::db=HASH(0x2e2354)) ARRAY(0x2e2330)
(already defined)
dbih_setup_attrib(DBI::st=HASH(0x1a47ac), Debug,
DBI::db=HASH(0x2e2354)) 6 (already defined)
OCIHandleAlloc(2d0fc0,3179ac,4,0,0)=SUCCESS
OCIStmtPrepare(3171e4,2de58c,'select mmd_data from
mm_data where mmd_mm_id = 'SU01D' and mmd_filename =
'nc010607su01d.exe'',101,1,0)=SUCCESS
OCIAttrGet(3171e4,4,3179b0,0,24,2de58c)=SUCCESS
dbd_st_prepare'd sql SELECT
dbd_describe SELECT (EXPLICIT, lb 37227008)...
OCIStmtExecute(2de364,3171e4,2de58c,0,0,0,0,16)=SUCCESS
OCIAttrGet(3171e4,4,effff154,0,18,2de58c)=SUCCESS
OCIParamGet(3171e4,4,2de58c,317858,1)=SUCCESS
OCIAttrGet(317048,53,31786e,0,2,2de58c)=SUCCESS
OCIAttrGet(317048,53,31786c,0,1,2de58c)=SUCCESS
OCIAttrGet(317048,53,317870,0,5,2de58c)=SUCCESS
OCIAttrGet(317048,53,317872,0,6,2de58c)=SUCCESS
OCIAttrGet(317048,53,317873,0,7,2de58c)=SUCCESS
OCIAttrGet(317048,53,31787c,effff150,4,2de58c)=SUCCESS
fbh 1: 'MMD_DATA' NULLable, otype 24-> 95,
dbsize 65535/74454016, p0.s0
OCIAttrSet(3171e4,4,effff14c,4,11,2de58c)=SUCCESS
CODE to perform read:
use DBI;
use DBD::Oracle qw(:ora_types ORA_OCI);
use strict;
use warnings;
my $sth;
my $ary_ref;
$DBI::ora_attrib{'ora_type'} = 24;
$DBI::dbh->{LongReadLen} = 37227008;
$DBI::dbh->{LongTruncOk} = 1;
$DBI::dbh->{RaiseError} = 1;
$DBI::dbh->trace(6, "trace.log");
$sth = $DBI::dbh->prepare("select mmd_data from
mm_data where mmd_mm_id = 'NC010607SU01D' and
mmd_filename = 'nc010607su01d.exe'");
$DBI::dbh->trace(6, "trace2.log");
$sth->execute;
$ary_ref = $sth->fetchrow_arrayref;
$sth->finish;
$DBI::dbh->disconnect;
open(OUT, ">nc010607su01d.exe") or die($!);
binmode(OUT);
print (OUT $ary_ref->[0]);
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie