Page MenuHomeFreeBSD

Fix sys/kern/coredump_phnum_test in case of kern.compress_user_cores=1
ClosedPublic

Authored by olivier on Sep 24 2019, 7:39 AM.

Details

Summary

On systems configured with kern.compress_user_cores=1, this test will always fail

Test Plan

Before this patch:

# sysctl kern.compress_user_cores=1
kern.compress_user_cores: 0 -> 1
# kyua test -k /usr/tests/Kyuafile sys/kern/coredump_phnum_test
sys/kern/coredump_phnum_test:coredump_phnum  ->  failed: Helper program did not dump core  [3.014s]

Results file id is usr_tests.20190924-072623-834696
Results saved to /root/.kyua/store/results.usr_tests.20190924-072623-834696.db

0/1 passed (1 failed)

After this patch:

# sysctl kern.compress_user_cores=1
kern.compress_user_cores: 0 -> 1
# kyua test -k /usr/tests/Kyuafile sys/kern/coredump_phnum_test
sys/kern/coredump_phnum_test:coredump_phnum  ->  passed  [2.003s]

Results file id is usr_tests.20190924-072755-601239
Results saved to /root/.kyua/store/results.usr_tests.20190924-072755-601239.db

1/1 passed (0 failed)

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

olivier created this revision.Sep 24 2019, 7:39 AM
lwhsu accepted this revision.Sep 24 2019, 2:35 PM
This revision is now accepted and ready to land.Sep 24 2019, 2:35 PM
ngie accepted this revision.Sep 24 2019, 4:08 PM

allow_sysctl_side_effects is set in the test already — LGTM!
Macro goforit:

This revision was automatically updated to reflect the committed changes.

Coincidentally, I have a different fix for this in a work-in-progress tree. My change keeps the current value of kern.compress_user_cores and decompresses the core file. It has the advantage of providing test coverage for kern.compress_user_cores (if the user enables it). I can't find any existing test coverage.

See D21820. What do you think?

Coincidentally, I have a different fix for this in a work-in-progress tree. My change keeps the current value of kern.compress_user_cores and decompresses the core file. It has the advantage of providing test coverage for kern.compress_user_cores (if the user enables it). I can't find any existing test coverage.
See D21820. What do you think?

That your fix is better than mine :-)
So feel free to overwrite my changes with yours.

See D21820. What do you think?

That your fix is better than mine :-)
So feel free to overwrite my changes with yours.

Thank you! If that counts as "Reviewed by", would you mind approving D21820?