Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.88k stars 530 forks source link

AIX Piped File Handle #5097

Closed p5pRT closed 20 years ago

p5pRT commented 22 years ago

Migrated from rt.perl.org#8613 (status was 'resolved')

Searchable as RT8613$

p5pRT commented 22 years ago

From dfaught@footlocker.com

Created by dfaught@footlocker.com

To​: perlbug@​perl.com Subject​: AIX Piped File Handle Cc​: jkaufman@​footlocker.com Reply-To​: dfaught@​footlocker.com

This is a bug report for perl from dfaught@​footlocker.com\, generated with the help of perlbug 1.28 running under perl v5.6.0.

----------------------------------------------------------------- Using the following code in a background process causes an error to be generated.

File best1tst.pl contains​: #!/usr/local/bin/perl -w print("---DEBUG​: $0 got to 1\n"); open (OUTFILE3\, "| cat | best1tst2.pl"); print("---DEBUG​: $0 got to 2\n"); close (OUTFILE3);

File best1tst2.pl contains​: #!/usr/local/bin/perl print("---DEBUG​: $0 got to 1\n");

Invoked by​: nohup best1tst.pl >best1.log &

Results in (best1.log contains)​: ---DEBUG​: /home/uedts/bin/best1tst.pl got to 1 who​: 0551-012 The process is not attached to a terminal.   Do not run who am i as a background process.

Usage​: who [-AabdHilmpqrsTtuw] [am {i\,I}] [utmp_like_file]   -A Accounting entries   -a All (AbdHlprTtu) options   -b Boot time   -d Dead processes   -H Display a Header (title)   -l Login processes   -m Information about current terminal (same as 'am i')   -p Processes other than getty or user process   -q Quick (only user and host name)   -r Run level   -s Short form (suppress Activity and PID)   -T\,w Status of tty   (+ writable\, - not writable\, x exclusive open\, ? no response)   -t Time changes   -u\,i Activity and PID of shell ---DEBUG​: /home/uedts/bin/best1tst2.pl got to 1 ---DEBUG​: /home/uedts/bin/best1tst.pl got to 2

The "who am i" command is coming out of nowhere. There is definitely nothing in this code that is running it. After playing around with this for a while\, I believe that this error has something to do with the fact that there are 2 pipes in the filehandle for OUTFILE3 and the version of AIX that we are running.

I have tried this on the same machine with an older version (4.0) of Perl and got exactly the same result. On a different machine running AIX 4.3.2 and Perl 5.003\, this code runs fine with no errors.

The Perl 5.6.0 which has the problem was installed from the package for AIX from Bull (copied on this email) rather that compiled from source. The AIX that it is actually running on is 4.3.3.

Perl Info ``` Flags: category=core severity=medium Site configuration information for perl v5.6.0: Configured by root at Fri Aug 4 18:41:30 DFT 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=aix, osvers=4.3.2.0, archname=aix uname='aix esther 3 4 00920517a000 ' config_args='' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong' ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong' 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 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib -b32' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lC -lc -lcrypt -lbsd -lPW -liconv libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE:/usr/local/lib/perl5/5.6.0/aix/CORE/perl.exp' cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lC -lc -L/usr/local/lib' Locally applied patches: @INC for perl v5.6.0: /usr/local/lib/perl5/5.6.0/aix /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/aix /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0 /usr/sbin/rsct/perl5/lib/site_perl /usr/opt/perl5/lib/site_perl/5.6.0/aix /usr/opt/perl5/lib/site_perl/5.6.0 /usr/opt/perl5/lib/site_perl /usr/opt/perl5/lib . Environment for perl v5.6.0: HOME=/home/uedts LANG=en_US LANGUAGE (unset) LC__FASTMSG=true LD_LIBRARY_PATH (unset) LIBPATH=/usr/local/Tivoli/lib/aix4-r1:/usr/lib LOGDIR (unset) PATH =.:/home/uedts/bin:/usr/local/Tivoli/bin/aix4-r1/bin:/usr/local/Tivoli/bin/aix4-r1/ADE:/usr/local/Tivoli/bin/aix4-r1/AEF:/usr/local/Tivoli/bin/aix4-r1/kerberos:/usr/bin:/usr/local/bin:/usr/bin/X11:/sbin:/etc:/usr/sbin:/usr/pdm/bin:/usr/OV/bin PERL_BADLANG (unset) SHELL=/usr/bin/ksh ```
p5pRT commented 22 years ago

From [Unknown Contact. See original ticket]

This was an environment issue with the .kshrc file that gets sourced for the subshells\, and has been fixed.

Sorry to clog your bug track\, Pumba (or Timone?).