Page MenuHomeFreeBSD

bhnd: remove srand() to produce deterministic output
ClosedPublic

Authored by emaste on Dec 19 2016, 7:29 PM.
Tags
None
Referenced Files
F87097157: D8857.id.diff
Sat, Jun 29, 7:36 AM
F87074730: D8857.id23179.diff
Sat, Jun 29, 12:19 AM
Unknown Object (File)
Thu, Jun 27, 6:46 PM
Unknown Object (File)
Apr 28 2024, 2:47 AM
Unknown Object (File)
Apr 28 2024, 2:46 AM
Unknown Object (File)
Apr 15 2024, 10:25 AM
Unknown Object (File)
Apr 9 2024, 3:12 PM
Unknown Object (File)
Apr 2 2024, 7:43 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.