Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of Deterministic Build #44323

Open
joshudson opened this issue Oct 20, 2024 · 0 comments
Open

Failure of Deterministic Build #44323

joshudson opened this issue Oct 20, 2024 · 0 comments
Labels
Area-DotNet Test untriaged Request triage from a team member

Comments

@joshudson
Copy link

joshudson commented Oct 20, 2024

Describe the bug

<Deterministic>true</Deterministic> isn't.

I have hexdumps of the same binary produced by the same tools version on two different machines. They differ; I can't explain everything but most of it traces to emitting the version resource in arbitrary order; and most of the rest appears to be other string constants emitted in arbitrary order too.

To Reproduce

  1. Have Linux-x64 (I am reporting this on Linux-x64 no point looking at Windows)
  2. Checkout project https://github.com/joshudson/Emet/tree/master/FileSystems ; the current commit is 302fe61
  3. Either build patchdosstub (nasm -f bin patchdosstub patchdosstub.asm) or take the reference to it out of the build step. This step is irrelevant to the reproduction but if you don't resolve it one way or the other the build will bomb.
  4. enter FileSystems and run dotnet build -c Release Emet.FileSystems.csproj

Exceptions (if any)

None

Further technical details

dotnet --info machine 1:

.NET SDK:
 Version:           8.0.403
 Commit:            c64aa40a71
 Workload version:  8.0.400-manifests.18f19b92
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     debian
 OS Version:  12
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.403/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      8.0.10
  Architecture: x64
  Commit:       81cabf2857

.NET SDKs installed:
  2.1.818 [/usr/share/dotnet/sdk]
  3.1.426 [/usr/share/dotnet/sdk]
  5.0.408 [/usr/share/dotnet/sdk]
  6.0.427 [/usr/share/dotnet/sdk]
  8.0.403 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.35 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.35 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

dotnet --info machine 2:

NET SDK:
 Version:           8.0.403
 Commit:            c64aa40a71
 Workload version:  8.0.400-manifests.18f19b92
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     debian
 OS Version:  12
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.403/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      8.0.10
  Architecture: x64
  Commit:       81cabf2857

.NET SDKs installed:
  7.0.410 [/usr/share/dotnet/sdk]
  8.0.403 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

IDE: None

Checklist

  • The sequence of command-line parameters.
    • dotnet build -c Release Emet.FileSystems.csproj
  • The contents of the compiler's .rsp response file.
    • N/A
  • The precise version of the compiler used, and its referenced assemblies.
  • Same version number in dotnet --info
  • The current directory path.
  • Debug type is none so current directory doesn't go to output anyway
  • The binary contents of all files explicitly passed to the compiler either directly or indirectly, including:
    • Source files
      • Equivalent: rm -rf Filesystems/bin FileSystems/obj on both followed by tar -cf - Emet.FileSystems | ssh tar -xf -
    • Referenced assemblies
      • Equivalent due to same exact project file
    • Referenced modules
      • Equivalent due to same exact project file
    • Resources
      • Equivalent due to same exact project file
    • The strong name key file
      • None
    • @ response files
      • Equivalent due to same exact project file
    • Analyzers
      • Still at factory defaults on both machines
    • Rulesets
      • Still at factory defaults on both machines
    • Other files that may be used by analyzers
      • Still at factory defaults on both machines
    • The current culture (for the language in which diagnostics and exception messages are produced).
      • EN-US for both
    • The default encoding (or the current code page) if the encoding isn't specified.
      • All input files are 7 bit ASCII
    • The existence, non-existence, and contents of files on the compiler's search paths (specified, for example, by -lib or -recurse).
      • Equivalent due to same exact project file
    • The Common Language Runtime (CLR) platform on which the compiler is run.
      • dotnet --info is the same
    • The value of %LIBPATH%, which can affect analyzer dependency loading.
      • Seems to be a Windows thing; no such environment variable on Linux

Diff

This seems to be the important part of the diff of the hexdump of the files.
I have attached both original hexdumps and the diff in a zip file.hex.zip

@@ -1897,31 +1897,32 @@
 00007690  45 54 20 43 6f 72 65 20  73 75 70 70 6f 72 74 69  |ET Core supporti|
 000076a0  6e 67 20 73 79 6d 62 6f  6c 69 63 20 6c 69 6e 6b  |ng symbolic link|
 000076b0  73 00 00 0c 01 00 07 30  2e 30 2e 35 2e 30 00 00  |s......0.0.5.0..|
