Commit 6f2cf18
authored
Fix an over-eager determinizer hack breaking overlay fuzzer (#5282)
We have a little hack in Random.cpp that routes to the
semi-deterministic global PRNG for drawing random bytes when we're in a
fuzzer build. This helps reduce pointless nondeterminism, but we've also
in the meantime made the global PRNG main-thread-only (sensibly!) and so
this actually hits an assert.
The simplest fix -- and I think entirely adequate since this is a
fuzzer-only hack anyways -- is to only do the diversion on the main
thread, and let non-main threads (of which there are only a small number
of callers, mostly those generating random filenames) keep using the
normal-build path of accessing true entropy.1 file changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | | - | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
0 commit comments