Page MenuHomeFreeBSD

Fix sys.kern.coredump_phnum_test.coredump_phnum on i386
ClosedPublic

Authored by ngie on Apr 22 2019, 10:14 AM.

Details

Summary

The zero-padding when printing out the Size field is 5, not 15. Adjust the
regular expression to work with both the 32-bit and non 32-bit case.

MFC after: 1 week

Test Plan

Tested the change on ^/head (amd64) and ^/stable/12 (i386).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ngie created this revision.Apr 22 2019, 10:14 AM
markj accepted this revision.Apr 22 2019, 11:13 AM
This revision is now accepted and ready to land.Apr 22 2019, 11:13 AM
lwhsu accepted this revision.Apr 22 2019, 11:15 AM

Thanks for the better fix. BTW, I still think these checks would be better to be rewritten as getting the real number and compare with 65535.

ngie added a comment.Apr 22 2019, 11:17 AM

Thanks for the better fix. BTW, I still think these checks would be better to be rewritten as getting the real number and compare with 65535.

Totally agree, but I couldn't get clarity on whether or not the value could be static or how to compute it. I'll see if I can reverse engineer how sometime in the future (*files bug*).

This revision was automatically updated to reflect the committed changes.
cem added a comment.Apr 22 2019, 3:57 PM
In D20005#429915, @ngie wrote:

Thanks for the better fix. BTW, I still think these checks would be better to be rewritten as getting the real number and compare with 65535.

Totally agree, but I couldn't get clarity on whether or not the value could be static or how to compute it. I'll see if I can reverse engineer how sometime in the future (*files bug*).

It's not a static number, AFAICT, depending on how the kernel maps libraries or waves hands does stuff with virtual memory. Hence the sloppy 66xxx match. I think @lwhsu's proposal is something like atf_check [ "$num" -gt 65535 ], which verifies that the number exceeds the lower 16 bit limit (which is the coredump feature the regression test is attempting to verify).

By the way, post-facto ๐Ÿ‘ to this revision (Phabricator removes the "approve" option for closed Differentials). Thanks for fixing the test on 32-bit CI.

ngie added a comment.May 3 2019, 10:23 PM
In D20005#430003, @cem wrote:

It's not a static number, AFAICT, depending on how the kernel maps libraries or waves hands does stuff with virtual memory. Hence the sloppy 66xxx match. I think @lwhsu's proposal is something like atf_check [ "$num" -gt 65535 ], which verifies that the number exceeds the lower 16 bit limit (which is the coredump feature the regression test is attempting to verify).

Hmmm... good to know. I guess it would help if I had read the comments >_> (thank you for pointing that out!)...

By the way, post-facto ๐Ÿ‘ to this revision (Phabricator removes the "approve" option for closed Differentials). Thanks for fixing the test on 32-bit CI.

Np!