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

nondeterministic ordering in rmeta section #113584

Closed
fangism opened this issue Jul 11, 2023 · 14 comments
Closed

nondeterministic ordering in rmeta section #113584

fangism opened this issue Jul 11, 2023 · 14 comments
Labels
A-metadata Area: Crate metadata A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fangism
Copy link

fangism commented Jul 11, 2023

We are running determinism checks on rustc outputs in our build infrastructure, basically running a rustc action twice in a row (backing up outputs from the first run) and comparing outputs. We have found that in one of our build environments (not directly accessible), this determinism check fails rather reliably on the same targets, while the exact same compilation appears deterministic in another local environment, and is thus difficult to manually reproduce.

We have been able to save and retrieve difference-pairs of rlibs when the determinism check fails, and need help determining the nature of the differences. So far we have determined that the differences lie in the rmeta section of the rlibs, but we do not understand the meaning or origin of these differences. This is where we need help. Identifying these content difference may help us create more reliably reproducible test cases to follow up with.

I will attach one pair of such rlibs shortly, with some more details.

@fangism fangism added the C-bug Category: This is a bug. label Jul 11, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 11, 2023
@fangism
Copy link
Author

fangism commented Jul 11, 2023

nondeterministic.zip

@fangism
Copy link
Author

fangism commented Jul 11, 2023

The zip file contains two rlibs that were produced by consecutive runs of the command (and renamed in the archive):

