-
Notifications
You must be signed in to change notification settings - Fork 65
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
t/harness.t creates untracked core dump on FreeBSD et al. but not on Linux #121
Comments
Probably because your FreeBSD has been set up to leave behind coredumps but your linux hasn't? |
Thanks for getting back on this. I'm merely a user of this FreeBSD system, so I myself would not have done anything to "set up" or not "set up" to leave core dumps behind. In addition, I noted in Perl/perl5#21455 that I've also observed the untracked So that suggests two questions:
|
It appears that whether a
Linux: From
FreeBSD: From
I myself have never fiddled with these system settings, so I assume that they are defaults for their respective OSes. So my hunch is that before running a test which executes a segfault, we should check the system's value for (I currently don't know how to do that, so if anyone else can jump in here with a patch for |
We can't. Or at least not without bringing in a XS module like BSD::Resource |
Would anything like this code in Perl's
|
No, not really. Not without some serious rearchitecting that wouldn't be proportional to the size of the issue. |
Well, my last thought on this is ... Could we simply skip the segfaut test if ulimit was not |
Or, if nothing else will work, we should place a comment indicating that a |
On machines where 'ulimit -c' does not return '0', a perl.core file is created here. We don't need to examine it, and it's annoying to have it subsequently show up as an untracked file in `git status`, so simply get rid of it per suggestion by Karen Etheridge at Perl/perl5#21455 (comment). For: Perl-Toolchain-Gang#121
On machines where 'ulimit -c' does not return '0', a perl.core file is created here. We don't need to examine it, and it's annoying to have it subsequently show up as an untracked file in `git status`, so simply get rid of it per suggestion by Karen Etheridge at Perl/perl5#21455 (comment). For: Perl-Toolchain-Gang#121
On machines where 'ulimit -c' does not return '0', a perl.core file is created here. We don't need to examine it, and it's annoying to have it subsequently show up as an untracked file in `git status`, so simply get rid of it per suggestion by Karen Etheridge at Perl/perl5#21455 (comment). For: #121
This was presumably fixed in the repository by 161ff77. However, it will need to be incorporated into a new CPAN release as well. |
This ticket continues the discussion begun in the Perl issue tracker at Perl/perl5#21455. I'm moving the discussion here because:
My analysis indicates that the problem lies in Test-Harness's own test suite and is merely reproduced when Test-Harness is synched into core; and
Test-Harness's documentation on CPAN indicates that bug tickets should be filed on RT, but that queue consists of 62 old reports and I suspect filing here in the Perl-Toolchain-Gang organization will get more attention. (If you want me to file on RT instead, just let me know.)
The discussion so far
Briefly, the discussion in Perl/perl5#21455: For the last month, when I configure, build and test Perl on FreeBSD (and other OSes) and then call
git status
at the end of the test suite, the status output includes:This core dump does not cause any test failures and appears to be compiler-independent, but is nonetheless real:
I do not observe this core dump on Linux: neither by
ls
nor bygit status
.I haven't definitively bisected this problem to see when it entered the Perl 5 core distribution, but I strongly suspect that it occurred when I synched Test-Harness-3.46 into core on August 13.
I performed that synching on Linux. All tests passed.
git status
was clean, so I had no reason to repeat that process on any other OS. If I weren't regularly building and testing on FreeBSD-13, I wouldn't have stumbled across this problem. My expectation is that on any (non-Windows, at least) OS to which I have access, after I run perl'smake test_harness
, all tests should PASS andgit status
should show no untracked files.Research in the Test-Harness repository on GitHub
I brought my own fork of Test-Harness on GitHub up-to-date with PTC's repository, then created a branch so that I could isolate the code generating the segfault in a way by which I could compare Linux and FreeBSD output more precisely. That 'segfault-analysis-20230908' branch is here.
I acknowledge that I have rarely peered into Test-Harness's code; hence, there may be weaknesses in the diagnostic code I added in my branch. All my changes are confined to
t/harness.t
:All the changes are debugging code except splitting
_runtests( $harness_failures, "$sample_tests/segfault" );
into two separate invocations of_runtests()
, for the second of which I had to create a new TAP::Harness object.Results
If I build Test::Harness on each of Linux and FreeBSD and exercise the file generating the segfault on FreeBSD, I get these comparative results:
Ubuntu Linux 22.04 LTS at release-3.45_01-12-gffc5f49
FreeBSD-13 at release-3.45_01-12-gffc5f49
Note that only on FreeBSD do I get this statement in the output from my branch:
... and that a core dump is created only on FreeBSD, as shown from this line in
ls
:Inferences and Next Questions
t/sample-tests/segfault
:Why does this create a segfault file (
./perl.core
) on FreeBSD but not on Linux?On FreeBSD, Test-Harness's own
make clean
(which appears to be a straightforward derivative from ExtUtils::MakeMaker) andgit clean -dfx
will both remove the core dump file, after whichgit status
will be clean. So what is annoying is that, on one OS but not the other, callinggit status
before running either of those cleanup commands will report an "untracked file." That annoyance would affect anyone doing maintenance work on Test-Harness, but nobody else. But this will be really annoying to anyone running Perl's own test suite on FreeBSD (or any other OS so affected).Should we consider modifying
t/harness.t
so that if it generates a core dump, the test file tidies up after itself and removesperl.core
once it's no longer needed?Thank you very much.
Jim Keenan
The text was updated successfully, but these errors were encountered: