mqt-core icon indicating copy to clipboard operation
mqt-core copied to clipboard

✨ An option to disable ASLR

Open burgholzer opened this issue 1 year ago • 2 comments

What's the problem this feature will solve?

The DD package as it is currently implemented relies on the memory addresses of nodes for hashing (pointer-based DD package). Modern compilers and operating systems implement Address Space Layout Randomization (ASLR) as a security measure to randomize the location of code. This, however, leads to non-deterministic behavior of the decision diagram package because different invocations of the same computation are allocated in different memory regions and hence hash values might differ.

Describe the solution you'd like

It would be convenient, especially for debugging, to have an option for disabling ASLR and, thus, enabling reproducible builds. AFAIK, the way to achieve this is platform-specific, but there should be enough about this out there. Ideally, it gets integrated into the cmake/ folder as an additional standalone script.

Note This issue becomes somewhat obsolete if we ever decide to switch to an index-based DD package implementation.

burgholzer avatar Jun 21 '23 11:06 burgholzer

If I recall correctly, ASLR is a feature of the OS and the compiler only cares about PIE (Position Independent Executable) to work with ASLR.

I don't know if disabling PIE helps with this issue.

hillmich avatar Jun 21 '23 12:06 hillmich

That could very well be the case. Although I remember that I got reproducible builds working once on my Intel-based Mac. Don't know about other platforms though.

burgholzer avatar Jun 21 '23 12:06 burgholzer