develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010108.004] fork() , $SIG{CHLD} on HPUX 10.20

From:
O.Flebbe
Date:
January 8, 2001 07:54
Subject:
[ID 20010108.004] fork() , $SIG{CHLD} on HPUX 10.20
Message ID:
200101081554.QAA00121@io.science-computing.de

This is a bug report for perl from flebbe@io.science-computing.de,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
There was some confusion a while ago about a little script a collegue
wrote. Its intention was to check wether a NFS mounted directory is
available.
 
He wrote something like this: Please note that /share/medina is a NFS
mounted directory. 
 
This script crashes perl 5.005_53 most of the time when running on HPUX
10.20. I have some evidences that this may happen on AIX, too. 
 
On a local directory no problem was found. Seems to be a timing issue.
I added a small delay (The commented out line) and hoped for the best.

The backtrace looks like

> (gdb) where
> #0  0x3fbec in new_xiv ()
> #1  0x40128 in Perl_sv_upgrade ()
> #2  0x42ea8 in Perl_sv_setsv ()
> #3  0x6aa84 in Perl_pp_sassign ()
> #4  0x6a408 in Perl_runops_standard ()
> #5  0x23464 in perl_run ()
> #6  0x208a4 in main ()
> #7  0xc0065594 in ?? () from /usr/lib/libc.1

As far as I can tell the new_xiv is the assignment  to $childret.



sub filetest {
    my($test)     = shift;
    my($file)     = shift;

    local($SIG{CHLD}) = sub { wait; $childret = ($? >> 8);};

    $childret = 0;
    if( $pid = fork ) {

	$seconds = 0;

    } else {
        select undef, undef, undef, 0.1;
	$ret = -d $file;

	exit $ret + 1;
    }
}

filetest( "-d", "/share/medina");




[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by flebbe at Fri Aug 25 08:48:50 METDST 2000.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=hpux, osvers=10.20, archname=PA-RISC2.0
    uname='hp-ux io b.10.20 a 9000780 2016114561 two-user license '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-D_HPUX_SOURCE -I/usr/local/include'
    ccflags ='-D_HPUX_SOURCE -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib /usr/ccs/lib
    libs=-lnsl_s -lndbm -lgdbm -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
    cccdlflags='-fpic', lddlflags='-b -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /usr/local/perl5.005_03/lib/5.00503/PA-RISC2.0
    /usr/local/perl5.005_03/lib/5.00503
    /usr/local/perl5.005_03/lib/site_perl/5.005/PA-RISC2.0
    /usr/local/perl5.005_03/lib/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/home/flebbe
    LANG=de_DE.iso88591
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/flebbe/bin/hp9000s700/HP-UX-B.10.20:/home/flebbe/bin/hp9000s700:/home/flebbe/bin:/usr/local/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pd/bin:/opt/upgrade/bin:/opt/aCC/bin:/opt/langtools/bin:/opt/perf/bin:/opt/java/bin:/opt/lrom/bin:/opt/graphics/OpenGL/debugger/bin:/opt/imake/bin:/opt/networker/bin:/opt/hparray/bin:/opt/fortran/bin:/usr/contrib/bin:/usr/contrib/bin/X11:/usr/dt/bin:/opt/softbench/bin:.:/usr/local/etc
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh




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