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

Abort when foreign exceptions are caught by catch_unwind #70212

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

Amanieu
Copy link
Member

@Amanieu Amanieu commented Mar 21, 2020

Prior to this PR, foreign exceptions were not caught by catch_unwind, and instead passed through invisibly. This represented a painful soundness hole in some libraries (take_mut), which relied on catch_unwind to handle all possible exit paths from a closure.

With this PR, foreign exceptions are now caught by catch_unwind and will trigger an abort since catching foreign exceptions is currently UB according to the latest proposals by the FFI unwind project group.

cc @rust-lang/wg-ffi-unwind

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2020
@Amanieu Amanieu force-pushed the catch_foreign branch 2 times, most recently from 3270761 to 5a677d8 Compare March 21, 2020 09:53
@rust-highfive
Copy link
Collaborator

The job wasm32 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-21T09:54:20.6018737Z ========================== Starting Command Output ===========================
2020-03-21T09:54:20.6022165Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/176a3c32-c12c-4d8b-8f02-5b4759aaaba5.sh
2020-03-21T09:54:20.6022450Z 
2020-03-21T09:54:20.6027025Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-21T09:54:20.6046742Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-21T09:54:20.6050141Z Task         : Get sources
2020-03-21T09:54:20.6050460Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-21T09:54:20.6050767Z Version      : 1.0.0
2020-03-21T09:54:20.6050976Z Author       : Microsoft
---
2020-03-21T09:54:21.5960651Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-21T09:54:21.5966147Z ##[command]git config gc.auto 0
2020-03-21T09:54:21.5969768Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-21T09:54:21.5973084Z ##[command]git config --get-all http.proxy
2020-03-21T09:54:21.5978804Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/70212/merge:refs/remotes/pull/70212/merge
---
2020-03-21T09:57:29.3341873Z configure: build.locked-deps    := True
2020-03-21T09:57:29.3342171Z configure: llvm.ccache          := sccache
2020-03-21T09:57:29.3342666Z configure: build.cargo-native-static := True
2020-03-21T09:57:29.3343139Z configure: dist.missing-tools   := True
2020-03-21T09:57:29.3343731Z configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
2020-03-21T09:57:29.3344308Z configure: writing `config.toml` in current directory
2020-03-21T09:57:29.3344548Z configure: 
2020-03-21T09:57:29.3344954Z configure: run `python /checkout/x.py --help`
2020-03-21T09:57:29.3345196Z configure: 
---
2020-03-21T11:20:32.7037006Z    Compiling backtrace v0.3.44
2020-03-21T11:20:33.0920680Z    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
2020-03-21T11:20:34.1493718Z warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-emscripten`
2020-03-21T11:20:34.1497666Z 
2020-03-21T11:20:40.3005566Z error: internal compiler error: src/librustc_codegen_llvm/intrinsic.rs:1110: eh_catch_typeinfo not defined, but needed for emcc unwinding
2020-03-21T11:20:40.3007395Z thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9
2020-03-21T11:20:40.3008047Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-21T11:20:40.3008465Z 
2020-03-21T11:20:40.3008889Z note: the compiler unexpectedly panicked. this is a bug.
2020-03-21T11:20:40.3008889Z note: the compiler unexpectedly panicked. this is a bug.
2020-03-21T11:20:40.3009263Z 
2020-03-21T11:20:40.3010264Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2020-03-21T11:20:40.3011495Z note: rustc 1.44.0-nightly (0080865a2 2020-03-21) running on x86_64-unknown-linux-gnu
2020-03-21T11:20:40.3011965Z 
2020-03-21T11:20:40.3011965Z 
2020-03-21T11:20:40.3013398Z note: compiler flags: -Z macro-backtrace -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C prefer-dynamic -C opt-level=3 -C codegen-units=1 -C debuginfo=0 -C prefer-dynamic -C debug-assertions=y --crate-type dylib --crate-type rlib
2020-03-21T11:20:40.3014635Z note: some of the compiler flags provided by cargo are hidden
2020-03-21T11:20:40.3015018Z 
2020-03-21T11:20:40.3730561Z error: aborting due to previous error
2020-03-21T11:20:41.1975695Z 
---
2020-03-21T11:20:41.1986669Z   local time: Sat Mar 21 11:20:40 UTC 2020
2020-03-21T11:20:41.1987528Z   network time: Sat, 21 Mar 2020 11:20:40 GMT
2020-03-21T11:20:41.1988065Z == end clock drift check ==
2020-03-21T11:20:42.0580718Z 
2020-03-21T11:20:42.0642439Z ##[error]Bash exited with code '1'.
2020-03-21T11:20:42.0658608Z ##[section]Finishing: Run build
2020-03-21T11:20:42.0729762Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-21T11:20:42.0734839Z Task         : Get sources
2020-03-21T11:20:42.0735167Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-21T11:20:42.0735480Z Version      : 1.0.0
2020-03-21T11:20:42.0735691Z Author       : Microsoft
2020-03-21T11:20:42.0735691Z Author       : Microsoft
2020-03-21T11:20:42.0736034Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-21T11:20:42.0736437Z ==============================================================================
2020-03-21T11:20:42.3890526Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-21T11:20:42.3933905Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-21T11:20:42.4023662Z Cleaning up task key
2020-03-21T11:20:42.4024890Z Start cleaning up orphan processes.
2020-03-21T11:20:42.4199915Z Terminate orphan process: pid (3932) (python)
2020-03-21T11:20:42.4414069Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@Mark-Simulacrum
Copy link
Member

For some context -- are we intending to land this or is this for experimentation? I think at this point I would personally expect that catch_unwind and similar in Rust does not act at all (i.e., is essentially invisible) to exceptions from other languages, though we may have special handlers at FFI boundaries to abort on foreign exceptions (depending on outcome of unwind WG RFCs, I guess).

What is the behavior on the side of C++? Does try { cause_panic_in_rust(); } catch (...) { ... } catch the panic from Rust in C++? Is this "by specification" or just an accident? It does sound like that's by specification -- but it's hard for me to be sure.

I've not reviewed the implementation in great detail (I can do another pass later with more context).

@Mark-Simulacrum
Copy link
Member

(Also, please try to limit additional builders on PRs to at most 5, to limit strain on our limited CI resources).

@Amanieu
Copy link
Member Author

Amanieu commented Mar 21, 2020

In C++, try { cause_panic_in_rust(); } catch (...) { ... } will indeed catch a Rust panic. It can be either rethrown (throw;) or discarded, but capturing it in a std::exception_ptr (e.g. to rethrow it in another thread) will not work.

The reason for this change is that there is code that relies on catch_unwind for soundness (e.g. take_mut, so allowing foreign exceptions to unwind past catch_unwind would make that code unsound.

(I've removed the windows builders, it was just a one-off thing to check that I didn't break windows)

@Mark-Simulacrum
Copy link
Member

Hm, the soundness argument is interesting. I note that catch_unwind currently gives somewhat ambiguous wording in whether it's correct to use for e.g. take_mut:

Note that this function may not catch all panics in Rust. A panic in Rust is not always implemented via unwinding, but can be implemented by aborting the process as well. This function only catches unwinding panics, not those that abort the process."

To me, this implies that not only are aborts not caught, but also that not even all unwinding in Rust is caught by catch_unwind. But it sounds like (especially after this PR), we would want to update the documentation for catch_unwind to say something like: "catch_unwind guarantees that program execution either halts (e.g., via an abort) or that the catch closure executes, if unwinding occurs within the try closure." -- I believe this or similar is the wording we would need for take_mut to be correct.

There's also a middle ground which -- AFAICT, based on a brief skim -- this PR does not take: we can abort on non-Rust exceptions caught by catch_unwind instead of returning them in an opaque manner (as this PR does).

Am I correct that this PR intends catch_unwind and resume_unwind to work with C++ exceptions, though not if passed across thread boundaries? (i.e., same as C++ try/catch can today with Rust panics based on your comment?)

@rust-highfive
Copy link
Collaborator

The job wasm32 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-21T17:12:34.1393497Z ========================== Starting Command Output ===========================
2020-03-21T17:12:34.1396171Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/07b2fbd6-8b0f-46b8-9035-2674d456d430.sh
2020-03-21T17:12:34.1396495Z 
2020-03-21T17:12:34.1400524Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-21T17:12:34.1420325Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-21T17:12:34.1424026Z Task         : Get sources
2020-03-21T17:12:34.1424310Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-21T17:12:34.1424583Z Version      : 1.0.0
2020-03-21T17:12:34.1424821Z Author       : Microsoft
---
2020-03-21T17:12:35.1336186Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-21T17:12:35.1344171Z ##[command]git config gc.auto 0
2020-03-21T17:12:35.1350831Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-21T17:12:35.1356154Z ##[command]git config --get-all http.proxy
2020-03-21T17:12:35.1364749Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/70212/merge:refs/remotes/pull/70212/merge
---
2020-03-21T17:15:15.7618506Z configure: build.locked-deps    := True
2020-03-21T17:15:15.7618802Z configure: llvm.ccache          := sccache
2020-03-21T17:15:15.7619296Z configure: build.cargo-native-static := True
2020-03-21T17:15:15.7619776Z configure: dist.missing-tools   := True
2020-03-21T17:15:15.7620368Z configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
2020-03-21T17:15:15.7620938Z configure: writing `config.toml` in current directory
2020-03-21T17:15:15.7621172Z configure: 
2020-03-21T17:15:15.7621594Z configure: run `python /checkout/x.py --help`
2020-03-21T17:15:15.7621820Z configure: 
---
2020-03-21T18:50:31.6185536Z     Finished release [optimized] target(s) in 1m 45s
2020-03-21T18:50:32.2482254Z Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> wasm32-unknown-emscripten)
2020-03-21T18:50:35.2678631Z 
2020-03-21T18:50:35.2679401Z running 9815 tests
2020-03-21T18:52:02.6809024Z ......ii..i.......i......i.......iiii.....................................ii................i......i 100/9815
2020-03-21T18:52:55.2676576Z i.............i.......................i....iiiiiii.iii.............................................. 200/9815
2020-03-21T18:53:55.7057377Z ........................................................................................ii.......... 400/9815
2020-03-21T18:53:55.7057377Z ........................................................................................ii.......... 400/9815
2020-03-21T18:54:27.1846002Z ...............................................................iii.................................. 500/9815
2020-03-21T18:55:00.8601154Z ........i........................................................iii................................ 600/9815
2020-03-21T18:56:34.9111417Z ...............................................i.................................................... 800/9815
2020-03-21T18:56:47.5798095Z .................................................................................................... 900/9815
2020-03-21T18:57:01.6917655Z .................................................................i.................................. 1000/9815
2020-03-21T18:57:47.4581029Z .................................................................................i........i.i....... 1100/9815
2020-03-21T18:57:47.4581029Z .................................................................................i........i.i....... 1100/9815
2020-03-21T18:58:12.6180865Z ......................................i............................................................. 1200/9815
2020-03-21T18:58:22.4238285Z .............................................................................iiiii.................. 1300/9815
2020-03-21T18:59:20.0055033Z .............................................................................i.......F.............. 1500/9815
2020-03-21T18:59:47.1717734Z .................................................................................................... 1600/9815
2020-03-21T19:00:22.7399180Z .............................................................ii.i.................i................. 1700/9815
2020-03-21T19:00:46.5289282Z ................i..................i.i.............................................................. 1800/9815
2020-03-21T19:00:46.5289282Z ................i..................i.i.............................................................. 1800/9815
2020-03-21T19:01:31.3371692Z ..................................................i......i...................i...................ii. 1900/9815
2020-03-21T19:01:58.3296313Z .................................................................................................... 2000/9815
2020-03-21T19:02:31.5572004Z ...................................................................iiiii.....................i...... 2100/9815
2020-03-21T19:03:22.3134247Z .................................................................................................... 2200/9815
2020-03-21T19:03:32.4771665Z .............................iii...i................................................................ 2300/9815
2020-03-21T19:03:34.8520154Z .................................................................................................... 2400/9815
2020-03-21T19:03:38.1056866Z ...........................................................................iiii....................i 2500/9815
2020-03-21T19:04:14.5903757Z ......................................................................................iiiiiiiiiiiiii 2600/9815
2020-03-21T19:04:21.7457921Z i.........i...........................i..........ii................................................. 2700/9815
2020-03-21T19:05:48.0436093Z ................................i....i.............................................................. 2900/9815
2020-03-21T19:06:21.9138746Z .............i............i..i...................................................................... 3000/9815
2020-03-21T19:06:49.3840221Z ....................................i.....................................................i......... 3100/9815
2020-03-21T19:07:15.1080729Z .................................................................................................... 3200/9815
2020-03-21T19:07:15.1080729Z .................................................................................................... 3200/9815
2020-03-21T19:07:42.1237692Z .................................................................................................... 3300/9815
2020-03-21T19:08:05.7755573Z ..............................................................................................ii.... 3400/9815
2020-03-21T19:08:34.9136856Z ................ii.ii...................i...i................................i...................... 3500/9815
2020-03-21T19:09:50.5839415Z ..........................i...................i........................................i.......i.... 3700/9815
2020-03-21T19:10:30.2077543Z ....i............................i.................................................................. 3800/9815
2020-03-21T19:11:00.8166266Z ................................................i................................................... 3900/9815
2020-03-21T19:11:30.9853580Z ..............i...........................................................i......................... 4000/9815
---
2020-03-21T19:24:27.1608992Z ..............i............... 5400/9815
2020-03-21T19:25:00.3606489Z ................................................................................................i... 5500/9815
2020-03-21T19:25:15.9136851Z .......i..............................i............................................................. 5600/9815
2020-03-21T19:25:40.8281198Z ............i.......................................................i...............i............... 5700/9815
2020-03-21T19:26:21.3480783Z .............................ii.................F.................ii................................ 5800/9815
2020-03-21T19:26:57.0023059Z .........................................i...i...................................................... 5900/9815
2020-03-21T19:27:36.9804223Z .................................................................................................... 6000/9815
2020-03-21T19:28:11.1490398Z ......i.....................................................ii...i..ii...........i.................. 6100/9815
2020-03-21T19:28:45.2795707Z ...........i........i.i............................................................................. 6200/9815
2020-03-21T19:29:01.9009644Z .................................................................................................... 6400/9815
2020-03-21T19:29:01.9009644Z .................................................................................................... 6400/9815
2020-03-21T19:29:11.0582465Z ........................................................................i...F..........i..i..ii..... 6500/9815
2020-03-21T19:29:57.2038524Z ...........................i.....ii................................................................. 6600/9815
2020-03-21T19:30:42.1781084Z ...............................................................i..............................ii.... 6700/9815
2020-03-21T19:30:58.8688736Z ................iii...Fii.FFFi.iiiiii....................................................i.......... 6800/9815
2020-03-21T19:31:04.0800917Z .................................................................................................... 7000/9815
2020-03-21T19:31:06.3996144Z ........................i........................................................................... 7100/9815
2020-03-21T19:31:18.4654439Z ......................................................i............................................. 7200/9815
2020-03-21T19:31:34.1156741Z ...............................................................i.................................... 7300/9815
2020-03-21T19:31:34.1156741Z ...............................................................i.................................... 7300/9815
2020-03-21T19:32:59.0762277Z ...........................................................i........................................ 7400/9815
2020-03-21T19:34:04.4905659Z ........................i...i.......i...................iiiiiiii.............................F...... 7500/9815
2020-03-21T19:35:05.3066739Z .................................................................................................... 7700/9815
2020-03-21T19:35:31.7190667Z .................................................................................................... 7800/9815
2020-03-21T19:35:46.3656388Z .................................................................................................... 7900/9815
2020-03-21T19:36:08.1260190Z .............................................................................i...................... 8000/9815
2020-03-21T19:36:08.1260190Z .............................................................................i...................... 8000/9815
2020-03-21T19:37:01.1237214Z ...................................................................i................................ 8100/9815
2020-03-21T19:37:23.0379583Z ..........................iiiiiiiiii.i.............................................................. 8200/9815
2020-03-21T19:37:58.1100848Z ......................................i..............iii.....i......iiiiiiiiiii.i................... 8300/9815
2020-03-21T19:38:32.4320510Z .................................................................................................... 8500/9815
2020-03-21T19:39:46.1372325Z .........i.i.....................................................................i.................. 8600/9815
2020-03-21T19:40:26.8276657Z ...............................................i.................................................... 8700/9815
2020-03-21T19:40:40.2356282Z .................................................................................................... 8800/9815
2020-03-21T19:40:40.2356282Z .................................................................................................... 8800/9815
2020-03-21T19:41:50.0366654Z .........iii......i....................iiii....ii....i.i.....iiiiii.....iiiiiiii.ii...ii.iii..iiii.. 8900/9815
2020-03-21T19:43:22.2745024Z .................................................................................................... 9100/9815
2020-03-21T19:43:48.5835136Z ..............................................i..................................................... 9200/9815
2020-03-21T19:44:04.5911186Z .......................i............................................................................ 9300/9815
2020-03-21T19:44:37.1929349Z .................................................................................................... 9400/9815
---
2020-03-21T19:46:59.0756404Z 
2020-03-21T19:46:59.0756833Z - error: any use of this value will cause an error
2020-03-21T19:46:59.0757342Z -   --> $DIR/const_panic_libcore_main.rs:9:15
2020-03-21T19:46:59.0757710Z -    |
2020-03-21T19:46:59.0758084Z - LL | const Z: () = panic!("cheese");
2020-03-21T19:46:59.0758906Z -    |               |
2020-03-21T19:46:59.0758906Z -    |               |
2020-03-21T19:46:59.0759485Z -    |               the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:9:15
2020-03-21T19:46:59.0760359Z -    = note: `#[deny(const_err)]` on by default
2020-03-21T19:46:59.0761002Z -    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-03-21T19:46:59.0761002Z -    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-03-21T19:46:59.0761471Z + error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0762986Z - error: any use of this value will cause an error
2020-03-21T19:46:59.0763519Z -   --> $DIR/const_panic_libcore_main.rs:12:15
2020-03-21T19:46:59.0763895Z -    |
2020-03-21T19:46:59.0763895Z -    |
2020-03-21T19:46:59.0764274Z - LL | const Y: () = unreachable!();
2020-03-21T19:46:59.0765127Z -    |               |
2020-03-21T19:46:59.0765859Z -    |               the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_main.rs:12:15
2020-03-21T19:46:59.0766827Z -    |
2020-03-21T19:46:59.0767401Z -    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-03-21T19:46:59.0767401Z -    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-03-21T19:46:59.0767919Z - 
2020-03-21T19:46:59.0768631Z - error: any use of this value will cause an error
2020-03-21T19:46:59.0769137Z -   --> $DIR/const_panic_libcore_main.rs:15:15
2020-03-21T19:46:59.0769514Z -    |
2020-03-21T19:46:59.0769914Z - LL | const X: () = unimplemented!();
2020-03-21T19:46:59.0770578Z -    | --------------^^^^^^^^^^^^^^^^-
2020-03-21T19:46:59.0770955Z -    |               |
2020-03-21T19:46:59.0771574Z -    |               the evaluated program panicked at 'not implemented', $DIR/const_panic_libcore_main.rs:15:15
2020-03-21T19:46:59.0773143Z -    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-03-21T19:46:59.0773610Z - 
2020-03-21T19:46:59.0773990Z - error: aborting due to 3 previous errors
2020-03-21T19:46:59.0778028Z + error: aborting due to previous error
2020-03-21T19:46:59.0778028Z + error: aborting due to previous error
2020-03-21T19:46:59.0778242Z 33 
2020-03-21T19:46:59.0778365Z 34 
2020-03-21T19:46:59.0778470Z 
2020-03-21T19:46:59.0778567Z 
2020-03-21T19:46:59.0778773Z The actual stderr differed from the expected stderr.
2020-03-21T19:46:59.0779679Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/const_panic_libcore_main/const_panic_libcore_main.stderr
2020-03-21T19:46:59.0780370Z To update references, rerun the tests and pass the `--bless` flag
2020-03-21T19:46:59.0781029Z To only update this specific test, also pass `--test-args consts/const-eval/const_panic_libcore_main.rs`
2020-03-21T19:46:59.0781508Z error: 1 errors occurred comparing output.
2020-03-21T19:46:59.0781747Z status: exit code: 1
2020-03-21T19:46:59.0781747Z status: exit code: 1
2020-03-21T19:46:59.0783948Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/const_panic_libcore_main" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/const_panic_libcore_main/auxiliary"
2020-03-21T19:46:59.0785597Z ------------------------------------------
2020-03-21T19:46:59.0785767Z 
2020-03-21T19:46:59.0786118Z ------------------------------------------
2020-03-21T19:46:59.0786581Z stderr:
2020-03-21T19:46:59.0786581Z stderr:
2020-03-21T19:46:59.0786958Z ------------------------------------------
2020-03-21T19:46:59.0787285Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0787942Z error: aborting due to previous error
2020-03-21T19:46:59.0788108Z 
2020-03-21T19:46:59.0788204Z 
2020-03-21T19:46:59.0789316Z ------------------------------------------
---
2020-03-21T19:46:59.0790710Z 40 LL |             write!(f, "{}",)?;
2020-03-21T19:46:59.0794854Z 41    |                        ^^
2020-03-21T19:46:59.0795058Z 42 
2020-03-21T19:46:59.0795575Z - error: aborting due to 7 previous errors
2020-03-21T19:46:59.0795902Z + error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0796807Z + error: aborting due to 8 previous errors
2020-03-21T19:46:59.0797004Z 44 
2020-03-21T19:46:59.0829212Z 45 
2020-03-21T19:46:59.0829349Z 
2020-03-21T19:46:59.0829349Z 
2020-03-21T19:46:59.0829453Z 
2020-03-21T19:46:59.0829670Z The actual stderr differed from the expected stderr.
2020-03-21T19:46:59.0830948Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-behavior.core/macro-comma-behavior.core.stderr
2020-03-21T19:46:59.0831623Z To update references, rerun the tests and pass the `--bless` flag
2020-03-21T19:46:59.0832679Z To only update this specific test, also pass `--test-args macros/macro-comma-behavior.rs`
2020-03-21T19:46:59.0833187Z error in revision `core`: 1 errors occurred comparing output.
2020-03-21T19:46:59.0833680Z status: exit code: 1
2020-03-21T19:46:59.0833680Z status: exit code: 1
2020-03-21T19:46:59.0836063Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/macro-comma-behavior.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--cfg" "core" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-behavior.core" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-behavior.core/auxiliary"
2020-03-21T19:46:59.0837828Z ------------------------------------------
2020-03-21T19:46:59.0838009Z 
2020-03-21T19:46:59.0838371Z ------------------------------------------
2020-03-21T19:46:59.0838594Z stderr:
2020-03-21T19:46:59.0838594Z stderr:
2020-03-21T19:46:59.0838967Z ------------------------------------------
2020-03-21T19:46:59.0839291Z error: 1 positional argument in format string, but no arguments were given
2020-03-21T19:46:59.0839887Z   --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:20:23
2020-03-21T19:46:59.0840148Z    |
2020-03-21T19:46:59.0840330Z LL |     assert_eq!(1, 1, "{}",);
2020-03-21T19:46:59.0840719Z 
2020-03-21T19:46:59.0840965Z error: 1 positional argument in format string, but no arguments were given
2020-03-21T19:46:59.0841561Z   --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:23:23
2020-03-21T19:46:59.0841811Z    |
2020-03-21T19:46:59.0841811Z    |
2020-03-21T19:46:59.0841992Z LL |     assert_ne!(1, 2, "{}",);
2020-03-21T19:46:59.0842388Z 
2020-03-21T19:46:59.0842806Z error: 1 positional argument in format string, but no arguments were given
2020-03-21T19:46:59.0843358Z   --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:29:29
2020-03-21T19:46:59.0843613Z    |
2020-03-21T19:46:59.0843613Z    |
2020-03-21T19:46:59.0843795Z LL |     debug_assert_eq!(1, 1, "{}",);
2020-03-21T19:46:59.0844183Z 
2020-03-21T19:46:59.0844440Z error: 1 positional argument in format string, but no arguments were given
2020-03-21T19:46:59.0845194Z   --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:32:29
2020-03-21T19:46:59.0845444Z    |
2020-03-21T19:46:59.0845444Z    |
2020-03-21T19:46:59.0845648Z LL |     debug_assert_ne!(1, 2, "{}",);
2020-03-21T19:46:59.0846211Z 
2020-03-21T19:46:59.0846649Z error: 1 positional argument in format string, but no arguments were given
2020-03-21T19:46:59.0847216Z   --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:53:19
2020-03-21T19:46:59.0847470Z    |
2020-03-21T19:46:59.0847470Z    |
2020-03-21T19:46:59.0847659Z LL |     format_args!("{}",);
2020-03-21T19:46:59.0848060Z 
2020-03-21T19:46:59.0848305Z error: 1 positional argument in format string, but no arguments were given
2020-03-21T19:46:59.0849092Z   --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:71:21
2020-03-21T19:46:59.0849702Z    |
---
2020-03-21T19:46:59.0851923Z    |
2020-03-21T19:46:59.0852115Z LL |             write!(f, "{}",)?;
2020-03-21T19:46:59.0852352Z    |                        ^^
2020-03-21T19:46:59.0852669Z 
2020-03-21T19:46:59.0853806Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0854391Z error: aborting due to 8 previous errors
2020-03-21T19:46:59.0854584Z 
2020-03-21T19:46:59.0854682Z 
2020-03-21T19:46:59.0855161Z ------------------------------------------
2020-03-21T19:46:59.0855161Z ------------------------------------------
2020-03-21T19:46:59.0855343Z 
2020-03-21T19:46:59.0855442Z 
2020-03-21T19:46:59.0855864Z ---- [ui] ui/no_owned_box_lang_item.rs stdout ----
2020-03-21T19:46:59.0856105Z diff of stderr:
2020-03-21T19:46:59.0856233Z 
2020-03-21T19:46:59.0856604Z + error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0857077Z 1 error: requires `owned_box` lang_item
2020-03-21T19:46:59.0857272Z 2 
2020-03-21T19:46:59.0857700Z - error: aborting due to previous error
2020-03-21T19:46:59.0857979Z + error: aborting due to 2 previous errors
2020-03-21T19:46:59.0857979Z + error: aborting due to 2 previous errors
2020-03-21T19:46:59.0858179Z 4 
2020-03-21T19:46:59.0858319Z 5 
2020-03-21T19:46:59.0858424Z 
2020-03-21T19:46:59.0858524Z 
2020-03-21T19:46:59.0858736Z The actual stderr differed from the expected stderr.
2020-03-21T19:46:59.0859474Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no_owned_box_lang_item/no_owned_box_lang_item.stderr
2020-03-21T19:46:59.0860144Z To update references, rerun the tests and pass the `--bless` flag
2020-03-21T19:46:59.0860774Z To only update this specific test, also pass `--test-args no_owned_box_lang_item.rs`
2020-03-21T19:46:59.0861229Z error: 1 errors occurred comparing output.
2020-03-21T19:46:59.0861478Z status: exit code: 1
2020-03-21T19:46:59.0861478Z status: exit code: 1
2020-03-21T19:46:59.0863788Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/no_owned_box_lang_item.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no_owned_box_lang_item" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no_owned_box_lang_item/auxiliary"
2020-03-21T19:46:59.0865449Z ------------------------------------------
2020-03-21T19:46:59.0865632Z 
2020-03-21T19:46:59.0866008Z ------------------------------------------
2020-03-21T19:46:59.0866237Z stderr:
2020-03-21T19:46:59.0866237Z stderr:
2020-03-21T19:46:59.0866622Z ------------------------------------------
2020-03-21T19:46:59.0866965Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0867412Z error: requires `owned_box` lang_item
2020-03-21T19:46:59.0867584Z 
2020-03-21T19:46:59.0868071Z error: aborting due to 2 previous errors
2020-03-21T19:46:59.0868269Z 
---
2020-03-21T19:46:59.0869502Z ---- [ui] ui/panic-runtime/link-to-abort.rs stdout ----
2020-03-21T19:46:59.0870375Z 
2020-03-21T19:46:59.0871332Z error: test compilation failed although it shouldn't!
2020-03-21T19:46:59.0871616Z status: exit code: 1
2020-03-21T19:46:59.0873688Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/panic-runtime/link-to-abort.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.js" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-C" "panic=abort" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/auxiliary"
2020-03-21T19:46:59.0875561Z ------------------------------------------
2020-03-21T19:46:59.0877402Z 
2020-03-21T19:46:59.0877870Z ------------------------------------------
2020-03-21T19:46:59.0878237Z stderr:
2020-03-21T19:46:59.0878237Z stderr:
2020-03-21T19:46:59.0878662Z ------------------------------------------
2020-03-21T19:46:59.0878986Z error: linking with `emcc` failed: exit code: 1
2020-03-21T19:46:59.0879219Z    |
2020-03-21T19:46:59.0891116Z    = note: "emcc" "-s" "DISABLE_EXCEPTION_CATCHING=1" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.1.rcgu.o" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.js" "-s" "EXPORTED_FUNCTIONS=[\"_main\",\"_rust_eh_personality\"]" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.4hgw2zitnpvuzihs.rcgu.o" "-O2" "--memory-init-file" "0" "-g0" "-s" "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]" "-L" "/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/auxiliary" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-90a14715185f1e04.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_abort-c6bc0c8c141f7ae8.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-fc74f8b041b9ecca.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-2251c0700d84727f.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libbacktrace-3772ab2e3c5d21db.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-1e628ec036d91e60.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-3442107804c1b2f9.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-6449a1b3aa986018.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-07cd903545e5136b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-7075ff8fcd9e3c8b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-097bf655430f1ab7.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-bda184b8b23ac7fa.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-a6af0508d3a0b2e1.rlib" "-l" "c" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1" "-s" "ASSERTIONS=1" "-s" "ABORTING_MALLOC=0" "-Wl,--fatal-warnings"
2020-03-21T19:46:59.0904303Z    = note: cache:INFO: generating system library: libc++abi-noexcept.a... (this will be cached in "/root/.emscripten_cache/wasm-obj/libc++abi-noexcept.a" for subsequent builds)
2020-03-21T19:46:59.0905078Z            cache:INFO:  - ok
2020-03-21T19:46:59.0906122Z            wasm-ld: error: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-90a14715185f1e04.rlib(std-90a14715185f1e04.std.559a6xlu-cgu.0.rcgu.o): undefined symbol: rust_eh_catch_typeinfo
2020-03-21T19:46:59.0908093Z            wasm-ld: error: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-90a14715185f1e04.rlib(std-90a14715185f1e04.std.559a6xlu-cgu.0.rcgu.o): undefined symbol: rust_eh_catch_typeinfo
2020-03-21T19:46:59.0919849Z            shared:ERROR: '/emsdk-portable/upstream/bin/wasm-ld -o /tmp/emscripten_temp_2kYRNL/a.wasm --allow-undefined --lto-O0 -L/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.0.rcgu.o /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.1.rcgu.o /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.4hgw2zitnpvuzihs.rcgu.o -L/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers -L/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/auxiliary -L/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-90a14715185f1e04.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_abort-c6bc0c8c141f7ae8.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-fc74f8b041b9ecca.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-2251c0700d84727f.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libbacktrace-3772ab2e3c5d21db.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-1e628ec036d91e60.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-3442107804c1b2f9.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-6449a1b3aa986018.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-07cd903545e5136b.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-7075ff8fcd9e3c8b.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-097bf655430f1ab7.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-bda184b8b23ac7fa.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-a6af0508d3a0b2e1.rlib -lc --fatal-warnings -L/emsdk-portable/upstream/emscripten/system/local/lib -L/emsdk-portable/upstream/emscripten/system/lib -L/root/.emscripten_cache/wasm-obj /root/.emscripten_cache/wasm-obj/libc.a /root/.emscripten_cache/wasm-obj/libcompiler_rt.a /root/.emscripten_cache/wasm-obj/libc-wasm.a /root/.emscripten_cache/wasm-obj/libc++abi-noexcept.a /root/.emscripten_cache/wasm-obj/libc-extras.a /root/.emscripten_cache/wasm-obj/libdlmalloc.a /root/.emscripten_cache/wasm-obj/libpthread_stub.a /root/.emscripten_cache/wasm-obj/libc_rt_wasm.a --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --export __wasm_call_ctors --export __data_end --export main --export rust_eh_personality --export malloc --export free --export setThrew --export __errno_location --export fflush --export htonl --export htons --export ntohs --export _get_environ --export __cxa_is_pointer_type --export __cxa_can_catch -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (1)
2020-03-21T19:46:59.0926968Z 
2020-03-21T19:46:59.0927171Z error: aborting due to previous error
2020-03-21T19:46:59.0927345Z 
2020-03-21T19:46:59.0927445Z 
2020-03-21T19:46:59.0927445Z 
2020-03-21T19:46:59.0927929Z ------------------------------------------
2020-03-21T19:46:59.0928113Z 
2020-03-21T19:46:59.0928232Z 
2020-03-21T19:46:59.0928679Z ---- [ui] ui/panic-runtime/transitive-link-a-bunch.rs stdout ----
2020-03-21T19:46:59.0928904Z 
2020-03-21T19:46:59.0929315Z error: test compilation failed although it shouldn't!
2020-03-21T19:46:59.0929601Z status: exit code: 1
2020-03-21T19:46:59.0932455Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/panic-runtime/transitive-link-a-bunch.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/transitive-link-a-bunch" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/transitive-link-a-bunch/auxiliary"
2020-03-21T19:46:59.0934275Z ------------------------------------------
2020-03-21T19:46:59.0934476Z 
2020-03-21T19:46:59.0934853Z ------------------------------------------
2020-03-21T19:46:59.0935063Z stderr:
2020-03-21T19:46:59.0935063Z stderr:
2020-03-21T19:46:59.0935465Z ------------------------------------------
2020-03-21T19:46:59.0935805Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0936242Z error: aborting due to previous error
2020-03-21T19:46:59.0936430Z 
2020-03-21T19:46:59.0936529Z 
2020-03-21T19:46:59.0936903Z ------------------------------------------
2020-03-21T19:46:59.0936903Z ------------------------------------------
2020-03-21T19:46:59.0937083Z 
2020-03-21T19:46:59.0937183Z 
2020-03-21T19:46:59.0937630Z ---- [ui] ui/panic-runtime/want-unwind-got-abort.rs stdout ----
2020-03-21T19:46:59.0937848Z 
2020-03-21T19:46:59.0938258Z error: test compilation failed although it shouldn't!
2020-03-21T19:46:59.0938543Z status: exit code: 1
2020-03-21T19:46:59.0940642Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/panic-runtime/want-unwind-got-abort.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/want-unwind-got-abort" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/want-unwind-got-abort/auxiliary"
2020-03-21T19:46:59.0942365Z ------------------------------------------
2020-03-21T19:46:59.0942756Z 
2020-03-21T19:46:59.0943137Z ------------------------------------------
2020-03-21T19:46:59.0943339Z stderr:
2020-03-21T19:46:59.0943339Z stderr:
2020-03-21T19:46:59.0943714Z ------------------------------------------
2020-03-21T19:46:59.0944057Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0944470Z error: aborting due to previous error
2020-03-21T19:46:59.0944635Z 
2020-03-21T19:46:59.0944750Z 
2020-03-21T19:46:59.0945112Z ------------------------------------------
2020-03-21T19:46:59.0945112Z ------------------------------------------
2020-03-21T19:46:59.0945285Z 
2020-03-21T19:46:59.0945559Z 
2020-03-21T19:46:59.0946013Z ---- [ui] ui/panic-runtime/want-unwind-got-abort2.rs stdout ----
2020-03-21T19:46:59.0946239Z 
2020-03-21T19:46:59.0946648Z error: test compilation failed although it shouldn't!
2020-03-21T19:46:59.0946916Z status: exit code: 1
2020-03-21T19:46:59.0950042Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/panic-runtime/want-unwind-got-abort2.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/want-unwind-got-abort2" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/want-unwind-got-abort2/auxiliary"
2020-03-21T19:46:59.0951777Z ------------------------------------------
2020-03-21T19:46:59.0951958Z 
2020-03-21T19:46:59.0952485Z ------------------------------------------
2020-03-21T19:46:59.0952717Z stderr:
2020-03-21T19:46:59.0952717Z stderr:
2020-03-21T19:46:59.0953103Z ------------------------------------------
2020-03-21T19:46:59.0953441Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0953888Z error: aborting due to previous error
2020-03-21T19:46:59.0954058Z 
2020-03-21T19:46:59.0954156Z 
2020-03-21T19:46:59.0954547Z ------------------------------------------
2020-03-21T19:46:59.0954547Z ------------------------------------------
2020-03-21T19:46:59.0954726Z 
2020-03-21T19:46:59.0954903Z 
2020-03-21T19:46:59.0955345Z ---- [ui] ui/range/issue-54505-no-std.rs stdout ----
2020-03-21T19:46:59.0955609Z diff of stderr:
2020-03-21T19:46:59.0955737Z 
2020-03-21T19:46:59.0955971Z 1 error: `#[panic_handler]` function required, but not found
2020-03-21T19:46:59.0956206Z 2 
2020-03-21T19:46:59.0956494Z + error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0956949Z 3 error[E0308]: mismatched types
2020-03-21T19:46:59.0957440Z 4   --> $DIR/issue-54505-no-std.rs:24:16
2020-03-21T19:46:59.0957663Z 5    |
2020-03-21T19:46:59.0957774Z 
2020-03-21T19:46:59.0957774Z 
2020-03-21T19:46:59.0957983Z 72    = note: expected reference `&_`
2020-03-21T19:46:59.0958333Z 73                  found struct `core::ops::RangeToInclusive<{integer}>`
2020-03-21T19:46:59.0958996Z - error: aborting due to 7 previous errors
2020-03-21T19:46:59.0959294Z + error: aborting due to 8 previous errors
2020-03-21T19:46:59.0959497Z 76 
2020-03-21T19:46:59.0959965Z 77 For more information about this error, try `rustc --explain E0308`.
2020-03-21T19:46:59.0959965Z 77 For more information about this error, try `rustc --explain E0308`.
2020-03-21T19:46:59.0960236Z 78 
2020-03-21T19:46:59.0960342Z 
2020-03-21T19:46:59.0960441Z 
2020-03-21T19:46:59.0960654Z The actual stderr differed from the expected stderr.
2020-03-21T19:46:59.0961526Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/range/issue-54505-no-std/issue-54505-no-std.stderr
2020-03-21T19:46:59.0962172Z To update references, rerun the tests and pass the `--bless` flag
2020-03-21T19:46:59.0962791Z To only update this specific test, also pass `--test-args range/issue-54505-no-std.rs`
2020-03-21T19:46:59.0963231Z error: 1 errors occurred comparing output.
2020-03-21T19:46:59.0963466Z status: exit code: 1
2020-03-21T19:46:59.0963466Z status: exit code: 1
2020-03-21T19:46:59.0965425Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/range/issue-54505-no-std.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/range/issue-54505-no-std" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/range/issue-54505-no-std/auxiliary"
2020-03-21T19:46:59.0967219Z ------------------------------------------
2020-03-21T19:46:59.0967407Z 
2020-03-21T19:46:59.0968032Z ------------------------------------------
2020-03-21T19:46:59.0968268Z stderr:
2020-03-21T19:46:59.0968268Z stderr:
2020-03-21T19:46:59.0968658Z ------------------------------------------
2020-03-21T19:46:59.0968966Z error: `#[panic_handler]` function required, but not found
2020-03-21T19:46:59.0969195Z 
2020-03-21T19:46:59.0969457Z error: language item required, but not found: `eh_catch_typeinfo`
2020-03-21T19:46:59.0969883Z error[E0308]: mismatched types
2020-03-21T19:46:59.0970563Z   --> /checkout/src/test/ui/range/issue-54505-no-std.rs:24:16
2020-03-21T19:46:59.0970809Z    |
2020-03-21T19:46:59.0970977Z LL |     take_range(0..1);
2020-03-21T19:46:59.0970977Z LL |     take_range(0..1);
2020-03-21T19:46:59.0971197Z    |                ^^^^
2020-03-21T19:46:59.0971389Z    |                |
2020-03-21T19:46:59.0971698Z    |                expected reference, found struct `core::ops::Range`
2020-03-21T19:46:59.0972120Z    |                help: consider borrowing here: `&(0..1)`
2020-03-21T19:46:59.0972474Z    |
2020-03-21T19:46:59.0972661Z    = note: expected reference `&_`
2020-03-21T19:46:59.0972981Z                  found struct `core::ops::Range<{integer}>`
2020-03-21T19:46:59.0973373Z error[E0308]: mismatched types
2020-03-21T19:46:59.0973900Z   --> /checkout/src/test/ui/range/issue-54505-no-std.rs:29:16
2020-03-21T19:46:59.0974161Z    |
2020-03-21T19:46:59.0974327Z LL |     take_range(1..);
2020-03-21T19:46:59.0974327Z LL |     take_range(1..);
2020-03-21T19:46:59.0974526Z    |                ^^^
2020-03-21T19:46:59.0974804Z    |                |
2020-03-21T19:46:59.0975126Z    |                expected reference, found struct `core::ops::RangeFrom`
2020-03-21T19:46:59.0975529Z    |                help: consider borrowing here: `&(1..)`
2020-03-21T19:46:59.0975794Z    |
2020-03-21T19:46:59.0975980Z    = note: expected reference `&_`
2020-03-21T19:46:59.0976290Z                  found struct `core::ops::RangeFrom<{integer}>`
2020-03-21T19:46:59.0976887Z error[E0308]: mismatched types
2020-03-21T19:46:59.0977601Z   --> /checkout/src/test/ui/range/issue-54505-no-std.rs:34:16
2020-03-21T19:46:59.0977846Z    |
2020-03-21T19:46:59.0978026Z LL |     take_range(..);
---
2020-03-21T19:46:59.0981685Z LL |     take_range(0..=1);
2020-03-21T19:46:59.0981907Z    |                ^^^^^
2020-03-21T19:46:59.0982103Z    |                |
2020-03-21T19:46:59.0982434Z    |                expected reference, found struct `core::ops::RangeInclusive`
2020-03-21T19:46:59.0982869Z    |                help: consider borrowing here: `&(0..=1)`
2020-03-21T19:46:59.0983309Z    = note: expected reference `&_`
2020-03-21T19:46:59.0983309Z    = note: expected reference `&_`
2020-03-21T19:46:59.0983646Z                  found struct `core::ops::RangeInclusive<{integer}>`
2020-03-21T19:46:59.0984054Z error[E0308]: mismatched types
2020-03-21T19:46:59.0984578Z   --> /checkout/src/test/ui/range/issue-54505-no-std.rs:44:16
2020-03-21T19:46:59.0984823Z    |
2020-03-21T19:46:59.0984990Z LL |     take_range(..5);
2020-03-21T19:46:59.0984990Z LL |     take_range(..5);
2020-03-21T19:46:59.0985188Z    |                ^^^
2020-03-21T19:46:59.0985397Z    |                |
2020-03-21T19:46:59.0985710Z    |                expected reference, found struct `core::ops::RangeTo`
2020-03-21T19:46:59.0986110Z    |                help: consider borrowing here: `&(..5)`
2020-03-21T19:46:59.0986546Z    |
2020-03-21T19:46:59.0986743Z    = note: expected reference `&_`
2020-03-21T19:46:59.0987060Z                  found struct `core::ops::RangeTo<{integer}>`
2020-03-21T19:46:59.0987485Z error[E0308]: mismatched types
2020-03-21T19:46:59.0988283Z   --> /checkout/src/test/ui/range/issue-54505-no-std.rs:49:16
2020-03-21T19:46:59.0988538Z    |
2020-03-21T19:46:59.0988733Z LL |     take_range(..=42);
2020-03-21T19:46:59.0988733Z LL |     take_range(..=42);
2020-03-21T19:46:59.0988946Z    |                ^^^^^
2020-03-21T19:46:59.0989148Z    |                |
2020-03-21T19:46:59.0989510Z    |                expected reference, found struct `core::ops::RangeToInclusive`
2020-03-21T19:46:59.0990087Z    |                help: consider borrowing here: `&(..=42)`
2020-03-21T19:46:59.0990540Z    = note: expected reference `&_`
2020-03-21T19:46:59.0990540Z    = note: expected reference `&_`
2020-03-21T19:46:59.0990862Z                  found struct `core::ops::RangeToInclusive<{integer}>`
2020-03-21T19:46:59.0991302Z error: aborting due to 8 previous errors
2020-03-21T19:46:59.0991588Z 
2020-03-21T19:46:59.0992229Z For more information about this error, try `rustc --explain E0308`.
2020-03-21T19:46:59.0992456Z 
---
2020-03-21T19:46:59.0998733Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-21T19:46:59.0999164Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-21T19:46:59.0999423Z 
2020-03-21T19:46:59.0999523Z 
2020-03-21T19:46:59.1003748Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-wasm32-unknown-emscripten" "--mode" "ui" "--target" "wasm32-unknown-emscripten" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/emsdk-portable/node/12.9.1_64bit/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.1-rust-1.44.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-21T19:46:59.1006776Z 
2020-03-21T19:46:59.1006878Z 
2020-03-21T19:46:59.1007823Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-emscripten --exclude src/libcore --exclude src/liballoc --exclude src/libproc_macro --exclude src/libstd --exclude src/libterm --exclude src/libtest
2020-03-21T19:46:59.1008477Z Build completed unsuccessfully in 2:29:52
2020-03-21T19:46:59.1008477Z Build completed unsuccessfully in 2:29:52
2020-03-21T19:46:59.1008736Z == clock drift check ==
2020-03-21T19:46:59.1009009Z   local time: Sat Mar 21 19:46:59 UTC 2020
2020-03-21T19:46:59.3823495Z   network time: Sat, 21 Mar 2020 19:46:59 GMT
2020-03-21T19:46:59.3827139Z == end clock drift check ==
2020-03-21T19:46:59.7856986Z 
2020-03-21T19:46:59.7913622Z ##[error]Bash exited with code '1'.
2020-03-21T19:46:59.7929025Z ##[section]Finishing: Run build
2020-03-21T19:46:59.7984089Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-21T19:46:59.7990937Z Task         : Get sources
2020-03-21T19:46:59.7991290Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-21T19:46:59.7991783Z Version      : 1.0.0
2020-03-21T19:46:59.7991998Z Author       : Microsoft
2020-03-21T19:46:59.7991998Z Author       : Microsoft
2020-03-21T19:46:59.7992351Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-21T19:46:59.7992742Z ==============================================================================
2020-03-21T19:47:00.1434597Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-21T19:47:00.1484039Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-21T19:47:00.1579791Z Cleaning up task key
2020-03-21T19:47:00.1581085Z Start cleaning up orphan processes.
2020-03-21T19:47:00.1782267Z Terminate orphan process: pid (3461) (python)
2020-03-21T19:47:00.2054730Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job wasm32 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-22T10:58:20.2780083Z ========================== Starting Command Output ===========================
2020-03-22T10:58:20.2782779Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/3bd362fe-2644-4981-974a-382d8577e613.sh
2020-03-22T10:58:20.2783172Z 
2020-03-22T10:58:20.2787345Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-22T10:58:20.2805444Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-22T10:58:20.2810602Z Task         : Get sources
2020-03-22T10:58:20.2811380Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-22T10:58:20.2811718Z Version      : 1.0.0
2020-03-22T10:58:20.2811877Z Author       : Microsoft
---
2020-03-22T10:58:23.1810175Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-22T10:58:23.1818598Z ##[command]git config gc.auto 0
2020-03-22T10:58:23.1831618Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-22T10:58:23.1837832Z ##[command]git config --get-all http.proxy
2020-03-22T10:58:23.1845190Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/70212/merge:refs/remotes/pull/70212/merge
---
2020-03-22T11:02:15.7988233Z configure: build.locked-deps    := True
2020-03-22T11:02:15.7988586Z configure: llvm.ccache          := sccache
2020-03-22T11:02:15.7989253Z configure: build.cargo-native-static := True
2020-03-22T11:02:15.7989804Z configure: dist.missing-tools   := True
2020-03-22T11:02:15.7990402Z configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
2020-03-22T11:02:15.7991248Z configure: writing `config.toml` in current directory
2020-03-22T11:02:15.7991526Z configure: 
2020-03-22T11:02:15.7991988Z configure: run `python /checkout/x.py --help`
2020-03-22T11:02:15.7992285Z configure: 
---
2020-03-22T12:24:46.9450484Z     Finished release [optimized] target(s) in 1m 32s
2020-03-22T12:24:46.9690124Z Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> wasm32-unknown-emscripten)
2020-03-22T12:24:50.0285262Z 
2020-03-22T12:24:50.0286118Z running 9818 tests
2020-03-22T12:26:04.3858710Z ......ii..i.......i......i.......iiii.....................................ii................i......i 100/9818
2020-03-22T12:26:49.0293335Z i.............i.......................i....iiiiiii.iii.............................................. 200/9818
2020-03-22T12:27:41.6044066Z ........................................................................................ii.......... 400/9818
2020-03-22T12:27:41.6044066Z ........................................................................................ii.......... 400/9818
2020-03-22T12:28:08.8144062Z ...............................................................iii.................................. 500/9818
2020-03-22T12:28:39.2900784Z ........i........................................................iii................................ 600/9818
2020-03-22T12:30:02.2683503Z ...............................................i.................................................... 800/9818
2020-03-22T12:30:12.8685766Z .................................................................................................... 900/9818
2020-03-22T12:30:24.5037064Z .................................................................i.................................. 1000/9818
2020-03-22T12:31:03.4253601Z .................................................................................i........i.i....... 1100/9818
2020-03-22T12:31:03.4253601Z .................................................................................i........i.i....... 1100/9818
2020-03-22T12:31:24.4912991Z ......................................i............................................................. 1200/9818
2020-03-22T12:31:33.1825579Z .............................................................................iiiii.................. 1300/9818
2020-03-22T12:32:25.4232850Z ..............................................................................i..................... 1500/9818
2020-03-22T12:32:49.9809770Z .................................................................................................... 1600/9818
2020-03-22T12:33:24.4209722Z ..............................................................ii.i.................i................ 1700/9818
2020-03-22T12:33:45.6188474Z .................i..................i.i............................................................. 1800/9818
2020-03-22T12:33:45.6188474Z .................i..................i.i............................................................. 1800/9818
2020-03-22T12:34:23.9350192Z ...................................................i......i...................i...................ii 1900/9818
2020-03-22T12:34:46.5118500Z .................................................................................................... 2000/9818
2020-03-22T12:35:13.5996048Z ....................................................................iiiii.....................i..... 2100/9818
2020-03-22T12:35:57.3586572Z .................................................................................................... 2200/9818
2020-03-22T12:36:05.8735558Z ..............................iii...i............................................................... 2300/9818
2020-03-22T12:36:07.8219945Z .................................................................................................... 2400/9818
2020-03-22T12:36:10.5688212Z ............................................................................iiii.................... 2500/9818
2020-03-22T12:36:41.2396025Z i......................................................................................iiiiiiiiiiiii 2600/9818
2020-03-22T12:36:46.8072420Z ii.........i...........................i..........ii................................................ 2700/9818
2020-03-22T12:37:56.9357217Z .................................i....i............................................................. 2900/9818
2020-03-22T12:38:25.8792391Z ..............i............i..i..................................................................... 3000/9818
2020-03-22T12:38:49.1212870Z .....................................i.....................................................i........ 3100/9818
2020-03-22T12:39:11.7088517Z .................................................................................................... 3200/9818
2020-03-22T12:39:11.7088517Z .................................................................................................... 3200/9818
2020-03-22T12:39:33.1794366Z .................................................................................................... 3300/9818
2020-03-22T12:39:54.3302523Z ...............................................................................................ii... 3400/9818
2020-03-22T12:40:18.9255449Z .................ii.ii...................i...i................................i..................... 3500/9818
2020-03-22T12:41:21.6491449Z ...........................i...................i........................................i.......i... 3700/9818
2020-03-22T12:41:55.6232428Z .....i............................i................................................................. 3800/9818
2020-03-22T12:42:21.4931661Z .................................................i.................................................. 3900/9818
2020-03-22T12:42:46.1232770Z ...............i...........................................................i........................ 4000/9818
---
2020-03-22T12:53:51.2282401Z ..............i............. 5400/9818
2020-03-22T12:54:19.8645833Z ..................................................................................................i. 5500/9818
2020-03-22T12:54:35.9693008Z .........i..............................i........................................................... 5600/9818
2020-03-22T12:54:56.9353310Z ..............i.......................................................i...............i............. 5700/9818
2020-03-22T12:55:33.5276837Z ...............................ii...................................ii.............................. 5800/9818
2020-03-22T12:56:04.3462628Z ...........................................i...i.................................................... 5900/9818
2020-03-22T12:56:37.4989950Z .................................................................................................... 6000/9818
2020-03-22T12:57:07.5115900Z ........i.....................................................ii...i..ii...........i................ 6100/9818
2020-03-22T12:57:36.1325331Z .............i........i.i........................................................................... 6200/9818
2020-03-22T12:57:51.2974834Z .................................................................................................... 6400/9818
2020-03-22T12:57:51.2974834Z .................................................................................................... 6400/9818
2020-03-22T12:57:59.3218454Z ..........................................................................i..............i..i..ii... 6500/9818
2020-03-22T12:58:40.0495252Z .............................i.....ii............................................................... 6600/9818
2020-03-22T12:59:17.5646321Z .................................................................i..............................ii.. 6700/9818
2020-03-22T12:59:32.8594017Z ..................iii...Fii....i.iiiiii....................................................i........ 6800/9818
2020-03-22T12:59:37.6636760Z .................................................................................................... 7000/9818
2020-03-22T12:59:39.7232613Z ..........................i......................................................................... 7100/9818
2020-03-22T12:59:50.3359583Z ........................................................i........................................... 7200/9818
2020-03-22T13:00:03.8557025Z .................................................................i.................................. 7300/9818
2020-03-22T13:00:03.8557025Z .................................................................i.................................. 7300/9818
2020-03-22T13:01:15.8030783Z .............................................................i...................................... 7400/9818
2020-03-22T13:02:14.6321182Z ..........................i...i........i...................iiiiiiii................................. 7500/9818
2020-03-22T13:03:06.2529757Z .................................................................................................... 7700/9818
2020-03-22T13:03:29.8636714Z .................................................................................................... 7800/9818
2020-03-22T13:03:42.4466389Z .................................................................................................... 7900/9818
2020-03-22T13:04:00.3370379Z ................................................................................i................... 8000/9818
2020-03-22T13:04:00.3370379Z ................................................................................i................... 8000/9818
2020-03-22T13:04:43.9432530Z ......................................................................i............................. 8100/9818
2020-03-22T13:05:03.8954588Z .............................iiiiiiiiii.i........................................................... 8200/9818
2020-03-22T13:05:33.4326665Z .........................................i..............iii.....i......iiiiiiiiiii.i................ 8300/9818
2020-03-22T13:06:02.7793165Z .................................................................................................... 8500/9818
2020-03-22T13:07:04.6594473Z ............i.i.....................................................................i............... 8600/9818
2020-03-22T13:07:42.2970103Z ..................................................i................................................. 8700/9818
2020-03-22T13:07:53.0521633Z .................................................................................................... 8800/9818
2020-03-22T13:07:53.0521633Z .................................................................................................... 8800/9818
2020-03-22T13:08:52.1934072Z ............iii......i....................iiii....ii....i.i.....iiiiii.....iiiiiiii.ii...ii.iii..iii 8900/9818
2020-03-22T13:09:29.5945064Z i...............................................................i................................... 9000/9818
2020-03-22T13:10:36.8963031Z .................................................i.................................................. 9200/9818
2020-03-22T13:10:50.9296355Z ..........................i......................................................................... 9300/9818
2020-03-22T13:11:17.0602146Z .................................................................................................... 9400/9818
2020-03-22T13:11:49.6105680Z .................................................................................................... 9500/9818
---
2020-03-22T13:13:18.2906914Z ---- [ui] ui/panic-runtime/link-to-abort.rs stdout ----
2020-03-22T13:13:18.2907098Z 
2020-03-22T13:13:18.2907482Z error: test compilation failed although it shouldn't!
2020-03-22T13:13:18.2907718Z status: exit code: 1
2020-03-22T13:13:18.2909441Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/panic-runtime/link-to-abort.rs" "-Zthreads=1" "--target=wasm32-unknown-emscripten" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.js" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-C" "panic=abort" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/auxiliary"
2020-03-22T13:13:18.2911178Z ------------------------------------------
2020-03-22T13:13:18.2911333Z 
2020-03-22T13:13:18.2911612Z ------------------------------------------
2020-03-22T13:13:18.2911771Z stderr:
2020-03-22T13:13:18.2911771Z stderr:
2020-03-22T13:13:18.2912054Z ------------------------------------------
2020-03-22T13:13:18.2912304Z error: linking with `emcc` failed: exit code: 1
2020-03-22T13:13:18.2912481Z    |
2020-03-22T13:13:18.2919001Z    = note: "emcc" "-s" "DISABLE_EXCEPTION_CATCHING=1" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.1.rcgu.o" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.js" "-s" "EXPORTED_FUNCTIONS=[\"_main\",\"_rust_eh_personality\"]" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.4hgw2zitnpvuzihs.rcgu.o" "-O2" "--memory-init-file" "0" "-g0" "-s" "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]" "-L" "/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/auxiliary" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-649ead28735e66bb.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_abort-587216951de5aadc.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-9f402acba710984b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-d4b94f9ef3267bc9.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libbacktrace-a419154407e135b4.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-9bcd7ed55114abfd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-52b7539f915078e8.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-c88276a1179c4990.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-a80fc12e123f7783.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-291d5652fb98867a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-74bc0e65f45846ac.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-bcc92ad1c6190631.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-eb3e1e6234b8fa89.rlib" "-l" "c" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1" "-s" "ASSERTIONS=1" "-s" "ABORTING_MALLOC=0" "-Wl,--fatal-warnings"
2020-03-22T13:13:18.2924013Z    = note: cache:INFO: generating system library: libc++abi-noexcept.a... (this will be cached in "/root/.emscripten_cache/wasm-obj/libc++abi-noexcept.a" for subsequent builds)
2020-03-22T13:13:18.2924563Z            cache:INFO:  - ok
2020-03-22T13:13:18.2925546Z            wasm-ld: error: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-649ead28735e66bb.rlib(std-649ead28735e66bb.std.9ruk0nu2-cgu.0.rcgu.o): undefined symbol: rust_eh_catch_typeinfo
2020-03-22T13:13:18.2926695Z            wasm-ld: error: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-649ead28735e66bb.rlib(std-649ead28735e66bb.std.9ruk0nu2-cgu.0.rcgu.o): undefined symbol: rust_eh_catch_typeinfo
2020-03-22T13:13:18.2938618Z            shared:ERROR: '/emsdk-portable/upstream/bin/wasm-ld -o /tmp/emscripten_temp__R2z7i/a.wasm --allow-undefined --lto-O0 -L/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.0.rcgu.o /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.link_to_abort.7rcbfp3g-cgu.1.rcgu.o /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/a.4hgw2zitnpvuzihs.rcgu.o -L/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers -L/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/link-to-abort/auxiliary -L/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-649ead28735e66bb.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_abort-587216951de5aadc.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-9f402acba710984b.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-d4b94f9ef3267bc9.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libbacktrace-a419154407e135b4.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-9bcd7ed55114abfd.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-52b7539f915078e8.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-c88276a1179c4990.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-a80fc12e123f7783.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-291d5652fb98867a.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-74bc0e65f45846ac.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-bcc92ad1c6190631.rlib /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-eb3e1e6234b8fa89.rlib -lc --fatal-warnings -L/emsdk-portable/upstream/emscripten/system/local/lib -L/emsdk-portable/upstream/emscripten/system/lib -L/root/.emscripten_cache/wasm-obj /root/.emscripten_cache/wasm-obj/libc.a /root/.emscripten_cache/wasm-obj/libcompiler_rt.a /root/.emscripten_cache/wasm-obj/libc-wasm.a /root/.emscripten_cache/wasm-obj/libc++abi-noexcept.a /root/.emscripten_cache/wasm-obj/libc-extras.a /root/.emscripten_cache/wasm-obj/libdlmalloc.a /root/.emscripten_cache/wasm-obj/libpthread_stub.a /root/.emscripten_cache/wasm-obj/libc_rt_wasm.a --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --export __wasm_call_ctors --export __data_end --export main --export rust_eh_personality --export malloc --export free --export setThrew --export __errno_location --export fflush --export htonl --export htons --export ntohs --export _get_environ --export __cxa_is_pointer_type --export __cxa_can_catch -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (1)
2020-03-22T13:13:18.2944651Z 
2020-03-22T13:13:18.2944819Z error: aborting due to previous error
2020-03-22T13:13:18.2944954Z 
2020-03-22T13:13:18.2945035Z 
---
2020-03-22T13:13:18.2947763Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-22T13:13:18.2948106Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-22T13:13:18.2957271Z 
2020-03-22T13:13:18.2957446Z 
2020-03-22T13:13:18.2961790Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-emscripten/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-wasm32-unknown-emscripten" "--mode" "ui" "--target" "wasm32-unknown-emscripten" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/emsdk-portable/node/12.9.1_64bit/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-emscripten/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.1-rust-1.44.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-22T13:13:18.2965003Z 
2020-03-22T13:13:18.2965082Z 
2020-03-22T13:13:18.3011281Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-emscripten --exclude src/libcore --exclude src/liballoc --exclude src/libproc_macro --exclude src/libstd --exclude src/libterm --exclude src/libtest
2020-03-22T13:13:18.3012190Z Build completed unsuccessfully in 2:09:24
2020-03-22T13:13:18.3012190Z Build completed unsuccessfully in 2:09:24
2020-03-22T13:13:18.3042069Z == clock drift check ==
2020-03-22T13:13:18.3060390Z   local time: Sun Mar 22 13:13:18 UTC 2020
2020-03-22T13:13:18.5915821Z   network time: Sun, 22 Mar 2020 13:13:18 GMT
2020-03-22T13:13:18.5916464Z == end clock drift check ==
2020-03-22T13:13:19.0629228Z 
2020-03-22T13:13:19.0692639Z ##[error]Bash exited with code '1'.
2020-03-22T13:13:19.0704865Z ##[section]Finishing: Run build
2020-03-22T13:13:19.0752259Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-22T13:13:19.0756460Z Task         : Get sources
2020-03-22T13:13:19.0756742Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-22T13:13:19.0756980Z Version      : 1.0.0
2020-03-22T13:13:19.0757144Z Author       : Microsoft
2020-03-22T13:13:19.0757144Z Author       : Microsoft
2020-03-22T13:13:19.0757432Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-22T13:13:19.0757741Z ==============================================================================
2020-03-22T13:13:19.3814263Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-22T13:13:19.3851548Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70212/merge to s
2020-03-22T13:13:19.3925606Z Cleaning up task key
2020-03-22T13:13:19.3926579Z Start cleaning up orphan processes.
2020-03-22T13:13:19.4082827Z Terminate orphan process: pid (4170) (python)
2020-03-22T13:13:19.4285096Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@sfackler
Copy link
Member

Is the inability to rethrow foreign exceptions with resume_unwind an inherent problem, or just something to be left for a follow up?

@Amanieu
Copy link
Member Author

Amanieu commented Mar 22, 2020

It's a bit complicated. Basically libunwind-level exceptions (_Unwind_Exception) cannot be soundly sent to another thread. This means that wrapping them in a Box<dyn Any + Send> is unsound since we can't guarantee Send.

C++ exceptions (__cxa_exception, which contains a _Unwind_Exception) can be sent to another thread, but they must be unlinked from the current thread's linked list of active exceptions first by calling __cxa_begin_catch (and other __cxa_* functions).

Now, we could do this and call into the C++ runtime when we catch a foreign exception, but then we add the C++ runtime as a dependency for all rust programs, which is probably unacceptable.

@Amanieu
Copy link
Member Author

Amanieu commented Mar 22, 2020

All tests pass now, rebased & squashed.

src/libpanic_abort/lib.rs Outdated Show resolved Hide resolved
@Mark-Simulacrum
Copy link
Member

I think before we land this, we should make sure that some team has signed off on this (perhaps lang?) -- I agree that we must catch the exception, but one could come up with a number of different ways of handling that, e.g., we could abort instead.

I would also like to see the documentation for catch_unwind updated -- perhaps with my suggestion here: #70212 (comment), but please make sure that my suggestions there are indeed accurate :)

