Bug 1181652 - smlnj varies between builds
Summary: smlnj varies between builds
Status: CONFIRMED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: Current
Hardware: Other All
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Avindra Goolcharan
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-01 14:46 UTC by Bernhard Wiedemann
Modified: 2021-03-02 21:28 UTC (History)
2 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Wiedemann 2021-02-01 14:46:28 UTC
While working on reproducible builds for openSUSE, I found that
our smlnj package varies for each build.

+++ new /usr/lib64/smlnj/lib/xml-lib.cm/.cm/amd64-unix/xml-lib.cm (hex)
@@ -1,4 +1,4 @@
-00000000  ac 24 34 bc 54 ff 03 61  53 35 85 7e 76 45 dd c4  |.$4.T..aS5.~vE..|
+00000000  cc f9 af ec d7 3a 5c c5  24 ac e7 60 af f4 dc d1  |.....:\.$..`....|

@@ -30,7 +30,7 @@
 000001d0  b1 00 00 12 e6 6e b2 00  e4 a2 3c 50 65 72 76 61  |.....n....<Perva|
 000001e0  73 69 76 65 3e 22 ff 86  3c ff 85 13 ff 86 3c 00  |sive>"..<.....<.|
 000001f0  98 18 31 70 ff 81 30 37  47 63 6e c3 42 f0 a2 47  |..1p..07Gcn.B..G|
-00000200  5a ab fb 4e cb f5 f8 8d  78 67 e8 4f 94 24 ed 22  |Z..N....xg.O.$."|
+00000200  5a ab fb 4e cb f5 f9 84  7a 61 e8 4e 94 27 ed 22  |Z..N....za.N.'."|
 00000210  00 f3 e3 a2 58 4d 4c 5f  53 43 48 45 4d 41 22 74  |....XML_SCHEMA"t|


my tools tell me that such files are created by
"/home/abuild/rpmbuild/BUILD/smlnj-110.99/bin/.run/run.amd64-linux", "@SMLcmdname=/home/abuild/rpmbuild/BUILD/smlnj-110.99/bin/sml", "@SMLload=/home/abuild/rpmbuild/BUILD/smlnj-110.99/bin/.heap/sml", "-m", "$smlnj/installer.cm"

Also it is not one of the usual sources of non-determinism.
Maybe from randomness or ASLR?

https://salsa.debian.org/reproducible-builds/reproducible-notes/-/blob/0f182efded/packages.yml#L26854 lists
    - random_order_in_static_libraries
Comment 1 Avindra Goolcharan 2021-03-02 21:28:47 UTC
Confirmed. Saw the issue crop up in another file. This is a snippet from the recent build log after 1 manual rebuild: https://build.opensuse.org/package/live_build_log/devel:tools:compiler/smlnj/openSUSE_Factory/x86_64

```
/usr/lib64/smlnj/bin/.heap/asdlgen.amd64-linux differs at offset '13' (data)
--- old /usr/lib64/smlnj/bin/.heap/asdlgen.amd64-linux (hex)
+++ new /usr/lib64/smlnj/bin/.heap/asdlgen.amd64-linux (hex)
@@ -1,9 +1,9 @@
-00000000  33 22 11 00 04 20 08 09  02 00 00 00 d7 55 00 00  |3"... .......U..|
-00000010  80 ea ac 3b d7 55 00 00  70 27 ac 3b d7 55 00 00  |...;.U..p'.;.U..|
+00000000  33 22 11 00 04 20 08 09  02 00 00 00 56 55 00 00  |3"... ......VU..|
+00000010  80 2a 16 97 56 55 00 00  70 67 15 97 56 55 00 00  |.*..VU..pg..VU..|
 00000020  00 00 00 00 01 00 00 00  05 00 00 00 04 00 00 00  |................|
 00000030  01 00 00 00 0a 00 00 00  02 00 00 00 00 00 08 00  |................|
-00000040  00 00 00 00 01 00 00 00  00 00 00 00 08 00 e0 08  |................|
-00000050  a0 7f 00 00 01 00 00 00  00 00 00 00 24 00 00 00  |............$...|
+00000040  00 00 00 00 01 00 00 00  00 00 00 00 08 00 9c bc  |................|
+00000050  d4 7f 00 00 01 00 00 00  00 00 00 00 24 00 00 00  |............$...|
 00000060  70 02 00 00 43 53 74 72  75 63 74 2e 44 69 76 49  |p...CStruct.DivI|
 00000070  64 00 43 53 74 72 75 63  74 2e 4f 76 65 72 66 6c  |d.CStruct.Overfl|
 00000080  6f 77 49 64 00 43 53 74  72 75 63 74 2e 53 79 73  |owId.CStruct.Sys|
```

Unclear what the source of in-determinism is yet.