Closed p5pRT closed 9 years ago
Hello\,
I don't know if this is the best news before releasing perl 5.20.2\, but none of the perl branches (including blead) does not pass tests when built with GCC 5.0:
t/run/switches ................................................. "EACCES" is not exported by the Errno module "EISDIR" is not exported by the Errno module Can't continue after import errors at run/switches.t line 126. # Looks like you planned 115 tests but ran 8. FAILED--expected 115 tests\, saw 8
etc.
This is caused by wrongly generated Errno.h which is missing all the constants (e.g. Errno::EISDIR):
[...]
That's reportedly caused by a change in GCC 5.0's preprocesor as described in:
\https://lists.fedoraproject.org/pipermail/devel/2015-February/207549.html \https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60723#c27
The preprocessed output contains a new line with current working directory directive which make troubles to the Errno_pm.PL parser.
Simple work-around is to call the preprocessor with -P option (inhibit generation of linemarkers). Once I find a proper fix\, I will post it here.
-- Petr
On 2015-02-10\, Petr Pisar \perlbug\-followup@​perl\.org wrote:
The preprocessed output contains a new line with current working directory directive which make troubles to the Errno_pm.PL parser.
The format change is from:
"ENOSTR" [[60]]
to
"ENOSTR" [[
# 14 "\
in preprocessed errno.c in write_errno_pm().
Simple work-around is to call the preprocessor with -P option (inhibit generation of linemarkers). Once I find a proper fix\, I will post it here.
As each line is broken into 5 lines and because the processed file is not a C code I'm keen to append the -P option to the preprocesor command in the write_errno_pm() function. The GCC's -P option is documented as:
This might be useful when running the preprocessor on something that is not C code\, and will be sent to a program which might be confused by the linemarkers.
But I don't know whether the option is something universally supported or recognized just by few compilers. In the latter case\, the option should be gaurded by $Config{gccversion} condition.
-- Petr
I perlbugged the fix to p5p\, but I'm not sure if I'm still blocked\, because I don't see my ticket.
basically gcc as cpp requires now the -P besides the -E
See attachment.
-- Reini Urban
The RT System itself - Status changed from 'new' to 'open'
On Tue Feb 10 12:43:33 2015\, rurban wrote:
I perlbugged the fix to p5p\, but I'm not sure if I'm still blocked\, because I don't see my ticket.
basically gcc as cpp requires now the -P besides the -E
See attachment.
Unfortunately that patch is broken in at least three different ways:
1) the echo says it's testing -E -P but then only tests -E
2) even if it's modified to use -P\, it fails\, since we're testing processing stdin
3) if we fix both of those\, adding -P to cppstdin breaks makedepend\, since it' uses the #line lines to generate the dependencies
The attached fixed all of those problems\, but perhaps this belongs in a change to Errno_pm.PL
Tony
On Tue Feb 10 20:32:03 2015\, tonyc wrote:
The attached fixed all of those problems\, but perhaps this belongs in a change to Errno_pm.PL
Now with the attachment.
Tony
On 2015-02-11\, Tony Cook via RT \perlbug\-followup@​perl\.org wrote:
On Tue Feb 10 20:32:03 2015\, tonyc wrote:
The attached fixed all of those problems\, but perhaps this belongs in a change to Errno_pm.PL
I think Errno_pm.PL is better place. Otherwise the you change CPP flags globaly and nobody can benefit from the new compiler feature.
Now with the attachment.
With the patch the lib/h2ph.t test fails for me:
lib/h2ph ....................................................... # Failed test 5 - preamble compiles at ../lib/h2ph.t line 49 # got 'Bareword found where operator expected at _h2ph_pre.ph line 222\, near "7fff" # (Missing operator before fff?) # Bareword found where operator expected at _h2ph_pre.ph line 228\, near "7fffffff" # (Missing operator before fffffff?) # Bareword found where operator expected at _h2ph_pre.ph line 234\, near "7fffffffffffffffL" # (Missing operator before fffffffffffffffL?) # Bareword found where operator expected at _h2ph_pre.ph line 240\, near "7f" # (Missing operator before f?) # Bareword found where operator expected at _h2ph_pre.ph line 246\, near "7fffffffffffffffL" # (Missing operator before fffffffffffffffL?) # Bareword found where operator expected at _h2ph_pre.ph line 250\, near "7fffffffffffffffL" # (Missing operator before fffffffffffffffL?) # Bareword found where operator expected at _h2ph_pre.ph line 254\, near "7fffffffffffffffL" # (Missing operator before fffffffffffffffL?) # Bareword found where operator expected at _h2ph_pre.ph line 258\, near "7fffffffffffffffL" # (Missing operator before fffffffffffffffL?) # Bareword found where operator expected at _h2ph_pre.ph line 262\, near "7fffffffffffffffL" # (Missing operator before fffffffffffffffL?) # Bareword found where operator expected at _h2ph_pre.ph line 266\, near "7f" # (Missing operator before f?) # syntax error at _h2ph_pre.ph line 222\, near "7fff " # syntax error at _h2ph_pre.ph line 228\, near "7fffffff " # syntax error at _h2ph_pre.ph line 234\, near "7fffffffffffffffL " # syntax error at _h2ph_pre.ph line 240\, near "7f " # syntax error at _h2ph_pre.ph line 246\, near "7fffffffffffffffL " # syntax error at _h2ph_pre.ph line 250\, near "7fffffffffffffffL " # syntax error at _h2ph_pre.ph line 254\, near "7fffffffffffffffL " # syntax error at _h2ph_pre.ph line 258\, near "7fffffffffffffffL " # syntax error at _h2ph_pre.ph line 262\, near "7fffffffffffffffL " # syntax error at _h2ph_pre.ph line 266\, near "7f " # _h2ph_pre.ph has too many errors. # ' # expected /(?^:syntax OK$)/ # Failed test 6 - output free of warnings at ../lib/h2ph.t line 56 # got "Bareword found where operator expected at _h2ph_pre.ph line 222\, near \"7fff\"\nCompilation failed in require at lib/h2ph.pht line 1.\nCompilation failed in require at -e line 1.\n" # expected "" FAILED at test 5
-- Petr
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
On 2015-02-11\, Tony Cook via RT \perlbug\-followup@​perl\.org wrote:
On Tue Feb 10 20:32:03 2015\, tonyc wrote:
The attached fixed all of those problems\, but perhaps this belongs in a change to Errno_pm.PL
I think Errno_pm.PL is better place. Otherwise the you change CPP flags globaly and nobody can benefit from the new compiler feature.
Now with the attachment.
With the patch the lib/h2ph.t test fails for me:
lib/h2ph ....................................................... # Failed test 5 - preamble compiles at ../lib/h2ph.t line 49 # got 'Bareword found where operator expected at _h2ph_pre.ph line 222\, near "7fff" # (Missing operator before fff?)
This failure is probably not releated to the patch as it fails with GCC 5.0 even if I patched Errno_pm.PL instead.
-- Petr
This is my patch patching Errno_pm.PL instead of the global configuration. Please not that it does not address the h2ph failure.
-- Petr
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
lib/h2ph ....................................................... # Failed test 5 - preamble compiles at ../lib/h2ph.t line 49 # got 'Bareword found where operator expected at _h2ph_pre.ph line 222\, near "7fff" # (Missing operator before fff?)
This failure is probably not releated to the patch as it fails with GCC 5.0 even if I patched Errno_pm.PL instead.
The t/_h2ph_pre.ph file generated by the ../utils/h2ps differs\, for example\, in this:
-unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { 32767 } } +unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { &0x7fff } }
All the test failures are about lines with a hexadecimal number prefixed by an ampersand.
This could be maybe caused my glibc-headers-2.20.90 which was also built by GCC 5.0.
-- Petr
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
lib/h2ph ....................................................... # Failed test 5 - preamble compiles at ../lib/h2ph.t line 49 # got 'Bareword found where operator expected at _h2ph_pre.ph line 222\, near "7fff" # (Missing operator before fff?)
This failure is probably not releated to the patch as it fails with GCC 5.0 even if I patched Errno_pm.PL instead.
The t/_h2ph_pre.ph file generated by the ../utils/h2ps differs\, for example\, in this:
-unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { 32767 } } +unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { &0x7fff } }
All the test failures are about lines with a hexadecimal number prefixed by an ampersand.
After I implement hexadecimal integers in the h2ph\, I got this failure:
$ ./perl -MTestInit lib/h2ph.t 1..6 ok 1 - output is free of warnings ok 2 - ../utils/h2ph runs successfully ok 3 - generated file has expected contents ok 4 - output compiles ok 5 - preamble compiles not ok 6 - output free of warnings # Failed test 6 - output free of warnings at lib/h2ph.t line 56 # got "Hexadecimal number > 0xffffffff non-portable at _h2ph_pre.ph line 234.\nCompilation failed in require at lib/h2ph.pht line 1.\nCompilation failed in require at -e line 1.\n" # expected ""
My understanding is this is rather advice for Perl users not to use such big numbers. So I think this warning could be ingnored by the "output free of warnings" test. Am I right?
What surprises me is that the failing number is 0x7fffffffffffffff which is exactly 9223372036854775807 and perl warns only on the hexadecimal form. I would expect warning in both cases:
$ ./perl -Ilib -w -e '$a = 9223372036854775807'; $ ./perl -Ilib -w -e '$a = 0x7fffffffffffffff'; Hexadecimal number > 0xffffffff non-portable at -e line 1.
-- Petr
On Wed Feb 11 08:09:15 2015\, ppisar wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
lib/h2ph ....................................................... # Failed test 5 - preamble compiles at ../lib/h2ph.t line 49 # got 'Bareword found where operator expected at _h2ph_pre.ph line 222\, near "7fff" # (Missing operator before fff?)
This failure is probably not releated to the patch as it fails with GCC 5.0 even if I patched Errno_pm.PL instead.
The t/_h2ph_pre.ph file generated by the ../utils/h2ps differs\, for example\, in this:
-unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { 32767 } } +unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { &0x7fff } }
All the test failures are about lines with a hexadecimal number prefixed by an ampersand.
This could be maybe caused my glibc-headers-2.20.90 which was also built by GCC 5.0.
The preamble file generation doesn't handle hex constants.
If you look at cppsymbols in config.sh\, you'll see:
__INT32_MAX__=0x7fffffff
Attached a patch to fix that.
As to the warning\, I suspect hex constants warn because people expect them to be treated as integers\, while a decimal constant could be treated either way.
Tony
On Wed\, Feb 11\, 2015 at 07:21:19PM -0800\, Tony Cook via RT wrote:
On Wed Feb 11 08:09:15 2015\, ppisar wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
On 2015-02-11\, Petr Pisar \ppisar@​redhat\.com wrote:
lib/h2ph ....................................................... # Failed test 5 - preamble compiles at ../lib/h2ph.t line 49 # got 'Bareword found where operator expected at _h2ph_pre.ph line 222\, near "7fff" # (Missing operator before fff?)
This failure is probably not releated to the patch as it fails with GCC 5.0 even if I patched Errno_pm.PL instead.
The t/_h2ph_pre.ph file generated by the ../utils/h2ps differs\, for example\, in this:
-unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { 32767 } } +unless (defined &__INT16_MAX__) { sub __INT16_MAX__() { &0x7fff } }
All the test failures are about lines with a hexadecimal number prefixed by an ampersand.
This could be maybe caused my glibc-headers-2.20.90 which was also built by GCC 5.0.
The preamble file generation doesn't handle hex constants.
If you look at cppsymbols in config.sh\, you'll see:
__INT32_MAX__=0x7fffffff
Attached a patch to fix that.
Yes. It works for me. Thanks.
Just a nit-pick. The regular expression:
/^([+-]?\d+|0x[\da-f]+)U?L{0\,2}$/i
does not cover negative hexadecimal integers. If I understand the ISO-C11 grammar correctly\, one can have -0xf or +0xf literals.
As to the warning\, I suspect hex constants warn because people expect them to be treated as integers\, while a decimal constant could be treated either way.
I don't understand. Hexadecimal constants are not integers?
-- Petr
On Wed\, Feb 11\, 2015 at 04:48:24PM +0100\, Petr Pisar wrote:
This is my patch patching Errno_pm.PL instead of the global configuration. Please not that it does not address the h2ph failure.
The patch did not expected GCC with major version number greater than 5 and it failed porting/cmp_version.t because it did not increase Errno's version value. Attached patch replaces the previous one.
Together with Tony's h2ph: correct handling of hex constants for the preamble patch\, all tests pass for me now.
-- Petr
On Thu\, Feb 12\, 2015 at 08:51:10AM +0100\, Petr Pisar wrote:
Yes. It works for me. Thanks.
Just a nit-pick. The regular expression:
/^\(\[\+\-\]?\\d\+|0x\[\\da\-f\]\+\)U?L\{0\,2\}$/i
does not cover negative hexadecimal integers. If I understand the ISO-C11 grammar correctly\, one can have -0xf or +0xf literals.
I'll fix that.
As to the warning\, I suspect hex constants warn because people expect them to be treated as integers\, while a decimal constant could be treated either way.
I don't understand. Hexadecimal constants are not integers?
On a 32-bit platform (without -Duse64bitint)\, a decimal integer over 2**32-1 will be treated as a floating point number\, but a hexadecimal integer over 2**32-1 will be treated as a compile-time error.
This makes me wonder if we have another issue - will _h2ph_pre.ph compile successfully under the following conditions:
- 32-bit build of perl - without -Duse64bitint - the platform has 64-bit long long\, - and the related constants are defined by the compiler.
Tony
On Thu\, Feb 12\, 2015 at 10:10:39PM +1100\, Tony Cook wrote:
On a 32-bit platform (without -Duse64bitint)\, a decimal integer over 2**32-1 will be treated as a floating point number\, but a hexadecimal integer over 2**32-1 will be treated as a compile-time error.
This makes me wonder if we have another issue - will _h2ph_pre.ph compile successfully under the following conditions:
- 32-bit build of perl - without -Duse64bitint - the platform has 64-bit long long\, - and the related constants are defined by the compiler.
You were right. This does not work. I thought it worked\, but after installing patched perl into such system\, next rebuild (for not clear reason\, the build used _h2pg_pre.ph from system\, so the issue got visible on second build) revealed:
t ok 6 - output free of warnings # Failed test 6 - output free of warnings at lib/h2ph.t line 56 # got "Integer overflow in hexadecimal number at _h2ph_pre.ph line 231.\nCompilation failed in require at lib/h2ph.pht line 1.\nCompilation failed in require at -e line 1.\n" # expected ""
Supressing "overflow" warnings category makes me nervous.
-- Petr
On Fri Feb 13 06:55:57 2015\, ppisar wrote:
On Thu\, Feb 12\, 2015 at 10:10:39PM +1100\, Tony Cook wrote:
On a 32-bit platform (without -Duse64bitint)\, a decimal integer over 2**32-1 will be treated as a floating point number\, but a hexadecimal integer over 2**32-1 will be treated as a compile-time error.
This makes me wonder if we have another issue - will _h2ph_pre.ph compile successfully under the following conditions:
- 32-bit build of perl - without -Duse64bitint - the platform has 64-bit long long\, - and the related constants are defined by the compiler.
You were right. This does not work. I thought it worked\, but after installing patched perl into such system\, next rebuild (for not clear reason\, the build used _h2pg_pre.ph from system\, so the issue got visible on second build) revealed:
t ok 6 - output free of warnings # Failed test 6 - output free of warnings at lib/h2ph.t line 56 # got "Integer overflow in hexadecimal number at _h2ph_pre.ph line 231.\nCompilation failed in require at lib/h2ph.pht line 1.\nCompilation failed in require at -e line 1.\n" # expected ""
Supressing "overflow" warnings category makes me nervous.
Does the attached help? I don't have a 32-bit system with gcc-5 installed.
Replaces my original patch.
Tony
On Sun\, Feb 15\, 2015 at 09:11:25PM -0800\, Tony Cook via RT wrote:
On Fri Feb 13 06:55:57 2015\, ppisar wrote:
On Thu\, Feb 12\, 2015 at 10:10:39PM +1100\, Tony Cook wrote:
On a 32-bit platform (without -Duse64bitint)\, a decimal integer over 2**32-1 will be treated as a floating point number\, but a hexadecimal integer over 2**32-1 will be treated as a compile-time error.
This makes me wonder if we have another issue - will _h2ph_pre.ph compile successfully under the following conditions:
- 32-bit build of perl - without -Duse64bitint - the platform has 64-bit long long\, - and the related constants are defined by the compiler.
You were right. This does not work. I thought it worked\, but after installing patched perl into such system\, next rebuild (for not clear reason\, the build used _h2pg_pre.ph from system\, so the issue got visible on second build) revealed:
t ok 6 - output free of warnings # Failed test 6 - output free of warnings at lib/h2ph.t line 56 # got "Integer overflow in hexadecimal number at _h2ph_pre.ph line 231.\nCompilation failed in require at lib/h2ph.pht line 1.\nCompilation failed in require at -e line 1.\n" # expected ""
Supressing "overflow" warnings category makes me nervous.
Does the attached help? I don't have a 32-bit system with gcc-5 installed.
Yes. It works both on amd64 and on x86 with native integers.
-- Petr
On Mon Feb 16 04:57:45 2015\, ppisar wrote:
On Sun\, Feb 15\, 2015 at 09:11:25PM -0800\, Tony Cook via RT wrote:
Does the attached help? I don't have a 32-bit system with gcc-5 installed.
Yes. It works both on amd64 and on x86 with native integers.
Your patch thanks\, applied as 816b056ffb99ae54642320e20dc30a59fd1effef and mine as 3bea78d24634e630b610f59957e7a019205a67b2.
Tony
@tonycoz - Status changed from 'open' to 'pending release'
On Fri\, Feb 13\, 2015 at 03:55:12PM +0100\, Petr Pisar wrote:
(for not clear reason\, the build used _h2pg_pre.ph from system\, so the issue got visible on second build)
I tracked the cause why it failed after second rebuild and not on the first one:
$ LD_PRELOAD=$PWD/libperl.so strace -fq -s 1024 -e execve\,chdir\,open -y -v ./perl -MTestInit lib/h2ph.t [...] chdir("t") = 0 [...] [pid 2341] execve("/home/test/perl-git/perl"\, ["/home/test/perl-git/perl"\, "-I../lib"\, "-w"\, "-e"\, "$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);"\, "-e"\, ""]\, ["XDG_SESSION_ID=1"\, "HOSTNAME=fedora-23"\, "TERM=screen"\, "SHELL=/bin/bash"\, "HISTSIZE=1000"\, "PERL5LIB=../lib"\, "LD_PRELOAD=/home/test/perl-git/libperl.so"\, "USER=test"\, "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01"...\, "COBBLER_SERVER=lab.rhts.englab.brq.redhat.com"\, "PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/test/bin"\, "MAIL=/var/spool/mail/test"\, "PERL_CORE=/home/test/perl-git/perl"\, "_=/home/test/perl-git/perl"\, "PWD=/home/test/perl-git/t"\, "LANG=en_US.UTF-8"\, "PERLEXE=/home/test/perl-git/perl"\, "HISTCONTROL=ignoredups"\, "HOME=/home/test"\, "SHLVL=2"\, "LOGNAME=test"\, "LESSOPEN=||/usr/bin/lesspipe.sh %s"]) = 0 [...] [pid 2341] open("./lib/h2ph.pht"\, O_RDONLY) = 3\</home/test/perl-git/t/lib/h2ph.pht> [pid 2341] open("../lib/warnings.pm"\, O_RDONLY) = 4\</home/test/perl-git/lib/warnings.pm> [pid 2341] open("/usr/lib64/perl5/_h2ph_pre.ph"\, O_RDONLY) = 3\</usr/lib64/perl5/_h2ph_pre.ph> [...]
It's becuse lib/h2ph.t executes generated code without passing proper -I argument to point to the place where the generated code resides. Then the interpreter loads _h2ph_pre.ph from system instead from the build directory.
Attached patch fixes it.
-- Petr
On Tue Feb 17 04:57:50 2015\, ppisar wrote:
It's becuse lib/h2ph.t executes generated code without passing proper -I argument to point to the place where the generated code resides. Then the interpreter loads _h2ph_pre.ph from system instead from the build directory.
Attached patch fixes it.
Thanks\, applied as 33593911f214382b592d05aa902655301915e666.
Tony
Thank you for submitting this ticket.
The issue should now be resolved with the release today of Perl v5.22\, which is available at http://www.perl.org/get.html -- Karl Williamson for the Perl 5 team
@khwilliamson - Status changed from 'pending release' to 'resolved'
Migrated from rt.perl.org#123784 (status was 'resolved')
Searchable as RT123784$