RUST_BACKTRACE=1 ../../prebuilt/third_party/rust/linux-x64/bin/rustc --color=always --crate-name openthread_fuchsia ../../src/connectivity/lowpan/lib/openthread_fuchsia/src/lib.rs --crate-type rlib --emit=dep-info=obj/src/connectivity/lowpan/lib/openthread_fuchsia/libopenthread_fuchsia.rlib.d,link -Zdep-info-omit-d-target --remote-flag=--label=\'//src/connectivity/lowpan/lib/openthread_fuchsia:openthread_fuchsia.actual\(//build/toolchain/fuchsia:x64\)\' --cfg=fidl_rust_transition_step=\"migrate_all_results\" --cfg=__rust_toolchain=\"dblnU3tEhEv7oy3yIm63PMqD3dsqu8htntNrnj3hkd0C\" -L gen/zircon/public/sysroot/cpp/lib -Clinker=../../prebuilt/third_party/clang/linux-x64/bin/lld -Clink-arg=--sysroot=gen/zircon/public/sysroot/cpp -Clink-arg=-L../../prebuilt/third_party/clang/linux-x64/bin/../lib/x86_64-unknown-fuchsia -Clink-arg=-L../../prebuilt/third_party/clang/linux-x64/lib/clang/17/lib/x86_64-unknown-fuchsia -Clink-arg=--pack-dyn-relocs=relr -Clink-arg=-dynamic-linker=ld.so.1 -Clink-arg=--icf=all -Clink-arg=-zrel -Ccodegen-units=1 -Zremap-cwd-prefix=. -Cforce-frame-pointers -Copt-level=1 -Cdebuginfo=2 -Zallow-features= --target x86_64-fuchsia --cap-lints=deny -Wrust-2018-idioms -Dderef-nullptr -Dinvalid-value -Dunused-must-use -Awhere_clauses_object_safety -Dwarnings -Cdebug-assertions=yes -Cprefer-dynamic -Clink-args=-zstack-size=0x200000 -Cpanic=abort -Cforce-unwind-tables=yes -Zpanic_abort_tests -Csymbol-mangling-version=v0 -Wunused_crate_dependencies -Dunused_results -Aunused_results -Clink-args=--push-state\ -Bstatic\ -lc++\ -Bdynamic\ -lm\ --pop-state\ -l:libunwind.a -Wclippy::all --edition=2021 --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false --remote-flag=--canonicalize_working_dir=false -o obj/src/connectivity/lowpan/lib/openthread_fuchsia/libopenthread_fuchsia.rlib -Ldependency=obj/sdk/fidl/fuchsia.net/fuchsia.net_rust -Ldependency=obj/src/lib/fidl/rust/fidl -Ldependency=obj/src/lib/fuchsia-async -Ldependency=host_x64/obj/src/lib/fuchsia-async-macro -Ldependency=obj/third_party/rust_crates -Ldependency=host_x64/obj/third_party/rust_crates -Ldependency=obj/src/lib/zircon/rust -Ldependency=obj/zircon/vdso/zx_zither.rust_syscall -Ldependency=obj/sdk/fidl/fuchsia.net.mdns/fuchsia.net.mdns_rust -Ldependency=obj/zircon/vdso/zx/zx_rust -Ldependency=obj/src/connectivity/lowpan/lib/lowpan_driver_common -Ldependency=obj/sdk/fidl/fuchsia.factory.lowpan/fuchsia.factory.lowpan_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan/fuchsia.lowpan_rust -Ldependency=obj/sdk/fidl/fuchsia.hardware.network/fuchsia.hardware.network_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan.device/fuchsia.lowpan.device_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan.driver/fuchsia.lowpan.driver_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan.experimental/fuchsia.lowpan.experimental_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan.test/fuchsia.lowpan.test_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan.thread/fuchsia.lowpan.thread_rust -Ldependency=obj/sdk/fidl/fuchsia.lowpan.spinel/fuchsia.lowpan.spinel_rust -Ldependency=obj/sdk/fidl/fuchsia.net.interfaces/fuchsia.net.interfaces_rust -Ldependency=obj/sdk/fidl/fuchsia.net.interfaces.admin/fuchsia.net.interfaces.admin_rust -Ldependency=obj/sdk/fidl/fuchsia.net.stack/fuchsia.net.stack_rust -Ldependency=obj/sdk/fidl/fuchsia.net.name/fuchsia.net.name_rust -Ldependency=obj/sdk/fidl/fuchsia.net.tun/fuchsia.net.tun_rust -Ldependency=obj/src/connectivity/lib/fidl_fuchsia_net_stack_ext -Ldependency=obj/src/lib/network/fidl_fuchsia_net_ext -Ldependency=obj/src/connectivity/lib/net-types -Ldependency=host_x64/obj/src/connectivity/lib/net-types -Ldependency=obj/src/connectivity/lib/net-declare -Ldependency=host_x64/obj/src/connectivity/lib/net-declare -Ldependency=obj/src/connectivity/lib/packet-formats -Ldependency=obj/src/connectivity/lib/internet-checksum -Ldependency=obj/src/connectivity/network/lib/explicit -Ldependency=obj/src/lib/network/packet -Ldependency=obj/src/connectivity/network/netstack3/core/fakestd -Ldependency=obj/src/connectivity/lowpan/lib/openthread_sys -Ldependency=obj/src/connectivity/lowpan/lib/spinel_pack -Ldependency=host_x64/obj/src/connectivity/lowpan/lib/spinel_pack/spinel_pack_macros -Ldependency=obj/src/lib/fuchsia-component -Ldependency=obj/sdk/fidl/fuchsia.component/fuchsia.component_rust -Ldependency=obj/sdk/fidl/fuchsia.component.decl/fuchsia.component.decl_rust -Ldependency=obj/sdk/fidl/fuchsia.data/fuchsia.data_rust -Ldependency=obj/sdk/fidl/fuchsia.io/fuchsia.io_rust -Ldependency=obj/sdk/fidl/fuchsia.unknown/fuchsia.unknown_rust -Ldependency=obj/sdk/fidl/fuchsia.url/fuchsia.url_rust -Ldependency=obj/sdk/fidl/fuchsia.process/fuchsia.process_rust -Ldependency=obj/sdk/fidl/fuchsia.ldsvc/fuchsia.ldsvc_rust -Ldependency=obj/src/lib/fdio/rust -Ldependency=obj/src/lib/fuchsia-runtime -Ldependency=obj/src/lib/fuchsia-fs -Ldependency=obj/src/lib/storage/vfs/rust -Ldependency=obj/sdk/fidl/fuchsia.mem/fuchsia.mem_rust -Ldependency=host_x64/obj/src/lib/storage/vfs/rust/macros -Ldependency=obj/src/lib/trace/rust -Ldependency=obj/src/lib/cstr -Ldependency=obj/src/lib/network/fidl_fuchsia_net_interfaces_ext -Ldependency=obj/src/lib/async-utils -Ldependency=obj/src/lib/fidl_table_validation -Ldependency=host_x64/obj/src/lib/fidl_table_validation/fidl_table_validation_derive -Ldependency=obj/src/connectivity/lowpan/lib/openthread_rust -Ldependency=obj/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics_rust -Lnative=obj/third_party/openthread/src/cli -Lnative=obj/third_party/openthread/src/core -Lnative=obj/third_party/openthread/third_party/mbedtls -Lnative=obj/third_party/openthread/src/ncp -Lnative=obj/third_party/openthread/src/lib/spinel -Lnative=obj/third_party/openthread/src/lib/platform -Lnative=x64-asan-ubsan-shared/link_stub -Lnative=obj/sdk/lib/fidl_base -Lnative=obj/sdk/lib/fit -Lnative=obj/sdk/lib/stdcompat -Lnative=obj/sdk/lib/utf-utils -Lnative=obj/zircon/system/ulib/zx -Lnative=obj/sdk/lib/fidl -Lnative=obj/sdk/lib/fidl/cpp/wire -Lnative=obj/zircon/system/ulib/async -Lnative=obj/sdk/lib/fit-promise -Lnative=obj/zircon/system/ulib/sync -Lnative=obj/zircon/system/ulib/zircon-internal -Lnative=obj/zircon/system/ulib/fbl -Lnative=obj/src/lib/fsl -Lnative=obj/zircon/system/ulib/fzl -Lnative=obj/third_party/modp_b64 -Lnative=obj/zircon/system/ulib/async-loop -Lnative=x64-shared/link_stub -Lnative=obj/zircon/system/ulib/svc -Lnative=obj/src/lib/storage/vfs/cpp -Lnative=obj/zircon/system/ulib/trace -Clink-arg=-Bdynamic -Clink-arg=obj/third_party/openthread/src/cli/libopenthread-cli-ftd.a -Clink-arg=obj/third_party/openthread/src/core/libopenthread-ftd.a -Clink-arg=obj/third_party/openthread/third_party/mbedtls/libmbedtls.a -Clink-arg=obj/third_party/openthread/src/ncp/libopenthread-ncp-ftd.a -Clink-arg=obj/third_party/openthread/src/lib/spinel/libopenthread-spinel-ncp.a -Clink-arg=obj/third_party/openthread/src/lib/platform/libopenthread-platform.a -Clink-arg=x64-asan-ubsan-shared/link_stub/libtrace-engine.so -Clink-arg=obj/sdk/lib/fidl_base/libfidl_base.a -Clink-arg=obj/sdk/lib/fit/libfit.a -Clink-arg=obj/sdk/lib/stdcompat/libstdcompat.a -Clink-arg=obj/sdk/lib/utf-utils/libutf-utils.a -Clink-arg=obj/zircon/system/ulib/zx/libzx.a -Clink-arg=obj/sdk/lib/fidl/libfidl.a -Clink-arg=obj/sdk/lib/fidl/cpp/wire/libwire.a -Clink-arg=obj/zircon/system/ulib/async/libasync.a -Clink-arg=obj/sdk/lib/fit-promise/libfit-promise.a -Clink-arg=obj/zircon/system/ulib/sync/libsync.a -Clink-arg=obj/zircon/system/ulib/zircon-internal/libzircon-internal.a -Clink-arg=obj/zircon/system/ulib/async/libasync-cpp.a -Clink-arg=x64-asan-ubsan-shared/link_stub/libasync-default.so -Clink-arg=x64-asan-ubsan-shared/link_stub/libfdio.so -Clink-arg=obj/zircon/system/ulib/fbl/libfbl.a -Clink-arg=obj/src/lib/fsl/libfsl.a -Clink-arg=obj/zircon/system/ulib/fzl/libfzl.a -Clink-arg=obj/third_party/modp_b64/libmodp_b64.a -Clink-arg=obj/zircon/system/ulib/async-loop/libasync-loop-cpp.a -Clink-arg=obj/zircon/system/ulib/async-loop/libasync-loop.a -Clink-arg=obj/zircon/system/ulib/async-loop/libasync-loop-default.a -Clink-arg=x64-shared/link_stub/libasync-default.so -Clink-arg=obj/zircon/system/ulib/svc/libsvc.a -Clink-arg=obj/src/lib/storage/vfs/cpp/libcpp.a -Clink-arg=obj/zircon/system/ulib/trace/libtrace.a -Lnative=gen/src/zircon/lib/zircon/zircon.x86_64 -Clink-arg=gen/src/zircon/lib/zircon/zircon.x86_64/libzircon.so --extern fidl_fuchsia_net=obj/sdk/fidl/fuchsia.net/fuchsia.net_rust/libfidl_fuchsia_net.rlib --extern fidl=obj/src/lib/fidl/rust/fidl/libfidl.rlib --extern fuchsia_async=obj/src/lib/fuchsia-async/libfuchsia_async.rlib --extern futures=obj/third_party/rust_crates/libfutures-e6516813fcd2ea59.rlib --extern fuchsia_zircon=obj/src/lib/zircon/rust/libfuchsia_zircon.rlib --extern socket2=obj/third_party/rust_crates/libsocket2-eb52e051ac66cd02.rlib --extern thiserror=obj/third_party/rust_crates/libthiserror-dcdc66d3bbb690d3.rlib --extern tracing=obj/third_party/rust_crates/libtracing-5bf51f3eb026ae27.rlib --extern fidl_fuchsia_net_mdns=obj/sdk/fidl/fuchsia.net.mdns/fuchsia.net.mdns_rust/libfidl_fuchsia_net_mdns.rlib --extern lowpan_driver_common=obj/src/connectivity/lowpan/lib/lowpan_driver_common/liblowpan_driver_common.rlib --extern anyhow=obj/third_party/rust_crates/libanyhow-6015da1b46818404.rlib --extern openthread_sys=obj/src/connectivity/lowpan/lib/openthread_sys/libopenthread_sys.rlib --extern spinel_pack=obj/src/connectivity/lowpan/lib/spinel_pack/libspinel_pack.rlib --extern fuchsia_component=obj/src/lib/fuchsia-component/libfuchsia_component.rlib --extern hex=obj/third_party/rust_crates/libhex-67ad4b3000c63154.rlib --extern openthread=obj/src/connectivity/lowpan/lib/openthread_rust/libopenthread.rlib

Running llvm-objdump on both rlibs and diff-ing them produces:

$ diff -u <(../fuchsia/fuchsia/prebuilt/third_party/clang/linux-x64/bin/llvm-objdump --full-contents libotf1.rlib) <(../fuchsia/fuchsia/prebuilt/third_party/clang/linux-x64/bin/llvm-objdump --full-contents libotf2.rlib)
--- /dev/fd/63	2023-07-11 18:50:47.875147356 +0000
+++ /dev/fd/62	2023-07-11 18:50:47.875147356 +0000
@@ -1,5 +1,5 @@
 
-libotf1.rlib(lib.rmeta):	file format elf64-x86-64
+libotf2.rlib(lib.rmeta):	file format elf64-x86-64
 Contents of section .note.gnu.property:
  0000 04000000 10000000 05000000 474e5500  ............GNU.
  0010 020000c0 04000000 03000000 00000000  ................
@@ -44829,20 +44829,20 @@
  af160 00d60101 070002d1 0d00d601 01070002  ................
  af170 d10d00d6 01050700 02d30d00 e3010107  ................
  af180 00024322 51586191 01ee01f4 014fa602  ..C"QXa......O..
- af190 85012f54 b202bd02 12000f6f 70656e74  ../T.......opent
- af1a0 68726561 645f7275 7374c101 00018059  hread_rust.....Y
- af1b0 01000013 6f70656e 74687265 61645f72  ....openthread_r
- af1c0 7573743a 3a6f74c1 00000011 506c6174  ust::ot.....Plat
- af1d0 666f726d 3a3a6275 696c6465 72c10000  form::builder...
- af1e0 019ae32b 00000180 59020000 226f7065  ...+....Y..."ope
- af1f0 6e746872 6561645f 72757374 3a3a6f74  nthread_rust::ot
- af200 3a3a496e 7374616e 63653a3a 6e6577c1  ::Instance::new.
- af210 010001ec e32b0200 01b3e32b 010001cb  .....+.....+....
- af220 e32b0200 001d6f70 656e7468 72656164  .+....openthread
- af230 5f727573 743a3a6f 743a3a49 6e737461  _rust::ot::Insta
- af240 6e6365c1 010001a5 e42b0200 01b3e32b  nce......+.....+
- af250 0200019a e32b0200 01805900 01000100  .....+....Y.....
- af260 ac0201ec e32b0000 01cbe32b 010001a5  .....+.....+....
+ af190 85012f54 b202bd02 12001d6f 70656e74  ../T.......opent
+ af1a0 68726561 645f7275 73743a3a 6f743a3a  hread_rust::ot::
+ af1b0 496e7374 616e6365 c1010001 80590100  Instance.....Y..
+ af1c0 00226f70 656e7468 72656164 5f727573  ."openthread_rus
+ af1d0 743a3a6f 743a3a49 6e737461 6e63653a  t::ot::Instance:
+ af1e0 3a6e6577 c1000000 11506c61 74666f72  :new.....Platfor
+ af1f0 6d3a3a62 75696c64 6572c101 0001e8e3  m::builder......
+ af200 2b020001 80590200 019ae32b 0000000f  +....Y.....+....
+ af210 6f70656e 74687265 61645f72 757374c1  openthread_rust.
+ af220 0100018f e42b0200 01c1e32b 02000013  .....+.....+....
+ af230 6f70656e 74687265 61645f72 7573743a  openthread_rust:
+ af240 3a6f74c1 010001af e42b0200 01e8e32b  :ot......+.....+
+ af250 00000180 59000100 0100ac02 019ae32b  ....Y..........+
+ af260 0200018f e42b0000 01c1e32b 010001af  .....+.....+....
  af270 e42b0000 154402c9 6015201a 0915611e  .+...D..`. ...a.
  af280 1b1e111e 191e1416 a20316c7 0416c125  ...............%
  af290 16b51416 fb1a16b3 2d16902d 16ae2d16  ........-..-..-.
@@ -68050,7 +68050,7 @@
  0020 74727461 62002e73 796d7461 62002e72  trtab..symtab..r
  0030 6d657461 00                          meta.
 
-libotf1.rlib(libopenthread_fuchsia.openthread_fuchsia.6f211ea536ce9cdf-cgu.0.rcgu.o):	file format elf64-x86-64
+libotf2.rlib(libopenthread_fuchsia.openthread_fuchsia.6f211ea536ce9cdf-cgu.0.rcgu.o):	file format elf64-x86-64
 Contents of section .strtab:
  0000 006d656d 63707900 5f524e76 4d73635f  .memcpy._RNvMsc_
  0010 4e744373 31736a36 4e397447 6438725f  NtCs1sj6N9tGd8r_

truncated diff of "assembly" just to show that the section of interest is rmeta:

 diff -u <(../fuchsia/fuchsia/prebuilt/third_party/clang/linux-x64/bin/llvm-objdump --disassemble-all libotf1.rlib) <(../fuchsia/fuchsia/prebuilt/third_party/clang/linux-x64/bin/llvm-objdump --disassemble-all libotf2.rlib)
--- /dev/fd/63	2023-07-11 19:12:15.178842024 +0000
+++ /dev/fd/62	2023-07-11 19:12:15.182842348 +0000
@@ -1,5 +1,5 @@
 
-libotf1.rlib(lib.rmeta):	file format elf64-x86-64
+libotf2.rlib(lib.rmeta):	file format elf64-x86-64
 
 Disassembly of section .note.gnu.property:
 
@@ -274986,7 +274986,7 @@
    af18a: 01 f4                        	addl	%esi, %esp
    af18c: 01 4f a6                     	addl	%ecx, -0x5a(%rdi)
    af18f: 02 85 01 2f 54 b2            	addb	-0x4dabd0ff(%rbp), %al
-   af195: 02 bd 02 12 00 0f            	addb	0xf001202(%rbp), %bh
+   af195: 02 bd 02 12 00 1d            	addb	0x1d001202(%rbp), %bh
    af19b: 6f                           	outsl	(%rsi), %dx
    af19c: 70 65                        	jo	0xaf203 <.rmeta+0xaf203>
    af19e: 6e                           	outsb	(%rsi), %dx

diff of strings:

$ diff -u <(strings libotf1.rlib) <(strings libotf2.rlib)
--- /dev/fd/63	2023-07-11 12:13:01.497722323 -0700
+++ /dev/fd/62	2023-07-11 12:13:01.501722285 -0700
@@ -4010,11 +4010,11 @@
 __formatter
 ( ze
 C"QXa
+openthread_rust::ot::Instance
+"openthread_rust::ot::Instance::new
+Platform::builder
 openthread_rust
 openthread_rust::ot
-Platform::builder
-"openthread_rust::ot::Instance::new
-openthread_rust::ot::Instance
 p1,L
 %t-1
 !ovH[

It appears that something in the rmeta section is ordered nondeterminstically.
Can someone describe what is happening?

@fangism
Copy link
Author

fangism commented Jul 11, 2023

Version info:

$ prebuilt/third_party/rust/linux-x64/bin/rustc --version
rustc 1.72.0-nightly (75726cae3 2023-06-28)

@saethlin saethlin added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 12, 2023
@workingjubilee workingjubilee added the A-reproducibility Area: Reproducible / deterministic builds label Jul 12, 2023
@lqd
Copy link
Member

lqd commented Jul 13, 2023

btw rlibs are archive files, so you can just ar -x my.rlib lib.rmeta to simplify your diffing

@fangism
Copy link
Author

fangism commented Jul 14, 2023

After extracting to libotf1.lib.rmeta and libotf2.lib.rmeta using ar x (attached), the objdump-diff looks the same as the above comment.

nondeterministic-rmeta.zip

$ sha256sum libotf1.lib.rmeta libotf2.lib.rmeta 
1a32d69f37fe98ae269a69edd1d4b0090cb369dc4bd1c14b473dd8952ce0c112  libotf1.lib.rmeta
3f38f6563e4c034ccd31fb0a9218f8aa4225d7aa25ff8d9eecdada4dccec449e  libotf2.lib.rmeta

I still need a way to look inside, human-readably.

@fangism
Copy link
Author

fangism commented Jul 17, 2023

Can we identify the code that emits the difference parts of the rmeta?

@saethlin
Copy link
Member

I suspect working this down to a smaller reproducer will be a better first step. If minimizing it can deduce what aspect of the input program is tripping the nondet, that would probably make fixing this much easier.

Perhaps https://github.com/Nilstrieb/cargo-minimize can help?

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 23, 2023
@saethlin saethlin added the A-metadata Area: Crate metadata label Jul 24, 2023
@fangism
Copy link
Author

fangism commented Jul 24, 2023

I suspect working this down to a smaller reproducer will be a better first step. If minimizing it can deduce what aspect of the input program is tripping the nondet, that would probably make fixing this much easier.

Perhaps https://github.com/Nilstrieb/cargo-minimize can help?

Auto-reducing doesn't work well with nondeterministic behavior. If we had some clue about what the rmeta differences are, we might be able to attempt to manually reduce or exercise the compiler in ways that increase the likelihood of reproducing.

@fangism
Copy link
Author

fangism commented Aug 1, 2023

Can anyone look inside the rmeta files attached in the above comment and describe the difference?

@lxy19980601
Copy link
Contributor

We had the same problem, using version 1.72.0 of rustc. After verification using current version(1.75.0), we find this problem has been solved. Which PR fixed it?

@bjorn3
Copy link
Member

bjorn3 commented Dec 25, 2023

There is a fair chance that this wasn't intentionally fixed, in which case nobody currently knows which PR it fixed. You could bisect between the nightly corresponding to 1.72 and the one corrwsponding to 1.75 if you want to know, but it will take quite a bit of time. You will probably want to pass --first-parent to avoid bisecting into PR's (not every commit inside a PR is guaranteed to build) and subtree syncs. And you need to bisect from the nightlies corresponding to those stable releases as each stable release has bugfixes backported such that the previous stable release is not a parent commit of the next stable release.

@fangism
Copy link
Author

fangism commented Jan 4, 2024

FWIW, our continuous builder also saw this issue disappear when we bumped to 1.76.
I'd be very curious to identify the change that fixed this (and thank the author).

@lxy19980601
Copy link
Contributor

FWIW, our continuous builder also saw this issue disappear when we bumped to 1.76. I'd be very curious to identify the change that fixed this (and thank the author).

#119372 (comment) you can see this issue

@fangism
Copy link
Author

fangism commented Jan 5, 2024

FWIW, our continuous builder also saw this issue disappear when we bumped to 1.76. I'd be very curious to identify the change that fixed this (and thank the author).

#119372 (comment) you can see this issue

Excellent, thank you. I'd be happy to call this issue closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants