Open lmcne opened 3 years ago
Cross-posted to StackOverflow: https://stackoverflow.com/questions/69226303/failures-bulding-perl-5-32-1-on-hp-ux-hpia11-31-related-to-failed-regex-eval
I have access to a HP-UX system (thanks Merijn).
With cc: HP C/aC++ B3910B A.06.28.02 [Mar 09 2016]
I can build v5.32.1:
./perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for IA64.ARCHREV_0-thread-multi-LP64
So it looks like the problem is something to do with the different compiler. Maybe a bug in the older compiler, because whilst Perl's C code does a few naughty things, it seems strange that every other compiler observed is fine.
Are you able to run make minitest
and post the failure output?
(If there's lots, the files that fail is interesting, and some sample diagnostic output)
If that won't even build, then the manual steps to get some output are
make miniperl
cd t
ln -s ../miniperl perl
./perl TEST base/*.t re/*.t
I'd hope that we can figure out what the C compiler is objecting to, and hence create a work-around.
If we can reduce the problem to a small test-case, then I'd hope that it's possible to use git bisect
to figure out the exact commit. Given a test case, there's a wrapper script Porting/bisect.pl
that can automate most of this.
Steps and output from building minitest
. There is a lot more output which I've excluded for legibility but can provide if needed.
N.B. the first time I ran Configure and make I saw these errors repeatedly:
./Configure -des -Dprefix=$HOME/localperl
-->8 snip 8<--
"intrpvar.h", line 950: error #2020: identifier "mbstate_t" is undefined
PERLVAR(I, wcrtomb_ps, mbstate_t)
^
Adding -Accflags="-D_INCLUDE__STDC_A1_SOURCE"
alleviated that issue.
./Configure -des -Dprefix=$HOME/localperl -Accflags="-D_INCLUDE__STDC_A1_SOURCE"
-->8 snip 8<--
bash-4.0$ make minitest
rm -f opmini.c
/usr/bin/ln -s op.c opmini.c
/bin/sh config_h.SH
Extracting config.h (with variable substitutions)
/bin/sh cflags.SH
cflags.SH: cc = cc
cflags.SH: ccflags = -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE
cflags.SH: stdflags =
cflags.SH: optimize = +O2 +Onolimit
cflags.SH: warn =
Extracting cflags (with variable substitutions)
echo @`sh cflags "optimize='+O2 +Onolimit'" opmini.o` -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
"op.c", line 2443: warning #2111-D: statement is unreachable
return arg;
^
-->8 snip 8<--
rm -f perlmini.c
/usr/bin/ln -s perl.c perlmini.c
echo @`sh cflags "optimize='+O2 +Onolimit'" perlmini.o` -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
@cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
"perl.c", line 3581: warning #2111-D: statement is unreachable
NOT_REACHED; /* NOTREACHED */
^
"perl.c", line 4653: warning #4232-D: conversion from "XPVHV *" to a more
strictly aligned type "XPVMG *" may cause misaligned access
if (HvKEYS(dups)) {
^
-->8 snip 8<--
cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit pp_sort.c
cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit caretx.c
cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit dquote.c
cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit time64.c
cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit miniperlmain.c
cc -L/usr/local/lib -L/usr/lib/hpux32 -o miniperl \
opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o miniperlmain.o -lcl -lpthread -lnsl -ldl -lm -lsec -lc
cc: warning 983: The -lc library specified on the command line is also added automatically by the compiler driver.
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
./miniperl -Ilib -f write_buildcustomize.pl
rm -f opmini.c
/usr/bin/ln -s op.c opmini.c
rm -f perlmini.c
/usr/bin/ln -s perl.c perlmini.c
./generate_uudmap uudmap.h bitcount.h mg_data.h
cc -c -DPERL_CORE -Ae -Wp,-H150000 -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE__STDC_A1_SOURCE +O2 +Onolimit globals.c
cc -L/usr/local/lib -L/usr/lib/hpux32 -o miniperl \
opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o miniperlmain.o -lcl -lpthread -lnsl -ldl -lm -lsec -lc
cc: warning 983: The -lc library specified on the command line is also added automatically by the compiler driver.
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
./miniperl -Ilib -f write_buildcustomize.pl
./miniperl -Ilib make_patchnum.pl
Updating 'git_version.h' and 'lib/Config_git.pl' is generated by make_patchnum.pl
# DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
######################################################################
$Config::Git_Data=<<'ENDOFGIT';
git_commit_id=''
git_describe=''
git_branch=''
git_uncommitted_changes=''
git_commit_id_title=''
Failed to open for write './lib/Config_git.pl' is generated by make_patchnum.pl
# DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
######################################################################
$Config::Git_Data=<<'ENDOFGIT';
git_commit_id=''
git_describe=''
git_branch=''
git_uncommitted_changes=''
git_commit_id_title='':File name too long at make_patchnum.pl line 84.
*** Error exit code 248
Stop.
*** Error exit code 1 (ignored)
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm, or the Unicode data files.
cd t && (rm -f perl; /usr/bin/ln -s ../miniperl perl)
cd t && ./perl -Ilib -I. TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t </dev/tty
t/base/cond .................... FAILED--unexpected output at test 0
Failed a basic test (base/cond.t) under minitest -- cannot continue.
*** Error exit code 255
Stop.
The 'Failed to open' message towards the end matches what I've seen in the regular build: regex parsing of the filename from make_patchnum.pl
fails resulting in a too-long filename. Patching for this issue moves the build into configpm
which also exhibits regex issues which prevent creation of lib/Config.pm
and associated files.
t/base/cond .................... FAILED--unexpected output at test 0 Failed a basic test (base/cond.t) under minitest -- cannot continue.
Oh erk, that failure is far earlier in the testsuite than I expected, and seemingly nothing to do with regular expressions.
If I run it manually I have:
-bash-5.1$ ./miniperl t/base/cond.t
1..4
ok 1 - operator eq
ok 2 - operator ne
ok 3 - operator ==
ok 4 - operator !=
For you, I assume that it's crashing before it can produce 1..4
. Is this the case?
Assuming that t/base/cond.t
passes on v5.28.0 (or so), and it's crashing on v5.32.1, and that the cause is one commit somewhere in the history between, it should be possible to automate finding out which;
Porting/bisect.pl
and Porting/bisect-runner.pl
to any location outside of the checkout (eg /tmp
)/tmp/bisect.pl --end v5.32.1 --crash --target miniperl -Duse64bitall -Dusethreads -- ./miniperl t/base/cond.t
(I can't test that completely as I don't have it crashing at any revision, and the HP-UX machine is rather too slow)
One could add a --start
option (eg --start v5.28.0
) to slightly cut down the search for a start revision
If I've got the options right it should
t/base/cond.t
(default is its #!
line, which is ./perl
and so won't work)bad
, non-crashes as good
The (numerous) command line options are documented in bisect-runner.pl
(which might seem odd, but makes sense implementation-wise)
Oops, given that you needed to add -Accflags="-D_INCLUDE__STDC_A1_SOURCE"
to the ./Configure
command line, I think you'll need
/tmp/bisect.pl --end v5.32.1 --crash --target miniperl -Duse64bitall -Dusethreads `-Accflags="-D_INCLUDE__STDC_A1_SOURCE" -- ./miniperl t/base/cond.t
Actually I get the same output you do, which is unexpected and perplexing:
bash-4.0$ ./miniperl t/base/cond.t
1..4
ok 1 - operator eq
ok 2 - operator ne
ok 3 - operator ==
ok 4 - operator !=
EDIT: running all the t/base/*.t
unit tests manually results in the following test failures:
bash-4.0$ ./miniperl `t/base/term.t`
1..7
ok 1
sh: ./miniperl: not found.
not ok 2
#3 :1: == :1:
ok 3
ok 4
ok 5
ok 6
ok 7
Failing tests in t/base/term.t
:
# check `` processing
$x = `$^X -le "print 'hi there'"`;
if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";}
bash-4.0$ ./miniperl t/base/lex.t
1..120
#1 :x: eq :x:
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12 - make sure single quotes are honored \nnot ok
ok 13
ok 14
ok 15
ok 16
ok 17
ok 18 - was the test for the deprecated use of bare << to mean <<""
ok 19
ok 20
ok 21
ok 22
ok 23
not ok 24
ok 25
not ok 26
ok 27
ok 28
ok 29
ok 30
ok 31
ok 32
ok 33
ok 34
ok 35
ok 36
ok 37
ok 38
ok 39
ok 40
ok 41
ok 42
ok 43
ok 44
ok 45
ok 46
ok 47
# uggedaboudit
ok 48
ok 49
ok 50
ok 51
ok 52
ok 53
ok 54
ok 55
ok 56
ok 57
ok 58
ok 59
ok 60
ok 61
ok 62
ok 63 - heredoc after "" in s/// in eval
ok 64 - heredoc in "" in multiline s///e in eval
ok 65 - null on same line as heredoc in s/// in eval
ok 66 - heredoc in "" in single-line s///e in eval
ok 67 - heredoc in "" in multiline s///e outside eval
ok 68 - s/// in s/// pattern
ok 69 - here-doc in re-eval
ok 70 - here-doc in re-eval in string eval
ok 71 - eval ending with semicolon
ok 72 - here-doc in single-line re-eval
ok 73 - here-doc in quotes in multiline re-eval
ok 74 - eval 's//<<END/' does not leave extra newlines
ok 75 - # after null in s/// repl
ok 76 - s//'#' . <<END/e
ok 77 - s//3}->{3/e
ok 78 - s//${\%x}{3}/e
ok 79 - s/${foo#}//e
ok 80 - listop({ok 78 => 1} + 1)
ok 81 - [perl #105924] require WORD << ...
ok 82 - [perl #105924] goto WORD << ...
ok 83 - [perl #105924] last WORD << ...
ok 84 - [perl #105924] next WORD << ...
ok 85 - [perl #105924] redo WORD << ...
ok 86 - [perl #105924] CORE::dump WORD << ...
ok 87 - Use v[0-9]+ as a label
ok 88 - Use v[0-9]+ as a label with space before colon
ok 89 - call a function in package v10::foo
ok 90 - colon detection after vstring does not break ? vstring :
#not
ok 91 - print vstring prints the vstring
ok 92 - q <comment> <newline> ...
ok 93 - qq <comment> <newline> ...
ok 94 - qw <comment> <newline> ...
ok 95 - m <comment> <newline> ...
ok 96 - qr <comment> <newline> ...
ok 97 - s <comment> <newline> ...
ok 98 - tr <comment> <newline> ...
ok 99 - y <comment> <newline> ...
ok 100 - => quotes keywords across lines
ok 101 - [perl #80368] qq <a\U=>
ok 102 - ${...} where {...} looks like hash
ok 103 - map{BEGIN...
ok 104 - map{BEGIN...
ok 105 - ${ <newline> =pod
ok 106 - map{ <newline> =pod
ok 107 - ${...} (literal triple-dot)
ok 108 - map{...} (literal triple-dot)
ok 109 - &{sub :lvalue...}
ok 110 - map{sub :lvalue...}
ok 111 - 124385
ok 112 - 125350
ok 113 - 128171
ok 114 - 132640
ok 115 - 125351
ok 116 - 126192
ok 117 - [perl #128478] "$foo::$bar"
ok 118 - [perl #128478] "$foo::@bar"
ok 119 - first constant in 'const1 const2' is not upgraded
ok 120 - second constant in 'const1 const2' is not upgraded
Failing tests in t/base/lex.t
:
print "FOO:" =~ /$foo[:]/ ? "ok 24\n" : "not ok 24\n";
print "FOOZ" =~ /^$foo[$A-Z]$/ ? "ok 26\n" : "not ok 26\n";
Character classes are common to the t/base/lex.t
and make_patchnum.pl
failures. If the bisection does not work, you could try building with -DDEBUGGING and trying the lex.t
tests with -Dr
, eg:
./miniperl -Dr -e 'print "FOO:" =~ /FOO[:]/ ? "ok\n" : "not ok\n"'
which might give us some more information.
You might be able to bisect that to a single commit in the C source that upset the compiler. Something like:
/tmp/bisect.pl --end v5.32.1 --target miniperl -Duse64bitall -Dusethreads `-Accflags="-D_INCLUDE__STDC_A1_SOURCE" -e 'exit("FOO:" =~ /$foo[:]/ ? 0 : 1)'
[Edited to change exit ...
to exit(...)
- sorry, I didn't test this carefully enough]
It might be that some "innocent" (and correct) change to the type of an expression inside an array index (or how some data structures are stored) between v5.28 and v5.32 has tickled a bug in that compiler.
I also wondered (but this might be a long shot) whether the compiler would behave differently in C99 mode. I think that the default is C89 - are you able to build by adding -AC99
to the compiler options?
(That flag is approaching the limit of my HP-UX specific knowledge.)
Definitely a long shot, and unsuccessful :-)
I'll try to run the bisect; not sure if I'll hit issues because git
is not installed on our build machines.
I'll try to run the bisect; not sure if I'll hit issues because
git
is not installed on our build machines.
Oh erk, and good luck.
You might benefit from adding --start v5.28.0
to the command line. The default is to try to find a start point automatically by trying stable versions in order. The earliest attempted is perl-5.002
, but to build that early the bisect runner has to patch various files in the source tree, which it attempts with patch
, so if you build machines don't have that either, it will fail (and IIRC hard fail, rather than deciding that that version should be skipped, and simply moving onwards)
A colleague was able to run bisect between 5.29.7 (successful) and 5.29.8 (failing); here's the results:
git bisect start ᚠ devel/v5.29.7
git bisect bad v5.29.7 ᚠ devel/v5.29.7
git bisect good v5.29.6 ᚠ devel/v5.29.7
Bisecting: 57 revisions left to test after this (roughly 6 steps)
[317a726d5977fc277a50871ea89e79ce9da36bed] regcomp.c: Rename a variable
$ sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest
-- Logged to step01-317a726d59...log
⋯/sandbox/GitHub/perl5 git bisect bad ᚠ 317a726d59
Bisecting: 28 revisions left to test after this (roughly 5 steps)
[a308c7e049aaaf6b8a593459292704ecb29655ac] regcomp.c, regexec.c: Rename some related variables
⋯/sandbox/GitHub/perl5 ᚠ a308c7e049
git clean -diX
$ sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest 2>&1 | tee step02-a308c7e049.log
⋯/sandbox/GitHub/perl5 git bisect good ᚠ a308c7e049
Bisecting: 14 revisions left to test after this (roughly 4 steps)
[0fbec7cfee07bcb4184ad6f26fffb15af3fdc048] regexec.c: Avoid unnecessary folding
⋯/sandbox/GitHub/perl5 ᚠ 0fbec7cfee
git clean -diX
$ ( sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest ) 2>&1 | tee step03-0fbec7cfee.log
⋯/sandbox/GitHub/perl5 git bisect good ᚠ 0fbec7cfee
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[98074cb544cfa35eb31ad1895dfc1015be2fab50] regcomp.c: Consolidate common code
⋯/sandbox/GitHub/perl5 ᚠ 98074cb544
git clean -diX
$ ( sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest ) 2>&1 | tee step04-98074cb544.log
⋯/sandbox/GitHub/perl5 git bisect good ᚠ 98074cb544
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[ddb2f1506d64f5966468a7d16db8d80608ab103e] regcomp.c: Refactor looking for POSIX optimizations
⋯/sandbox/GitHub/perl5 ᚠ ddb2f1506d
git clean -diX
$ ( sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest ) 2>&1 | tee step05-ddb2f1506d.log
⋯/sandbox/GitHub/perl5 git bisect bad ᚠ ddb2f1506d
Bisecting: 1 revision left to test after this (roughly 1 step)
[17e8e8e82459ab4457d5037180fa67796e0fac8e] regcomp.c: Remove no longer used static function
⋯/sandbox/GitHub/perl5 ᚠ 17e8e8e824
git clean -diX
$ ( sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest ) 2>&1 | tee step06-17e8e8e824.log
⋯/sandbox/GitHub/perl5 git bisect good ᚠ 17e8e8e824
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[c5d6a6ca99e382c5efe257bef87df4e1369cdc7e] regcomp.c: Rename a variable
⋯/sandbox/GitHub/perl5 ᚠ c5d6a6ca99
git clean -diX
$ ( sh Configure -des -Dprefix=/opt/perl/5.32.1/hpia11.31 -Duseshrplib=false -Dusethreads -Dnoextensions=ODBM_File -Duse64bitall -Dusedevel && make minitest ) 2>&1 | tee step07-c5d6a6ca99.log
⋯/sandbox/GitHub/perl5 git bisect good ᚠ c5d6a6ca99
ddb2f1506d64f5966468a7d16db8d80608ab103e is the first bad commit
commit ddb2f1506d64f5966468a7d16db8d80608ab103e
Author: Karl Williamson <khw@cpan.org>
Date: Tue Nov 27 11:59:03 2018 -0700
regcomp.c: Refactor looking for POSIX optimizations
Instead of repeating the code, slightly modified, this uses a loop.
This is in preparation for a future commit where a third instance would
have been required
:100644 100644 779cc05d8fc1e720e0a7e1e12edb5227ff7a8584 909764aeaf9c82dbb3581b43fcea9f66b77b0fc6 M regcomp.c
Here's the git bisect log:
⋯/sandbox/GitHub/perl5 git bisect log ᚠ bisect/good-c5d6a6ca99e382c5efe257bef87df4e1369cdc7e
git bisect start
# bad: [e0cf033f421e677e25c7c28ce932de16832f814b] And 5.29.7 release to pod/perlhist
git bisect bad e0cf033f421e677e25c7c28ce932de16832f814b
# good: [4a292fc5f1b9c62ae52c835d69cb90c874a52ca0] Perlhist: Date of the 5.29.6 release.
git bisect good 4a292fc5f1b9c62ae52c835d69cb90c874a52ca0
# bad: [317a726d5977fc277a50871ea89e79ce9da36bed] regcomp.c: Rename a variable
git bisect bad 317a726d5977fc277a50871ea89e79ce9da36bed
# good: [a308c7e049aaaf6b8a593459292704ecb29655ac] regcomp.c, regexec.c: Rename some related variables
git bisect good a308c7e049aaaf6b8a593459292704ecb29655ac
# good: [0fbec7cfee07bcb4184ad6f26fffb15af3fdc048] regexec.c: Avoid unnecessary folding
git bisect good 0fbec7cfee07bcb4184ad6f26fffb15af3fdc048
# good: [98074cb544cfa35eb31ad1895dfc1015be2fab50] regcomp.c: Consolidate common code
git bisect good 98074cb544cfa35eb31ad1895dfc1015be2fab50
# bad: [ddb2f1506d64f5966468a7d16db8d80608ab103e] regcomp.c: Refactor looking for POSIX optimizations
git bisect bad ddb2f1506d64f5966468a7d16db8d80608ab103e
# good: [17e8e8e82459ab4457d5037180fa67796e0fac8e] regcomp.c: Remove no longer used static function
git bisect good 17e8e8e82459ab4457d5037180fa67796e0fac8e
# good: [c5d6a6ca99e382c5efe257bef87df4e1369cdc7e] regcomp.c: Rename a variable
git bisect good c5d6a6ca99e382c5efe257bef87df4e1369cdc7e
# first bad commit: [ddb2f1506d64f5966468a7d16db8d80608ab103e] regcomp.c: Refactor looking for POSIX optimizations
My colleague successfully built with bad commit - 1. Bumping up to the bad commit then failed.
Tail end of the failed build log:
make[1]: *** [uni.data] Error 255
make[1]: Leaving directory `/sandbox/GitHub/perl5'
make: [minitest_prep] Error 2 (ignored)
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm, or the Unicode data files.
cd t && (rm -f perl; /usr/bin/ln -s ../miniperl perl)
cd t && ./perl -Ilib -I. TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t </dev/tty
t/base/cond .................... FAILED--unexpected output at test 0
Failed a basic test (base/cond.t) under minitest -- cannot continue.
make: [minitest] Error 255 (ignored)
That commit that git bisect
has found looks plausible as a cause of the problem:
commit ddb2f1506d64f5966468a7d16db8d80608ab103e
Author: Karl Williamson <khw@cpan.org>
Date: Tue Nov 27 11:59:03 2018 -0700
regcomp.c: Refactor looking for POSIX optimizations
Instead of repeating the code, slightly modified, this uses a loop.
This is in preparation for a future commit where a third instance would
have been required
diff --git a/regcomp.c b/regcomp.c
index 779cc05..909764a 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -18403,50 +18403,52 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flag>
}
}
+ {
+ PERL_UINT_FAST8_T type;
+
/* Here, didn't find an optimization. See if this matches any
* of the POSIX classes. The POSIXA ones are about the same speed
* as ANYOF ops, but take less room; the ones that have
* above-Latin1 code point matches are somewhat faster than ANYOF.
* */
+ for (type = POSIXU; type <= POSIXA; type++) {
+
...
I think that that commit was one of the first uses in the source code of the C99 types. And your compiler is older, so maybe it doesn't quite get something right.
If I make regcomp.i
working backwards I see:
$ grep PERL_UINT_FAST8_T regcomp.i
typedef uint_fast8_t PERL_UINT_FAST8_T;
PERL_UINT_FAST8_T inverted = 0;
const PERL_UINT_FAST8_T max_permissible = 0x7F;
PERL_UINT_FAST8_T type;
$ grep uint_fast8_t regcomp.i
typedef unsigned int uint_fast8_t;
typedef uint_fast8_t PERL_UINT_FAST8_T;
so for cc: HP C/aC++ B3910B A.06.28.02 [Mar 09 2016]
the type is unsigned int
.
The pre-processed source code for that loop above starts
{
PERL_UINT_FAST8_T type;
for (type = 26; type <= 27; type++) {
I'd assume that you should see the same. (and hopefully PERL_UINT_FAST8_T
also ends up as unsigned int
)
but this sort of bug is about finding out which assumption turns out to be wrong... :-)
We do indeed see the same thing; nice to have some confirmation!
We do indeed see the same thing; nice to have some confirmation!
That's sort of good news and bad news simultaneously. Because the compiler I have access to compiles that code correctly. Whereas (if I understand your report correctly) the compiler on your systems does not.
Which seems nuts, as that C code looks to be doing nothing special whatsoever. What about it contuses your compiler? I'm struggling to even guess sensibly.
The compiler that @nwc10 can use on that HP-UX is:
hp-ux$ cc --version
cc: HP C/aC++ B3910B A.06.28.02 [Mar 09 2016]
(next to some GNU gcc variants) If yours is newer, something broke in HP's patches. If yours is older and you still have a support contract to get the patches, it might be making sense to apply them
Could you try with the latest version of blead? I just fixed a bunch of HPUX build issues.
Description
Building Perl 5.32.1 on an hpia11.31 system fails during execution of
configpm
:lib/Config.pm
,lib/Config_heavy.pl
, andlib/Config.pod
are not generated and hence are unavailable to the later steps of the build process.Errors reported from build process:
Expected behavior
Completing a successful build of Perl 5.32.1 on HP-UX (hpia11.31).
Additional Info
This seems to be related to the regex parser used during the build process:
make_patchnum.pl
fails because a regex intended to pull the filename from a heredoc instead returns the entire heredoc as the filename:Manually getting past that,
configpm
exhibits the same issue: regex evaluations to extract variable headers fail in 5.32.1 where they succeed in 5.28.1. Sample output:Compiler info:
Some warnings are reported building
regexec.c
, but they seem consistent with warnings reported when building 5.28.1 on the same host with the same toolchain: I don't see anything here that suggests it doesn't work.Build command and output for
regexec.c
:Perl configuration
NOTE: this is the Perl available to the system during the build process, NOT the Perl I am attempting to build