about summary refs log tree commit diff
path: root/src/test/ui/panics
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-873/+0
2022-09-19Adding ignore fuchsia tests for Backtrace, ErrorKind casesAndrew Pollack-4/+6
2022-07-28location-detail: disable all location details when passed `none`Hudson Ayers-0/+10
Prior to this fix, `-Z location-detail` provided no mechanism for disabling all location details. This commit also adds a test case to verify that this option continues to work as intended, and clarifies the documentation of this option.
2022-06-30Specialize a few tests depending on opt-level.Camille GILLOT-2/+2
2022-06-30Allow inlining `#[inline]` functions.Camille GILLOT-1/+1
2022-06-22use `-Cstrip=debuginfo` with ui tests to reduce disk space usageklensy-4/+10
2022-02-03Rollup merge of #93566 - Aaron1011:rustc-backtrace, r=davidtwcoYuki Okushi-0/+27
Make rustc use `RUST_BACKTRACE=full` by default Compiler panics should be rare - when they do occur, we want the report filed by the user to contain as much information as possible. This is especially important when the panic is due to an incremental compilation bug, since we may not have enough information to reproduce it. This PR sets `RUST_BACKTRACE=full` inside `rustc` if the user has not explicitly set `RUST_BACKTRACE`. This is more verbose than `RUST_BACKTRACE=1`, but this may make it easier to debug incremental compilation issues. Users who find this too verbose can still manually set `RUST_BACKTRACE` before invoking the compiler. This only affects `rustc` (and any tool using `rustc_driver::install_ice_hook`). It does *not* affect any user crates or the standard library - backtraces will continue to be off by default in any application *compiled* by rustc.
2022-02-02Configure panic hook backtrace behaviorMark Rousskov-0/+35
2022-02-01Make rustc use `RUST_BACKTRACE=full` by defaultAaron Hill-0/+27
Compiler panics should be rare - when they do occur, we want the report filed by the user to contain as much information as possible. This is especially important when the panic is due to an incremental compilation bug, since we may not have enough information to reproduce it. This PR sets `RUST_BACKTRACE=full` inside `rustc` if the user has not explicitly set `RUST_BACKTRACE`. This is more verbose than `RUST_BACKTRACE=1`, but this may make it easier to debug incremental compilation issues. Users who find this too verbose can still manually set `RUST_BACKTRACE` before invoking the compiler. This only affects `rustc` (and any tool using `rustc_driver::install_ice_hook`). It does *not* affect any user crates or the standard library - backtraces will continue to be off by default in any application *compiled* by rustc.
2022-01-08Change panic::update_hook to simplify usageBadel2-16/+36
And to remove possibility of panics while changing the panic handler, because that resulted in a double panic.
2022-01-07Implement panic::update_hookBadel2-0/+16
2022-01-05Auto merge of #92498 - camelid:ignore-flaky-test, r=Mark-Simulacrumbors-0/+4
Ignore flaky `panic-short-backtrace-windows-x86_64.rs` test for now Mitigates (but does not fix) #92000. It has been causing a lot of spurious test failures recently that slow down the bors queue.
2022-01-04Ignore flaky `panic-short-backtrace-windows-x86_64.rs` test for nowNoah Lev-0/+4
It has been causing a lot of spurious test failures recently that slow down the bors queue.
2022-01-01Update references to `-Z symbol-mangling-version` to use `-C`Josh Triplett-2/+2
Replace `-Z symbol-mangling-version=v0` with `-C symbol-mangling-version=v0`. Replace `-Z symbol-mangling-version=legacy` with `-Z unstable-options -C symbol-mangling-version=legacy`.
2021-12-17Set `RUST_BACKTRACE=0` when running location-detail testsAaron Hill-3/+7
This ensures that the output does not depend on environment variables set in the shell.
2021-12-09Add needs-unwind to tests that depend on panickingDavid Koloski-0/+5
This directive isn't automatically set by compiletest or x.py, but can be turned on manually for targets that require it.
2021-10-21add tests for -Zlocation-detailHudson Ayers-0/+37
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-5/+2
2021-08-24tests: support -Zsymbol-mangling-version=v0 being the default.Eduard-Mihai Burtescu-1/+11
2021-08-11Modify structured suggestion outputEsteban Küber-2/+2
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-03rustc: Fill out remaining parts of C-unwind ABIAlex Crichton-24/+20
This commit intends to fill out some of the remaining pieces of the C-unwind ABI. This has a number of other changes with it though to move this design space forward a bit. Notably contained within here is: * On `panic=unwind`, the `extern "C"` ABI is now considered as "may unwind". This fixes a longstanding soundness issue where if you `panic!()` in an `extern "C"` function defined in Rust that's actually UB because the LLVM representation for the function has the `nounwind` attribute, but then you unwind. * Whether or not a function unwinds now mainly considers the ABI of the function instead of first checking the panic strategy. This fixes a miscompile of `extern "C-unwind"` with `panic=abort` because that ABI can still unwind. * The aborting stub for non-unwinding ABIs with `panic=unwind` has been reimplemented. Previously this was done as a small tweak during MIR generation, but this has been moved to a separate and dedicated MIR pass. This new pass will, for appropriate functions and function calls, insert a `cleanup` landing pad for any function call that may unwind within a function that is itself not allowed to unwind. Note that this subtly changes some behavior from before where previously on an unwind which was caught-to-abort it would run active destructors in the function, and now it simply immediately aborts the process. * The `#[unwind]` attribute has been removed and all users in tests and such are now using `C-unwind` and `#![feature(c_unwind)]`. I think this is largely the last piece of the RFC to implement. Unfortunately I believe this is still not stabilizable as-is because activating the feature gate changes the behavior of the existing `extern "C"` ABI in a way that has no replacement. My thinking for how to enable this is that we add support for the `C-unwind` ABI on stable Rust first, and then after it hits stable we change the behavior of the `C` ABI. That way anyone straddling stable/beta/nightly can switch to `C-unwind` safely.
2021-07-29[backtraces]: look for the `begin` symbol only after seeing `end`Wesley Wiser-1/+12
On `x86_64-pc-windows-msvc`, we often get backtraces which look like this: ``` 10: 0x7ff77e0e9be5 - std::panicking::rust_panic_with_hook 11: 0x7ff77e0e11b4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5769736bdb11136c 12: 0x7ff77e0e116f - std::sys_common::backtrace::__rust_end_short_backtrace::h61c7ecb1b55338ae 13: 0x7ff77e0f89dd - std::panicking::begin_panic::h8e60ef9f82a41805 14: 0x7ff77e0e108c - d 15: 0x7ff77e0e1069 - c 16: 0x7ff77e0e1059 - b 17: 0x7ff77e0e1049 - a 18: 0x7ff77e0e1039 - core::ptr::drop_in_place<std::rt::lang_start<()>::{{closure}}>::h1bfcd14d5e15ba81 19: 0x7ff77e0e1186 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5769736bdb11136c 20: 0x7ff77e0e100c - std::rt::lang_start::{{closure}}::ha054184bbf9921e3 ``` Notice that `__rust_begin_short_backtrace` appears on frame 11 before `__rust_end_short_backtrace` on frame 12. This is because in typical release binaries without debug symbols, dbghelp.dll, which we use to walk and symbolize the stack, does not know where CGU internal functions start or end and so the closure invoked by `__rust_end_short_backtrace` is incorrectly described as `__rust_begin_short_backtrace` because it happens to be near that symbol. While that can obviously change, this has been happening quite consistently since #75048. Since this is a very small change to the std and the change makes sense by itself, I think this is worth doing. This doesn't completely resolve the situation for release binaries on Windows, since without debug symbols, the stack printed can still show incorrect symbol names (this is why the test uses `#[no_mangle]`) but it does slightly improve the situation in that you see the same backtrace you would see with `RUST_BACKTRACE=full` or in a debugger (without the uninteresting bits at the top and bottom).
2021-07-29Add regression testWesley Wiser-0/+47
2021-07-06Add s to non_fmt_panicRyan Levick-3/+3
2021-06-06Update testsuite to match new panic msgReagan McFarland-2/+2
This patch fixes tests from failing that were matching on `Box<Any>`, which was the old panic message. Since the new panic message is `Box<dyn Any>`, the tests have been updated to match against this instead.
2021-05-07panic ui test: Test always_abort on one thread, panic on anotherIan Jackson-1/+20
This test failed on an earlier version of this branch, where this did not work properly, so I know the test works. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-05-07panic ui test: Add a test for panic::always_abortIan Jackson-0/+7
Our existing tests are only on Unix. We want a general one too. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-05-07panic ui test: Improve error handlingIan Jackson-2/+11
Previoously, if somehow this program got a wrong argument, it would panic in the re-executed child. But that looks like a "success" for this program! We mustn't panic unless everything is great. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-05-07panic ui test: Provide comprehensive test for panic after forkIan Jackson-22/+26
This tests that we can indeed safely panic after fork, both a raw libc::fork and in a Command pre_exec hook. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk> Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2021-02-03Allow/fix non_fmt_panic in tests.Mara Bos-1/+5
2021-02-01Add UI test for panic/assert in Rust 2021.Mara Bos-0/+51
2020-11-22Drop support for cloudabi targetsLzu Tao-3/+1
2020-09-21Move panic safety traits testsAlexis Bourget-51/+0
2020-08-07Prevent `__rust_begin_short_backtrace` frames from being tail-call optimised ↵Alan Egerton-0/+23
away
2020-05-08Skip tests on emscriptenYuki Okushi-0/+25
2020-05-06Move tests from `test/run-fail` to UIYuki Okushi-0/+271
2019-10-12test unwind(abort) with Rust ABIRalf Jung-0/+64
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+222