Commit Graph

4270 Commits

Author SHA1 Message Date
bors
c6e8838b89 Auto merge of #1261 - RalfJung:cross-gnu, r=RalfJung
cross-running windows-gnu should now also work

Fixes https://github.com/rust-lang/miri/issues/1198
2020-03-25 11:11:41 +00:00
Ralf Jung
8ffbca797f bump xargo version 2020-03-25 12:11:05 +01:00
Ralf Jung
e19552ba41 cross-running windows-gnu should now also work 2020-03-25 11:44:11 +01:00
bors
a84d8a8b98 Auto merge of #1260 - RalfJung:unreachable, r=RalfJung
Implement unreachable intrinsic

Fixes https://github.com/rust-lang/miri/issues/1254
2020-03-25 08:33:44 +00:00
Ralf Jung
962e2105df remove an unnecessary as_str 2020-03-25 09:32:15 +01:00
Ralf Jung
47b91e619a test unreachable intrinsic 2020-03-25 09:32:15 +01:00
bors
5d8229e4f4 Auto merge of #1259 - RalfJung:rustup, r=RalfJung
rustup, adjust for renames
2020-03-25 08:10:28 +00:00
Ralf Jung
9b0e9dec49 rustup, adjust for renames 2020-03-25 09:05:30 +01:00
bors
a6d74a6026 Auto merge of #1251 - RalfJung:win-cross, r=RalfJung
cross-test on a Windows host
2020-03-24 13:18:44 +00:00
Ralf Jung
e9e04e56fc move path methods together, to the bottom of the string helpers 2020-03-24 09:11:48 +01:00
Ralf Jung
8817397828 test harness informs tests about suitable temp dir 2020-03-24 09:11:48 +01:00
Ralf Jung
3ba588db49 make fs.rs at least build under Windows 2020-03-24 09:11:48 +01:00
Ralf Jung
c4e29c8646 convert dir separators on path load/store 2020-03-24 09:11:48 +01:00
Ralf Jung
4ac91384ff route all path reading/writing through central read/write methods 2020-03-24 09:11:47 +01:00
Ralf Jung
3517ce66ab need to unset MIRI_SYSROOT before calling 'cargo miri setup' 2020-03-24 09:11:47 +01:00
Ralf Jung
da721233d7 cross-test on a Windows host 2020-03-24 09:11:47 +01:00
bors
ad7089f194 Auto merge of #1258 - RalfJung:rustup, r=RalfJung
Rustup
2020-03-24 07:29:25 +00:00
Ralf Jung
87f5495715 32bit macOS is no more 2020-03-24 08:25:37 +01:00
Ralf Jung
80088e131b rustup for trait MachineStopType 2020-03-24 08:24:36 +01:00
bors
15dd15861c Auto merge of #1256 - JOE1994:rw_widestr_helpers, r=RalfJung
helper functions for env_var emulation in Windows

Moving some of the changes submitted in PR #1225, in order to prevent the original PR from bloating too much.
2020-03-24 07:09:40 +00:00
JOE1994
5f9167bdaa helper functions for env_var emulation in Windows 2020-03-23 19:40:22 -04:00
bors
e5f1a29937 Auto merge of #1257 - RalfJung:rustup, r=RalfJung
Rustup
2020-03-23 22:55:08 +00:00
Ralf Jung
9091811147 use Wake trait for async-fn driver 2020-03-23 23:53:54 +01:00
Ralf Jung
284067cc15 rustup 2020-03-23 23:48:24 +01:00
bors
db49339136 Auto merge of #1255 - RalfJung:os_str_bytes, r=RalfJung
fix conditional compilation condition for os_str <-> bytes conversion

Turns out that condition was wrong and these functions never got compiled... Cc @christianpoveda
2020-03-23 18:45:34 +00:00
Ralf Jung
2f371774ef fix conditional compilation condition for os_str <-> bytes conversion 2020-03-23 19:43:03 +01:00
bors
aaa16a5f4b Auto merge of #1252 - RalfJung:rustup, r=RalfJung
bump Rust; HashMap should now work on macOS even with isolation
2020-03-23 09:36:23 +00:00
Ralf Jung
b4b8750e44 bump Rust; HashMap should now work on macOS even with isolation 2020-03-23 10:34:15 +01:00
bors
9fe39ba763 Auto merge of #1250 - RalfJung:error-context, r=oli-obk
give some context in error messages

### Some examples for how different errors look now

Unsupported operation:
```
error: unsupported operation: Miri does not support threading
  --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/thread.rs:68:19
   |
68 |         let ret = libc::pthread_create(&mut native, &attr, thread_start, &*p as *const _ as *mut _);
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri does not support threading
   |
   = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
```
Unsupported operation that works without isolation:
```
error: unsupported operation: `clock_gettime` not available when isolation is enabled
   --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/time.rs:349:22
    |
349 |         cvt(unsafe { libc::clock_gettime(clock, &mut t.t) }).unwrap();
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `clock_gettime` not available when isolation is enabled
    |
    = help: pass the flag `-Zmiri-disable-isolation` to disable isolation
```
Program abort:
```
error: program stopped: the evaluated program aborted execution
   --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/panicking.rs:530:18
    |
530 |         unsafe { intrinsics::abort() }
    |                  ^^^^^^^^^^^^^^^^^^^ the evaluated program aborted execution
    |
```
UB:
```
error: Undefined Behavior: type validation failed: encountered 2, but expected a boolean
 --> tests/compile-fail/validity/invalid_bool.rs:2:23
  |
2 |     let _b = unsafe { std::mem::transmute::<u8, bool>(2) }; //~ ERROR encountered 2, but expected a boolean
  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 2, but expected a boolean
  |
  = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
```
Experimental UB:
```
error: Undefined Behavior: not granting access to tag <1562> because incompatible item is protected: [Unique for <1567> (call 1189)]
  --> tests/compile-fail/stacked_borrows/aliasing_mut1.rs:3:1
   |
3  | pub fn safe(_x: &mut i32, _y: &mut i32) {} //~ ERROR protect
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not granting access to tag <1562> because incompatible item is protected: [Unique for <1567> (call 1189)]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
```

Fixes https://github.com/rust-lang/miri/issues/417
2020-03-22 22:34:23 +00:00
Ralf Jung
6e302b830a link to some websites for UB explanations 2020-03-22 23:32:19 +01:00
Ralf Jung
dd4fef0cd9 fix outdated sysroot help message 2020-03-22 20:09:14 +01:00
Ralf Jung
6dcca62b63 move -Zmiri-disable-isolation hint to help 2020-03-22 19:48:59 +01:00
Ralf Jung
a1b823886c give some context in error messages 2020-03-22 18:59:06 +01:00
bors
d7d2266414 Auto merge of #1249 - RalfJung:rustup, r=RalfJung
Cross-test targets

We should now be able to run Linux targets on macOS hosts and vice versa.
Cc https://github.com/rust-lang/miri/issues/1198
2020-03-22 08:05:35 +00:00
Ralf Jung
b843de6dd2 run-test.py: also print what we are testing for 2020-03-22 09:04:10 +01:00
Ralf Jung
e1b654f09a mention cross-running in docs 2020-03-22 08:55:53 +01:00
Ralf Jung
d85f09c4e4 platform -> target 2020-03-22 08:55:39 +01:00
Ralf Jung
dece5bc4ee fix bad use of FOREIGN_TARGET 2020-03-21 23:28:10 +01:00
Ralf Jung
82fe771676 also cross-test Windows from Linux, macOS 2020-03-21 23:26:44 +01:00
Ralf Jung
78fe5288d0 do more cross-testing 2020-03-21 23:17:18 +01:00
Ralf Jung
8306073835 bump Rust 2020-03-21 23:17:07 +01:00
bors
7f476266fd Auto merge of #1248 - RalfJung:overflow, r=RalfJung
detect UB: overflow in copy/write_bytes

Fixes https://github.com/rust-lang/miri/issues/1234
2020-03-21 17:09:57 +00:00
Ralf Jung
238ed49a07 detect UB: overflow in copy/write_bytes 2020-03-21 17:54:33 +01:00
Ralf Jung
8acfafe186 test for zero-sized write_bytes to NULL 2020-03-21 17:54:18 +01:00
Ralf Jung
eb3be2f97d ./miri check 2020-03-21 17:43:28 +01:00
bors
70ab91d087 Auto merge of #1247 - RalfJung:rustup, r=RalfJung
call error location was fixed by rustup
2020-03-21 12:13:39 +00:00
Ralf Jung
6355228d4e remove no longer needed (and sometimes broken) 'extern crate' 2020-03-21 13:13:08 +01:00
Ralf Jung
e890d4d5e1 call error location was fixed by rustup 2020-03-21 12:52:23 +01:00
bors
b2605d809d Auto merge of #1241 - RalfJung:dont-panic, r=RalfJung
whitelist platforms where panicking should work

@CAD97 [proposed](https://github.com/rust-lang/miri/issues/1059#issuecomment-601217992) trying to get a better error for failed panics on Windows.

Could you test if this works for you?
2020-03-21 09:55:23 +00:00
Ralf Jung
5c09047411 fix tests 2020-03-21 10:54:56 +01:00