Commit c4f6077
tools: make code cache and snapshot deterministic
Use a fixed random seed to ensure that the generated sources are
identical across runs.
The final node binary still reseeds itself on start-up so there should
be no security implications caused by predictable random numbers (e.g.,
`Math.random()`, ASLR, the hash seed, etc.)
Fixes: #29108
PR-URL: #29142
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent d4e397a commit c4f6077Copy full SHA for c4f6077
File tree
Expand file treeCollapse file tree
3 files changed
+24
-0
lines changedOpen diff view settings
Filter options
- test/parallel
- tools
- code_cache
- snapshot
Expand file treeCollapse file tree
3 files changed
+24
-0
lines changedOpen diff view settings
Collapse file
test/parallel/test-math-random.js
Copy file name to clipboard+17Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
Collapse file
tools/code_cache/mkcodecache.cc
Copy file name to clipboardExpand all lines: tools/code_cache/mkcodecache.cc+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
| 29 | + |
| 30 | + |
29 | 31 | |
30 | 32 | |
31 | 33 | |
| ||
53 | 55 | |
54 | 56 | |
55 | 57 | |
| 58 | + |
| 59 | + |
| 60 | + |
56 | 61 | |
57 | 62 | |
58 | 63 | |
|
Collapse file
tools/snapshot/node_mksnapshot.cc
Copy file name to clipboardExpand all lines: tools/snapshot/node_mksnapshot.cc+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
19 | 19 | |
20 | 20 | |
21 | 21 | |
| 22 | + |
| 23 | + |
22 | 24 | |
23 | 25 | |
24 | 26 | |
|
0 commit comments