-
Notifications
You must be signed in to change notification settings - Fork 245
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
Invalid/corrupt ar
headers in .rlib
s, in high-UID/GID VMs/containers.
#889
Comments
These are both marked as fixed but even then, they're making me suspicious:
What's the name of the crate that failed to compile? If it's longer than 16 characters, what happens if you rename it to less than 16 characters? (feel free to try e.g. 13 or 7, just be sure) |
The crate which ran rust-gpu in it's build script was longer than 16 characters but I still seem to have the same problem even after making it shorter (8 long) |
Sorry, no, I wasn't referring to the crate using Rust-GPU, but the shader crate being compiled with Rust-GPU (you posted an ICE output from a compilation, but I want the few lines below/above that in the output, that include "Compiling my-shaders-foo" or whatever the name is). |
I changed that as well to be a very short name (
|
Nevermind those ideas, if it is file length, it's already ~guaranteed over 16: $ ar tv ~/.rustup/toolchains/nightly-x*64*/lib/rustlib/x*64*/lib/libcore-*.rlib
rw-r--r-- 0/0 55736376 Jan 1 02:00 1970 lib.rmeta
rw-r--r-- 0/0 3735096 Jan 1 02:00 1970 core-0e3656b1fda5fd7b.core.7728b167-cgu.0.rcgu.o (the first hash, |
So I was able to run a build of the current $ git log --oneline | head -n1
805297146 Update to 0.4.0-alpha.14 (#905)
$ podman run -it --userns=keep-id -v $PWD:$PWD -w $PWD docker.io/arm64v8/rust
Trying to pull docker.io/arm64v8/rust:latest...
...
eddy@168e4dacc9b4:~$ cargo compiletest
info: syncing channel updates for 'nightly-2022-04-11-aarch64-unknown-linux-gnu'
...
Downloaded ar v0.9.0
...
Compiling rustc_codegen_spirv v0.4.0-alpha.14 (/home/eddy/Projects/rust-gpu-issue-889/crates/rustc_codegen_spirv)
Compiling compiletests v0.0.0 (/home/eddy/Projects/rust-gpu-issue-889/tests)
Finished release [optimized] target(s) in 42m 18s
Running `target/release/compiletests`
...
Compiling compiletests-deps-helper v0.0.0 (/home/eddy/Projects/rust-gpu-issue-889/tests/deps-helper)
Finished dev [unoptimized + debuginfo] target(s) in 4m 05s
running 185 tests
...
test result: ok. 184 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 279.66s
eddy@168e4dacc9b4:~$ ar tv target/compiletest-deps/spirv-unknown-spv1.3/debug/deps/libcompiletests_deps_helper-*.rlib
--------- 0/0 1494 Jan 1 00:00 1970 lib.rmeta
rw-r--r-- 1000/100 116 Aug 15 16:15 2022 compiletests_deps_helper-11b751367bf20fcb.56c7h0wvqsscq974.rcgu.o (omitted most of the noisy parts of the log with It's a bit on the slow side, but keep in mind that it includes the native build of |
ar
headers in .rlib
s on aarch64-unknown-linux-gnu.
Got a
So the I didn't even know UIDs/GIDs could be that large, but wikipedia has some interesting history:
There's nothing Two things are going wrong here:
$ touch foo.o
$ sudo chown 1999999992:3999999994 foo.o
$ ar qU gnu.a foo.o
ar: creating gnu.a
$ llvm-ar qU llvm.a foo.o
llvm-ar: warning: creating llvm.a
$ cat gnu.a
!<arch>
foo.o/ 1660643250 199999399999100644 0 `
$ cat llvm.a
!<arch>
foo.o/ 1660643250 999992999994644 0 ` |
ar
headers in .rlib
s on aarch64-unknown-linux-gnu.ar
headers in .rlib
s, in high-UID/GID VMs/containers.
cg_clif uses |
Instead of fixing this (pretty much in the way @bjorn3 described) with no documented repro, I decided to take another stab at #889 (comment) but native x64 containers and $ podman run -it --uidmap 1999999997:0:1 --gidmap 1899999996:0:1 --user 1999999997:1899999996 -w /tmp docker.io/rust
1999999997@a87f7a319144:~$ id
uid=1999999997(1999999997) gid=1899999996(1899999996) groups=1899999996(1899999996)
1999999997@a87f7a319144:~$ git clone https://github.com/EmbarkStudios/rust-gpu
Cloning into 'rust-gpu'...
...
1999999997@a87f7a319144:~$ cd rust-gpu
1999999997@a87f7a319144:~/rust-gpu$ cargo compiletest
info: syncing channel updates for 'nightly-2022-04-11-x86_64-unknown-linux-gnu'
...
Downloaded ar v0.9.0
...
Compiling rustc_codegen_spirv v0.4.0-alpha.14 (/tmp/rust-gpu/crates/rustc_codegen_spirv)
Compiling compiletests v0.0.0 (/tmp/rust-gpu/tests)
Finished release [optimized] target(s) in 4m 06s
Running `target/release/compiletests`
...)
Compiling compiletests-deps-helper v0.0.0 (/tmp/rust-gpu/tests/deps-helper)
Finished dev [unoptimized + debuginfo] target(s) in 18.97ss
running 185 testss
normalized stderr:
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: "Invalid file size field in entry header (/"100644 97/")" }', crates/rustc_codegen_spirv/src/link.rs:525:35
...
test result: FAILED. 18 passed; 166 failed; 1 ignored; 0 measured; 0 filtered out; finished in 7.11s (again omitted most of the noisy parts of the log with Also, there's a way to find $ find target -type f -name '*.rlib' -exec bash -c 'ar tv "{}" | grep -v 0/0 > /dev/null && (echo "{}:"; ar tv "{}"; echo)' ';'
target/compiletest-deps/spirv-unknown-spv1.3/debug/libcompiletests_deps_helper.rlib:
--------- 0/0 1494 Jan 1 02:00 1970 lib.rmeta
rw-r--r-- 1000/100 116 Aug 15 21:26 2022 compiletests_deps_helper-11b751367bf20fcb.56c7h0wvqsscq974.rcgu.o
target/compiletest-deps/spirv-unknown-spv1.3/debug/deps/libbitflags-8bcc6a30d8aa2e2e.rlib:
--------- 0/0 49469 Jan 1 02:00 1970 lib.rmeta
rw-r--r-- 1000/100 116 Aug 15 21:24 2022 bitflags-8bcc6a30d8aa2e2e.bitflags.f9f0adc0-cgu.0.rcgu.o
... (I'm only seeing results from Rust-GPU's usage of the |
Expected Behaviour
It to compile successfully
System Info
Backtrace
Backtrace
The text was updated successfully, but these errors were encountered: