-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
tools: make code cache and snapshot deterministic #29142
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
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: nodejs#29108
@@ -26,6 +26,8 @@ int wmain(int argc, wchar_t* argv[]) { | |||
int main(int argc, char* argv[]) { | |||
#endif // _WIN32 | |||
|
|||
v8::V8::SetFlagsFromString("--random_seed=42"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IEEE 1149.5 specifies 4 as the random number.
Hrm, looks like retrieval from the cache fails unless node is also started with I can work around that by resetting |
also @nodejs/v8 |
pummel/test-hash-seed: https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/8546/ |
@bnoordhuis Would I be correct to conclude from the above comments that this shouldn't land yet? |
@Trott I incorporated the necessary fixes. bnoordhuis/io.js@ed2c673 is the fix but the timestamp may be throwing off GH because it shows up before my comment. |
Landed in 5116a6a |
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>
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>
@bnoordhuis Yes, I can confirm that this fixes the issue. Thanks! |
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