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

several regexp failures when built with Intel C 15 #14517

Open
p5pRT opened this issue Feb 17, 2015 · 9 comments
Open

several regexp failures when built with Intel C 15 #14517

p5pRT opened this issue Feb 17, 2015 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 17, 2015

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

Searchable as RT123853$

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @tonycoz

Created by @tonycoz

When built with Intel C 15, several regexp tests fail, and some
others​:

Test Summary Report
-------------------
re/pat.t (Wstat​: 0 Tests​: 772 Failed​: 5)
  Failed tests​: 119, 274, 304, 306, 772
re/pat_advanced.t (Wstat​: 0 Tests​: 1623 Failed​: 4)
  Failed tests​: 96-97, 928, 1007
re/pat_re_eval.t (Wstat​: 0 Tests​: 527 Failed​: 72)
  Failed tests​: 30-31, 33-34, 36-37, 39-43, 45-46, 48-49
  54-55, 62-64, 68, 70-88, 90-92, 94-96, 98-100
  102-104, 106-120, 443-444, 456-457, 525
re/pat_rt_report.t (Wstat​: 0 Tests​: 2532 Failed​: 1)
  Failed test​: 2507
re/reg_eval.t (Wstat​: 0 Tests​: 7 Failed​: 1)
  Failed test​: 3
re/regexp.t (Wstat​: 0 Tests​: 1906 Failed​: 44)
  Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
  1123, 1125, 1127, 1130, 1132-1141, 1265-1266
  1322, 1724-1731, 1736-1739, 1873-1879
re/regexp_noamp.t (Wstat​: 0 Tests​: 1906 Failed​: 42)
  Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
  1123, 1125, 1127, 1130, 1132-1141, 1266
  1322, 1724-1731, 1736, 1738-1739, 1873-1879
re/regexp_notrie.t (Wstat​: 0 Tests​: 1906 Failed​: 44)
  Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
  1123, 1125, 1127, 1130, 1132-1141, 1265-1266
  1322, 1724-1731, 1736-1739, 1873-1879
re/regexp_qr.t (Wstat​: 0 Tests​: 1906 Failed​: 44)
  Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
  1123, 1125, 1127, 1130, 1132-1141, 1265-1266
  1322, 1724-1731, 1736-1739, 1873-1879
re/regexp_qr_embed.t (Wstat​: 0 Tests​: 1906 Failed​: 44)
  Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
  1123, 1125, 1127, 1130, 1132-1141, 1265-1266
  1322, 1724-1731, 1736-1739, 1873-1879
re/regexp_trielist.t (Wstat​: 0 Tests​: 1906 Failed​: 44)
  Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
  1123, 1125, 1127, 1130, 1132-1141, 1265-1266
  1322, 1724-1731, 1736-1739, 1873-1879
op/svleak.t (Wstat​: 0 Tests​: 129 Failed​: 1)
  Failed test​: 36
../dist/ExtUtils-ParseXS/t/517-t-targetable.t (Wstat​: 4864 Tests​: 41 Failed​: 19)
  Failed tests​: 4-5, 7-10, 14-19, 23, 32, 37-41
  Non-zero exit status​: 19
../lib/English.t (Wstat​: 768 Tests​: 58 Failed​: 3)
  Failed tests​: 36, 38-39
  Non-zero exit status​: 3
../lib/perl5db.t (Wstat​: 0 Tests​: 120 Failed​: 1)
  Failed test​: 2
Files=2430, Tests=678416, 202 wallclock secs (66.15 usr 10.10 sys + 442.18 cusr 43.78 csys = 562.21 CPU)
Result​: FAIL

The tests in lib/English.t that fail are testing the regexp related
variables.

Some hints changes were required for the build to succeed, patch
attached.

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.21.9:

Configured by tony at Tue Feb 17 11:34:25 AEDT 2015.

Summary of my perl5 (revision 5 version 21 subversion 9) configuration:
  Derived from: 8e0a272fbda1da989d682dceeee7f5e8dee38a7b
  Platform:
    osname=linux, osvers=3.2.0-4-amd64, archname=x86_64-linux
    uname='linux mars 3.2.0-4-amd64 #1 smp debian 3.2.65-1+deb7u1 x86_64 gnulinux '
    config_args='-des -Dcc=icc -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='icc', ccflags ='-we147 -mieee-fp -no-gcc -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-we147 -mieee-fp -no-gcc -I/usr/local/include'
    ccversion='15.0.2 20150121', gccversion='', 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='icc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /home/tony/local/intelc/composer_xe_2015.2.164/compiler/lib/intel64 /home/tony/local/intelc/composer_xe_2015.2.164/ipp/../compiler/lib/intel64 /home/tony/local/intelc/composer_xe_2015.2.164/ipp/lib/intel64 /home/tony/local/intelc/composer_xe_2015.2.164/mkl/lib/intel64 /lib /usr/lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.13.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.13'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O3 -L/usr/local/lib'

Locally applied patches:
    uncommitted-changes


@INC for perl 5.21.9:
    lib
    /usr/local/lib/perl5/site_perl/5.21.9/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.21.9
    /usr/local/lib/perl5/5.21.9/x86_64-linux
    /usr/local/lib/perl5/5.21.9
    .


Environment for perl 5.21.9:
    HOME=/home/tony
    LANG=en_AU.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/tony/local/intelc/composer_xe_2015.2.164/compiler/lib/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/mpirt/lib/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/ipp/../compiler/lib/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/ipp/lib/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/ipp/tools/intel64/perfsys:/home/tony/local/intelc/composer_xe_2015.2.164/compiler/lib/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/mkl/lib/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/tbb/lib/intel64/gcc4.4:/home/tony/local/intelc/composer_xe_2015.2.164/debugger/ipt/intel64/lib
    LOGDIR (unset)
    PATH=/home/tony/local/intelc/composer_xe_2015.2.164/bin/intel64:/home/tony/local/intelc/composer_xe_2015.2.164/debugger/gdb/intel64_mic/bin:/home/tony/perl5/perlbrew/bin:/home/tony/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    PERLBREW_BASHRC_VERSION=0.43
    PERLBREW_HOME=/home/tony/.perlbrew
    PERLBREW_PATH=/home/tony/perl5/perlbrew/bin
    PERLBREW_ROOT=/home/tony/perl5/perlbrew
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @tonycoz

0001-ensure-Intel-C-15-is-detected-and-replace-removed-mp.patch
From a239e9388f6c2dc27955cb8784ea7814cb09d225 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 17 Feb 2015 14:51:03 +1100
Subject: [PATCH] ensure Intel C 15 is detected and replace removed -mp option

15.0 no longer supports the -mp option, but the 11.0 documentation says:

-m[no-]ieee-fp
              same as -mp

The 12.0 documentation lists -mp in deprecated options and documents it
as:

-mp                      use -fp-model <arg>

but doesn't say which value for <arg> is equivalent
---
 hints/linux.sh |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hints/linux.sh b/hints/linux.sh
index fb5a46e..d2b2132 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -84,17 +84,20 @@ uname_minus_m="`$run uname -m 2>/dev/null`"
 uname_minus_m="${uname_minus_m:-"$targetarch"}"
 
 # Check if we're about to use Intel's ICC compiler
+# 11.0: Intel(R) C Compiler for applications running on Intel(R) 64,
+# 12.0: Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64.
+# 15.0: Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64.
 case "`${cc:-cc} -V 2>&1`" in
-*"Intel(R) C++ Compiler"*|*"Intel(R) C Compiler"*)
+*"Intel(R) C++ Compiler"*|*"Intel(R) C "*"Compiler"*)
     # record the version, formats:
     # icc (ICC) 10.1 20080801
     # icpc (ICC) 10.1 20080801
     # followed by a copyright on the second line
     ccversion=`${cc:-cc} --version | sed -n -e 's/^icp\?c \((ICC) \)\?//p'`
     # This is needed for Configure's prototype checks to work correctly
-    # The -mp flag is needed to pass various floating point related tests
+    # The -mieee-fp flag is needed to pass various floating point related tests
     # The -no-gcc flag is needed otherwise, icc pretends (poorly) to be gcc
-    ccflags="-we147 -mp -no-gcc $ccflags"
+    ccflags="-we147 -mieee-fp -no-gcc $ccflags"
     # Prevent relocation errors on 64bits arch
     case "$uname_minus_m" in
 	*ia64*|*x86_64*)
-- 
1.7.10.4

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @demerphq

On 17 February 2015 at 11​:55, Tony Cook <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Tony Cook
# Please include the string​: [perl #123853]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123853 >

This is a bug report for perl from tony@​develop-help.com,
generated with the help of perlbug 1.40 running under perl 5.21.9.

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

When built with Intel C 15, several regexp tests fail, and some
others​:

Test Summary Report
-------------------
re/pat.t (Wstat​: 0 Tests​: 772 Failed​: 5)
Failed tests​: 119, 274, 304, 306, 772
re/pat_advanced.t (Wstat​: 0 Tests​: 1623 Failed​: 4)
Failed tests​: 96-97, 928, 1007
re/pat_re_eval.t (Wstat​: 0 Tests​: 527 Failed​: 72)
Failed tests​: 30-31, 33-34, 36-37, 39-43, 45-46, 48-49
54-55, 62-64, 68, 70-88, 90-92, 94-96, 98-100
102-104, 106-120, 443-444, 456-457, 525
re/pat_rt_report.t (Wstat​: 0 Tests​: 2532 Failed​: 1)
Failed test​: 2507
re/reg_eval.t (Wstat​: 0 Tests​: 7 Failed​: 1)
Failed test​: 3
re/regexp.t (Wstat​: 0 Tests​: 1906 Failed​: 44)
Failed tests​: 951, 1029, 1082-1084, 1096, 1102, 1111
1123, 1125, 1127, 1130, 1132-1141, 1265-1266
1322, 1724-1731, 1736-1739, 1873-1879

Hi Tony,

Could you please run

TEST_ARGS="-v -re re\/regexp\.t" make test_harness
TEST_ARGS="-v -re re\/pat_re_eval" make test_harness

And send the output?

Might need more but there will be copious output from those two and
hopefully we can work out what is wrong from that output.

Thanks,
Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @tonycoz

On Tue Feb 17 03​:50​:55 2015, demerphq wrote​:

Could you please run

TEST_ARGS="-v -re re\/regexp\.t" make test_harness
TEST_ARGS="-v -re re\/pat_re_eval" make test_harness

And send the output?

Attached.

If I build with -DDEBUGGING then all tests are successful, the tests are only failing on non-debugging builds.

Tony

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @tonycoz

icc-no-debug.txt

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @demerphq

On 17 February 2015 at 20​:39, Tony Cook via RT
<perlbug-followup@​perl.org> wrote​:

On Tue Feb 17 03​:50​:55 2015, demerphq wrote​:

Could you please run

TEST_ARGS="-v -re re\/regexp\.t" make test_harness
TEST_ARGS="-v -re re\/pat_re_eval" make test_harness

And send the output?

Attached.

If I build with -DDEBUGGING then all tests are successful, the tests are only failing on non-debugging builds.

I see. That suggests an optimization bug in the compiler to me. Can
you build a non-debugging build with -Og and -O1 or the equivalent and
see if it also passes?

Note you may speed things up by using

make test-reonly

to run just the regex tests.

Yves

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2015

From @tonycoz

On Tue Feb 17 06​:13​:36 2015, demerphq wrote​:

On 17 February 2015 at 20​:39, Tony Cook via RT
<perlbug-followup@​perl.org> wrote​:

On Tue Feb 17 03​:50​:55 2015, demerphq wrote​:

Could you please run

TEST_ARGS="-v -re re\/regexp\.t" make test_harness
TEST_ARGS="-v -re re\/pat_re_eval" make test_harness

And send the output?

Attached.

If I build with -DDEBUGGING then all tests are successful, the tests
are only failing on non-debugging builds.

I see. That suggests an optimization bug in the compiler to me. Can
you build a non-debugging build with -Og and -O1 or the equivalent and
see if it also passes?

Note you may speed things up by using

make test-reonly

to run just the regex tests.

All tests pass with -Doptimize="-g -O1".

That doesn't mean it's an optimization bug - we've have at least a couple of issues where we've had apparent compiler optimization bugs that turned out to be perl bugs.

That said, Intel don't appear to be offering free use of their compilers to open source developers right now[1] (I'm using an evaluation license), so this may not be worth following up.

Tony

[1] https://software.intel.com/en-us/non-commercial-software-development

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2016

From @khwilliamson

On Tue Feb 17 15​:16​:50 2015, tonyc wrote​:

On Tue Feb 17 06​:13​:36 2015, demerphq wrote​:

On 17 February 2015 at 20​:39, Tony Cook via RT
<perlbug-followup@​perl.org> wrote​:

On Tue Feb 17 03​:50​:55 2015, demerphq wrote​:

Could you please run

TEST_ARGS="-v -re re\/regexp\.t" make test_harness
TEST_ARGS="-v -re re\/pat_re_eval" make test_harness

And send the output?

Attached.

If I build with -DDEBUGGING then all tests are successful, the
tests
are only failing on non-debugging builds.

I see. That suggests an optimization bug in the compiler to me. Can
you build a non-debugging build with -Og and -O1 or the equivalent
and
see if it also passes?

Note you may speed things up by using

make test-reonly

to run just the regex tests.

All tests pass with -Doptimize="-g -O1".

That doesn't mean it's an optimization bug - we've have at least a
couple of issues where we've had apparent compiler optimization bugs
that turned out to be perl bugs.

That said, Intel don't appear to be offering free use of their
compilers to open source developers right now[1] (I'm using an
evaluation license), so this may not be worth following up.

Tony

[1] https://software.intel.com/en-us/non-commercial-software-
development

Is this worth following up? Does valgrind run so that it can see if perl is doing out-of-bounds accesses
--
Karl Williamson

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