Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Weird behavior when computing the hash of a module #1277

@CryptoPascal31

Description

@CryptoPascal31

Issue description

Just had a weird behavior of (hash) when computing the hash of module. The hash is not reproducible and looks like it is disturbed by the state of the REPL.

Maybe this is related to: #1273

Steps to reproduce

In REPL:

(module my-mod G
  (defcap G() true))

(print (hash my-mod))
(print (hash my-mod))

gives:

eaWTzFZbVSOvoJa-UbwV-I3zevAZdLV1d26yr6C4_-U
b7-_hjwbZ3H5Lr5BV1ezqHtL_WFHF7dUtgTAm6_JtLs
Load successful

Let's try again with a slight change (just add an empty printed line between the 2 prints)

(module my-mod G
  (defcap G() true))

(print (hash my-mod))
(print "")
(print (hash my-mod))

gives:

Let's do another try 
ERM0JYQF5_YYf-s10LHUy6WnCJ3G4gIek6qd8JxUgZ0

wYo8EYDWoN3DK7WMMdTQ2jyIj8Nl1jz1fCrYK7AKWKg
Load successful

Expected Behavior

I expect the hash function to be reproducible and all the hashes shouldn't depend on externals factors.

This is not only a theoretical case. Marmalade uses as a token ID, the hash of a structure containing modrefs and may suffer from the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions