Perl / perl5

šŸŖ The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 559 forks source link

chown() failure in 5.24 on El Capitan #15709

Closed p5pRT closed 4 years ago

p5pRT commented 8 years ago

Migrated from rt.perl.org#130080 (status was 'open')

Searchable as RT130080$

p5pRT commented 8 years ago

From @FGasper

Created by @FGasper

The tests for IO​::Die fail on 5.24 in El Capitan. The failure is in test_chown().

The issue is NOT in IO​::Die; I tried the Perl built-in at that point in the tests and found the same failure.

Perl Info ``` Flags: category=core severity=medium This perlbug was built using Perl 5.10.1 in the Fedora build system. It is being executed now by Perl 5.10.1 - Sun Nov 6 00:37:43 GMT 2011. Site configuration information for perl 5.10.1: Configured by Red Hat, Inc. at Sun Nov 6 00:37:43 GMT 2011. Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Platform: osname=linux, osvers=2.6.32-44.2.el6.x86_64, archname=x86_64-linux-thread-multi uname='linux c6b5.bsys.dev.centos.org 2.6.32-44.2.el6.x86_64 #1 smp wed jul 21 12:48:32 edt 2010 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DDEBUGGING=-g -Dversion=5.10.1 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Darchlib=/usr/lib64/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib64/perl5/vendor_perl -Dinc_version_list=5.10.0 -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin' hint=recommended, useposix=true, d_sigaction=define 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', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.4.5 20110214 (Red Hat 4.4.5-6)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 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 =' -fstack-protector' libpth=/usr/local/lib64 /lib64 /usr/lib64 libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.12' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' Locally applied patches: @INC for perl 5.10.1: /home/fgasper/perl5/lib/perl5 /home/fgasper/perl5/lib/perl5/x86_64-linux-thread-multi /home/fgasper/perl/home/fgasper/perl5/lib/perl5/5.10.1/x86_64-linux-thread-multi /home/fgasper/perl/home/fgasper/perl5/lib/perl5/5.10.1 /home/fgasper/perl/home/fgasper/perl5/lib/perl5/x86_64-linux-thread-multi /home/fgasper/perl/home/fgasper/perl5/lib/perl5/5.10.0 /home/fgasper/perl/home/fgasper/perl5/lib/perl5 /home/fgasper/perl/usr/local/lib64/perl5 /home/fgasper/perl/usr/local/share/perl5 /home/fgasper/perl/usr/lib64/perl5/vendor_perl /home/fgasper/perl/usr/share/perl5/vendor_perl /home/fgasper/perl/usr/lib64/perl5 /home/fgasper/perl/usr/share/perl5 /home/fgasper/perl5/lib/perl5/5.10.1/x86_64-linux-thread-multi /home/fgasper/perl5/lib/perl5/5.10.1 /home/fgasper/perl5/lib/perl5/x86_64-linux-thread-multi /home/fgasper/perl5/lib/perl5/5.10.0 /home/fgasper/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . Environment for perl 5.10.1: HOME=/home/fgasper LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/fgasper/perl5/bin:/usr/local/jdk/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/cpanel/3rdparty/bin:/home/fgasper/bin PERL5LIB=/home/fgasper/perl5/lib/perl5 PERL_BADLANG (unset) PERL_LOCAL_LIB_ROOT=/home/fgasper/perl5 PERL_MB_OPT=--install_base "/home/fgasper/perl5" PERL_MM_OPT=INSTALL_BASE=/home/fgasper/perl5 SHELL=/bin/bash ```
p5pRT commented 8 years ago

From @tonycoz

On Sat\, Nov 12\, 2016 at 05​:54​:18PM -0800\, felipe@​felipegasper.com (via RT) wrote​:

[Please describe your issue here]

The tests for IO​::Die fail on 5.24 in El Capitan. The failure is in test_chown().

The issue is NOT in IO​::Die; I tried the Perl built-in at that point in the tests and found the same failure.

What was that failure in the built-in?

Tony

p5pRT commented 8 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 8 years ago

From @jkeenan

On Sun\, 13 Nov 2016 01​:54​:18 GMT\, felipe@​felipegasper.com wrote​:

This is a bug report for perl from felipe@​felipegasper.com\, generated with the help of perlbug 1.39 running under perl 5.10.1.

----------------------------------------------------------------- [Please describe your issue here]

The tests for IO​::Die fail on 5.24 in El Capitan. The failure is in test_chown().

The issue is NOT in IO​::Die; I tried the Perl built-in at that point in the tests and found the same failure.

Could you supply the output of 'perl -V' for that machine?

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 8 years ago

From @FGasper

On Nov 12\, 2016\, at 10​:27 PM\, James E Keenan via RT \perlbug\-followup@​perl\.org wrote​:

