News for hackers. Stuff that matters.
Re:Debian bookworm live images now reproducible by koolba on Wednesday March 26, 2025 @02:19PM (#43485157)
ASLR shouldn’t be an issue unless you intend to capture the entire memory state of the application. It’s an intermediate representation in memory, not an output of any given step of a build.

Annoying edge cases come up for things like internal object serialization to sort things like JSON keys in config files.

Re:Debian bookworm live images now reproducible by sodality2 on Wednesday March 26, 2025 @03:17PM (#43485872)
Let’s say a compiler is doing something in a multi-threaded manner - isn’t it possible that ASLR would affect the ordering of certain events which could change the compiled output? Sure you could just set threads to 1 but there’s probably some more edge cases in there I haven’t thought of.
Re:Debian bookworm live images now reproducible by zamadatix on Wednesday March 26, 2025 @03:36PM (#43486161)
I think you'd need the compiler to guarantee serialization order of such operations regardless if you used ASLR or not. Otherwise you're just hoping thread scheduling, core clocking, thread memory access, and many other things are the same between every system trying to do a reproducible build. Even setting threads to 1 may not solve that problem class if asynchronous functions/syscalls come into play.
Re:Debian bookworm live images now reproducible by cperciva on Wednesday March 26, 2025 @06:58PM (#43488447)
FreeBSD tripped over an issue recently where a C++ program (I think clang?) used a collection of pointers and output values in an order based on the pointers rather than the values they pointed to.

ASLR by itself shouldn't cause reproducibility issues, but it can certainly expose bugs.

Re:Debian bookworm live images now reproducible by ahartmetz on Thursday March 27, 2025 @08:35AM (#43492945)
It is sometimes just fine to have a hash table with pointers as keys. It is by design an unordered collection, so you do not care about the order, only about finding entries.

Then at some point you happen to need all the entries, you iterate, and you get a random order. Which is not necessarily a problem unless you want reproducible builds, which is just a new requirement, not exposing a latent bug.

Re:Debian bookworm live images now reproducible by kazinator on Wednesday March 26, 2025 @10:13PM (#43489756)
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.

Re:Debian bookworm live images now reproducible by account42 on Thursday March 27, 2025 @08:09AM (#43492749)
That'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.
Re:Debian bookworm live images now reproducible by kazinator on Thursday March 27, 2025 @12:14PM (#43495112)
[delayed]
Re:Debian bookworm live images now reproducible by account42 on Friday March 28, 2025 @05:02AM (#43503110)
There 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.