Operating System - Linux
1748270 Members
3788 Online
108760 Solutions
New Discussion юеВ

Re: perl on itanium produces out of memory

 
Wanda Canade'
Advisor

perl on itanium produces out of memory

I'm running perl script on itanium but I have an out of memory.
This is the output of perl -V command:
"Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=hpux, osvers=11.22, archname=IA64.ARCHREV_0-thread-multi-LP64
uname='hp-ux bigsur03 b.11.22 u ia64 1800516905 unlimited-user license '
config_args='-ders -Dcc=gcc -Accflags=-DNO_HASH_SEED -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Duse64bitall -Dd_attribut=undef -Accflags=-fPIC -Dcccdlflags=-fPIC -Uoptimize -Duselargefiles -Dinc_version_list=5.8.1/$archname 5.8.1 5.8.0/$archname 5.8.0 -Duseshrplib -Dprefix=/opt/perl_64 -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com'
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=define use64bitall=define uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -mlp64 -DNO_HASH_SEED -fPIC -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize=' ',
cppflags='-D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -mlp64 -DNO_HASH_SEED -fPIC -fno-strict-aliasing'
ccversion='', gccversion='3.3.2 20030829 (prerelease)', gccosandvers='hpux11.22'
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -mlp64 -L/usr/lib/hpux64'
libpth=/usr/lib/hpux64 /lib /usr/lib /usr/ccs/lib /usr/local/lib
libs=-lnsl -lnm -ldl -ldld -lm -lsec -lpthread
perllibs=-lnsl -lnm -ldl -ldld -lm -lsec -lpthread
libc=/usr/lib/hpux64/libc.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
cccdlflags='-fPIC', lddlflags='-shared -static-libgcc -fPIC -mlp64 -L/usr/lib/hpux64'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
ActivePerl Build 808
21846 Configure gets d_u32align wrong
21739 [perl #24493] install.html not working
21737 Ooops. left an XXX comment in, and worse still it's a // comment
21735 utf8 keys now work for tied hashes
21734 Accessing unicode keys in tie hashes via hv_exists was broken
21733 ext/threads/t/problem.t
21732 Config::myconfig() fails under ithreads
21728 Update perlhist with 5.6.2
21723 Include 'SCCS' in the list of dir names ignored by installperl
21718 Empty subroutine as object method segfaults in 5.8.2 (sometimes)
21714 Fix bug #24380: assigning list with duplicated keys to a hash
21706 [perl #24460] [DOC PATCH] the begincheck program
21693 must copy changes from win32/makeifle.mk to wince/makefile.ce
21691 Update the list of pumpkings in perlhist.pod
21687 [PATCH 5.6.2-RC1 pod/perlhist.pod] Updated
21677 OS/2 docu
21676 Bug #24407: key for shared hash got stringified into wrong pool
21673 Be sure to use -fPIC not -fpic on Linux/SPARC
21672 extending the hash attack test
21671 Benchmark.pm cmpthese segfault
21662 'make minitest' fails for op/cproto and op/pat
21586 Comment that this 'optimisation' is actually a necessary fixup
21548 Sync with Pod::Perldoc 3.12
21540 Fix backward-compatibility issues in if.pm
Built under hpux
Compiled at Jan 19 2005 15:58:04
@INC:
/opt/perl_64/lib/5.8.2/IA64.ARCHREV_0-thread-multi-LP64
/opt/perl_64/lib/5.8.2
/opt/perl_64/lib/site_perl/5.8.2/IA64.ARCHREV_0-thread-multi-LP64
/opt/perl_64/lib/site_perl/5.8.2
/opt/perl_64/lib/site_perl"

May be line of my programm that produces error is :
"$stringa = sprintf "%s%-$lung\s", $str;"

Any ideas .
Thanks in advance
"
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor

Re: perl on itanium produces out of memory

Hi Wanda:

Without seeing your script and knowing the data that it is attempting to process, it's difficult to pinpoint your problem.

An out-of-memory condition could arise from attempting to slurp too large a file; or from attempting to build too large an array, string, etc.

The 'sprintf' statement you mention is syntatically incorrect.

I suspect that your script does not have the 'warnings' pragma either. Without it, debugging is so much harder than it needs to be!

Regards!

...JRF...
Hein van den Heuvel
Honored Contributor

Re: perl on itanium produces out of memory


Yes, try perl -w or add 'use warnings;' to the source.

That print statement looks bad and warning will alert you at the very least to the "\s" being an unrecognized escape.

Also check the "%-$lung" part.
What is that supposed to do?

The % starts a formating sequence.
The - is for left justified
The the contents of $lung will become the formatting specification (like '5s').

What is the value of $lung at that point?
It would take something very funky to make perl run out of memory!

I suspect you just wanted the value of $lung in the string?
If so, why not put the appropriate %-ns in the format and pass the variable as a second argument.
Of course if no formatting is needed, then the whole sprintf is fluff and can be possibly be replaced by
$stringa = $str . "-" . $lung;

If the $lung is a format string, then protect it a little by using ${lung}.

fwiw,
Hein.