Hi,
Our (standalone) Perl scripts often encounter memory corruptions after a migration on RHEL5.5 (Perl 5.8.8) with Oracle
client 11.1.0 and DBD-Oracle-1.26.
Some Oracle core dumps are present in the Oracle client directory ../incident/incdir_... with the generic error code
"oci-24550".
We had done before a compilation directly on Oracle libraries with perl
Makefile.PL -l.
After an installation of Oracle Database 11g Examples and a standard
compilation the problems remain the same.
The service task stops once or twice a day with an error message like 'Attempt
to free unreferenced scalar'.
Once, a debug session session showed corruption on an undef array :
main::(script.pl:73): undef @tache;
DB<3> x @tache
0 '($@, $!, $^E, $,, $/, $\\, $^W) = @saved;package main; $^D = $^D |
$DB::db_stop;
@tache;
;'
DB<4> n
Attempt to free unreferenced scalar: SV 0x8b34580, Perl interpreter: 0x83b8008
at script.pl line 73.
The problem doesn't seem to appear with Apache mod_perl.
Did anyone encounter similar issues or has an idea what is going wrong here?
Tell me what complementary information I can provide.
# cd DBD-Oracle-1.26
# perl Makefile.PL
Using DBI 1.602 (for perl 5.008008 on i386-linux-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBI/
Configuring DBD::Oracle for perl 5.008008 on linux (i386-linux-thread-multi)
Remember to actually *READ* the README file! Especially if you have any
problems.
Installing on a linux, Ver#2.6
Using Oracle in /app/oracle/product/11.1.0/client_1
DEFINE _SQLPLUS_RELEASE = "1101000600" (CHAR)
Oracle version 11.1.0.6 (11.1)
Found /app/oracle/product/11.1.0/client_1/rdbms/demo/demo_rdbms32.mk
Found /app/oracle/product/11.1.0/client_1/precomp/demo/proc/demo_proc.mk
Using /app/oracle/product/11.1.0/client_1/rdbms/demo/demo_rdbms32.mk
Your LD_LIBRARY_PATH env var is set to '/app/oracle/product/11.1.0/client_1/lib'
Reading /app/oracle/product/11.1.0/client_1/rdbms/demo/demo_rdbms32.mk
Reading /app/oracle/product/11.1.0/client_1/rdbms/lib/env_rdbms.mk
Attempting to discover Oracle OCI build rules
gcc -c -o DBD_ORA_OBJ.o DBD_ORA_OBJ.c
by executing: [make -f
/app/oracle/product/11.1.0/client_1/rdbms/demo/demo_rdbms32.mk build
ECHODO=echo ECHO=echo GENCLNTSH='echo genclntsh' CC=true OPTIMIZE= CCFLAGS=
EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]
Oracle oci build prolog:
[Building client shared library libclntsh.so ...]
[Call script /app/oracle/product/11.1.0/client_1/bin/genclntsh ...]
[genclntsh]
[Built /app/oracle/product/11.1.0/client_1/lib/libclntsh.so ... DONE]
Oracle oci build command:
[]
WARNING: Unable to interpret Oracle build commands from
/app/oracle/product/11.1.0/client_1/rdbms/demo/demo_rdbms32.mk.
(Will continue by using fallback approach.)
Please report this to dbi-us...@perl.org. See README for what to include.
Found header files in /app/oracle/product/11.1.0/client_1/rdbms/public.
client_version=11.1
DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.1.0.6\"
-DORA_OCI_102
Checking for functioning wait.ph
System: perl5.008008 linux ls20-bc1-14.build.redhat.com 2.6.18-128.1.10.el5 #1
smp wed apr 29 13:53:08 edt 2009 i686 athlon i386 gnulinux
Compiler: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing
-pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
Linker: /usr/bin/ld
Sysliblist: -ldl -lm -lpthread -lnsl -lirc -lipgo
Oracle makefiles would have used these definitions but we override them:
CC: $(COMPDIR)/bin/gcc
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O2 $(CDEBUG) $(CCFLAGS)
-I/app/oracle/product/11.1.0/client_1/rdbms/demo
-I/app/oracle/product/11.1.0/client_1/rdbms/public
-I/app/oracle/product/11.1.0/client_1/plsql/public
-I/app/oracle/product/11.1.0/client_1/network/public -DLINUX -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE
-D_REENTRANT -DNS_THREADS $(LPFLAGS) $(USRFLAGS)]
build: $(BUILDEXE32)
[ $(BUILDEXE32)]
LDFLAGS: -o $@ $(LDPATHFLAG)$(PRODLIBHOME) $(LDPATHFLAG)$(LIBHOME)
$(LDPATHFLAG)$(LIBHOME)stubs/ -L$(COMPDIR)/lib $(LLIBIRC)
[-o $@ -L/app/oracle/product/11.1.0/client_1/rdbms/lib/ -L$(LIBHOME)
-L$(LIBHOME)stubs/ -L/usr/lib -lirc -lipgo ]
Linking with -lclntsh -ldl -lm -lpthread -lnsl -lirc -lipgo -ldl -lm [from
$(OCISHAREDLIBS)]
WARNING: META_MERGE is not a known parameter.
Checking if your kit is complete...
Looks good
'META_MERGE' is not a known MakeMaker parameter name.
LD_RUN_PATH=/app/oracle/product/11.1.0/client_1/lib
Using DBD::Oracle 1.26.
Using DBD::Oracle 1.26.
Using DBI 1.602 (for perl 5.008008 on i386-linux-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::Oracle
*** If you have problems...
read all the log printed above, and the README and README.help.txt files.
(Of course, you have read README by now anyway, haven't you?)
# perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.18-128.1.10.el5, archname=i386-linux-thread-multi
uname='linux ls20-bc1-14.build.redhat.com 2.6.18-128.1.10.el5 #1 smp wed
apr 29 13:53:08 edt 2009 i686 athlon i386 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables -Dversion=5.8.8
-Dmyhostname=localhost -dperladmin=r...@localhost -Dcc=gcc -Dcf_by=Red Hat,
Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux-thread-multi
-Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads
-Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow
-Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005
-Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto
-Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto
-Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto
-Dinc_version_list=5.8.7 5.8.6 5.8.5 -Dscriptdir=/usr/bin'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-44)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.5.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_REENTRANT_API
Built under linux
Compiled at Jul 2 2009 05:48:59
@INC:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/5.8.8
.
# rpm -qa |grep DBI
perl-DBI-1.602-1.el5.rf
perl-Apache-DBI-1.06-1.el5.rf