[rb-general] Addresses in (I)Python output

Ludovic Courtès ludo at gnu.org
Sat Sep 28 09:57:52 UTC 2019


Hello,

"Rebecca N. Palmer via rb-general"
<rb-general at lists.reproducible-builds.org> skribis:

> In Python, objects that don't have an explicit string representation
> have a default one that includes their memory address, which is very
> likely to vary from run to run:
>
>>>> lambda x:x
> <function <lambda> at 0x7f80c9f937b8>

Naive question: if you disable address space layout randomization (ASLR)
with personality(2) or by running:

  setarch -R python …

with the exact same inputs, do you get the exact same addresses?

For Guile (which also uses a garbage collector), that seems to work.
For example, this program allocates a fresh list on the GC-managed heap
and prints its address:

--8<---------------cut here---------------start------------->8---
$ setarch -R guile -c '(pk (object-address (list 1 2)))'

;;; (140737313893328)
$ setarch -R guile -c '(pk (object-address (list 1 2)))'

;;; (140737313893328)
--8<---------------cut here---------------end--------------->8---

Thanks,
Ludo’.


More information about the rb-general mailing list