pjf / ipc-system-simple

Perl module to make running system commands and capturing errors as simple as possible.
http://search.cpan.org/perldoc?IPC::System::Simple
Other
19 stars 20 forks source link

Core dump file remains on disk after running t/08_core.t on FreeBSD #40

Open jkeenan opened 2 years ago

jkeenan commented 2 years ago

In the course of working on https://github.com/pjf/ipc-system-simple/pull/39, I had occasion to install CPAN module BSD::Resource on the machines on which I had previously worked on IPC-System-Simple. Once I did so, test program t/08_core.t was no longer skipped. When it ran, it PASSed on both Linux and FreeBSD. However, on FreeBSD running that file deposited a core dump file in t/perl.core; no such core dump remained after running the test on Linux.

This was surprising. I peeked into t/08_core.t and saw this code:

# Core dumps on OS X are complicated. See GH #5.

BEGIN {
    if ($^O eq 'darwin') {
        plan skip_all => "Coredump tests skipped under OS X/Darwin";
    }
}

So at some point in the past, it was seen fit to skip the core tests on Darwin. (I don't currently have a working Mac.) Was this because t/perl.core was not cleaned up, or for some other reason? Should the prohibition against running coredump tests on Darwin be extended to FreeBSD which, in the long distant past, was an ancestor of Darwin? And against other OSes as well?

@pjf, do you have any thoughts about this?

jkeenan commented 2 years ago

In the course of working on #39, I had occasion to install CPAN module BSD::Resource on the machines on which I had previously worked on IPC-System-Simple. Once I did so, test program t/08_core.t was no longer skipped. When it ran, it PASSed on both Linux and FreeBSD. However, on FreeBSD running that file deposited a core dump file in t/perl.core; no such core dump remained after running the test on Linux.

This was surprising. I peeked into t/08_core.t and saw this code:

# Core dumps on OS X are complicated. See GH #5.

BEGIN {
    if ($^O eq 'darwin') {
        plan skip_all => "Coredump tests skipped under OS X/Darwin";
    }
}

So at some point in the past, it was seen fit to skip the core tests on Darwin. (I don't currently have a working Mac.) Was this because t/perl.core was not cleaned up, or for some other reason?

I located https://github.com/pjf/ipc-system-simple/issues/5, in which the rationale for skipping t/08_core.t was presented, viz., on Darwin core dumps are deposited in a weird location that the test program would have to jump through hoops to identify.

This logic would clearly not apply on FreeBSD; the core dump occurs exactly where you would expect it to. So the question then becomes: Why is the core dump being "cleaned up" on Linux but not on FreeBSD?

[snip] @pjf, do you have any thoughts about this?