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

Spurious CI failure: tests/run-make/jobserver-error #110321

Open
RalfJung opened this issue Apr 14, 2023 · 12 comments
Open

Spurious CI failure: tests/run-make/jobserver-error #110321

RalfJung opened this issue Apr 14, 2023 · 12 comments
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason)

Comments

@RalfJung
Copy link
Member

#110177 (comment) seems to have run into some spurious CI failure

---- [run-make] tests/run-make/jobserver-error stdout ----

error: make failed
status: exit status: 2
command: cd "/checkout/tests/run-make/jobserver-error" && AR="i586-unknown-linux-gnu-ar" CC="i586-unknown-linux-gnu-gcc -ffunction-sections -fdata-sections -fPIC -m32 -march=pentium -Wa,-mrelax-relocations=no" CXX="c++ -ffunction-sections -fdata-sections -fPIC -m32 -march=pentium" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerparallel dwp engine executionengine extensions filecheck frontendhlsl frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_LINKER="i586-unknown-linux-gnu-gcc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" RUST_BUILD_STAGE="stage2-i586-unknown-linux-gnu" RUST_DEMANGLER="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/rust-demangler" S="/checkout" TARGET="i586-unknown-linux-gnu" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i586-unknown-linux-gnu/lib" TMPDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error" "make"
--- stdout -------------------------------
bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error  -Clinker='i586-unknown-linux-gnu-gcc' - 3</dev/null' 2>&1 | diff jobserver.stderr -
1c1,27
< error: failed to acquire jobserver token: early EOF on jobserver pipe
---
> error: linking with `i586-unknown-linux-gnu-gcc` failed: exit status: 1
>   |
>   = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/x-tools/i586-unknown-linux-gnu/bin" VSLANG="1033" "i586-unknown-linux-gnu-gcc" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rustckXLWxz/symbols.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.1.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.2.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.3.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.4.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.4u7kfiaws83vwnvi.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-21dcc623e8bedf43.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e09f867968bd88e3.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-33fb876b68f7fd77.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c0ff7ddb2987d8da.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-48db2e664dcd007b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-e4d46294820130ba.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-d22c51811a78dc80.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-328f43c2abce5784.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-c6524d8077d4ee9d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-fc890bd32fb6cecd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-6deb8c633abe47e3.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-45ff23c614a38f1d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-daa91946230a4443.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-0b7d1529f62927c0.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-c2c050aec00eb6da.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-522518611024dce5.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-05898138a596088a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-35b8a4bd2de4e62e.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
>   = note: /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rustckXLWxz/symbols.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.0.rcgu.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.1.rcgu.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.2.rcgu.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.3.rcgu.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.4.rcgu.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.4u7kfiaws83vwnvi.rcgu.o' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-21dcc623e8bedf43.rlib(std-21dcc623e8bedf43.std.9e3db96e-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e09f867968bd88e3.rlib(panic_unwind-e09f867968bd88e3.panic_unwind.ec2351a3-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-33fb876b68f7fd77.rlib(object-33fb876b68f7fd77.object.c99370cb-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c0ff7ddb2987d8da.rlib(memchr-c0ff7ddb2987d8da.memchr.2b17ee83-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-48db2e664dcd007b.rlib(addr2line-48db2e664dcd007b.addr2line.3e241b1b-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-e4d46294820130ba.rlib(gimli-e4d46294820130ba.gimli.4fa9f6c2-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-d22c51811a78dc80.rlib(rustc_demangle-d22c51811a78dc80.rustc_demangle.4fc2d765-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-fc890bd32fb6cecd.rlib(miniz_oxide-fc890bd32fb6cecd.miniz_oxide.52a5fa4d-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-6deb8c633abe47e3.rlib(adler-6deb8c633abe47e3.adler.83a4b082-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib(libc-68a2d9e195dd6ed2.libc.c95aa1cb-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-c2c050aec00eb6da.rlib(alloc-c2c050aec00eb6da.alloc.684d6a34-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-05898138a596088a.rlib(core-05898138a596088a.core.441cf872-cgu.0.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-35b8a4bd2de4e62e.rlib(compiler_builtins-35b8a4bd2de4e62e.compiler_builtins.d0a19a8a-cgu.118.rcgu.o)' is incompatible with i386 output
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/jobserver-error/jobserver-error/rust_out.rust_out.b8060d94-cgu.0.rcgu.o: file class ELFCLASS64 incompatible with ELFCLASS32
>           /x-tools/i586-unknown-linux-gnu/lib/gcc/i586-unknown-linux-gnu/8.3.0/../../../../i586-unknown-linux-gnu/bin/ld: final link failed: file in wrong format
>           collect2: error: ld returned 1 exit status
>
------------------------------------------
--- stderr -------------------------------
make: *** [Makefile:8: all] Error 1
------------------------------------------
@RalfJung RalfJung added the A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) label Apr 14, 2023
@ehuss
Copy link
Contributor

ehuss commented Apr 14, 2023

This seems to have happened several times very recently:

I don't have even the remotest theory on how that could be happening.
It happened twice in #110201. @compiler-errors had the theory that it was #110142, but that has not yet merged.

The jobserver was last updated 2023-02-28 in #108582. It was a fairly significant update, but that was sufficiently long ago that I doubt it was directly responsible.

There has been a series of recent changes to rustc_codegen_ssa just before 2023-04-07:

But none of those look related.

cc @weihanglo Does this error make any sense to you?

One way someone can help is try to reproduce it locally. I'm thinking running hundreds of copies of the test. IIRC, these builders do not use an outer make, but that would be good to double-check.

@weihanglo
Copy link
Member

I don't really know the testing infra here. Is there any chance that it happened because of this #109770?

@petrochenkov
Copy link
Contributor

The test itself is very new, it was added in #109694, maybe it could always fail spuriously.

@jyn514
Copy link
Member

jyn514 commented Apr 15, 2023

I don't really know the testing infra here. Is there any chance that it happened because of this #109770?

That made it more likely to fail, but only because it's being run more often now (previously it wouldn't be run for targets that were cross-compiled). I doubt it's the root cause.

@jyn514
Copy link
Member

jyn514 commented Apr 15, 2023

@belovdv do you have time to follow up here?

@Noratrieb
Copy link
Member

until then, we should just disable it. This test doesn't seem important enough to cause trouble.

@ehuss
Copy link
Contributor

ehuss commented Apr 15, 2023

I'm not sure why I thought this was an old test. Teaches me to not ignore the obvious.

I was able to reproduce this once locally, but it took hundreds of thousands of attempts. I tried some instrumenting, but I wasn't able to reproduce after adding the logging (even with the logging turned off).

My hypothesis is that due to scheduling oddities, the jobserver helper thread gets delayed. The coordinator thread will proceed with using the implicit token for doing work. However, I'm surprised that it would get delayed for such a long time. There are 5 CGUs, and that would require processing them all serially, with several switches between the main and coordinator threads.

I posted #110361 to disable it temporarily.

bors added a commit to rust-lang-ci/rust that referenced this issue Apr 15, 2023
…k-Simulacrum

Temporarily disable the jobserver-error test

This test is failing randomly on CI. We don't have a handle on what might be causing it, so disable it for now to reduce disruption.

cc rust-lang#110321
@ehuss
Copy link
Contributor

ehuss commented Apr 17, 2023

I was able to reproduce on CI with debug logging. I confirmed that the jobserver helper thread never starts until after coordinator thread finishes. That means it just uses the implicit token until it tries to link, and the jobserver helper thread just exits since it is no longer needed.

I'm not very familiar with Linux thread scheduling, so I'm not sure why the thread gets delayed for so long. I also don't have any particular ideas on how to make this test work reliably.

@belovdv
Copy link
Contributor

belovdv commented Jul 15, 2023

I'll work on this, but i doubt if my experience is enough.

I wasn't able to reproduce it locally. Could you share your results?

@jyn514
Copy link
Member

jyn514 commented Jul 15, 2023

the jobserver test is currently disabled: https://github.com/rust-lang/rust/pull/110361/files
did you remember to re-enable it before running it?

@belovdv
Copy link
Contributor

belovdv commented Jul 15, 2023

I'm almost sure i didn't forgot to re-enable it and now i've run another 100 times a bit different test: bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC) - 3< <(cat /dev/null)' 2>&1 | diff poisoned_pipe.stderr - which, i hope, should be the same in this case.

UPD: i'll run again exactly the same as was disabled to check myself, but a bit later

@ehuss
Copy link
Contributor

ehuss commented Jul 15, 2023

i've run another 100 times

It took me hundreds of thousands of attempts to reproduce it once locally. That generally wasn't productive since it was so rare.

I had much better luck reproducing in GitHub Actions. Here is a branch with some changes to run just the one test, and to instrument it. If you have Actions enabled on your fork, you can just push a new branch with similar changes.

The problem is that the jobserver helper thread launched here gets starved out and doesn't run, while the coordinator thread continually processes work using the implicit jobserver token, never yielding long enough for the jobserver helper to do its work (and process the error).

Honestly, I'm not sure this is really worth fixing. It would be nice to have a test to validate the jobserver behavior, but I'm not sure it is worth the expense of changing the coordinator's behavior in some way (since there could be performance losses, for example if it explicitly yielded or waited for the jobserver helper, or more aggressively tried to acquire tokens). I'm not familiar enough with Linux thread scheduling to know why the thread could get blocked for so long, or if there are different approaches to fix the scheduling.

Another thought I just had would be to change the test to generate a binary with enough code to split across a very large number of CGUs (and use -C codegen-units=…). That would ensure that the coordinator does a lot of work, giving it more opportunity to yield. Again, I'm not too familiar with Linux thread scheduling, so I don't know if that would help, but might be worth a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason)
Projects
None yet
Development

No branches or pull requests

7 participants