my threaded perl script core dumps on Solaris

[email protected] (Charles Bueche)
Newsgroups perl.ithreads
Message-ID <[email protected]>
Hi Team,

I'm having intermittent core dumps with a script I wrote. It collect the
status of 180'000 interfaces on 7'000 devices across 15 networks. It's
quite a big script, with a bunch of loaded modules. When running, it
grows to 600Mb ram in "top". This ram usage is caused by the way I store
data and flush to DB at the end.

Initially, I thought my core dumps would come from DBI and
DBD::Postgres, so took the database code out of the threads and only do
DB handling before threads are created and after all threads have
joined. Even with these measures, I continue to have sporadic core
dumps.

I thought you might have an idea. Here are the description of my
environment :

Hardware : sun4u Netra t 1400/1405 (2 X UltraSPARC-II 440MHz)
ram : 2 Gb
OS : Solaris 5.9 Generic_118558-14
gcc : 3.4.2
perl, v5.8.5 built for sun4-solaris-thread-multi : self-built with all modules as well, using our packaging system. See the "perl -V" output below.
used modules within the threads : Storable, Log::Log4perl, Net::SNMP, Digest::MD5;

a pstack on the core dump is included below

Thanks in advance for any hint.
Charles

=============

/appl/perl/bin/perl -V
--------------------------------------------------
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=solaris, osvers=2.9, archname=sun4-solaris-thread-multi
    uname='sunos oss-pkg 5.9 generic_117171-12 sun4u sparc sunw,ultraax-i2 '
    config_args='-Dcc=gcc -Dinstallprefix=/appl/perl -Dprefix=/appl/perl [email protected] [email protected] -Duselargefiles -Dusethreads -des -Uinstallusrbinperl -Dotherlibdirs=/appl/libperl'
    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 -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-D_REENTRANT -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.4.2', gccosandvers='solaris2.9'
    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, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lpthread -lc
    perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under solaris
  Compiled at Dec 17 2004 10:25:04
  @INC:
    /appl/perl/lib/5.8.5/sun4-solaris-thread-multi
    /appl/perl/lib/5.8.5
    /appl/perl/lib/site_perl/5.8.5/sun4-solaris-thread-multi
    /appl/perl/lib/site_perl/5.8.5
    /appl/perl/lib/site_perl
    /appl/libperl
    .

--------------------------------------------------

=============

core 'core.first_run' of 1969:	/appl/perl/bin/perl -w /appl/spyagent/bin/ifdbagent.pl -f /appl/spyage
-----------------  lwp# 6 / thread# 6  --------------------
 0004f2d0 Perl_op_free (153345d0, 780a18, 13, 1d6db260, 42c, 21) + 138
 0005866c Perl_cv_undef (153345d0, 24f58928, 0, 80003, 73000000, 99f38) + e0
 00099ba4 Perl_sv_clear (153345d0, 24f58928, 0, ffffffff, 1d6db260, 10a) + 4d4
 0009a100 Perl_sv_free (153345d0, 24f58928, 1af501bc, 1af50818, 20aa31c8, 10) + 174
 000b7c50 Perl_free_tmps (153345d0, 24f58898, 1b26ef60, 208aa914, 19, 4) + 58
 00087530 Perl_pp_nextstate (153345d0, 208aa920, 80, 0, 208aa924, 208aa918) + 54
 0008744c Perl_runops_standard (153345d0, fc000, 0, 7efefeff, 0, 4040000) + 2c
 0002a988 S_call_body (153345d0, fe97bf00, 0, 153345d0, 153345d0, 153345d0) + 50
 0002a6cc Perl_call_sv (153345d0, 1b26d75c, 0, 0, 0, 0) + 4a4
 fef029f0 Perl_ithread_run (171ef0e0, 0, 0, 0, 0, 0) + 1a4
 ff1f57b4 _lwp_start (0, 0, 0, 0, 0, 0)
-----------------  lwp# 7 / thread# 7  --------------------
 0008ff0c Perl_pp_entersub (1921f1e0, 220d08d8, 80, 0, 220d08dc, 220d08d4) + 6f0
 0008744c Perl_runops_standard (1921f1e0, fc000, 0, 7efefeff, 0, 4040000) + 2c
 0002a988 S_call_body (1921f1e0, fe87bf00, 0, 1921f1e0, 1921f1e0, 1921f1e0) + 50
 0002a6cc Perl_call_sv (1921f1e0, 1f157a2c, 0, 0, 0, 0) + 4a4
 fef029f0 Perl_ithread_run (1b0da578, 0, 0, 0, 0, 0) + 1a4
 ff1f57b4 _lwp_start (0, 0, 0, 0, 0, 0)
-----------------  lwp# 1 / thread# 1  --------------------
 ff19fc3c _lwp_wait (2, ffbffa74, fef01dfc, fef00c70, 1, 9fb958) + 8
 ff1e90e8 _thrp_join (2, 0, ffbffadc, 1, 812938, 0) + 44
 fef03658 Perl_ithread_join (1307f0, 45b8800, 8e9b0c, 610b28, 3f, a0d460) + 134
 fef0402c XS_threads_join (1307f0, 884280, ffbffbdc, 1, 1010501, 82ec80) + a4
 0008fdc0 Perl_pp_entersub (1307f0, a0d490, 80, 95fd90, a0d490, 0) + 5a4
 0008744c Perl_runops_standard (1307f0, 800000, 0, 0, 12c, 1402e0) + 2c
 00029ed8 S_run_body (1307f0, 1, 1307f0, 5, 1307f0, 0) + 138
 00029b24 perl_run (1307f0, 1, 5, ffbffe74, 12e400, 2) + 8c
 000263e8 main     (5, ffbffe74, ffbffe8c, 1307d8, 0, 0) + b0
 000261d0 _start   (0, 0, 0, 0, 0, 0) + 5c
-----------------  lwp# 2 / thread# 2  --------------------
 ff1f59b0 lwp_yield (ff1d0200, 6, 1, ff1bc000, 0, 0) + 8
 ff1f2650 pthread_mutex_unlock (ff1c05a8, ff1d0200, 0, ff1bc000, 0, 0) + 148
 ff146e44 malloc   (76cfde8, 4, 0, 0, 0, 0) + 2c
 000744ac Perl_safesysmalloc (d, 0, 0, 0, 4, 0) + 24
 00092718 Perl_sv_grow (0, 22eb5f04, d, 22eb5f04, 74, 979b4) + 10c
 000974f8 Perl_sv_setsv_flags (a029f0, 22eb5f04, b6119e8, 4040304, 81010100, b6117d8) + 1308
 000878e4 Perl_pp_sassign (a029f0, b6cd8e0, 80, 0, b6cd8ec, b6cd8d4) + 9c
 0008744c Perl_runops_standard (a029f0, b601548, 63, 5, 0, 0) + 2c
 00032bd4 Perl_amagic_call (a029f0, b3bb0f4, 22eb5d18, 6, b6cd8e0, 1) + b10
 0008870c Perl_pp_add (a029f0, 3, 1d339e09, 495380, 0, 0) + 84
 0008744c Perl_runops_standard (a029f0, fc000, 0, 7efefeff, 0, 4040000) + 2c
 0002a988 S_call_body (a029f0, fed7bf00, 0, a029f0, a029f0, a029f0) + 50
 0002a6cc Perl_call_sv (a029f0, b6bea60, 0, 0, 0, 0) + 4a4
 fef029f0 Perl_ithread_run (45b8800, 0, 0, 0, 0, 0) + 1a4
 ff1f57b4 _lwp_start (0, 0, 0, 0, 0, 0)
