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

Some UI tests that used to pass now fail sync the last sync #542

Open
antoyo opened this issue Jul 5, 2024 · 9 comments
Open

Some UI tests that used to pass now fail sync the last sync #542

antoyo opened this issue Jul 5, 2024 · 9 comments
Labels

Comments

@antoyo
Copy link
Contributor

antoyo commented Jul 5, 2024

The following UI tests now fail since the last sync:

  • tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
  • tests/ui/backtrace/backtrace.rs
  • tests/ui/consts/zst_no_llvm_alloc.rs
  • tests/ui/runtime/rt-explody-panic-payloads.rs (fail with master as well)
@antoyo antoyo added the sync label Jul 5, 2024
@sum12
Copy link

sum12 commented Jul 19, 2024

how do I run these tests locally ? ( in order to try and fix them )
running ./y.sh test --test-failing-ui-pattern-tests I get

Testing stage0 compiletest suite=ui mode=ui (aarch64-unknown-linux-gnu)
Build completed unsuccessfully in 0:00:00
./x.py test --run always --stage 0 tests/ui --rustc-args  -Zcodegen-backend=<path>/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so --sysroot <path>/rustc_codegen_gcc/build/build_sysroot/sysroot`

I did build libgccjit.so and the gcc-path is pointing to the folder with that file

@antoyo
Copy link
Contributor Author

antoyo commented Jul 19, 2024

Are you on Asahi Linux?

@sum12
Copy link

sum12 commented Jul 19, 2024

would love to but not yet.
fedora vm on M2

@antoyo
Copy link
Contributor Author

antoyo commented Jul 19, 2024

Hum, I can try on a M1 with Asahi Linux to see if it still works, but the support for it is currently WIP.

Are you able to compile a simple project with rustc_codegen_gcc?

@sum12
Copy link

sum12 commented Jul 19, 2024

I guess it does ?

➜ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
[BUILD] build system
    Finished `release` profile [optimized] target(s) in 0.02s
warning: no edition set: defaulting to the 2015 edition while the latest is 2021
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s

@sum12
Copy link

sum12 commented Jul 19, 2024

nope,

✗ tests/hello-world/target/debug/hello_world 
[1]    1944449 segmentation fault (core dumped)  tests/hello-world/target/debug/hello_world
```

@antoyo
Copy link
Contributor Author

antoyo commented Jul 19, 2024

Did you build the sysroot --release-sysroot?
There's a bug because the naked attributed is not supported on AArch64 in GCC and compiling the sysroot in release mode workarounds the issue.
See more info here.

@sum12
Copy link

sum12 commented Aug 27, 2024

okay, I moved to an x86 machine and tried to find why the test is failing


---- [ui] tests/ui/backtrace/backtrace.rs stdout ----

error: test run failed!
status: exit status: 101
command: cd "/root/rustc_codegen_gcc/build/rust/build/x86_64-unknown-linux-gnu/test/ui/backtrace/backtrace" && RUST_TEST_THREADS="8" "/root/rustc_codegen_gcc/build/rust/build/x86_64-unknown-linux-gnu/test/ui/backtrace/backtrace/a"
stdout: none
--- stderr -------------------------------
thread 'main' panicked at /root/rustc_codegen_gcc/build/rust/tests/ui/backtrace/backtrace.rs:103:9:
bad output3: thread 'main' panicked at /root/rustc_codegen_gcc/build/rust/tests/ui/backtrace/backtrace.rs:33:5:
once
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 3

stack backtrace:
   0: rust_begin_unwind
             at /root/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/std/src/panicking.rs:661:5
   1: core::panicking::panic_fmt
             at /root/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/panicking.rs:74:14
   2: backtrace::runtest
             at /root/rustc_codegen_gcc/build/rust/tests/ui/backtrace/backtrace.rs:103:9
   3: backtrace::main
             at /root/rustc_codegen_gcc/build/rust/tests/ui/backtrace/backtrace.rs:135:9
   4: core::ops::function::FnOnce::call_once
             at /root/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
------------------------------------------

this is what I amanged to get

iiuc the bad output3 is the interesting bit. this matches what is tests/ui/backtrace/backtrace.rs

the last assert here is failing.

let p = template(me).arg("double-fail").env("RUST_BACKTRACE","0").spawn().unwrap();         
let out = p.wait_with_output().unwrap();                                                    
assert!(!out.status.success());                                                             
let s = str::from_utf8(&out.stderr).unwrap();                                               
// loosened the following from double::h to double:: due to                                 
// spurious failures on mac, 32bit, optimized                                               
assert!(                                                                                    
    s.contains("stack backtrace") &&                                                        
        s.contains("panic in a destructor during cleanup") &&                               
        contains_verbose_expected(s, "double"),                                             
    "bad output3: {}", s                                                                    
);                                                                                          

what I do not understand is with RUST_BACKTRACE=0 why will the stacktrace be printed. what am I missing ?

@antoyo
Copy link
Contributor Author

antoyo commented Aug 27, 2024

I would suggest you try to debug another test since this one involves panics, which is very complex and we already had cases where it didn't work properly.

The build system seems to set RUST_BACKTRACE to 1, which might be why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants