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

BBC: Blead breaks App-ClusterSSH-4.16 #20376

Open
eserte opened this issue Oct 9, 2022 · 8 comments
Open

BBC: Blead breaks App-ClusterSSH-4.16 #20376

eserte opened this issue Oct 9, 2022 · 8 comments
Labels
BBC Blead Breaks CPAN - changes in blead broke a cpan module(s) Not a Release Blocker

Comments

@eserte
Copy link
Contributor

eserte commented Oct 9, 2022

t/15config.t fails with perl 5.37.4:

#   Failed test 'returned ok'
#   at t/15config.t line 546.
#          got: 'die'
#     expected: 'return'

#   Failed test 'Expecting no STDERR'
#   at t/15config.t line 550.
#          got: ''
#     expected: 'Unable to write default $HOME/.clusterssh/config: Is a directory
# 
# '
# Looks like you failed 2 tests of 155.
t/15config.t ............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/155 subtests 

Sample fail report at CPAN Testers: http://www.cpantesters.org/cpan/report/2b2844fe-41c5-11ed-ae77-5f2e6e8775ea (but disregard the failure of t/10host.t here, that's another issue unrelated to bleadperl).

(FYI: @duncs)

@eserte eserte added BBC Blead Breaks CPAN - changes in blead broke a cpan module(s) Needs Triage labels Oct 9, 2022
@jkeenan
Copy link
Contributor

jkeenan commented Oct 9, 2022

t/15config.t fails with perl 5.37.4:

#   Failed test 'returned ok'
#   at t/15config.t line 546.
#          got: 'die'
#     expected: 'return'

#   Failed test 'Expecting no STDERR'
#   at t/15config.t line 550.
#          got: ''
#     expected: 'Unable to write default $HOME/.clusterssh/config: Is a directory
# 
# '
# Looks like you failed 2 tests of 155.
t/15config.t ............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/155 subtests 

Sample fail report at CPAN Testers: http://www.cpantesters.org/cpan/report/2b2844fe-41c5-11ed-ae77-5f2e6e8775ea (but disregard the failure of t/10host.t here, that's another issue unrelated to bleadperl).

(FYI: @duncs)

@eserte, is there any way that the failure in t/15config.t could be reduced so that we could bisect it against blead without loading this module? (Otherwise, the failure in the other file will simply confuse the results.)

@eserte
Copy link
Contributor Author

eserte commented Oct 9, 2022

t/10host.t fails only on few systems (but on most of my smokers). If it happens to fail on your system, then just try to set the LOCALDOMAIN environment variable to, say, example.org

@rjbs
Copy link
Member

rjbs commented Apr 28, 2023

Could we get a bisect on this? :)

@rjbs
Copy link
Member

rjbs commented May 5, 2023

I don't have Tk, so I can't build and test this. We need to update the test in t/15config.t at line 546 to add something like:

diag(explain($trap->die));

That way, we know the error that it's throwing, since it is now throwing instead of returning. Without that, unlikely to make progress.

@leonerd
Copy link
Contributor

leonerd commented May 5, 2023

I've tested this even just on systemperl (5.36.0) on debian and I get lots of output here, but one line stands out:

#   'message' => 'Could not close /tmp/O0ahk1pyKG/.clusterssh/config after reading: Is a directory',

@leonerd
Copy link
Contributor

leonerd commented May 5, 2023

Further output using $trap->die->trace->as_string:

# Trace begun at /home/leo/.cpan/build/App-ClusterSSH-4.16-0/t/../lib/App/ClusterSSH/Base.pm line 289
# App::ClusterSSH::Base::load_file('App::ClusterSSH::Config=HASH(0x559a761caf38)', 'type', 'config', 'filename', '/tmp/_HbI_E4D5R/.clusterssh/config') called at /home/leo/.cpan/build/App-ClusterSSH-4.16-0/t/../lib/App/ClusterSSH/Config.pm line 275
# App::ClusterSSH::Config::parse_config_file('App::ClusterSSH::Config=HASH(0x559a761caf38)', '/tmp/_HbI_E4D5R/.clusterssh/config') called at /home/leo/.cpan/build/App-ClusterSSH-4.16-0/t/../lib/App/ClusterSSH/Config.pm line 317
# App::ClusterSSH::Config::load_configs('App::ClusterSSH::Config=HASH(0x559a761caf38)') called at t/15config.t line 544
# main::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap.pm line 98
# Test::Trap::__ANON__('Test::Trap=HASH(0x559a7614d160)', undef) called at /usr/share/perl5/Test/Trap/Builder.pm line 292
# Test::Trap::Builder::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap.pm line 109
# eval {...} at /usr/share/perl5/Test/Trap.pm line 109
# Test::Trap::__ANON__('Test::Trap=HASH(0x559a7614d160)', undef) called at /usr/share/perl5/Test/Trap/Builder.pm line 292
# Test::Trap::Builder::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap.pm line 84
# Test::Trap::__ANON__('Test::Trap=HASH(0x559a7614d160)', undef) called at /usr/share/perl5/Test/Trap/Builder.pm line 292
# Test::Trap::Builder::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap/Builder/TempFile.pm line 69
# Test::Trap::Builder::TempFile::__ANON__('Test::Trap=HASH(0x559a7614d160)', 'stdout', 1, 'GLOB(0x559a752b2748)') called at /usr/share/perl5/Test/Trap/Builder.pm line 321
# Test::Trap::Builder::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap/Builder/TempFile.pm line 69
# Test::Trap::Builder::TempFile::__ANON__('Test::Trap=HASH(0x559a7614d160)', 'stderr', 2, 'GLOB(0x559a752b27a8)') called at /usr/share/perl5/Test/Trap/Builder.pm line 321
# Test::Trap::Builder::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap.pm line 149
# Test::Trap::__ANON__('Test::Trap=HASH(0x559a7614d160)', undef) called at /usr/share/perl5/Test/Trap/Builder.pm line 292
# Test::Trap::Builder::__ANON__('Test::Trap=HASH(0x559a7614d160)') called at /usr/share/perl5/Test/Trap/Builder.pm line 97
# eval {...} at /usr/share/perl5/Test/Trap/Builder.pm line 97
# Test::Trap::Builder::trap('Test::Trap::Builder=HASH(0x559a75b69e48)', 'Test::Trap', 'GLOB(0x559a754e6b30)', 'ARRAY(0x559a75bac428)', 'CODE(0x559a761cd860)') called at /usr/share/perl5/Test/Trap.pm line 38
# Test::Trap::__ANON__('CODE(0x559a761cd860)') called at t/15config.t line 545

#   Failed test 'returned ok'
#   at t/15config.t line 548.
#          got: 'die'
#     expected: 'return'

#   Failed test 'Expecting no STDERR'
#   at t/15config.t line 552.
#          got: ''
#     expected: 'Unable to write default $HOME/.clusterssh/config: Is a directory
# 
# '
# Looks like you failed 2 tests of 155.

@leonerd
Copy link
Contributor

leonerd commented May 5, 2023

Digging further into the code, it appears that the unit test calls mkdir() (t/15config.t line 541), and then attempts to load the config, expecting this to fail with "it's a directory". It does fail, but it fails earlier than the test expected, because close() on a filehandle now fails.

$ eachperl -E "open my \$fh, '<', \$ENV{HOME}; say <\$fh>; close \$fh or die 'close() - '.\$!"
(no error on perls up to perl5.36.1)
  --- perl5.36.1 --- 

  --- perl5.37.8 --- 

close() - Is a directory at -e line 1.

  --- perl5.37.11 --- 

close() - Is a directory at -e line 1.

@bram-perl
Copy link

bram-perl commented May 6, 2023

It does fail, but it fails earlier than the test expected, because close() on a filehandle now fails.

To be exact: close() on a filehandle (opened to a directory) after a read() on that filehandle now fails.

That is:

$ ./perl -wle 'open(my $fh, ".") or die $!; <$fh>; close $fh or die "Err close $!";'
Err close Is a directory at -e line 1.

$ ./perl -wle 'open(my $fh, ".") or die $!; close $fh or die "Err close $!";'
$

The reason for the change in behavior is commit 80c1f1e
For some more context see:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BBC Blead Breaks CPAN - changes in blead broke a cpan module(s) Not a Release Blocker
Projects
None yet
Development

No branches or pull requests

5 participants