-----------------  lwp# 3 / thread# 3  --------------------
 ff1f58f8 __lwp_park (ff208b44, 0, ff1c05a8, ff208000, 2533dbe1, 4040804) + 14
 ff1f206c slow_lock (ff1c05a8, ff1d0400, 0, ff1bc000, 8, 4040000) + 58
 ff146e30 malloc   (8, 4, fec7bad8, 4, 23e23140, 1d3d6cb0) + 18
 000744ac Perl_safesysmalloc (8, 24119e20, a, 244861d0, 244861d0, 1d3d6cb0) + 24
 00085250 Perl_av_make (24119e20, 2, 2448619c, f3408da, 244861a4, 244861a0) + 58
 000b5014 Perl_pp_anonlist (853faa0, f33fad0, 0, 17, f5963f0, 2e) + 34
 0008744c Perl_runops_standard (853faa0, fc000, 0, 7efefeff, 0, 4040000) + 2c
 0002a988 S_call_body (853faa0, fec7bf00, 0, 853faa0, 853faa0, 853faa0) + 50
 0002a6cc Perl_call_sv (853faa0, f5a9798, 0, 0, 0, 0) + 4a4
 fef029f0 Perl_ithread_run (b6c2c08, 0, 0, 0, 0, 0) + 1a4
 ff1f57b4 _lwp_start (0, 0, 0, 0, 0, 0)
-----------------  lwp# 4 / thread# 4  --------------------
 ff1f58f8 __lwp_park (ff208b44, 0, ff1c05a8, ff208000, 252a38aa, 4040804) + 14
 ff1f206c slow_lock (ff1c05a8, ff1d0600, 0, ff1bc000, 2d, 4040000) + 58
 ff146e30 malloc   (8, 4, feb7bad8, 4, 1d8c3780, 20b2d2a8) + 18
 000744ac Perl_safesysmalloc (8, 2438daf8, a, 20b799dc, 20b799dc, 20b2d2a8) + 24
 00085250 Perl_av_make (2438daf8, 2, 20b799a4, 13224ee2, 20b799ac, 20b799a8) + 58
 000b5014 Perl_pp_anonlist (d55f248, 1322abf8, 0, 1a, 13480b90, 2e) + 34
 0008744c Perl_runops_standard (d55f248, fc000, 0, 7efefeff, 0, 4040000) + 2c
 0002a988 S_call_body (d55f248, feb7bf00, 0, d55f248, d55f248, d55f248) + 50
 0002a6cc Perl_call_sv (d55f248, 13462c7c, 0, 0, 0, 0) + 4a4
 fef029f0 Perl_ithread_run (f5ad430, 0, 0, 0, 0, 0) + 1a4
 ff1f57b4 _lwp_start (0, 0, 0, 0, 0, 0)
-----------------  lwp# 5 / thread# 5  --------------------
 ff1f58f8 __lwp_park (ff208b44, 0, ff1c05a8, ff208000, 0, 17116a28) + 14
 ff1f206c slow_lock (ff1c05a8, ff1d0800, 0, ff1bc000, 73, 76) + 58
 ff147ce8 free     (252863d8, 76, ffffffff, 114ec6, 171ca750, 17115044) + 18
 00074674 Perl_safesysfree (252863d8, 22a7e31c, ffffffff, 229739dc, 252863d8, 252863d8) + 10
 00103cf8 S_mergesortsv (11448ec8, 25287508, 25286c6c, 10525c, 25286c70, ffffffff) + 4f0
 00104624 Perl_sortsv (11448ec8, 229728ac, 44c, 10525c, 1738cac8, 0) + 64
 00104e64 Perl_pp_sort (11448ec8, 0, 0, 0, 0, 0) + 82c
 0008744c Perl_runops_standard (11448ec8, fc000, 0, 7efefeff, 0, 4040000) + 2c
 0002a988 S_call_body (11448ec8, fea7bf00, 0, 11448ec8, 11448ec8, 11448ec8) + 50
 0002a6cc Perl_call_sv (11448ec8, 1734d73c, 0, 0, 0, 0) + 4a4
 fef029f0 Perl_ithread_run (13304578, 0, 0, 0, 0, 0) + 1a4
 ff1f57b4 _lwp_start (0, 0, 0, 0, 0, 0)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.