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

SIGILL in a heavy test #3783

Closed
o0Ignition0o opened this issue Mar 31, 2020 · 5 comments · Fixed by #3784
Closed

SIGILL in a heavy test #3783

o0Ignition0o opened this issue Mar 31, 2020 · 5 comments · Fixed by #3784
Assignees

Comments

@o0Ignition0o
Copy link
Contributor

As I was running heavy tests for #3781, I stumbled upon a SIGILL for test preserves_dos_line_endings:

The command I ran was:

RUST_BACKTRACE=full RUN_SLOW_TESTS=true cargo test --package rust-analyzer --test heavy_tests -- preserves_dos_line_endings --exact --nocapture

Here's the output I got:

running 1 test
thread 'preserves_dos_line_endings' panicked at 'unexpected request: Request { id: RequestId(U64(1)), method: "window/workDoneProgress/create", params: Object({"token": String("rustAnalyzer/startup")}) }', crates/rust-analyzer/tests/heavy_tests/support.rs:191:42
stack backtrace:
   0:        0x10d0d7d45 - backtrace::backtrace::libunwind::trace::h5c84db184dbe55ed
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:        0x10d0d7d45 - backtrace::backtrace::trace_unsynchronized::hfabf504f184a4062
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:        0x10d0d7d45 - std::sys_common::backtrace::_print_fmt::hb18545a457444b58
                               at src/libstd/sys_common/backtrace.rs:77
   3:        0x10d0d7d45 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hff7732c2e44ef8b9
                               at src/libstd/sys_common/backtrace.rs:59
   4:        0x10d0f9add - core::fmt::write::hd42cb3dea57bae40
                               at src/libcore/fmt/mod.rs:1052
   5:        0x10d0d358b - std::io::Write::write_fmt::ha39f6009af02b1d2
                               at src/libstd/io/mod.rs:1426
   6:        0x10d0da26a - std::sys_common::backtrace::_print::h5cfb8cdd320f1e64
                               at src/libstd/sys_common/backtrace.rs:62
   7:        0x10d0da26a - std::sys_common::backtrace::print::hef683e3bc77ce269
                               at src/libstd/sys_common/backtrace.rs:49
   8:        0x10d0da26a - std::panicking::default_hook::{{closure}}::h389f076017b5df43
                               at src/libstd/panicking.rs:204
   9:        0x10d0d9f6a - std::panicking::default_hook::h04b06ec20c41bf02
                               at src/libstd/panicking.rs:224
  10:        0x10d0da8bd - std::panicking::rust_panic_with_hook::hccde7faed9a5c398
                               at src/libstd/panicking.rs:472
  11:        0x10d0da482 - rust_begin_unwind
                               at src/libstd/panicking.rs:380
  12:        0x10d11f8db - std::thread::local::fast::Key<T>::try_initialize::hafc83b0b9dac2707
  13:        0x10b6a99ae - heavy_tests::support::Server::send_request_::h66ed10add5465d05
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:191
  14:        0x10b6de4a1 - heavy_tests::support::Server::send_request::h369a05de7799ebac
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:184
  15:        0x10b6dd6bf - heavy_tests::support::Server::request::h64ff7559ae0f97ff
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:163
  16:        0x10b6d8754 - heavy_tests::preserves_dos_line_endings::hb8e8cb92d0bc833f
                               at crates/rust-analyzer/tests/heavy_tests/main.rs:554
  17:        0x10b6c9a71 - heavy_tests::preserves_dos_line_endings::{{closure}}::haa4c65d850973659
                               at crates/rust-analyzer/tests/heavy_tests/main.rs:536
  18:        0x10b6ca3b1 - core::ops::function::FnOnce::call_once::h4157c612650e1b64
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/ops/function.rs:232
  19:        0x10b71460e - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h27d1322c81491638
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
  20:        0x10d0e1cbb - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:86
  21:        0x10b72dc85 - std::panicking::try::h64fe1944bde3d8ca
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panicking.rs:281
  22:        0x10b72dc85 - std::panic::catch_unwind::he2328e79964636c4
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panic.rs:394
  23:        0x10b72dc85 - test::run_test_in_process::h316addbc1cb07abe
                               at src/libtest/lib.rs:539
  24:        0x10b72dc85 - test::run_test::run_test_inner::{{closure}}::h71c25705e981f4bd
                               at src/libtest/lib.rs:452
  25:        0x10b7088bb - std::sys_common::backtrace::__rust_begin_short_backtrace::hfde8bd6e56b0c899
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/sys_common/backtrace.rs:129
  26:        0x10b70cf8b - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::hd839c9ae7715b537
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/thread/mod.rs:475
  27:        0x10b70cf8b - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h37ac3fabcd45fa01
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panic.rs:318
  28:        0x10b70cf8b - std::panicking::try::do_call::hb5b064d52913f725
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panicking.rs:305
  29:        0x10d0e1cbb - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:86
  30:        0x10b70dc46 - std::panicking::try::h5cadccbfd19fc144
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panicking.rs:281
  31:        0x10b70dc46 - std::panic::catch_unwind::h046ca8a6018c411f
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panic.rs:394
  32:        0x10b70dc46 - std::thread::Builder::spawn_unchecked::{{closure}}::h96a4708b76aef308
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/thread/mod.rs:474
  33:        0x10b70dc46 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hdf8bbeeed49234cf
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/ops/function.rs:232
  34:        0x10d0cc8de - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h606f2dced48ff3c4
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
  35:        0x10d0e12fe - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h0ece8cce658c93ae
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
  36:        0x10d0e12fe - std::sys_common::thread::start_thread::h30bbd9f3fb79e88c
                               at src/libstd/sys_common/thread.rs:13
  37:        0x10d0e12fe - std::sys::unix::thread::Thread::new::thread_start::h7199626a1bd56873
                               at src/libstd/sys/unix/thread.rs:80
  38:     0x7fff6e679109 - <unknown>
thread 'preserves_dos_line_endings' panicked at 'assertion failed: `(left == right)`
  left: `RequestId(U64(1))`,
 right: `RequestId(U64(2))`', crates/rust-analyzer/tests/heavy_tests/support.rs:194:21
stack backtrace:
   0:        0x10d0d7d45 - backtrace::backtrace::libunwind::trace::h5c84db184dbe55ed
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:        0x10d0d7d45 - backtrace::backtrace::trace_unsynchronized::hfabf504f184a4062
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:        0x10d0d7d45 - std::sys_common::backtrace::_print_fmt::hb18545a457444b58
                               at src/libstd/sys_common/backtrace.rs:77
   3:        0x10d0d7d45 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hff7732c2e44ef8b9
                               at src/libstd/sys_common/backtrace.rs:59
   4:        0x10d0f9add - core::fmt::write::hd42cb3dea57bae40
                               at src/libcore/fmt/mod.rs:1052
   5:        0x10d0d358b - std::io::Write::write_fmt::ha39f6009af02b1d2
                               at src/libstd/io/mod.rs:1426
   6:        0x10d0da26a - std::sys_common::backtrace::_print::h5cfb8cdd320f1e64
                               at src/libstd/sys_common/backtrace.rs:62
   7:        0x10d0da26a - std::sys_common::backtrace::print::hef683e3bc77ce269
                               at src/libstd/sys_common/backtrace.rs:49
   8:        0x10d0da26a - std::panicking::default_hook::{{closure}}::h389f076017b5df43
                               at src/libstd/panicking.rs:204
   9:        0x10d0d9f6a - std::panicking::default_hook::h04b06ec20c41bf02
                               at src/libstd/panicking.rs:224
  10:        0x10d0da8bd - std::panicking::rust_panic_with_hook::hccde7faed9a5c398
                               at src/libstd/panicking.rs:472
  11:        0x10d0da482 - rust_begin_unwind
                               at src/libstd/panicking.rs:380
  12:        0x10d11f8db - std::thread::local::fast::Key<T>::try_initialize::hafc83b0b9dac2707
  13:        0x10b6a9baa - heavy_tests::support::Server::send_request_::h66ed10add5465d05
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:194
  14:        0x10b6dec2e - heavy_tests::support::Server::send_request::hef92733f08bf1ddc
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:184
  15:        0x10b6ddf3f - heavy_tests::support::Server::request::h85fa477b69efda57
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:163
  16:        0x10b6aa50d - <heavy_tests::support::Server as core::ops::drop::Drop>::drop::h9e82b1f280dff33b
                               at crates/rust-analyzer/tests/heavy_tests/support.rs:249
  17:        0x10b6caab5 - core::ptr::drop_in_place::h25b942bb93f11742
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/ptr/mod.rs:174
  18:        0x10b6d77c4 - heavy_tests::preserves_dos_line_endings::hb8e8cb92d0bc833f
                               at crates/rust-analyzer/tests/heavy_tests/main.rs:583
  19:        0x10b6c9a71 - heavy_tests::preserves_dos_line_endings::{{closure}}::haa4c65d850973659
                               at crates/rust-analyzer/tests/heavy_tests/main.rs:536
  20:        0x10b6ca3b1 - core::ops::function::FnOnce::call_once::h4157c612650e1b64
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/ops/function.rs:232
  21:        0x10b71460e - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h27d1322c81491638
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
  22:        0x10d0e1cbb - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:86
  23:        0x10b72dc85 - std::panicking::try::h64fe1944bde3d8ca
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panicking.rs:281
  24:        0x10b72dc85 - std::panic::catch_unwind::he2328e79964636c4
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panic.rs:394
  25:        0x10b72dc85 - test::run_test_in_process::h316addbc1cb07abe
                               at src/libtest/lib.rs:539
  26:        0x10b72dc85 - test::run_test::run_test_inner::{{closure}}::h71c25705e981f4bd
                               at src/libtest/lib.rs:452
  27:        0x10b7088bb - std::sys_common::backtrace::__rust_begin_short_backtrace::hfde8bd6e56b0c899
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/sys_common/backtrace.rs:129
  28:        0x10b70cf8b - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::hd839c9ae7715b537
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/thread/mod.rs:475
  29:        0x10b70cf8b - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h37ac3fabcd45fa01
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panic.rs:318
  30:        0x10b70cf8b - std::panicking::try::do_call::hb5b064d52913f725
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panicking.rs:305
  31:        0x10d0e1cbb - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:86
  32:        0x10b70dc46 - std::panicking::try::h5cadccbfd19fc144
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panicking.rs:281
  33:        0x10b70dc46 - std::panic::catch_unwind::h046ca8a6018c411f
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/panic.rs:394
  34:        0x10b70dc46 - std::thread::Builder::spawn_unchecked::{{closure}}::h96a4708b76aef308
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libstd/thread/mod.rs:474
  35:        0x10b70dc46 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hdf8bbeeed49234cf
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/ops/function.rs:232
  36:        0x10d0cc8de - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h606f2dced48ff3c4
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
  37:        0x10d0e12fe - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h0ece8cce658c93ae
                               at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
  38:        0x10d0e12fe - std::sys_common::thread::start_thread::h30bbd9f3fb79e88c
                               at src/libstd/sys_common/thread.rs:13
  39:        0x10d0e12fe - std::sys::unix::thread::Thread::new::thread_start::h7199626a1bd56873
                               at src/libstd/sys/unix/thread.rs:80
  40:     0x7fff6e679109 - <unknown>
thread panicked while panicking. aborting.
error: test failed, to rerun pass '-p rust-analyzer --test heavy_tests'

Caused by:
  process didn't exit successfully: `/Users/ignition/Projects/oss/rust-analyzer/target/debug/deps/heavy_tests-6f6fae431553e10c preserves_dos_line_endings --exact --nocapture` (signal: 4, SIGILL: illegal instruction)

I would love to figure it out, if you can assign it to me :)

@lnicola
Copy link
Member

lnicola commented Mar 31, 2020

It's not SIGILL, it's a failed assertion:

thread 'preserves_dos_line_endings' panicked at 'assertion failed: `(left == right)`
  left: `RequestId(U64(1))`,
 right: `RequestId(U64(2))`', crates/rust-analyzer/tests/heavy_tests/support.rs:194:21

I think SIGILL (well, ud2) is used as a way to abort the process. This also came up in #3754 (comment) and the solution was probably 12297ab. You might want to rebase over #3754 if you started from an older commit.

@o0Ignition0o
Copy link
Contributor Author

Hi, thanks a lot for your super fast answer!

I forked the project this morning, the last commit seems to be the master tip: 6f0d8db

I think SIGILL (well, ud2) is used as a way to abort the process.

I think so as well, the trace states it panicked while panicking:

thread panicked while panicking. aborting.

What I would actually try to do is have the test pass (and maybe figure out what is going on, because it seems like #3754 didnt completely fix it)
Do you think I can give it a try ?

@matklad
Copy link
Member

matklad commented Mar 31, 2020

yeah, I can rerproduce the problem locally. @o0Ignition0o if you have time to look into this, go for it!

Otherwise, I'll try to fix this later today, flaky tests are bad.

@lnicola
Copy link
Member

lnicola commented Mar 31, 2020

I forked the project this morning, the last commit seems to be the master tip: 6f0d8db

Ah, bummer.

thread panicked while panicking. aborting.

Yeah, that's probably the reason it aborts in that way.

Do you think I can give it a try ?

I think so, but I have no idea what's wrong :-).

@matklad
Copy link
Member

matklad commented Mar 31, 2020

actually, let me take a look at this rn, as it blocks other PRs...

bors bot added a commit that referenced this issue Mar 31, 2020
3777: Add basic task support r=matklad a=Timmmm

This adds basic support for running `cargo build`, `cargo run`, etc.

Fixes #1935

I have tested this and it seems to work. There are two things I'm not sure about:

1. The workspace folder handling seems wrong - just get the first workspace folder? Is this just a TODO item? I don't know if it is right to lift `workspaceFolder` up to `activate()` but I couldn't see another way.
2. If you manually add an entry to `tasks.json` like this:

```
    {
      "type": "cargo",
      "command": "build",
      "problemMatcher": [
        "$rustc"
      ],
      "group": "build"
    }
```

then VSCode somehow magically knows to run `cargo build`. The documentation for `resolveTask` *sounds* like I should have to implement that for it to work:

```
 * Resolves a task that has no [`execution`](#Task.execution) set. Tasks are
 * often created from information found in the `tasks.json`-file. Such tasks miss
 * the information on how to execute them and a task provider must fill in
 * the missing information in the `resolveTask`-method.
```

But then it also says this:

```
* This method will not be
 * called for tasks returned from the above `provideTasks` method since those
 * tasks are always fully resolved. A valid default implementation for the
 * `resolveTask` method is to return `undefined`.
```

Either way, it works without implementing it so the only thing I can think is that it is doing some kind of crazy pattern matching of the tasks returned by `provideTasks()` and the ones found in `tasks.json`.

3784: Ignore createProgress request in tests r=matklad a=matklad

closes #3783



bors r+
🤖

Co-authored-by: Tim <tdhutt@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
@bors bors bot closed this as completed in 6b2f02f Mar 31, 2020
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants