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

Build failure in blead: Linux -Dusequadmath -Dcc=g++-8 #16689

Closed
p5pRT opened this issue Sep 11, 2018 · 15 comments
Closed

Build failure in blead: Linux -Dusequadmath -Dcc=g++-8 #16689

p5pRT opened this issue Sep 11, 2018 · 15 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 11, 2018

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

Searchable as RT133510$

@p5pRT
Copy link
Author

p5pRT commented Sep 11, 2018

From @jkeenan

I first caught a whiff of this build-time failure in this smoke-test
report from Carlos Guevara​:

http​://perl.develop-help.com/raw/?id=213970

... whose log file is here​:

http​://perl5.test-smoke.org/logfile/70257

(Note the 6 "Segmentation fault" messages in that log.)

I installed gcc-8 and g++-8 locally on Ubuntu 18.04 LTS and configured thus​:

#####
sh ./Configure -des -Dusedevel -Dcc="g++-8" -Dusequadmath
#####

(The perl_V.txt attached does not pertain to this build.)

make test_prep failed after miniperl had been built, apparently during
the build of ext/POSIX/. See attachment for the tail of 'make
test_prep' output; I can send the full output if needed.

Same configuration only with gcc-8 tests PASS.

Can someone diagnose?

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Sep 11, 2018

From @jkeenan

./miniperl -Ilib make_ext.pl lib/auto/POSIX/POSIX.so MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic
Warning (mostly harmless)​: No library found for -lposix
Warning (mostly harmless)​: No library found for -lcposix
Generating a Unix-style Makefile
Writing Makefile for POSIX
make[1]​: Entering directory '/home/jkeenan/gitwork/perl/ext/POSIX'
Running Mkbootstrap for POSIX ()
chmod 644 "POSIX.bs"
/home/jkeenan/gitwork/perl/ext/POSIX/../../miniperl "-I../../lib" -MExtUtils​::Command​::MM -e 'cp_nonempty' -- POSIX.bs ../../lib/auto/POSIX/POSIX.bs 644
"../../miniperl" "-I../../lib" "../../lib/ExtUtils/xsubpp" -noprototypes -typemap '/home/jkeenan/gitwork/perl/ext/POSIX/../../lib/ExtUtils/typemap' -typemap '/home/jkeenan/gitwork/perl/ext/POSIX/typemap' POSIX.xs > POSIX.xsc
mv POSIX.xsc POSIX.c
g++-8 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSTRUCT_TM_HASZONE -DHINT_SC_EXIST -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wwrite-strings -Wno-format -O2 -DVERSION=\"1.84\" -DXS_VERSION=\"1.84\" -fPIC "-I../.." POSIX.c
POSIX.xs​: In function ‘void XS_POSIX_acos(CV*)’​:
POSIX.xs​:2419​:22​: error​: call of overloaded ‘log10(NV&)’ is ambiguous
  RETVAL = log10(x); /* C89 math */
  ^
In file included from /usr/include/features.h​:424,
  from /usr/include/x86_64-linux-gnu/sys/types.h​:25,
  from ../../perl.h​:684,
  from POSIX.xs​:19​:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h​:107​:1​: note​: candidate​: ‘double log10(double)’
__MATHCALL (log10,, (_Mdouble_ __x));
^~~~~~~~~~
In file included from /usr/include/c++/8/math.h​:36,
  from ../../perl.h​:4164,
  from POSIX.xs​:19​:
/usr/include/c++/8/cmath​:361​:3​: note​: candidate​: ‘constexpr long double std​::log10(long double)’
  log10(long double __x)
  ^~~~~
/usr/include/c++/8/cmath​:357​:3​: note​: candidate​: ‘constexpr float std​::log10(float)’
  log10(float __x)
  ^~~~~
POSIX.c​: In function ‘void XS_POSIX_ldexp(CV*)’​:
POSIX.c​:3540​:23​: error​: call of overloaded ‘ldexp(NV&, int&)’ is ambiguous
  RETVAL = ldexp(x, exp);
  ^
In file included from /usr/include/features.h​:424,
  from /usr/include/x86_64-linux-gnu/sys/types.h​:25,
  from ../../perl.h​:684,
  from POSIX.xs​:19​:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h​:101​:1​: note​: candidate​: ‘double ldexp(double, int)’
__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
^~~~~~~~~~
In file included from /usr/include/c++/8/math.h​:36,
  from ../../perl.h​:4164,
  from POSIX.xs​:19​:
/usr/include/c++/8/cmath​:323​:3​: note​: candidate​: ‘constexpr long double std​::ldexp(long double, int)’
  ldexp(long double __x, int __exp)
  ^~~~~
/usr/include/c++/8/cmath​:319​:3​: note​: candidate​: ‘constexpr float std​::ldexp(float, int)’
  ldexp(float __x, int __exp)
  ^~~~~
Makefile​:337​: recipe for target 'POSIX.o' failed
make[1]​: *** [POSIX.o] Error 1
make[1]​: Leaving directory '/home/jkeenan/gitwork/perl/ext/POSIX'
make[1]​: Entering directory '/home/jkeenan/gitwork/perl/ext/POSIX'
/home/jkeenan/gitwork/perl/ext/POSIX/../../miniperl "-I../../lib" -MExtUtils​::Command​::MM -e 'cp_nonempty' -- POSIX.bs ../../lib/auto/POSIX/POSIX.bs 644
g++-8 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSTRUCT_TM_HASZONE -DHINT_SC_EXIST -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wwrite-strings -Wno-format -O2 -DVERSION=\"1.84\" -DXS_VERSION=\"1.84\" -fPIC "-I../.." POSIX.c
POSIX.xs​: In function ‘void XS_POSIX_acos(CV*)’​:
POSIX.xs​:2419​:22​: error​: call of overloaded ‘log10(NV&)’ is ambiguous
  RETVAL = log10(x); /* C89 math */
  ^
In file included from /usr/include/features.h​:424,
  from /usr/include/x86_64-linux-gnu/sys/types.h​:25,
  from ../../perl.h​:684,
  from POSIX.xs​:19​:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h​:107​:1​: note​: candidate​: ‘double log10(double)’
__MATHCALL (log10,, (_Mdouble_ __x));
^~~~~~~~~~
In file included from /usr/include/c++/8/math.h​:36,
  from ../../perl.h​:4164,
  from POSIX.xs​:19​:
/usr/include/c++/8/cmath​:361​:3​: note​: candidate​: ‘constexpr long double std​::log10(long double)’
  log10(long double __x)
  ^~~~~
/usr/include/c++/8/cmath​:357​:3​: note​: candidate​: ‘constexpr float std​::log10(float)’
  log10(float __x)
  ^~~~~
POSIX.c​: In function ‘void XS_POSIX_ldexp(CV*)’​:
POSIX.c​:3540​:23​: error​: call of overloaded ‘ldexp(NV&, int&)’ is ambiguous
  RETVAL = ldexp(x, exp);
  ^
In file included from /usr/include/features.h​:424,
  from /usr/include/x86_64-linux-gnu/sys/types.h​:25,
  from ../../perl.h​:684,
  from POSIX.xs​:19​:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h​:101​:1​: note​: candidate​: ‘double ldexp(double, int)’
__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
^~~~~~~~~~
In file included from /usr/include/c++/8/math.h​:36,
  from ../../perl.h​:4164,
  from POSIX.xs​:19​:
/usr/include/c++/8/cmath​:323​:3​: note​: candidate​: ‘constexpr long double std​::ldexp(long double, int)’
  ldexp(long double __x, int __exp)
  ^~~~~
/usr/include/c++/8/cmath​:319​:3​: note​: candidate​: ‘constexpr float std​::ldexp(float, int)’
  ldexp(float __x, int __exp)
  ^~~~~
Makefile​:337​: recipe for target 'POSIX.o' failed
make[1]​: *** [POSIX.o] Error 1
make[1]​: Leaving directory '/home/jkeenan/gitwork/perl/ext/POSIX'
Unsuccessful make(ext/POSIX)​: code=512 at make_ext.pl line 570.
makefile​:582​: recipe for target 'lib/auto/POSIX/POSIX.so' failed
make​: *** [lib/auto/POSIX/POSIX.so] Error 25

@p5pRT
Copy link
Author

p5pRT commented Sep 11, 2018

From @jkeenan

Summary of my perl5 (revision 5 version 29 subversion 3) configuration​:
  Commit id​: 3809fbe
  Platform​:
  osname=linux
  osvers=4.15.0-33-generic
  archname=x86_64-linux
  uname='linux zareason 4.15.0-33-generic #36-ubuntu smp wed aug 15 16​:00​:05 utc 2018 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dusedevel'
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=undef
  usemultiplicity=undef
  use64bitint=define
  use64bitall=define
  uselongdouble=undef
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='cc'
  ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  optimize='-O2'
  cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='7.3.0'
  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='cc'
  ldflags =' -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64
  libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
  perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.27.so
  so=so
  useshrplib=false
  libperl=libperl.a
  gnulibc_version='2.27'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=so
  d_dlsymun=undef
  ccdlflags='-Wl,-E'
  cccdlflags='-fPIC'
  lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:
  Compile-time options​:
  HAS_TIMES
  PERLIO_LAYERS
  PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_MALLOC_WRAP
  PERL_OP_PARENT
  PERL_PRESERVE_IVUV
  PERL_USE_DEVEL
  USE_64_BIT_ALL
  USE_64_BIT_INT
  USE_LARGE_FILES
  USE_LOCALE
  USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC
  USE_LOCALE_TIME
  USE_PERLIO
  USE_PERL_ATOF
  Built under linux
  Compiled at Sep 4 2018 10​:33​:18
  %ENV​:
  PERL2DIR="/home/jkeenan/gitwork/perl2"
  PERLBREW_BASHRC_VERSION="0.78"
  PERLBREW_HOME="/home/jkeenan/.perlbrew"
  PERLBREW_MANPATH="/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/man"
  PERLBREW_PATH="/home/jkeenan/perl5/perlbrew/bin​:/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/bin"
  PERLBREW_PERL="perl-5.28.0"
  PERLBREW_ROOT="/home/jkeenan/perl5/perlbrew"
  PERLBREW_VERSION="0.78"
  PERL_WORKDIR="/home/jkeenan/gitwork/perl"
  @​INC​:
  lib
  /usr/local/lib/perl5/site_perl/5.29.3/x86_64-linux
  /usr/local/lib/perl5/site_perl/5.29.3
  /usr/local/lib/perl5/5.29.3/x86_64-linux
  /usr/local/lib/perl5/5.29.3

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

From @sisyphus

On Tue, 11 Sep 2018 15​:24​:21 -0700, jkeenan@​pobox.com wrote​:

I installed gcc-8 and g++-8 locally on Ubuntu 18.04 LTS and configured thus​:

#####
sh ./Configure -des -Dusedevel -Dcc="g++-8" -Dusequadmath
#####

FWIW, I get the same failures on Ubuntu 18.04 LTS using g++ version 7.3.0.

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

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

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

From @tonycoz

On Tue, 11 Sep 2018 15​:24​:21 -0700, jkeenan@​pobox.com wrote​:

I first caught a whiff of this build-time failure in this smoke-test
report from Carlos Guevara​:

http​://perl.develop-help.com/raw/?id=213970

... whose log file is here​:

http​://perl5.test-smoke.org/logfile/70257

(Note the 6 "Segmentation fault" messages in that log.)

I installed gcc-8 and g++-8 locally on Ubuntu 18.04 LTS and configured thus​:

#####
sh ./Configure -des -Dusedevel -Dcc="g++-8" -Dusequadmath
#####

(The perl_V.txt attached does not pertain to this build.)

make test_prep failed after miniperl had been built, apparently during
the build of ext/POSIX/. See attachment for the tail of 'make
test_prep' output; I can send the full output if needed.

Same configuration only with gcc-8 tests PASS.

Can someone diagnose?

This wasn't g++ 8 (or 7) specific - I reproduced it with g++ 6 too.

The problem is the C++ standard provides three versions of log10()​:

  log10(float)
  log10(double)
  log10(long double)

but we're calling it with a different floating point type​:

  log10(__float128)

so the compiler doesn't know which to call.

As with many other math functions, perl.h defines Perl_log10, which becomes log10q on quadmath builds, changing POSIX.xs to use Perl_log10 fixes the problem.

Similarly for ldexp(), except that using Perl_ldexp() takes a slightly larger change.

With those changes compilation succeeded, but two tests for signbit() failed.

Since quadmath provides signbitq() I changed perl.h to use that for quadmath builds.

Tony

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

From @jkeenan

On Wed, 12 Sep 2018 01​:36​:56 GMT, tonyc wrote​:

On Tue, 11 Sep 2018 15​:24​:21 -0700, jkeenan@​pobox.com wrote​:

I first caught a whiff of this build-time failure in this smoke-test
report from Carlos Guevara​:

http​://perl.develop-help.com/raw/?id=213970

... whose log file is here​:

http​://perl5.test-smoke.org/logfile/70257

(Note the 6 "Segmentation fault" messages in that log.)

I installed gcc-8 and g++-8 locally on Ubuntu 18.04 LTS and
configured thus​:

#####
sh ./Configure -des -Dusedevel -Dcc="g++-8" -Dusequadmath
#####

(The perl_V.txt attached does not pertain to this build.)

make test_prep failed after miniperl had been built, apparently
during
the build of ext/POSIX/. See attachment for the tail of 'make
test_prep' output; I can send the full output if needed.

Same configuration only with gcc-8 tests PASS.

Can someone diagnose?

This wasn't g++ 8 (or 7) specific - I reproduced it with g++ 6 too.

The problem is the C++ standard provides three versions of log10()​:

log10(float)
log10(double)
log10(long double)

but we're calling it with a different floating point type​:

log10(__float128)

so the compiler doesn't know which to call.

As with many other math functions, perl.h defines Perl_log10, which
becomes log10q on quadmath builds, changing POSIX.xs to use Perl_log10
fixes the problem.

Similarly for ldexp(), except that using Perl_ldexp() takes a slightly
larger change.

With those changes compilation succeeded, but two tests for signbit()
failed.

Since quadmath provides signbitq() I changed perl.h to use that for
quadmath builds.

Tony

Tony, thanks for getting right on this. So far looks good on g++-8. I'm taking this ticket for the purpose of monitoring smoke tests for a few days, after which I'll close the ticket.

Thank you very much.
Jim Keenan
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

From @jkeenan

On Wed, 12 Sep 2018 02​:15​:42 GMT, jkeenan wrote​:

On Wed, 12 Sep 2018 01​:36​:56 GMT, tonyc wrote​:

On Tue, 11 Sep 2018 15​:24​:21 -0700, jkeenan@​pobox.com wrote​:

I first caught a whiff of this build-time failure in this smoke-
test
report from Carlos Guevara​:

http​://perl.develop-help.com/raw/?id=213970

... whose log file is here​:

http​://perl5.test-smoke.org/logfile/70257

(Note the 6 "Segmentation fault" messages in that log.)

I installed gcc-8 and g++-8 locally on Ubuntu 18.04 LTS and
configured thus​:

#####
sh ./Configure -des -Dusedevel -Dcc="g++-8" -Dusequadmath
#####

(The perl_V.txt attached does not pertain to this build.)

make test_prep failed after miniperl had been built, apparently
during
the build of ext/POSIX/. See attachment for the tail of 'make
test_prep' output; I can send the full output if needed.

Same configuration only with gcc-8 tests PASS.

Can someone diagnose?

This wasn't g++ 8 (or 7) specific - I reproduced it with g++ 6 too.

The problem is the C++ standard provides three versions of log10()​:

log10(float)
log10(double)
log10(long double)

but we're calling it with a different floating point type​:

log10(__float128)

so the compiler doesn't know which to call.

As with many other math functions, perl.h defines Perl_log10, which
becomes log10q on quadmath builds, changing POSIX.xs to use
Perl_log10
fixes the problem.

Similarly for ldexp(), except that using Perl_ldexp() takes a
slightly
larger change.

With those changes compilation succeeded, but two tests for signbit()
failed.

Since quadmath provides signbitq() I changed perl.h to use that for
quadmath builds.

Tony

Tony, thanks for getting right on this. So far looks good on g++-8.
I'm taking this ticket for the purpose of monitoring smoke tests for a
few days, after which I'll close the ticket.

Unfortunately, we're getting some new smoke test failures in one particular configuration.

#####
[default] -DDEBUGGING -Duseithreads -Dusequadmath
../t/run/switchDx.t.........................................FAILED
  3, 5, 7-8
#####

Observed in these smoke test reports​:

1.
http​://perl.develop-help.com/raw/?id=214129
  on linux - 4.15.0-34-generic [Ubuntu 18.04.1 LTS (bionic)]
  using g++ version 7.3.0

2.
http​://perl.develop-help.com/raw/?id=214131
  on linux - 4.17.0-3-amd64 [Debian GNU/Linux buster/sid]
  using g++ version 8.2.0

3.
http​://perl.develop-help.com/raw/?id=214132
  on linux - 4.17.19-100.fc27.x86_64 [Fedora 27 (Server Edition)]
  using g++ version 7.3.1 20180712 (Red Hat 7.3.1-6)

Branch in each case was blead or a branch rebased on blead after e6081c0

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

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

From @jkeenan

On Wed, 12 Sep 2018 19​:26​:31 GMT, jkeenan wrote​:

On Wed, 12 Sep 2018 02​:15​:42 GMT, jkeenan wrote​:

On Wed, 12 Sep 2018 01​:36​:56 GMT, tonyc wrote​:

On Tue, 11 Sep 2018 15​:24​:21 -0700, jkeenan@​pobox.com wrote​:

I first caught a whiff of this build-time failure in this smoke-
test
report from Carlos Guevara​:

http​://perl.develop-help.com/raw/?id=213970

... whose log file is here​:

http​://perl5.test-smoke.org/logfile/70257

(Note the 6 "Segmentation fault" messages in that log.)

I installed gcc-8 and g++-8 locally on Ubuntu 18.04 LTS and
configured thus​:

#####
sh ./Configure -des -Dusedevel -Dcc="g++-8" -Dusequadmath
#####

(The perl_V.txt attached does not pertain to this build.)

make test_prep failed after miniperl had been built, apparently
during
the build of ext/POSIX/. See attachment for the tail of 'make
test_prep' output; I can send the full output if needed.

Same configuration only with gcc-8 tests PASS.

Can someone diagnose?

This wasn't g++ 8 (or 7) specific - I reproduced it with g++ 6 too.

The problem is the C++ standard provides three versions of log10()​:

log10(float)
log10(double)
log10(long double)

but we're calling it with a different floating point type​:

log10(__float128)

so the compiler doesn't know which to call.

As with many other math functions, perl.h defines Perl_log10, which
becomes log10q on quadmath builds, changing POSIX.xs to use
Perl_log10
fixes the problem.

Similarly for ldexp(), except that using Perl_ldexp() takes a
slightly
larger change.

With those changes compilation succeeded, but two tests for
signbit()
failed.

Since quadmath provides signbitq() I changed perl.h to use that for
quadmath builds.

Tony

Tony, thanks for getting right on this. So far looks good on g++-8.
I'm taking this ticket for the purpose of monitoring smoke tests for
a
few days, after which I'll close the ticket.

Unfortunately, we're getting some new smoke test failures in one
particular configuration.

#####
[default] -DDEBUGGING -Duseithreads -Dusequadmath
../t/run/switchDx.t.........................................FAILED
3, 5, 7-8
#####

Observed in these smoke test reports​:

1.
http​://perl.develop-help.com/raw/?id=214129
on linux - 4.15.0-34-generic [Ubuntu 18.04.1 LTS (bionic)]
using g++ version 7.3.0

2.
http​://perl.develop-help.com/raw/?id=214131
on linux - 4.17.0-3-amd64 [Debian GNU/Linux buster/sid]
using g++ version 8.2.0

3.
http​://perl.develop-help.com/raw/?id=214132
on linux - 4.17.19-100.fc27.x86_64 [Fedora 27 (Server
Edition)]
using g++ version 7.3.1 20180712 (Red Hat 7.3.1-6)

Branch in each case was blead or a branch rebased on blead after
e6081c0

Here is the failure​:

#####
$ cd t;./perl harness -v run/switchDx.t; cd -

ok 1 - No perlio debug file without -Di...
ok 2 - ...no perlio.txt found
not ok 3 - Perlio debug file with both -Di and PERLIO_DEBUG...
ok 4 - ... perlio debugging file found with -Di and PERLIO_DEBUG
# Failed test 3 - Perlio debug file with both -Di and PERLIO_DEBUG... at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:\nEXECUTING...\n{1,2}hello\n?)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 5 - Perlio debug output to stderr with -TDi (with PERLIO_DEBUG)...
ok 6 - ...no perlio debugging file found
# Failed test 5 - Perlio debug output to stderr with -TDi (with PERLIO_DEBUG)... at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 7 - -Di defaults to stderr
# Failed test 7 - -Di defaults to stderr at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
not ok 8 - Perlio debug output to STDERR with -TDi (no PERLIO_DEBUG)
# Failed test 8 - Perlio debug output to STDERR with -TDi (no PERLIO_DEBUG) at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
Failed 4/8 subtests

Test Summary Report


run/switchDx.t (Wstat​: 0 Tests​: 8 Failed​: 4)
  Failed tests​: 3, 5, 7-8
Files=1, Tests=8, 1 wallclock secs ( 0.01 usr 0.00 sys + 0.03 cusr 0.03 csys = 0.07 CPU)
Result​: FAIL
/home/jkeenan/gitwork/perl
#####

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

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2018

From @jkeenan

Summary of my perl5 (revision 5 version 29 subversion 3) configuration​:
  Commit id​: 9d3dfe4
  Platform​:
  osname=linux
  osvers=4.15.0-34-generic
  archname=x86_64-linux-thread-multi-quadmath
  uname='linux zareason 4.15.0-34-generic #37-ubuntu smp mon aug 27 15​:21​:48 utc 2018 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dusedevel -Dcc=g++-8 -Dusequadmath -DDEBUGGING -Duseithreads'
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=define
  usemultiplicity=define
  use64bitint=define
  use64bitall=define
  uselongdouble=undef
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='g++-8'
  ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  optimize='-O2 -g'
  cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='8.0.1 20180414 (experimental) [trunk revision 259383]'
  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='__float128'
  nvsize=16
  Off_t='off_t'
  lseeksize=8
  alignbytes=16
  prototype=define
  Linker and Libraries​:
  ld='g++-8'
  ldflags =' -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/include/c++/8 /usr/include/x86_64-linux-gnu/c++/8 /usr/include/c++/8/backward /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64
  libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lquadmath
  perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lquadmath
  libc=libc-2.27.so
  so=so
  useshrplib=false
  libperl=libperl.a
  gnulibc_version='2.27'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=so
  d_dlsymun=undef
  ccdlflags='-Wl,-E'
  cccdlflags='-fPIC'
  lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:
  Compile-time options​:
  DEBUGGING
  HAS_TIMES
  MULTIPLICITY
  PERLIO_LAYERS
  PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_IMPLICIT_CONTEXT
  PERL_MALLOC_WRAP
  PERL_OP_PARENT
  PERL_PRESERVE_IVUV
  PERL_TRACK_MEMPOOL
  PERL_USE_DEVEL
  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_QUADMATH
  USE_REENTRANT_API
  Built under linux
  Compiled at Sep 12 2018 15​:31​:25
  %ENV​:
  PERL2DIR="/home/jkeenan/gitwork/perl2"
  PERLBREW_HOME="/home/jkeenan/.perlbrew"
  PERLBREW_MANPATH="/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/man"
  PERLBREW_PATH="/home/jkeenan/perl5/perlbrew/bin​:/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/bin"
  PERLBREW_PERL="perl-5.28.0"
  PERLBREW_ROOT="/home/jkeenan/perl5/perlbrew"
  PERLBREW_SHELLRC_VERSION="0.84"
  PERLBREW_VERSION="0.84"
  PERL_WORKDIR="/home/jkeenan/gitwork/perl"
  @​INC​:
  lib
  /usr/local/lib/perl5/site_perl/5.29.3/x86_64-linux-thread-multi-quadmath
  /usr/local/lib/perl5/site_perl/5.29.3
  /usr/local/lib/perl5/5.29.3/x86_64-linux-thread-multi-quadmath
  /usr/local/lib/perl5/5.29.3

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 2018