-000076c0  0a 01 00 05 30 2e 30 2e  35 00 00 15 01 00 10 45  |....0.0.5......E|
-000076d0  6d 65 74 2e 46 69 6c 65  53 79 73 74 65 6d 73 00  |met.FileSystems.|
-000076e0  00 05 01 00 02 00 00 05  01 00 01 00 00 0a 01 00  |................|
-000076f0  02 00 00 00 01 00 00 00  26 01 00 84 6b 00 00 02  |........&...k...|
-00007700  00 54 02 0d 41 6c 6c 6f  77 4d 75 6c 74 69 70 6c  |.T..AllowMultipl|
-00007710  65 00 54 02 09 49 6e 68  65 72 69 74 65 64 00 26  |e.T..Inherited.&|
-00007720  01 00 4c 14 00 00 02 00  54 02 0d 41 6c 6c 6f 77  |..L.....T..Allow|
-00007730  4d 75 6c 74 69 70 6c 65  00 54 02 09 49 6e 68 65  |Multiple.T..Inhe|
-00007740  72 69 74 65 64 00 0a 01  00 02 00 00 00 02 01 00  |rited...........|
-00007750  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-00007760  10 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-00007770  98 95 00 00 00 00 00 00  00 00 00 00 b2 95 00 00  |............²...|
-00007780  00 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |. ..............|
-00007790  00 00 00 00 00 00 00 00  a4 95 00 00 00 00 00 00  |........¤.......|
-000077a0  00 00 00 00 00 00 5f 43  6f 72 44 6c 6c 4d 61 69  |......_CorDllMai|
-000077b0  6e 00 6d 73 63 6f 72 65  65 2e 64 6c 6c 00 00 00  |n.mscoree.dll...|
-000077c0  00 00 ff 25 00 20 00 10  00 00 00 00 00 00 00 00  |..ÿ%. ..........|
-000077d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-*
+000076c0  33 01 00 2e 30 2e 30 2e  35 2b 33 30 32 66 65 36  |3...0.0.5+302fe6|
+000076d0  31 64 30 62 38 36 31 34  65 32 61 35 37 39 33 30  |1d0b8614e2a57930|
+000076e0  66 63 37 35 63 66 66 61  30 33 34 62 61 33 64 35  |fc75cffa034ba3d5|
+000076f0  63 61 00 00 15 01 00 10  45 6d 65 74 2e 46 69 6c  |ca......Emet.Fil|
+00007700  65 53 79 73 74 65 6d 73  00 00 05 01 00 02 00 00  |eSystems........|
+00007710  05 01 00 01 00 00 0a 01  00 02 00 00 00 01 00 00  |................|
+00007720  00 26 01 00 84 6b 00 00  02 00 54 02 0d 41 6c 6c  |.&...k....T..All|
+00007730  6f 77 4d 75 6c 74 69 70  6c 65 00 54 02 09 49 6e  |owMultiple.T..In|
+00007740  68 65 72 69 74 65 64 00  26 01 00 4c 14 00 00 02  |herited.&..L....|
+00007750  00 54 02 0d 41 6c 6c 6f  77 4d 75 6c 74 69 70 6c  |.T..AllowMultipl|
+00007760  65 00 54 02 09 49 6e 68  65 72 69 74 65 64 00 0a  |e.T..Inherited..|
+00007770  01 00 02 00 00 00 02 01  00 00 00 00 00 00 00 00  |................|
+00007780  00 00 00 00 00 00 00 00  10 00 00 00 00 00 00 00  |................|
+00007790  00 00 00 00 00 00 00 00  c0 95 00 00 00 00 00 00  |........À.......|
+000077a0  00 00 00 00 da 95 00 00  00 20 00 00 00 00 00 00  |....Ú.... ......|
+000077b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+000077c0  cc 95 00 00 00 00 00 00  00 00 00 00 00 00 5f 43  |Ì............._C|
+000077d0  6f 72 44 6c 6c 4d 61 69  6e 00 6d 73 63 6f 72 65  |orDllMain.mscore|
+000077e0  65 2e 64 6c 6c 00 00 00  00 00 ff 25 00 20 00 10  |e.dll.....ÿ%. ..|
+000077f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00007800  00 00 00 00 00 00 00 00  00 00 00 00 00 00 01 00  |................|
 00007810  10 00 00 00 18 00 00 80  00 00 00 00 00 00 00 00  |................|
 00007820  00 00 00 00 00 00 01 00  01 00 00 00 30 00 00 80  |............0...|
 00007830  00 00 00 00 00 00 00 00  00 00 00 00 00 00 01 00  |................|
-00007840  00 00 00 00 48 00 00 00  58 a0 00 00 fc 03 00 00  |....H...X ..ü...|
-00007850  00 00 00 00 00 00 00 00  fc 03 34 00 00 00 56 00  |........ü.4...V.|
+00007840  00 00 00 00 48 00 00 00  58 a0 00 00 50 04 00 00  |....H...X ..P...|
+00007850  00 00 00 00 00 00 00 00  50 04 34 00 00 00 56 00  |........P.4...V.|
 00007860  53 00 5f 00 56 00 45 00  52 00 53 00 49 00 4f 00  |S._.V.E.R.S.I.O.|
 00007870  4e 00 5f 00 49 00 4e 00  46 00 4f 00 00 00 00 00  |N._.I.N.F.O.....|
 00007880  bd 04 ef fe 00 00 01 00  00 00 00 00 00 00 05 00  |½.ïþ............|
@@ -1931,9 +1932,9 @@
 000078c0  46 00 69 00 6c 00 65 00  49 00 6e 00 66 00 6f 00  |F.i.l.e.I.n.f.o.|
 000078d0  00 00 00 00 24 00 04 00  00 00 54 00 72 00 61 00  |....$.....T.r.a.|
 000078e0  6e 00 73 00 6c 00 61 00  74 00 69 00 6f 00 6e 00  |n.s.l.a.t.i.o.n.|
-000078f0  00 00 00 00 00 00 b0 04  5c 03 00 00 01 00 53 00  |......°.\.....S.|
+000078f0  00 00 00 00 00 00 b0 04  b0 03 00 00 01 00 53 00  |......°.°.....S.|
 00007900  74 00 72 00 69 00 6e 00  67 00 46 00 69 00 6c 00  |t.r.i.n.g.F.i.l.|
-00007910  65 00 49 00 6e 00 66 00  6f 00 00 00 38 03 00 00  |e.I.n.f.o...8...|
+00007910  65 00 49 00 6e 00 66 00  6f 00 00 00 8c 03 00 00  |e.I.n.f.o.......|
 00007920  01 00 30 00 30 00 30 00  30 00 30 00 34 00 62 00  |..0.0.0.0.0.4.b.|
 00007930  30 00 00 00 ac 00 4a 00  01 00 43 00 6f 00 6d 00  |0...¬.J...C.o.m.|
 00007940  6d 00 65 00 6e 00 74 00  73 00 00 00 52 00 65 00  |m.e.n.t.s...R.e.|
@@ -1978,17 +1979,22 @@
 00007bb0  72 00 6f 00 64 00 75 00  63 00 74 00 4e 00 61 00  |r.o.d.u.c.t.N.a.|
 00007bc0  6d 00 65 00 00 00 00 00  45 00 6d 00 65 00 74 00  |m.e.....E.m.e.t.|
 00007bd0  2e 00 46 00 69 00 6c 00  65 00 53 00 79 00 73 00  |..F.i.l.e.S.y.s.|
-00007be0  74 00 65 00 6d 00 73 00  00 00 00 00 30 00 06 00  |t.e.m.s.....0...|
+00007be0  74 00 65 00 6d 00 73 00  00 00 00 00 82 00 2f 00  |t.e.m.s......./.|
 00007bf0  01 00 50 00 72 00 6f 00  64 00 75 00 63 00 74 00  |..P.r.o.d.u.c.t.|
 00007c00  56 00 65 00 72 00 73 00  69 00 6f 00 6e 00 00 00  |V.e.r.s.i.o.n...|
-00007c10  30 00 2e 00 30 00 2e 00  35 00 00 00 38 00 08 00  |0...0...5...8...|
-00007c20  01 00 41 00 73 00 73 00  65 00 6d 00 62 00 6c 00  |..A.s.s.e.m.b.l.|
-00007c30  79 00 20 00 56 00 65 00  72 00 73 00 69 00 6f 00  |y. .V.e.r.s.i.o.|
-00007c40  6e 00 00 00 30 00 2e 00  30 00 2e 00 35 00 2e 00  |n...0...0...5...|
-00007c50  30 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |0...............|
-00007c60  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00007c10  30 00 2e 00 30 00 2e 00  35 00 2b 00 33 00 30 00  |0...0...5.+.3.0.|
+00007c20  32 00 66 00 65 00 36 00  31 00 64 00 30 00 62 00  |2.f.e.6.1.d.0.b.|
+00007c30  38 00 36 00 31 00 34 00  65 00 32 00 61 00 35 00  |8.6.1.4.e.2.a.5.|
+00007c40  37 00 39 00 33 00 30 00  66 00 63 00 37 00 35 00  |7.9.3.0.f.c.7.5.|
+00007c50  63 00 66 00 66 00 61 00  30 00 33 00 34 00 62 00  |c.f.f.a.0.3.4.b.|
+00007c60  61 00 33 00 64 00 35 00  63 00 61 00 00 00 00 00  |a.3.d.5.c.a.....|
+00007c70  38 00 08 00 01 00 41 00  73 00 73 00 65 00 6d 00  |8.....A.s.s.e.m.|
+00007c80  62 00 6c 00 79 00 20 00  56 00 65 00 72 00 73 00  |b.l.y. .V.e.r.s.|
+00007c90  69 00 6f 00 6e 00 00 00  30 00 2e 00 30 00 2e 00  |i.o.n...0...0...|
+00007ca0  35 00 2e 00 30 00 00 00  00 00 00 00 00 00 00 00  |5...0...........|
+00007cb0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-DotNet Test untriaged Request triage from a team member labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DotNet Test untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant