Page MenuHomeFreeBSD

bhnd: remove srand() to produce deterministic output
ClosedPublic

Authored by emaste on Dec 19 2016, 7:29 PM.
Tags
None
Referenced Files
F105779250: D8857.diff
Fri, Dec 20, 2:07 PM
Unknown Object (File)
Nov 12 2024, 8:54 PM
Unknown Object (File)
Nov 2 2024, 12:39 PM
Unknown Object (File)
Oct 31 2024, 7:38 AM
Unknown Object (File)
Oct 31 2024, 5:43 AM
Unknown Object (File)
Oct 17 2024, 11:45 AM
Unknown Object (File)
Oct 5 2024, 12:30 AM
Unknown Object (File)
Sep 17 2024, 2:27 PM

Details

Summary

nvram_map_gen.awk uses rand() in its qsort implementation, to select the pivot. This results in non-deterministic output, presumably because one of the arrays has elements that compare identical but are in fact not.

A better fix may be to improve the comparison, so that no elements compare identical.

PR: 215422

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to bhnd: remove srand() to produce deterministic output.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a reviewer: landonf.
emaste added subscribers: lidl, gjb, adrian.

Need for this change obviated by D8859, although it's probably still sensible to make this change and have completely deterministic operation.

landonf edited edge metadata.
This revision is now accepted and ready to land.Dec 20 2016, 1:27 AM
This revision was automatically updated to reflect the committed changes.