Page MenuHomeFreeBSD

bhnd: remove srand() to produce deterministic output
ClosedPublic

Authored by emaste on Dec 19 2016, 7:29 PM.
Tags
None
Referenced Files
F148609341: D8857.diff
Thu, Mar 19, 3:11 AM
F148556473: D8857.id.diff
Wed, Mar 18, 5:38 PM
Unknown Object (File)
Wed, Mar 18, 4:08 AM
Unknown Object (File)
Wed, Mar 18, 4:08 AM
Unknown Object (File)
Sat, Mar 14, 2:30 PM
Unknown Object (File)
Jan 20 2026, 3:42 PM
Unknown Object (File)
Jan 9 2026, 5:45 PM
Unknown Object (File)
Jan 7 2026, 11:08 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.