Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building perl 5.22.1 64bit, On Solaris 10, with GCC4... test t/op/threads-dirh.t fails test 1. #15197

Open
p5pRT opened this issue Feb 24, 2016 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 24, 2016

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

Searchable as RT127611$

@p5pRT
Copy link
Author

p5pRT commented Feb 24, 2016

From rj7252@att.com

This is a bug report for perl from rj7252@​att.com,
generated with the help of perlbug 1.40 running under perl 5.22.1.


Building perl 5.22.1 64bit, On Solaris 10, with GCC4... during "make test", one test fails.

$ ./perl harness -v op/threads-dirh.t
op/threads-dirh.t ..
1..6
not ok 1 - crash when duping dirh
# Failed test 1 - crash when duping dirh at ./test.pl line 1027
# got "The dirfd function is unimplemented at - line 3."
# expected "ok"
# PROG​:
# use threads;
# opendir dir, 'op';
# async{}->join for 1..2;
# print "ok";
# STATUS​: 7424
The dirfd function is unimplemented at op/threads-dirh.t line 80.
Dubious, test returned 29 (wstat 7424, 0x1d00)
Failed 6/6 subtests

Test Summary Report


op/threads-dirh.t (Wstat​: 7424 Tests​: 1 Failed​: 1)
  Failed test​: 1
  Non-zero exit status​: 29
  Parse errors​: Bad plan. You planned 6 tests but ran 1.
Files=1, Tests=1, 1 wallclock secs ( 0.03 usr 0.02 sys + 0.13 cusr 0.07 csys = 0.25 CPU)
Result​: FAIL

NOTE​: Without ccflags using "-D__EXTENSIONS__ -D_POSIX_C_SOURCE=200112L", stuff either did not compile and/or there were lots of warnings.
ccflags.SH added -std=c99 and -D_XPG6 it it was not on the command line, but without -D__EXTENSIONS__ wanted to put in -std=c89 at the same time.
Adding those two flags stopped that result and it had a very clean build.



Flags​:
  category=core
  severity=high


Site configuration information for perl 5.22.1​:

Configured by gfp-ip at Wed Feb 24 16​:31​:47 GMT 2016.

Summary of my perl5 (revision 5 version 22 subversion 1) configuration​:

  Platform​:
  osname=solaris, osvers=2.10, archname=sun4-solaris-thread-multi-64
  uname='sunos gfpmtipb 5.10 generic_150400-17 sun4u sparc sunw,netra-t12 solaris '
  config_args='-Dprefix=/appl/local64-201601/perl-5.22.0 -Dcc=gcc -Dusethreads -A ccflags=-std=c99 -D__EXTENSIONS__ -D_POSIX_C_SOURCE=200112L -D_XPG6 -m64 -I/appl/local64-201601/perl-5.22.0/include -I/appl/local64-201601/include -I/appl/local64-201601/bdb-6.0.19/include -A ldflags=-L/appl/local64-201601/perl-5.22.0/lib/sparcv9 -L/appl/local64-201601/lib/sparcv9 -L/appl/local64-201601/bdb-6.0.19/lib/sparcv9 -L/appl/local64-201601/mysql-5.6.26/lib/sparcv9 -L/appl/local64-201601/java1.7/lib/sparcv9'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags ='-I/appl/local64-201601/include -I/appl/local64-201601/bdb-6.0.19/include -D_REENTRANT -mcpu=v9 -std=c99 -D__EXTENSIONS__ -D_POSIX_C_SOURCE=200112L -D_XPG6 -m64 -std=c99 -D_XPG6 -fwrapv -fno-strict-aliasing -pipe -fstack-protector -mcpu=v9 -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV',
  optimize='-O',
  cppflags='-I/appl/local64-201601/include -I/appl/local64-201601/bdb-6.0.19/include -D_REENTRANT -mcpu=v9 -std=c99 -D__EXTENSIONS__ -D_POSIX_C_SOURCE=200112L -D_XPG6 -m64 -std=c99 -D_XPG6 -fwrapv -fno-strict-aliasing -pipe -fstack-protector'
  ccversion='', gccversion='4.7.2', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321, doublekind=4
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=2
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags ='-m64 -fstack-protector -L/appl/local64-201601/lib/sparcv9 -L/appl/local64-201601/bdb-6.0.19/lib/sparcv9 -L/usr/lib/sparcv9 -m64 '
  libpth=/appl/local64-201601/lib/sparcv9 /appl/local64-201601/bdb-6.0.19/lib/sparcv9 /appl/local-201601/lib/gcc/sparc-sun-solaris2.10/4.7.2/sparcv9 /usr/lib/sparcv9
  libs=-lpthread -lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
  perllibs=-lpthread -lsocket -lnsl -ldl -lm -lc
  libc=/usr/lib/sparcv9/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 -m64 -L/appl/local64-201601/lib/sparcv9 -L/appl/local64-201601/bdb-6.0.19/lib/sparcv9 -L/usr/lib/sparcv9 -fstack-protector'


@​INC for perl 5.22.1​:
  /appl/local64-201601/perl-5.22.0/lib/site_perl/5.22.1/sun4-solaris-thread-multi-64
  /appl/local64-201601/perl-5.22.0/lib/site_perl/5.22.1
  /appl/local64-201601/perl-5.22.0/lib/5.22.1/sun4-solaris-thread-multi-64
  /appl/local64-201601/perl-5.22.0/lib/5.22.1
  .


Environment for perl 5.22.1​:
  HOME=/appl/current
  LANG (unset)
  LANGUAGE (unset)
  LC_COLLATE=C
  LD_LIBRARY_PATH=/appl/local64-201601/perl-5.22.1/lib/sparcv9​:/appl/local64-201601/lib/sparcv9​:/appl/local-201601/lib​:/appl/local64-201601/bdb-6.0.19/lib/sparcv9​:/appl/local64-201601/mysql-5.6.26/lib/sparcv9​:/appl/local64-201601/python2/lib/sparcv9​:/appl/local64-201601/java1.7/lib/sparcv9​:/usr/sfw/lib/sparcv9​:/usr/sfw/lib
  LOGDIR (unset)
  PATH=/appl/local64-201601/perl-5.22.1/bin​:/appl/local64-201601/perl-5.22.0/sbin​:/appl/local64-201601/bin​:/appl/local64-201601/sbin​:/appl/local-201601/bin​:/appl/local-201601/sbin​:/appl/local64-201601/python2/bin​:/appl/local64-201601/bdb-6.0.19/bin​:/appl/local64-201601/mysql-5.6.26/bin​:/appl/local64-201601/java1.7/bin/sparcv9​:/usr/local/gcc4/bin​:/appl/perl5/bin​:/opt/SUNWspro/bin​:/usr/ccs/bin​:/usr/xpg6/bin​:/usr/xpg4/bin​:/opt/SUNWspro/contrib/vim/bin​:/sbin​:/bin​:/usr/sbin​:/usr/bin
  PERL=/appl/perl5/bin/perl
  PERL_BADLANG (unset)
  SHELL=/appl/local64-201601/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Mar 1, 2016

From @tonycoz

On Wed Feb 24 15​:01​:53 2016, rj7252@​att.com wrote​:

Building perl 5.22.1 64bit, On Solaris 10, with GCC4... during "make
test", one test fails.

$ ./perl harness -v op/threads-dirh.t
op/threads-dirh.t ..
1..6
not ok 1 - crash when duping dirh
# Failed test 1 - crash when duping dirh at ./test.pl line 1027
# got "The dirfd function is unimplemented at - line 3."
# expected "ok"

I don't have access to Solaris 10, but I do know dirfd() is detected on Solaris 11​:

$ perl -V​:d_dirfd
d_dirfd='define';

If you do the above with your system perl, do you get the same result?

I've never needed all those extra defines on Solaris 11, but I normally build with the workshop compiler.

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 1, 2016

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

@p5pRT
Copy link
Author

p5pRT commented Mar 2, 2016

From rj7252@att.com

$ perl -V​:d_dirfd
d_dirfd='undef';

I am wondering what is the criteria that Perl is looking for to "define" this?

If I know that I could see why it's failing.

-----Original Message-----
From​: Tony Cook via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Monday, February 29, 2016 8​:08 PM
To​: JONES, BILL
Subject​: [perl #127611] Building perl 5.22.1 64bit, On Solaris 10, with GCC4... test t/op/threads-dirh.t fails test 1.

On Wed Feb 24 15​:01​:53 2016, rj7252@​att.com wrote​:

Building perl 5.22.1 64bit, On Solaris 10, with GCC4... during "make
test", one test fails.

$ ./perl harness -v op/threads-dirh.t
op/threads-dirh.t ..
1..6
not ok 1 - crash when duping dirh
# Failed test 1 - crash when duping dirh at ./test.pl line 1027
# got "The dirfd function is unimplemented at - line 3."
# expected "ok"

I don't have access to Solaris 10, but I do know dirfd() is detected on Solaris 11​:

$ perl -V​:d_dirfd
d_dirfd='define';

If you do the above with your system perl, do you get the same result?

I've never needed all those extra defines on Solaris 11, but I normally build with the workshop compiler.

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 2, 2016

From @tonycoz

On Wed Mar 02 11​:23​:04 2016, rj7252@​att.com wrote​:

$ perl -V​:d_dirfd
d_dirfd='undef';

I am wondering what is the criteria that Perl is looking for to
"define" this?

If I know that I could see why it's failing.

On Solaris Configure appears to search libc with nm, and if not found, build a simple test program to check for the symbol.

Simple things to check​:

- is there a man page for dirfd? 2.11 has one, if 2.10 has the manpage it should have the function

- try forcing d_dirfd enabled​:

  ./Configure ... -Dd_dirfd

  If that fails at link/runtime because it can't find the symbol, then you don't have it.

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 4, 2016

From rj7252@att.com

From looking at other threads, Solaris 8, 9 and 10 and some other OS do not have dirfd...so shouldn't this be "skip" instead of "fail" or at least xfail or some other notice that this it's expected to not work on Solaris 10?

-----Original Message-----
From​: Tony Cook via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Wednesday, March 02, 2016 6​:00 PM
To​: JONES, BILL
Subject​: [perl #127611] Building perl 5.22.1 64bit, On Solaris 10, with GCC4... test t/op/threads-dirh.t fails test 1.

On Wed Mar 02 11​:23​:04 2016, rj7252@​att.com wrote​:

$ perl -V​:d_dirfd
d_dirfd='undef';

I am wondering what is the criteria that Perl is looking for to
"define" this?

If I know that I could see why it's failing.

On Solaris Configure appears to search libc with nm, and if not found, build a simple test program to check for the symbol.

Simple things to check​:

- is there a man page for dirfd? 2.11 has one, if 2.10 has the manpage it should have the function

- try forcing d_dirfd enabled​:

  ./Configure ... -Dd_dirfd

  If that fails at link/runtime because it can't find the symbol, then you don't have it.

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 6, 2016

From @tonycoz

On Fri Mar 04 05​:58​:24 2016, rj7252@​att.com wrote​:

From looking at other threads, Solaris 8, 9 and 10 and some other OS
do not have dirfd...so shouldn't this be "skip" instead of "fail" or
at least xfail or some other notice that this it's expected to not
work on Solaris 10?

Looking closer at the code, it should be falling back to using the dd_fd member of the DIR structure.

From looking at the headers on OmniOS (which appears to have an older set of headers)​:

#if !defined(__XOPEN_OR_POSIX)

typedef struct {
  int dd_fd; /* file descriptor */
  int dd_loc; /* offset in block */
  int dd_size; /* amount of valid data */
  char *dd_buf; /* directory block */
} DIR; /* stream data from opendir() */

#else

typedef struct {
  int d_fd; /* file descriptor */
  int d_loc; /* offset in block */
  int d_size; /* amount of valid data */
  char *d_buf; /* directory block */
} DIR; /* stream data from opendir() */

#endif /* !defined(__XOPEN_OR_POSIX) */

From sys/feature_tests.h​:

#if defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE)
#define __XOPEN_OR_POSIX
#endif

So your -D_POSIX_C_SOURCE=200112L on the Configure command-line appears to be preventing the detection of dd_fd.

What do you see for d_dir_dd_fd from your system perl​:

  perl -V​:d_dir_dd_fd

?

I suspect we need to add a Configure test for d_fd in the DIR structure.

Tony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants