2 ms·
ASLR means that the pointers from malloc (which may come from mmap) are not predictable. Sometimes programs have hash tables which use object identity as key (
by kazinator 2y ago
ASLR means that the pointers from malloc (which may come from mmap) are not predictable.
Sometimes programs have hash tables which use object identity as key (i.e. pointer).
ASLR can cause corresponding objects in different runs of the program to have different pointers, and be ordered differently in an identity hash table.
A program producing some output which depends on this is not necessarily a bug, but becomes a reproducibility issue.
E.g. a compiler might output some object in which a symbol table is ordered by a pointer hash. The difference in order doesn't change the meaning/validity of the object file, but is is seen as the build not having reproduced exactly.
- account42 2y agoThat's just one example of nondeterminism in compilers though - at the end it's the responsibility of the compile to provide options not to do that.
- kazinator 2y agoNot for external causes like ASLR and memory allocators; those things should have their respective options for that.
- account42 2y agoThere is no guarantee that memory allocation is deterministic even without ASLR. If your program is supposed to be deterministic but its output depends on the memory addresses returned by the allocator then your program is buggy.