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

DragonflyBSD: t/op/magic.t has test failures since v5.35.9 #19894

Closed
jkeenan opened this issue Jun 26, 2022 · 16 comments
Closed

DragonflyBSD: t/op/magic.t has test failures since v5.35.9 #19894

jkeenan opened this issue Jun 26, 2022 · 16 comments

Comments

@jkeenan
Copy link
Contributor

jkeenan commented Jun 26, 2022

Somewhere between v5.35.8-29-g4ccd1515c8 and v5.35.9-114-gc3c9d6b15f -- approximately February 2022 -- two tests (202-203) in t/op/magic.t began to fail in blead in DragonflyBSD -- and they continue to fail to this day.

See these smoke-test reports:
PASS https://perl5.test-smoke.org/report/5015286
FAIL https://perl5.test-smoke.org/report/5016701

We only have one person submitting smoke-test reports on this OS; @cjg-cguevara, can you supply more data?

I don't have access to DragonflyBSD, so if anyone can investigate, please do so.

@tonycoz
Copy link
Contributor

tonycoz commented Jun 27, 2022

The log provides more information:

# Failed test 202 - altering $0 is effective (testing with /proc/) at op/magic.t line 900
#      got "perl: -bar"
# expected "bar"
# Failed test 203 - altering $0 is effective (testing with `ps`) at op/magic.t line 931
#      got 'perl: -x (perl)'
# expected /(?^:^(?:(?:mini)?perl: )?x(?: \((?:mini)?perl\))?$)/

I don't see any changes in S_set_dollarzero() over that period.

The calling code to that was changed in 2d3b356 but that looks fairly safe for the test that's failing.

@tonycoz
Copy link
Contributor

tonycoz commented Jun 27, 2022

Bisected to 2d3b356.

I wasn't able to make a short reproducer, but moving the tests introduced in 2d3b356 after the existing $0 tests allows the failing (and all non-TODO) tests to pass.

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 27, 2022

Bisected to 2d3b356.

I wasn't able to make a short reproducer, but moving the tests introduced in 2d3b356 after the existing $0 tests allows the failing (and all non-TODO) tests to pass.

Could you create a smoke-me branch so that we could confirm that that happens on Dragonfly?

@tonycoz
Copy link
Contributor

tonycoz commented Jun 28, 2022

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 28, 2022

https://github.com/Perl/perl5/tree/smoke-me/tonyc/19894-dflybsd-workaround

@cjg-cguevara, can you give this branch a spin on your DragonflyBSD smoker? Thanks.

@tonycoz
Copy link
Contributor

tonycoz commented Jun 28, 2022

Looks like it's failing on -Duseshrplib builds.

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 28, 2022

Looks like it's failing on -Duseshrplib builds.

I don't see that in smoke-test results. (In fact, I don't yet see any results for this smoke-me branch. Where are you seeing that?

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 28, 2022

Looks like it's failing on -Duseshrplib builds.

I don't see that in smoke-test results. (In fact, I don't yet see any results for this smoke-me branch. Where are you seeing that?

Correction: I don't yet see any results for this branch run on Dragonfly BSD.

@tonycoz
Copy link
Contributor

tonycoz commented Jun 29, 2022

I'm looking at the github CI results, eg. https://github.com/Perl/perl5/runs/7083910270?check_suite_focus=true

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 29, 2022

I'm looking at the github CI results, eg. https://github.com/Perl/perl5/runs/7083910270?check_suite_focus=true

@tonycoz, I think we have a bigger problem here. I'm getting problems with -Duseshrplib even in blead:
On Linux:

$ uname -mrs
Linux 5.10.13-x86_64-linode141 x86_64

$ gitcurr
blead

$ git describe
v5.37.1-38-gee41234

$ sh ./Configure -des -Dusedevel -Dusequadmath -Duseshrplib -Dusebacktrace -Duseithreads && make test_prep
...

$ ./perl -Ilib -V:config_args
./perl: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory

Configure without -Duseshrplib:

$ git clean -dfx

$ sh ./Configure -des -Dusedevel -Dusequadmath -Dusebacktrace -Duseithreads && make test_prep
...

$ ./perl -Ilib -V:config_args
config_args='-des -Dusedevel -Dusequadmath -Dusebacktrace -Duseithreads';

$ cd t;./perl harness op/magic.t; cd -
op/magic.t .. ok       
All tests successful.
Files=1, Tests=208,  4 wallclock secs ( 0.04 usr  0.01 sys +  0.12 cusr  0.12 csys =  0.29 CPU)
Result: PASS

On FreeBSD-12:

$ uname -mrs
FreeBSD 12.3-RELEASE-p1 amd64
$ gitcurr
blead
$ git describe
v5.37.1-38-gee41234643
$ sh ./Configure -des -Dusedevel -Duseshrplib && make test_prep
...
$ ./perl -Ilib -V:config_args
ld-elf.so.1: /usr/home/jkeenan/gitwork/perl/perl: Undefined symbol "PL_exit_flags"

I know very little about -Duseshrplib so I can't yet say what's going on here.

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 29, 2022

So, having just now read perldoc INSTALL, I realize that I know even less about -Duseshrplib than I thought I did.

Once I precede configuration with LD_LIBRARY_PATH=pwd:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH, on Linux, if I configure with -Duseshrplib in @tonycoz's branch, I can reproduce the failues in t/op/magic.t reported in https://github.com/Perl/perl5/runs/7083910270?check_suite_focus=true.

Test Summary Report
-------------------
op/magic.t (Wstat: 0 Tests: 208 Failed: 13)
  Failed tests:  143-145, 180-182, 187-192, 194
Files=1, Tests=208,  3 wallclock secs ( 0.06 usr  0.00 sys +  0.10 cusr  0.07 csys =  0.23 CPU)
Result: FAIL

I note in passing, however, that Tony's branch does get t/op/magic.t -- and, by extension, the entire test suite -- PASSing on DragonflyBSD for the first time in months. See: https://perl5.test-smoke.org/report/5019769.

How should we proceed?

@tonycoz
Copy link
Contributor

tonycoz commented Jun 29, 2022

For your -Duseshrplib perl to run (outside of make test, which does the right thing) you'll need to set the equivalent of LD_LIBRARY_PATH to run your newly built perl. This isn't a problem in blead. I expect my change broke a relative path being used to find libperl.so, I'll take another look tomorrow later today (it's 1am here).

@tonycoz
Copy link
Contributor

tonycoz commented Jun 30, 2022

Note that my change isn't a fix - it's a workaround, I expect it will be better to TODO these tests on DragonflyBSD.

I've reproduced this from straight C code, and opened https://bugs.dragonflybsd.org/issues/3319

I'll work on a better patch, probably skipping the Unicode $0 tests on DragonflyBSD

@jkeenan
Copy link
Contributor Author

jkeenan commented Jun 30, 2022 via email

@tonycoz
Copy link
Contributor

tonycoz commented Jun 30, 2022

Changing t/op/magic.t to just the two failing tests would pass.

It seems to be all the calls to setproctitle() that cause the problem, commenting out any of the active setproctitle() calls in the C reproducer in the upstream bug stops the change in behaviour.

tonycoz added a commit that referenced this issue Jun 30, 2022
The sequence of calls to setproctitle() seems to mess up some internal
OS state, which ends up making the more fundamental $0 tests fail
later in the file.

Reported upstream as https://bugs.dragonflybsd.org/issues/3319

Fixes #19894
@tonycoz
Copy link
Contributor

tonycoz commented Jun 30, 2022

@tonycoz tonycoz closed this as completed in 855c15d Jul 1, 2022
scottchiefbaker pushed a commit to scottchiefbaker/perl5 that referenced this issue Nov 3, 2022
The sequence of calls to setproctitle() seems to mess up some internal
OS state, which ends up making the more fundamental $0 tests fail
later in the file.

Reported upstream as https://bugs.dragonflybsd.org/issues/3319

Fixes Perl#19894
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