Could you supply the output of 'perl -V' for that machine?

Thank you very much.

perl -V Summary of my perl5 (revision 5 version 24 subversion 0) configuration​:  
  Platform​:   osname=darwin\, osvers=15.4.0\, archname=darwin-thread-multi-2level   uname='darwin teneleven-slave.macports.org 15.4.0 darwin kernel version 15.4.0​: fri feb 26 22​:08​:05 pst 2016; root​:xnu-3248.40.184~3release_x86_64 x86_64 '   config_args='-des -Dprefix=/opt/local -Dscriptdir=/opt/local/bin -Dvendorprefix=/opt/local -Dusemultiplicity=y -Dusethreads -Duseshrplib -Dcc=/usr/bin/clang -Dman1ext=1pm -Dman3ext=3pm -Dman1dir=/opt/local/share/man/man1p -Dman3dir=/opt/local/share/man/man3p -Dsitebin=/opt/local/libexec/perl5.24/sitebin -Dsiteman1dir=/opt/local/share/perl5.24/siteman/man1 -Dsiteman3dir=/opt/local/share/perl5.24/siteman/man3 -Dvendorbin=/opt/local/libexec/perl5.24 -Dvendorman1dir=/opt/local/share/perl5.24/man/man1 -Dvendorman3dir=/opt/local/share/perl5.24/man/man3 -Dpager=/usr/bin/less -sR -Dperlpath=/opt/local/bin/perl5.24 -Dstartperl=#!/opt/local/bin/perl5.24 -Acppflags=-I/opt/local/include -Accflags=-pipe -Os -Aldflags=-L/opt/local/lib -Wl\,-headerpad_max_install_names '   hint=recommended\, useposix=true\, d_sigaction=define   useithreads=define\, usemultiplicity=define   use64bitint=define\, use64bitall=define\, uselongdouble=undef   usemymalloc=n\, bincompat5005=undef   Compiler​:   cc='/usr/bin/clang'\, ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.11 -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV'\,   optimize='-O3'\,   cppflags='-I/opt/local/include -fno-common -DPERL_DARWIN -mmacosx-version-min=10.11 -pipe -Os -fno-strict-aliasing -fstack-protector-strong -I/opt/local/include'   ccversion=''\, gccversion='4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)'\, gccosandvers=''   intsize=4\, longsize=8\, ptrsize=8\, doublesize=8\, byteorder=12345678\, doublekind=3   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16\, longdblkind=3   ivtype='long'\, ivsize=8\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='/usr/bin/clang'\, ldflags =' -mmacosx-version-min=10.11 -L/opt/local/lib -Wl\,-headerpad_max_install_names -fstack-protector-strong'   libpth=/opt/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib   libs=-lpthread -lgdbm -ldbm -ldl -lm -lutil -lc   perllibs=-lpthread -ldl -lm -lutil -lc   libc=\, so=dylib\, useshrplib=true\, libperl=libperl.dylib   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=bundle\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags=' '\, lddlflags=' -mmacosx-version-min=10.11 -bundle -undefined dynamic_lookup -L/opt/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:   Compile-time options​: HAS_TIMES MULTIPLICITY PERLIO_LAYERS   PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV   PERL_HASH_FUNC_ONE_AT_A_TIME_HARD   PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP   PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV   USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS   USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE   USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME   USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API   Built under darwin   Compiled at May 12 2016 00​:02​:54   @​INC​:   /opt/local/lib/perl5/site_perl/5.24/darwin-thread-multi-2level   /opt/local/lib/perl5/site_perl/5.24   /opt/local/lib/perl5/vendor_perl/5.24/darwin-thread-multi-2level   /opt/local/lib/perl5/vendor_perl/5.24   /opt/local/lib/perl5/5.24/darwin-thread-multi-2level   /opt/local/lib/perl5/5.24   .

p5pRT commented 8 years ago

From @FGasper

On Nov 12\, 2016\, at 10​:06 PM\, Tony Cook via RT \perlbug\-followup@​perl\.org wrote​:

On Sat\, Nov 12\, 2016 at 05​:54​:18PM -0800\, felipe@​felipegasper.com (via RT) wrote​:

[Please describe your issue here]

The tests for IO​::Die fail on 5.24 in El Capitan. The failure is in test_chown().

The issue is NOT in IO​::Die; I tried the Perl built-in at that point in the tests and found the same failure.

What was that failure in the built-in?

Invalid argument

(To get the test to run you have to be running as root\, of course.)

-FG

p5pRT commented 8 years ago

From @tonycoz

On Sat\, 12 Nov 2016 20​:24​:35 -0800\, felipe@​felipegasper.com wrote​:

On Nov 12\, 2016\, at 10​:06 PM\, Tony Cook via RT \<perlbug- followup@​perl.org> wrote​:

On Sat\, Nov 12\, 2016 at 05​:54​:18PM -0800\, felipe@​felipegasper.com (via RT) wrote​:

[Please describe your issue here]

The tests for IO​::Die fail on 5.24 in El Capitan. The failure is in test_chown().

The issue is NOT in IO​::Die; I tried the Perl built-in at that point in the tests and found the same failure.

What was that failure in the built-in?

Invalid argument

(To get the test to run you have to be running as root\, of course.)

chown works fine for me on OS X El Capitan​:

neptune​:perl tony$ ls -lnd . drwxr-xr-x 303 501 20 10302 14 Nov 10​:20 . neptune​:perl tony$ ls -ld foo -rw-r--r-- 1 root staff 0 14 Nov 10​:20 foo neptune​:perl tony$ sudo ~/perl/5.24.0/bin/perl -e 'chown(501\, -1\, "foo") or die "chown​: $!"' neptune​:perl tony$ ls -ln foo -rw-r--r-- 1 501 20 0 14 Nov 10​:20 foo neptune​:perl tony$ ~/perl/5.24.0/bin/perl -v

This is perl 5\, version 24\, subversion 0 (v5.24.0) built for darwin-2level

Copyright 1987-2016\, Larry Wall

... neptune​:perl tony$ ls -l foo -rw-r--r-- 1 tony staff 0 14 Nov 10​:20 foo neptune​:perl tony$ uname -a Darwin neptune.local 15.6.0 Darwin Kernel Version 15.6.0​: Thu Sep 1 15​:01​:16 PDT 2016; root​:xnu-3248.60.11~2/RELEASE_X86_64 x86_64

You've apparently debugged this enough to find out what the parameters to chown() are\, but haven't provided that information.

Please provide a simple self-contained sample that demonstrates the problem.

Tony

p5pRT commented 8 years ago

From @FGasper

On Nov 13\, 2016\, at 6​:27 PM\, Tony Cook via RT \perlbug\-followup@&#8203;perl\.org wrote​:

You've apparently debugged this enough to find out what the parameters to chown() are\, but haven't provided that information.

Please provide a simple self-contained sample that demonstrates the problem.

=============== use File​::Temp;

my $dummy = 'nobody';

my $nobody_gid = ( getgrnam $dummy )[2]; print "GID​: [$nobody_gid]\n";

my ( $fh\, $file ) = File​::Temp​::tempfile( CLEANUP => 1 );

chown( -1\, $nobody_gid\, $fh ) or die "chown fh​: $!";

It works in 5.22 but is broken in 5.24​:

=============== root@​Macintosh-4 20​:14​:38 ~/code/io-die

perl5.22 ../test_chown_rt_130080.pl GID​: [4294967294] -rw------- 1 root nobody 0 13 Nov 20​:14 /tmp/5lCGpVMKOS sh​: pretty_exit_status​: command not found

root@​Macintosh-4 20​:14​:57 ~/code/io-die

perl5.24 ../test_chown_rt_130080.pl GID​: [4294967294] -rw------- 1 root wheel 0 13 Nov 20​:15 /tmp/AHvWxrjLZn chown fh​: Invalid argument at ../test_chown_rt_130080.pl line 11.   ...propagated at ../test_chown_rt_130080.pl line 14. sh​: pretty_exit_status​: command not found

Looks like fchown() underneath isnā€™t happy?

-FG

p5pRT commented 8 years ago

From @tonycoz

On Sun\, 13 Nov 2016 17​:16​:17 -0800\, felipe@​felipegasper.com wrote​:

Looks like fchown() underneath isnā€™t happy?

It turns out this is a duplicate of #128967

This has been fixed in blead\, but not in maint-5.24.

The fix is listed in the 5.24 votes file\, but I'm not sure whether maint-5.24 is considered frozen.

Tony

p5pRT commented 8 years ago

From @khwilliamson

On 11/14/2016 11​:15 PM\, Tony Cook via RT wrote​:

On Sun\, 13 Nov 2016 17​:16​:17 -0800\, felipe@​felipegasper.com wrote​:

Looks like fchown() underneath isnā€™t happy? It turns out this is a duplicate of #128967

This has been fixed in blead\, but not in maint-5.24.

The fix is listed in the 5.24 votes file\, but I'm not sure whether maint-5.24 is considered frozen.

5.24.1 is frozen to include just security fixes. 5.24.2 has yet to be voted fully on.

Tony

--- via perlbug​: queue​: perl5 status​: open https://rt-archive.perl.org/perl5/Ticket/Display.html?id=130080

FGasper commented 4 years ago

This works in 5.26. Closing.

FGasper commented 4 years ago

Oops I canā€™t close. @toddr, this can be closed.