develooper Front page | perl.perl5.porters | Postings from February 2004

[perl #26990] Perl segfaults during network operations

From:
E. Stuart Hicks
Date:
February 23, 2004 19:10
Subject:
[perl #26990] Perl segfaults during network operations
Message ID:
rt-3.0.8-26990-79113.5.67328189351066@perl.org
# New Ticket Created by  "E. Stuart Hicks" 
# Please include the string:  [perl #26990]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=26990 >


This is a bug report for perl from root@binarymagi.com,
generated with the help of perlbug 1.34 running under perl v5.8.3.


-----------------------------------------------------------------
[Please enter your report here]

During network operations, Perl tends to segfault and dump core.
I first noticed this during CPAN's attempt to download the list of
servers using Net::FTP.  If the destination server can't be reached
due to some networking problem the module does not crash; however,
if it's successful in contacting the remote server, it promptly
crashes and dumps core.

The following is a gdb backtrace generated using SpamAssassin code.
Simply running spamd (a background daemon) will segfault and crash
Perl after a few seconds.


[root@lurch Mail-SpamAssassin-2.63]# gdb /usr/local/bin/perl
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparcv9-sun-solaris2"...(no debugging symbols
found)...
(gdb) run -T /usr/local/bin/spamd -a -d -x
Starting program: /usr/local/bin/perl -T /usr/local/bin/spamd -a -d -x
(no debugging symbols found)...(no debugging symbols found)...

Program received signal SIGSEGV, Segmentation fault.
0xffffffff7da0054c in memcpy () from
/usr/platform/SUNW,Ultra-250/lib/sparcv9/libc_psr.so.1
(gdb) bt
#0  0xffffffff7da0054c in memcpy () from
/usr/platform/SUNW,Ultra-250/lib/sparcv9/libc_psr.so.1
#1  0xffffffff7ec174e4 in copy_hostent (he=0x10120e0c0, hptr=0x10010da00,
    buf=0x110728 <Address 0x110728 out of bounds>, buflen=1115968) at
gethostent_r.c:180
#2  0xffffffff7d2054f0 in XS_Socket_inet_aton ()
   from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/auto/Socket/Socket.s
o
#3  0xffffffff7f1a895c in Perl_pp_entersub ()
   from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/CORE/libperl.so
#4  0xffffffff7f1a07c4 in Perl_runops_standard ()
   from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/CORE/libperl.so
#5  0xffffffff7f13f0fc in S_run_body ()
   from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/CORE/libperl.so
#6  0xffffffff7f13ed60 in perl_run () from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/CORE/libperl.so
#7  0x0000000100001750 in main ()
(gdb) frame 0
#0  0xffffffff7da0054c in memcpy () from
/usr/platform/SUNW,Ultra-250/lib/sparcv9/libc_psr.so.1
(gdb) frame 1
#1  0xffffffff7ec174e4 in copy_hostent (he=0x10120e0c0, hptr=0x10010da00,
    buf=0x110728 <Address 0x110728 out of bounds>, buflen=1115968) at
gethostent_r.c:180
180     gethostent_r.c: No such file or directory.
        in gethostent_r.c
(gdb) frame 2
#2  0xffffffff7d2054f0 in XS_Socket_inet_aton ()
   from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/auto/Socket/Socket.s
o
(gdb) frame 3
#3  0xffffffff7f1a895c in Perl_pp_entersub ()
   from
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/CORE/libperl.so
(gdb)


I'm not sure what to do about this problem.  It appears to be a
problem during a DNS name resolution but I wouldn't know why.  I
have a properly functioning version of Bind 9.2.3 running on the
server and it seems happy enough.

If anyone can help I'd appreciate it.  Let me know if there's
anything else you need.


---------------------
Stu Hicks
ehicks@binarymagi.com


P.S.  This email was generated bug perlbug; however it told me that it
couldn't find sendmail or Mail::Send.  I created a symlink to
/usr/local/courier/bin/sendmail in /usr/include and tried running perlbug
again.  This was the result:

[root@lurch root]# perlbug
Segmentation Fault (core dumped)
[root@lurch root]#

There is something very wrong with Perl and I hope you guys can figure out
what it is so I can get my system functioning properly again.


P.P.S.  The mail server that accepts mail for this domain doesn't seem to
work properly.  When attempting to send mail via my Courier-based server,
the email gets kicked back with the following error:

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

                           UNDELIVERABLE MAIL

Your message to the following recipients cannot be delivered:

<perlbug@perl.org>:
    la.mx.develooper.com [63.251.223.176]:
>>> MAIL FROM:<ehicks@binarymagi.com>
<<< 503 but you already said HELO ...

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

I'm getting a little frusterated with all of the Perl-related problems I'm
having tonight.  I certainly hope this is the last one.


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.8.3:

Configured by root at Sat Feb 21 18:30:22 EST 2004.

Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.9, archname=sun4-solaris-thread-multi-64
    uname='sunos lurch 5.9 generic_112233-11 sun4u sparc sunw,ultra-250 '
    config_args=''
    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=n, bincompat5005=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', ccflags
='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include -mcpu=v9 -m64 -Wa,-
xarch=v9  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3', gccosandvers='solaris2'
    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 -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib -m64 '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lbind -lnsl -lgdbm -ldb -ldl -lm -lpthread -lc
    perllibs=-lsocket -lbind -lnsl -ldl -lm -lpthread -lc
    libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=true,
libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R
/usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64/CORE'
    cccdlflags='-fPIC', lddlflags=' -G -m64 -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.8.3:
    /usr/local/lib/perl5/5.8.3/sun4-solaris-thread-multi-64
    /usr/local/lib/perl5/5.8.3
    /usr/local/lib/perl5/site_perl/5.8.3/sun4-solaris-thread-multi-64
    /usr/local/lib/perl5/site_perl/5.8.3
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.3:
    HOME=/root
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/local/co
urier/bin:/usr/local/ssl/bin:/root/bin:/sbin:/usr/sbin:/usr/local/courier/sb
in:/home/httpd/bin:/home/mysql/sbin:/home/mysql/bin:/home/pgsql/sbin:/home/p
gsql/bin:/home/openldap/sbin:/home/openldap/bin
    PERL_BADLANG (unset)
    SHELL=/usr/bin/bash



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About