Other than those two concerns, r=me

@Centril
Copy link
Contributor

Centril commented Mar 25, 2020

I think before we land this, we should make sure that some team has signed off on this (perhaps lang?)

Nominating -- if you both can attend to provide context and answer questions that'd be great. :)

@Centril Centril added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Mar 25, 2020
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Mar 25, 2020

I've added a brief blurb to the prior state to the PR description. I think I got it right :)

Note that the only reason I suggested lang is due to overlap with the FFI unwind group (it is unclear to me what the right team here is -- I mainly don't want to be the one signing off on the new behavior :).

@BatmanAoD
Copy link
Member

@Mark-Simulacrum Lang is the correct group; project groups (such as FFI-unwind) have no formal decision-making power.

@Amanieu
Copy link
Member Author

Amanieu commented Mar 26, 2020

I am hesitant to make any changes to the documentation that might imply that throwing foreign exceptions over Rust frames is not UB since the lang team has not yet made an official decision regarding FFI unwinding. This will probably require an RFC from the FFI-unwind group to resolve.

@Amanieu
Copy link
Member Author

Amanieu commented Mar 26, 2020

The changes proposed in this PR reflect the current consensus of the FFI-unwind group as to how catch_unwind should behave once this is fully defined. Note that since FFI unwinding is currently still officially UB, this PR isn't actually stabilizing any behavior.

@Mark-Simulacrum
Copy link
Member

Hm, okay, then I'm less worried about getting signoff, I wasn't clear if you were intending this as a guarantee or not.

However, I do think moving carefully here is worthwhile, and lang will meet tomorrow anyway.

@bors
Copy link
Contributor

bors commented Mar 30, 2020

☔ The latest upstream changes (presumably #70536) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

I'm not quite sure where we left this in our discussion at the meeting. It seemed like there was some concern about people coming to rely on this behavior, even if it's undocumented, and a slight preference towards something like a "hard abort"..?

I tend to think that we ultimately want to offer some way to capture and rethrow a C++ exception as transparently as possible, and having it be converted into a rust panic doesn't seem very satisfying. (I appreciate this is hard to achieve technically.)

@Amanieu
Copy link
Member Author

Amanieu commented Mar 30, 2020

I think it's possible to transparently handle C++ exceptions, I just haven't had time to work on this PR lately. However the resulting code is likely to be quite hacky since we need to check at runtime whether certain symbols exist using dlsym.

@Mark-Simulacrum
Copy link
Member

From what I remember, I suggested that if we were to land this before we had an RFC (under the "technically not documented, so just changing undefined behavior's actual behavior") we should do so with a hard abort rather than the return of a opaque Box<dyn Any>. That's solely because it's much easier to accidentally depend on the opaque box and much harder to accidentally depend on the abort, I think.

I agree that in the ideal world we would probably want the capture of the foreign exception to permit re-throwing. I'm not sure if we'd want resume_unwind to cause both Rust and (e.g.) C++ exceptions to emit from it though, or if we'd want a separate resume_foreign_exception or something like that. OTOH, if the catching interface is the same then there's probably not much point in having two separate throwing interfaces.

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume there's been some discussion in the unwind project group? I am happy with the implementation (r=me) but we probably want some sort of T-lang (or "not me") decision :)

@Amanieu
Copy link
Member Author

Amanieu commented Aug 27, 2020

This was discussed in a meeting a while back and the conclusion was that foreign exceptions unwinding into Rust is UB until further notice. This PR basically gives a nicer error message when this happens instead of silently allowing foreign unwinding through catch_unwind.

@BatmanAoD
Copy link
Member

@Mark-Simulacrum Per the "C-unwind" RFC, foreign exceptions unwinding frames with catch_unwind will remain undefined behavior even after the "C-unwind" ABI is implemented.

@Mark-Simulacrum
Copy link
Member

I do recall that meeting, but was unsure if there was any movement since then. I don't personally feel comfortable r+ing this without some form of lang/project group 👍 (though, IMO, @Amanieu or @BatmanAoD as involved members of the project group, you could give that approval -- I am uncertain if you meant to in the last two comments).

cc @rust-lang/lang, too, I guess, though I don't expect that anyone has objections.

@BatmanAoD
Copy link
Member

@Mark-Simulacrum 👍

Sorry, yes, my previous comment was meant to indicate approval.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

We're early in the cycle, so this should get plenty of testing. Also marking as rollup=never because I want easy bisection to this PR if people note problems in their (large) codebases.

@bors
Copy link
Contributor

bors commented Aug 27, 2020

📌 Commit 239f833 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2020
@bors
Copy link
Contributor

bors commented Aug 28, 2020

⌛ Testing commit 239f833 with merge 41aaa90...

@bors
Copy link
Contributor

bors commented Aug 28, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Mark-Simulacrum
Pushing 41aaa90 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 28, 2020
@bors bors merged commit 41aaa90 into rust-lang:master Aug 28, 2020
@Dylan-DPC-zz Dylan-DPC-zz added this to the 1.48 milestone Aug 28, 2020
yvt added a commit to r3-os/r3 that referenced this pull request Sep 8, 2020
…ngjmp`

`pthread_exit` can't unwind through `catch_unwind` anymore because of
[1].

Because the actual `longjmp` isn't supported by Rust at this time and
[3] is tricky to set up, this commit implements something similar using
inline assembler.

[1]: rust-lang/rust#70212
[2]: rust-lang/rfcs#2625
[3]: https://github.com/jeff-davis/setjmp.rs
yvt added a commit to r3-os/r3 that referenced this pull request Sep 8, 2020
…ngjmp`

`pthread_exit` can't unwind through `catch_unwind` anymore because of
[1].

Because the actual `longjmp` [2] isn't supported by Rust at this time
and [3] is tricky to set up, this commit implements something similar
using inline assembler.

[1]: rust-lang/rust#70212
[2]: rust-lang/rfcs#2625
[3]: https://github.com/jeff-davis/setjmp.rs
@fweimer
Copy link

fweimer commented Nov 17, 2020

How is this supposed to interact with thread cancellation on GNU/Linux, i.e. pthread_cancel?

@bjorn3
Copy link
Member

bjorn3 commented Nov 17, 2020

Thread cancellation is not safe. If the canceled thread used scoped threads from for example crossbeam or rayon, then the stack may be deallocated on thread cancellation when there is still another thread borrowing values from the stack of the canceled thread.

@fweimer
Copy link

fweimer commented Nov 17, 2020

Shouldn't crossbeam or rayon detect this, and not the core runtime?

Note that glibc also pdeallocates thread stacks on fork](https://www.sourceware.org/bugzilla/show_bug.cgi?id=19430). The bug reported was negatively decided, and it focused on TLS data, but the same rationale applies to the stack threads themselves.

@bjorn3
Copy link
Member

bjorn3 commented Nov 17, 2020

Crossbeam and rayon have no way to detect this. Many libc functions have the possibility to trigger a canceled thread perform the cancelation. There is no cross-platform way for crossbeam and rayon to run any code before this happens. While pthread_cleanup_push exists, it is unreasonable to expect all unsafe code to handle all platform specific ways to catch thread cancellation. Even if it did, in most cases the only possible way to handle it is to abort the process anyway. If catch_unwind were to catch the unwinding that happens when canceling threads for glibc, which is impossible as it is a forced unwind, it would still not be safe on libc implementations that don't unwind at all.

@fweimer
Copy link

fweimer commented Nov 18, 2020

How do crossbeam and rayon handle panics? They also unwind the stack, and the memory donated to these libraries must be deregistered as well before the stack frame goes away.

@bjorn3
Copy link
Member

bjorn3 commented Nov 18, 2020

Panics are handled by waiting for the child threads and then resuming unwinding.

@BatmanAoD
Copy link
Member

@fweimer

They also unwind the stack...

This is different from a forced unwind. As explained in this RFC:

Since language features and library functions implemented using forced unwinding on some platforms use other mechanisms on other platforms, Rust code cannot rely on forced unwinding to invoke destructors (calling drop on Drop types). In other words, a forced unwind operation on one platform will simply deallocate Rust frames without true unwinding on other platforms.

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Nov 24, 2020
Clean up some of the pkgsrc Makefile, there's still lots in here that
should just be deleted though.  Switch SunOS to the illumos bootstrap
by default.

Version 1.48.0 (2020-11-19)
==========================

Language
--------

- [The `unsafe` keyword is now syntactically permitted on modules.][75857] This
  is still rejected *semantically*, but can now be parsed by procedural macros.

Compiler
--------
- [Stabilised the `-C link-self-contained=<yes|no>` compiler flag.][76158] This tells
  `rustc` whether to link its own C runtime and libraries or to rely on a external
  linker to find them. (Supported only on `windows-gnu`, `linux-musl`, and `wasi` platforms.)
- [You can now use `-C target-feature=+crt-static` on `linux-gnu` targets.][77386]
  Note: If you're using cargo you must explicitly pass the `--target` flag.
- [Added tier 2\* support for `aarch64-unknown-linux-musl`.][76420]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`io::Write` is now implemented for `&ChildStdin` `&Sink`, `&Stdout`,
  and `&Stderr`.][76275]
- [All arrays of any length now implement `TryFrom<Vec<T>>`.][76310]
- [The `matches!` macro now supports having a trailing comma.][74880]
- [`Vec<A>` now implements `PartialEq<[B]>` where `A: PartialEq<B>`.][74194]
- [The `RefCell::{replace, replace_with, clone}` methods now all use `#[track_caller]`.][77055]

Stabilized APIs
---------------
- [`slice::as_ptr_range`]
- [`slice::as_mut_ptr_range`]
- [`VecDeque::make_contiguous`]
- [`future::pending`]
- [`future::ready`]

The following previously stable methods are now `const fn`'s:

- [`Option::is_some`]
- [`Option::is_none`]
- [`Option::as_ref`]
- [`Result::is_ok`]
- [`Result::is_err`]
- [`Result::as_ref`]
- [`Ordering::reverse`]
- [`Ordering::then`]

Cargo
-----

Rustdoc
-------
- [You can now link to items in `rustdoc` using the intra-doc link
  syntax.][74430] E.g. ``/// Uses [`std::future`]`` will automatically generate
  a link to `std::future`'s documentation. See ["Linking to items by
  name"][intradoc-links] for more information.
- [You can now specify `#[doc(alias = "<alias>")]` on items to add search aliases
  when searching through `rustdoc`'s UI.][75740]

Compatibility Notes
-------------------
- [Promotion of references to `'static` lifetime inside `const fn` now follows the
  same rules as inside a `fn` body.][75502] In particular, `&foo()` will not be
  promoted to `'static` lifetime any more inside `const fn`s.
- [Associated type bindings on trait objects are now verified to meet the bounds
  declared on the trait when checking that they implement the trait.][27675]
- [When trait bounds on associated types or opaque types are ambiguous, the
  compiler no longer makes an arbitrary choice on which bound to use.][54121]
- [Fixed recursive nonterminals not being expanded in macros during
  pretty-print/reparse check.][77153] This may cause errors if your macro wasn't
  correctly handling recursive nonterminal tokens.
- [`&mut` references to non zero-sized types are no longer promoted.][75585]
- [`rustc` will now warn if you use attributes like `#[link_name]` or `#[cold]`
  in places where they have no effect.][73461]
- [Updated `_mm256_extract_epi8` and `_mm256_extract_epi16` signatures in
  `arch::{x86, x86_64}` to return `i32` to match the vendor signatures.][73166]
- [`mem::uninitialized` will now panic if any inner types inside a struct or enum
  disallow zero-initialization.][71274]
- [`#[target_feature]` will now error if used in a place where it has no effect.][78143]
- [Foreign exceptions are now caught by `catch_unwind` and will cause an abort.][70212]
  Note: This behaviour is not guaranteed and is still considered undefined behaviour,
  see the [`catch_unwind`] documentation for further information.

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.
- [Building `rustc` from source now uses `ninja` by default over `make`.][74922]
  You can continue building with `make` by setting `ninja=false` in
  your `config.toml`.
- [cg_llvm: `fewer_names` in `uncached_llvm_type`][76030]
- [Made `ensure_sufficient_stack()` non-generic][76680]

[78143]: rust-lang/rust#78143
[76680]: rust-lang/rust#76680
[76030]: rust-lang/rust#76030
[70212]: rust-lang/rust#70212
[27675]: rust-lang/rust#27675
[54121]: rust-lang/rust#54121
[71274]: rust-lang/rust#71274
[77386]: rust-lang/rust#77386
[77153]: rust-lang/rust#77153
[77055]: rust-lang/rust#77055
[76275]: rust-lang/rust#76275
[76310]: rust-lang/rust#76310
[76420]: rust-lang/rust#76420
[76158]: rust-lang/rust#76158
[75857]: rust-lang/rust#75857
[75585]: rust-lang/rust#75585
[75740]: rust-lang/rust#75740
[75502]: rust-lang/rust#75502
[74880]: rust-lang/rust#74880
[74922]: rust-lang/rust#74922
[74430]: rust-lang/rust#74430
[74194]: rust-lang/rust#74194
[73461]: rust-lang/rust#73461
[73166]: rust-lang/rust#73166
[intradoc-links]: https://doc.rust-lang.org/rustdoc/linking-to-items-by-name.html
[`catch_unwind`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html
[`Option::is_some`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some
[`Option::is_none`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_none
[`Option::as_ref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref
[`Result::is_ok`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_ok
[`Result::is_err`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_err
[`Result::as_ref`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.as_ref
[`Ordering::reverse`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.reverse
[`Ordering::then`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then
[`slice::as_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_ptr_range
[`slice::as_mut_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_mut_ptr_range
[`VecDeque::make_contiguous`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.make_contiguous
[`future::pending`]: https://doc.rust-lang.org/std/future/fn.pending.html
[`future::ready`]: https://doc.rust-lang.org/std/future/fn.ready.html
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 1, 2021
Pkgsrc changes:
 * Compensate for files being moved around upstream.
 * Introduce optional, on-by-default semi-static building of cargo,
   using the internal curl and openssl sources.  This reduces the dynamic
   dependencies of cargo and therefore the rust package itself.
   Ref. options.mk.
 * The 1.47.0 bootstrap kits have been re-built with the above option
   turned on, so no longer depends on curl or openssl from pkgsrc and/or
   from earlier OS or pkgsrc versions.  This should hopefully fix
   installation of rust with non-default PREFIX, ref. PR#54453.


Upstream changes:

Version 1.48.0 (2020-11-19)
==========================

Language
--------
- [The `unsafe` keyword is now syntactically permitted on modules.][75857] This
  is still rejected *semantically*, but can now be parsed by procedural macros.

Compiler
--------
- [Stabilised the `-C link-self-contained=<yes|no>` compiler flag.][76158]
  This tells `rustc` whether to link its own C runtime and libraries
  or to rely on a external linker to find them. (Supported only on
  `windows-gnu`, `linux-musl`, and `wasi` platforms.)
- [You can now use `-C target-feature=+crt-static` on `linux-gnu` targets.]
  [77386]
  Note: If you're using cargo you must explicitly pass the `--target` flag.
- [Added tier 2\* support for `aarch64-unknown-linux-musl`.][76420]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`io::Write` is now implemented for `&ChildStdin` `&Sink`, `&Stdout`,
  and `&Stderr`.][76275]
- [All arrays of any length now implement `TryFrom<Vec<T>>`.][76310]
- [The `matches!` macro now supports having a trailing comma.][74880]
- [`Vec<A>` now implements `PartialEq<[B]>` where `A: PartialEq<B>`.][74194]
- [The `RefCell::{replace, replace_with, clone}` methods now all use
  `#[track_caller]`.][77055]

Stabilized APIs
---------------
- [`slice::as_ptr_range`]
- [`slice::as_mut_ptr_range`]
- [`VecDeque::make_contiguous`]
- [`future::pending`]
- [`future::ready`]

The following previously stable methods are now `const fn`'s:

- [`Option::is_some`]
- [`Option::is_none`]
- [`Option::as_ref`]
- [`Result::is_ok`]
- [`Result::is_err`]
- [`Result::as_ref`]
- [`Ordering::reverse`]
- [`Ordering::then`]

Cargo
-----

Rustdoc
-------
- [You can now link to items in `rustdoc` using the intra-doc link
  syntax.][74430] E.g. ``/// Uses [`std::future`]`` will automatically generate
  a link to `std::future`'s documentation. See ["Linking to items by
  name"][intradoc-links] for more information.
- [You can now specify `#[doc(alias = "<alias>")]` on items to add
  search aliases when searching through `rustdoc`'s UI.][75740]

Compatibility Notes
-------------------
- [Promotion of references to `'static` lifetime inside `const fn`
  now follows the same rules as inside a `fn` body.][75502] In
  particular, `&foo()` will not be promoted to `'static` lifetime
  any more inside `const fn`s.
- [Associated type bindings on trait objects are now verified to meet the bounds
  declared on the trait when checking that they implement the trait.][27675]
- [When trait bounds on associated types or opaque types are ambiguous, the
  compiler no longer makes an arbitrary choice on which bound to use.][54121]
- [Fixed recursive nonterminals not being expanded in macros during
  pretty-print/reparse check.][77153] This may cause errors if your macro wasn't
  correctly handling recursive nonterminal tokens.
- [`&mut` references to non zero-sized types are no longer promoted.][75585]
- [`rustc` will now warn if you use attributes like `#[link_name]` or `#[cold]`
  in places where they have no effect.][73461]
- [Updated `_mm256_extract_epi8` and `_mm256_extract_epi16` signatures in
  `arch::{x86, x86_64}` to return `i32` to match the vendor signatures.][73166]
- [`mem::uninitialized` will now panic if any inner types inside
  a struct or enum disallow zero-initialization.][71274]
- [`#[target_feature]` will now error if used in a place where it
  has no effect.][78143]
- [Foreign exceptions are now caught by `catch_unwind` and will
  cause an abort.][70212] Note: This behaviour is not guaranteed
  and is still considered undefined behaviour, see the [`catch_unwind`]
  documentation for further information.

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [Building `rustc` from source now uses `ninja` by default over `make`.][74922]
  You can continue building with `make` by setting `ninja=false` in
  your `config.toml`.
- [cg_llvm: `fewer_names` in `uncached_llvm_type`][76030]
- [Made `ensure_sufficient_stack()` non-generic][76680]

[78143]: rust-lang/rust#78143
[76680]: rust-lang/rust#76680
[76030]: rust-lang/rust#76030
[70212]: rust-lang/rust#70212
[27675]: rust-lang/rust#27675
[54121]: rust-lang/rust#54121
[71274]: rust-lang/rust#71274
[77386]: rust-lang/rust#77386
[77153]: rust-lang/rust#77153
[77055]: rust-lang/rust#77055
[76275]: rust-lang/rust#76275
[76310]: rust-lang/rust#76310
[76420]: rust-lang/rust#76420
[76158]: rust-lang/rust#76158
[75857]: rust-lang/rust#75857
[75585]: rust-lang/rust#75585
[75740]: rust-lang/rust#75740
[75502]: rust-lang/rust#75502
[74880]: rust-lang/rust#74880
[74922]: rust-lang/rust#74922
[74430]: rust-lang/rust#74430
[74194]: rust-lang/rust#74194
[73461]: rust-lang/rust#73461
[73166]: rust-lang/rust#73166
[intradoc-links]: https://doc.rust-lang.org/rustdoc/linking-to-items-by-name.html
[`catch_unwind`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html
[`Option::is_some`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some
[`Option::is_none`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.is_none
[`Option::as_ref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref
[`Result::is_ok`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_ok
[`Result::is_err`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.is_err
[`Result::as_ref`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.as_ref
[`Ordering::reverse`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.reverse
[`Ordering::then`]: https://doc.rust-lang.org/std/cmp/enum.Ordering.html#method.then
[`slice::as_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_ptr_range
[`slice::as_mut_ptr_range`]: https://doc.rust-lang.org/std/primitive.slice.html#method.as_mut_ptr_range
[`VecDeque::make_contiguous`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.make_contiguous
[`future::pending`]: https://doc.rust-lang.org/std/future/fn.pending.html
[`future::ready`]: https://doc.rust-lang.org/std/future/fn.ready.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet