Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.99k stars 559 forks source link

t/re/reg_mesg.t: tests failing under `-Uusedl` #21829

Closed jkeenan closed 8 months ago

jkeenan commented 10 months ago

As I followed the discussion in https://github.com/Perl/perl5/issues/21750, I was struck by @Leont's comment that, notwithstanding the merging of https://github.com/Perl/perl5/pull/21320 last August, some tests were failing on static perls. We apparently don't have any tests of "static perls" in our GH workflow, nor do we have any in our contributed smoke tests. This is what I found today in blead:

$ git describe
v5.39.6-130-g8508c300fd

$ sh ./Configure -des -Dusedevel -Uusedl && make test_prep
[# perl compiles successfully with -Uusedl]

$ cd t;./perl harness re/reg_mesg.t; cd -
re/reg_mesg.t .. 1/? # Failed test 2692 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2694 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2696 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2698 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2700 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2702 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2704 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 2706 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3286 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3288 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3290 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3292 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3294 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3296 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3298 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
# Failed test 3300 - ... and gave expected number (1) of warnings at re/reg_mesg.t line 903
#      got "0"
# expected "1"
re/reg_mesg.t .. Failed 16/3300 subtests 

Test Summary Report
-------------------
re/reg_mesg.t (Wstat: 0 Tests: 3300 Failed: 16)
  Failed tests:  2692, 2694, 2696, 2698, 2700, 2702, 2704
                2706, 3286, 3288, 3290, 3292, 3294, 3296
                3298, 3300
Files=1, Tests=3300,  0 wallclock secs ( 0.09 usr  0.00 sys +  0.12 cusr  0.00 csys =  0.21 CPU)
Result: FAIL

Peering into the verbose output, I see:

ok 2691 -  /(?<=(p|qq|rrr))/ did not die
not ok 2692 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<=(p|qq|rrr)) <-- HERE / at 
ok 2693 -  /(?<!(p|qq|rrr))/ did not die
not ok 2694 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<!(p|qq|rrr)) <-- HERE / at 
ok 2695 -  /(?| (?=(foo)) | (?<=(foo)|p) )/ did not die
not ok 2696 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<=(foo)|p) ) <-- HERE / at 
ok 2697 -  /(?| (?=(foo)) | (?<=(foo)|p) )/x did not die
not ok 2698 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<=(foo)|p) ) <-- HERE / at 
ok 2699 -  /(?| (?=(foo)) | (?<!(foo)|p) )/ did not die
not ok 2700 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<!(foo)|p) ) <-- HERE / at 
ok 2701 -  /(?| (?=(foo)) | (?<!(foo)|p) )/x did not die
not ok 2702 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<!(foo)|p) ) <-- HERE / at 
ok 2703 -  /(?<!(foo|bop(*ACCEPT)|bar)baz)/ did not die
not ok 2704 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<!(foo|bop(*ACCEPT)|bar)baz) <-- HERE / at 
ok 2705 -  /(?<=(foo|bop(*ACCEPT)|bar)baz)/ did not die
not ok 2706 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<=(foo|bop(*ACCEPT)|bar)baz) <-- HERE / at 
ok 2707 - no warnings 'experimental::re_strict'; use re 'strict'; m/\b*\x{100}/ did not die

...

ok 3285 - no warnings 'experimental::re_strict'; use re 'strict'; /(?<=(p|qq|rrr))/ did not die
not ok 3286 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<=(p|qq|rrr)) <-- HERE / at 
ok 3287 - no warnings 'experimental::re_strict'; use re 'strict'; /(?<!(p|qq|rrr))/ did not die
not ok 3288 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<!(p|qq|rrr)) <-- HERE / at 
ok 3289 - no warnings 'experimental::re_strict'; use re 'strict'; /(?| (?=(foo)) | (?<=(foo)|p) )/ did not die
not ok 3290 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<=(foo)|p) ) <-- HERE / at 
ok 3291 - no warnings 'experimental::re_strict'; use re 'strict'; /(?| (?=(foo)) | (?<=(foo)|p) )/x did not die
not ok 3292 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<=(foo)|p) ) <-- HERE / at 
ok 3293 - no warnings 'experimental::re_strict'; use re 'strict'; /(?| (?=(foo)) | (?<!(foo)|p) )/ did not die
not ok 3294 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<!(foo)|p) ) <-- HERE / at 
ok 3295 - no warnings 'experimental::re_strict'; use re 'strict'; /(?| (?=(foo)) | (?<!(foo)|p) )/x did not die
not ok 3296 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?| (?=(foo)) | (?<!(foo)|p) ) <-- HERE / at 
ok 3297 - no warnings 'experimental::re_strict'; use re 'strict'; /(?<!(foo|bop(*ACCEPT)|bar)baz)/ did not die
not ok 3298 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length negative lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<!(foo|bop(*ACCEPT)|bar)baz) <-- HERE / at 
ok 3299 - no warnings 'experimental::re_strict'; use re 'strict'; /(?<=(foo|bop(*ACCEPT)|bar)baz)/ did not die
not ok 3300 - ... and gave expected number (1) of warnings
# Expected warnings not gotten:
#   Variable length positive lookbehind with capturing is experimental in regex; marked by <-- HERE in m/(?<=(foo|bop(*ACCEPT)|bar)baz) <-- HERE / at 
1..3300

Questions:

  1. What would it take to get these tests to PASS under -Uusedl?

  2. In the meantime, shouldn't they be TODOed under -Uusedl?

  3. Also in the meantime, shouldn't this limitation of -Uusedl be documented in the "Dynamic Loading" section of INSTALL?

Leont commented 10 months ago

We apparently don't have any tests of "static perls" in our GH workflow, nor do we have any in our contributed smoke tests. This is what I found today in blead:

In fact I discovered it while trying to add such a smoke configurations.

I would suggest this would be a blocker for 5.40

Leont commented 10 months ago

What would it take to get these tests to PASS under -Uusedl?

I suspect only @demerphq knows the answer to that.

Corion commented 10 months ago

This is fun.

git clean -dfX ; sh ./Configure -des -Dusedevel -Uusedl && make test_prep && cd t && ./perl re/reg_mesg.t

fails as above, but

git clean -dfX ; sh ./Configure -des -Doptimize=-g -Dusedevel -Uusedl && make test_prep && cd t && ./perl re/reg_mesg.t

(as produced by Porting/bisect-runner.pl ) passes.

Fails:

git clean -dfX ; sh ./Configure -des -Doptimize=-O2 -Dusedevel -Uusedl && make test_prep -j8 && cd t && ./perl re/reg_mesg.t

So it might be a linking/naming issue like Nick alluded to on irc

tonycoz commented 10 months ago

I believe it's related to #21550 which I'm looking at.

Leont commented 9 months ago

This is actually a duplicate of #21558

leonerd commented 8 months ago

Closing this as it's a duplicate of #21558 but see over there anyway.