From @tonycoz

On Wed, 12 Sep 2018 12​:39​:55 -0700, jkeenan wrote​:

Here is the failure​:

#####
$ cd t;./perl harness -v run/switchDx.t; cd -

ok 1 - No perlio debug file without -Di...
ok 2 - ...no perlio.txt found
not ok 3 - Perlio debug file with both -Di and PERLIO_DEBUG...
ok 4 - ... perlio debugging file found with -Di and PERLIO_DEBUG
# Failed test 3 - Perlio debug file with both -Di and PERLIO_DEBUG...
at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:\nEXECUTING...\n{1,2}hello\n?)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 5 - Perlio debug output to stderr with -TDi (with
PERLIO_DEBUG)...
ok 6 - ...no perlio debugging file found
# Failed test 5 - Perlio debug output to stderr with -TDi (with
PERLIO_DEBUG)... at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 7 - -Di defaults to stderr
# Failed test 7 - -Di defaults to stderr at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
not ok 8 - Perlio debug output to STDERR with -TDi (no PERLIO_DEBUG)
# Failed test 8 - Perlio debug output to STDERR with -TDi (no
PERLIO_DEBUG) at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
Failed 4/8 subtests

Test Summary Report
-------------------
run/switchDx.t (Wstat​: 0 Tests​: 8 Failed​: 4)
Failed tests​: 3, 5, 7-8
Files=1, Tests=8, 1 wallclock secs ( 0.01 usr 0.00 sys + 0.03 cusr
0.03 csys = 0.07 CPU)
Result​: FAIL
/home/jkeenan/gitwork/perl
#####

The attached should fix it.

Tony

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 2018

From @tonycoz

0001-perl-133510-can-t-use-my_vsnprintf-on-quadmath-threa.patch
From 14b21593c19501eb30d65a4572dce272c08f12cd Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 13 Sep 2018 11:45:14 +1000
Subject: (perl #133510) can't use my_vsnprintf() on quadmath/threaded builds

Since anything with quadmath should be recent enough to have
vsnprintf() I've fallen back to that.

Calls to PerlIO_debug() in core don't include floating point values
and I expect it to be unlikely outside of core - if it is needed
they'll just have to use double formatting/types.
---
 perlio.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/perlio.c b/perlio.c
index f5eb4851b6..3a2f9120d3 100644
--- a/perlio.c
+++ b/perlio.c
@@ -371,7 +371,19 @@ PerlIO_debug(const char *fmt, ...)
 	/* Use fixed buffer as sv_catpvf etc. needs SVs */
 	char buffer[1024];
 	const STRLEN len1 = my_snprintf(buffer, sizeof(buffer), "%.40s:%" IVdf " ", s ? s : "(none)", (IV) CopLINE(PL_curcop));
+#  ifdef USE_QUADMATH
+#    ifdef HAS_VSNPRINTF
+        /* my_vsnprintf() isn't available with quadmath, but the native vsnprintf()
+           should be, otherwise the system isn't likely to support quadmath.
+           Nothing should be calling PerlIO_debug() with floating point anyway.
+        */
+        const STRLEN len2 = vsnprintf(buffer + len1, sizeof(buffer) - len1, fmt, ap);
+#    else
+        STATIC_ASSERT_STMT(0);
+#    endif
+#  else
 	const STRLEN len2 = my_vsnprintf(buffer + len1, sizeof(buffer) - len1, fmt, ap);
+#  endif
 	PERL_UNUSED_RESULT(PerlLIO_write(PL_perlio_debug_fd, buffer, len1 + len2));
 #else
 	const char *s = CopFILE(PL_curcop);
-- 
2.11.0

@p5pRT
Copy link
Author

p5pRT commented Sep 13, 2018

From @jkeenan

On Thu, 13 Sep 2018 01​:49​:15 GMT, tonyc wrote​:

On Wed, 12 Sep 2018 12​:39​:55 -0700, jkeenan wrote​:

Here is the failure​:

#####
$ cd t;./perl harness -v run/switchDx.t; cd -

ok 1 - No perlio debug file without -Di...
ok 2 - ...no perlio.txt found
not ok 3 - Perlio debug file with both -Di and PERLIO_DEBUG...
ok 4 - ... perlio debugging file found with -Di and PERLIO_DEBUG
# Failed test 3 - Perlio debug file with both -Di and PERLIO_DEBUG...
at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:\nEXECUTING...\n{1,2}hello\n?)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 5 - Perlio debug output to stderr with -TDi (with
PERLIO_DEBUG)...
ok 6 - ...no perlio debugging file found
# Failed test 5 - Perlio debug output to stderr with -TDi (with
PERLIO_DEBUG)... at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 7 - -Di defaults to stderr
# Failed test 7 - -Di defaults to stderr at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
not ok 8 - Perlio debug output to STDERR with -TDi (no PERLIO_DEBUG)
# Failed test 8 - Perlio debug output to STDERR with -TDi (no
PERLIO_DEBUG) at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
Failed 4/8 subtests

Test Summary Report
-------------------
run/switchDx.t (Wstat​: 0 Tests​: 8 Failed​: 4)
Failed tests​: 3, 5, 7-8
Files=1, Tests=8, 1 wallclock secs ( 0.01 usr 0.00 sys + 0.03 cusr
0.03 csys = 0.07 CPU)
Result​: FAIL
/home/jkeenan/gitwork/perl
#####

The attached should fix it.

Tony

It works for me with that configuration on both g++7 and g++8. So I'm pushing it to blead to let the smokers have another go at it.

Thank you very much.

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

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2018

From @jkeenan

On Thu, 13 Sep 2018 02​:27​:07 GMT, jkeenan wrote​:

On Thu, 13 Sep 2018 01​:49​:15 GMT, tonyc wrote​:

On Wed, 12 Sep 2018 12​:39​:55 -0700, jkeenan wrote​:

Here is the failure​:

#####
$ cd t;./perl harness -v run/switchDx.t; cd -

ok 1 - No perlio debug file without -Di...
ok 2 - ...no perlio.txt found
not ok 3 - Perlio debug file with both -Di and PERLIO_DEBUG...
ok 4 - ... perlio debugging file found with -Di and PERLIO_DEBUG
# Failed test 3 - Perlio debug file with both -Di and
PERLIO_DEBUG...
at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:\nEXECUTING...\n{1,2}hello\n?)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 5 - Perlio debug output to stderr with -TDi (with
PERLIO_DEBUG)...
ok 6 - ...no perlio debugging file found
# Failed test 5 - Perlio debug output to stderr with -TDi (with
PERLIO_DEBUG)... at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello
# )
# STATUS​: 35584
not ok 7 - -Di defaults to stderr
# Failed test 7 - -Di defaults to stderr at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
not ok 8 - Perlio debug output to STDERR with -TDi (no
PERLIO_DEBUG)
# Failed test 8 - Perlio debug output to STDERR with -TDi (no
PERLIO_DEBUG) at ./test.pl line 1075
# got 'Segmentation fault (core dumped)'
# expected /(?^​:define raw)/
# PROG​:
# print qq(hello)
# STATUS​: 35584
Failed 4/8 subtests

Test Summary Report
-------------------
run/switchDx.t (Wstat​: 0 Tests​: 8 Failed​: 4)
Failed tests​: 3, 5, 7-8
Files=1, Tests=8, 1 wallclock secs ( 0.01 usr 0.00 sys + 0.03
cusr
0.03 csys = 0.07 CPU)
Result​: FAIL
/home/jkeenan/gitwork/perl
#####

The attached should fix it.

Tony

It works for me with that configuration on both g++7 and g++8. So I'm
pushing it to blead to let the smokers have another go at it.

Thank you very much.

Smoke tests look good. Re-closing.

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

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2018

@jkeenan - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant