Repository navigation
Fix RANDOMX_FLAG_HARD_AES crashing on CPUs without AES - #369
Open
thomasbuilds wants to merge 1 commit into
Open
thomasbuilds wants to merge 1 commit into
thomasbuilds wants to merge 1 commit into
Conversation
hyc
reviewed
Oct 30, 2026
| void VmBase<Allocator, softAes>::allocate() { | ||
| if (datasetPtr == nullptr) | ||
| throw std::invalid_argument("Cache/Dataset not set"); | ||
| #ifdef __riscv |
Collaborator
There was a problem hiding this comment.
Should not duplicate this code.
Use a single #if test, or do something like
#if (bunch of conditions)
#define HAVE_AES_CHECKER
#endif
#ifdef HAVE_AES_CHECKER
...
hyc
requested changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In default builds on x86-64 and ARM64
randomx_create_vmprobes for hardware AES by executing an AES instruction. On a CPU without AESRANDOMX_FLAG_HARD_AEStherefore makes it crash with an illegal instruction instead of returning NULL, whichrandomx.hdocuments for unsupported flags.randomx-benchmarkhits this by default.Where
cpu.hasAes()is reliable (x86-64, and ARM64 on Linux and Apple), this checks it before the probe, as #349 does for RISC-V.