Commit Graph

2721 Commits

Author SHA1 Message Date
Ralf Jung
257e9cef66 docify some comments 2021-08-02 17:58:55 +02:00
Ralf Jung
5338a16018 adjust for ERR_ON_PARTIAL_PTR_OVERWRITE 2021-08-02 17:58:55 +02:00
hyd-dev
a789b49e4c
Use Lrc instead of Rc in MiriCompilerCalls::config() 2021-07-30 21:28:34 +08:00
bors
02f78b089c Auto merge of #1858 - RalfJung:thread-leaks, r=oli-obk
also ignore 'thread leaks' with -Zmiri-ignore-leaks

This is a step towards https://github.com/rust-lang/miri/issues/1371. The remaining hard part would be supporting checking for memory leaks when there are threads still running. For now we elegantly avoid this problem by using the same flag to control both of these checks. :)
2021-07-27 12:23:56 +00:00
Ralf Jung
df9d481989 tell users how to disable the leak check 2021-07-25 14:21:06 +02:00
Ralf Jung
71efd950d1 also ignore 'thread leaks' with -Zmiri-ignore-leaks 2021-07-25 14:21:06 +02:00
bors
eb9e3073a0 Auto merge of #1856 - RalfJung:no-mir, r=RalfJung
show proper error when using a sysroot without MIR

Fixes https://github.com/rust-lang/miri/issues/1834
2021-07-25 09:50:06 +00:00
Smit Soni
20d0f2ee26 Move shim argument checks before isolation check
This allows catching extremely incorrect arguments before rejecting
due to isolation.
2021-07-24 11:54:55 -07:00
Ralf Jung
46d31f9230 show proper error when using a sysroot without MIR 2021-07-24 14:02:09 +02:00
Smit Soni
da6880427a Update error code for fs ops in isolation
Change the code to either `EACCES` (if the op is performed on the
path), or `EBADF` (if the op is performed the fd)

Updated ops: `stat`, `opendir`, `ftruncate64`, and `readlink`

Add a new test for fs ops in isolation.
2021-07-20 08:23:51 -07:00
Smit Soni
a1cabac727 Fix use of deprecated check_no_isolation in posix fs ops
Update posix fs shims to use new API `reject_in_isolation`, which
allows rejection with error code instead of always forcing abort.
Error code chosen for each op is the most appropriate one from the
list in corresponding syscall's manual.

Updated helper APIs to not use quotes (`) around input name while
preparing the message. This allows callers to pass multi-word string
like -- "`read` from stdin".
2021-07-20 08:23:51 -07:00
Ralf Jung
46ed39ec20 adjust for PointerOutOfBounds change 2021-07-20 13:30:49 +02:00
Ralf Jung
a1233a721d adjust Miri to Pointer type overhaul 2021-07-16 10:10:12 +02:00
Ralf Jung
0341b8ac84 fmt: set force_multiline_blocks=true 2021-07-11 14:18:44 +02:00
Ralf Jung
447f23c71b fmt 2021-07-06 10:13:30 +02:00
Ralf Jung
340267525c exported_symbols_cache: ensure we do not overwrite anything 2021-07-06 10:09:53 +02:00
Ralf Jung
9b57313a4d also treat CallerLocation and Machine memory as properly tagged 2021-07-06 10:07:48 +02:00
Ralf Jung
efd582c6d8 explicitly list memory kinds for stacked borrows 2021-07-06 10:04:16 +02:00
Smitty
d19376985d Make work after mir-alloc-oom 2021-07-04 09:59:55 -04:00
hyd-dev
76fe48543c
Update for TyCtxt::crates() change 2021-07-02 16:08:27 +08:00
Ralf Jung
e33bf695db rustup 2021-06-29 20:47:28 +02:00
Ralf Jung
7b2d2cfa46 use exhaustive struct match for manual Debug impl 2021-06-20 19:33:05 +02:00
bors
35af23b6a9 Auto merge of #1833 - hyd-dev:82261, r=RalfJung
Filter out items other than non-generic functions and statics in our version of `exported_symbols`

[`#[no_mangle]` on a `use` item](https://docs.rs/brotli-decompressor/2.3.1/src/brotli_decompressor/ffi/mod.rs.html#3-5) can make Miri ICE when compiling a dependency (rust-lang/rust#86261):
```rs
#[no_mangle]
use std::{thread,panic, io, boxed, any, string};
```

<details>

```
error: internal compiler error: compiler/rustc_middle/src/ty/mod.rs:1650:13: item_name: no name for DefPath { data: [DisambiguatedDefPathData { data: Misc, disambiguator: 14 }], krate: crate0 }

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1007:9
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util:🐛:opt_span_bug_fmt
   6: rustc_middle::util:🐛:bug_fmt
   7: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::item_name
   8: rustc_symbol_mangling::symbol_name_provider
   9: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::symbol_name>::compute
  10: rustc_query_system::query::plumbing::get_query_impl
  11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::symbol_name
  12: rustc_middle::middle::exported_symbols::ExportedSymbol::symbol_name_for_local_instance
  13: rustc_codegen_ssa:🔙:symbol_export::symbol_name_for_instance_in_crate
  14: rustc_codegen_ssa:🔙:linker::exported_symbols
  15: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  16: rustc_codegen_ssa:🔙:linker::LinkerInfo::new
  17: rustc_codegen_ssa:🔙:write::start_async_codegen
  18: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  19: rustc_interface::passes::QueryContext::enter
  20: rustc_interface::queries::Queries::ongoing_codegen
  21: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  22: rustc_span::with_source_map
  23: rustc_interface::interface::create_compiler_and_run
  24: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.54.0-nightly (a50d72158 2021-06-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=1 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [symbol_name] computing the symbol for `{misc#14}`
end of query stack
```
</details>

This might be because in #1776, we override the `exported_symbols` query, and our version of `exported_symbols` can return a `use` item which don't have a name if the `use` item is tagged with `#[no_mangle]`, and then:
- `rustc_codegen_ssa:🔙:symbol_export::symbol_name_for_instance_in_crate` is called for for every `exported_symbols`: fb3ea63d9b/compiler/rustc_codegen_ssa/src/back/linker.rs (L1300-L1304)
- it calls `rustc_middle::middle::exported_symbols::ExportedSymbol::symbol_name_for_local_instance`: fb3ea63d9b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs (L412)
- which calls `rustc_symbol_mangling::symbol_name_provider`: fb3ea63d9b/compiler/rustc_middle/src/middle/exported_symbols.rs (L37-L44)
- which calls `item_name`: fb3ea63d9b/compiler/rustc_symbol_mangling/src/lib.rs (L216), which triggers the ICE

It might also be problematic for d39f0c64b8/src/shims/foreign_items.rs (L165) which also uses `item_name`, but Miri cannot compile the dependency, so that code can't be reached.

Therefore, this PR makes `exported_symbols` filter out all items that are not functions or statics, so all items returned will have a name, which avoids the ICE (I have tested it in the https://github.com/jorgecarleitao/arrow2 repository).
(This PR also includes a commit that fixes a small (unrelated) bug for `#[no_mangle]` on associated functions -- I found that because I notice `#[no_mangle]` is supported on associated functions and they should not be filtered out in `exported_symbols`.)

Fixes (when the submodule is bumped) rust-lang/rust#86261.
2021-06-15 10:07:24 +00:00
bors
486b5dfe74 Auto merge of #1832 - hyd-dev:1776-follow-up, r=RalfJung
Report an error if a `#[no_mangle]`/`#[export_name = ...]` function has the same symbol name as a built-in shim

Implements https://github.com/rust-lang/miri/pull/1776#issuecomment-821322605.

The error looks like this:
```
error: found `malloc` symbol definition that clashes with a built-in shim
  --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9
   |
12 |         malloc(0);
   |         ^^^^^^^^^ found `malloc` symbol definition that clashes with a built-in shim
   |
help: the `malloc` symbol is defined here

  --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:2:1
   |
2  | / extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void {
3  | |     //~^ HELP the `malloc` symbol is defined here
4  | |     unreachable!()
5  | | }
   | |_^
   = note: inside `main` at tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9
```

This does not implement "better error messages than we do currently for arg/ABI mismatches" in https://github.com/rust-lang/miri/pull/1776#issuecomment-821343175 -- I failed to remove all `check_arg_count()` and `check_abi()` (they are still used in `src/shims/intrinsics.rs` and `call_dlsym()`) and they don't receive the name of the shim.
2021-06-15 09:53:05 +00:00
hyd-dev
aaaa142dc1
Rename all link_name_sym to link_name and remove the only remaining let link_name = link_name_sym.as_str() 2021-06-15 01:24:09 +08:00
hyd-dev
9011524454
Remove strip_linker_suffix 2021-06-15 01:16:38 +08:00
hyd-dev
a67a65359f
Only pass Symbol to emulate_foreign_item_by_name 2021-06-15 00:43:15 +08:00
hyd-dev
34603e586f
Add whitespace 2021-06-14 23:38:15 +08:00
hyd-dev
d1e72d0854
Check argument count for CreateThread 2021-06-14 23:01:06 +08:00
hyd-dev
89c722ac32
Add some comments about check_shim 2021-06-14 22:53:17 +08:00
hyd-dev
da2ed6f768
Don't report UB for #[no_mangle] on associated functions 2021-06-14 20:58:54 +08:00
hyd-dev
99467349f2
Do not return DefId that doesn't have exported symbol in exported_symbols 2021-06-14 20:55:27 +08:00
hyd-dev
49a8f002a0
let-bind exp_abi of "exit" | "ExitProcess" 2021-06-11 15:53:58 +08:00
hyd-dev
e46aab5816
Use check_shim() for abort 2021-06-11 15:47:12 +08:00
hyd-dev
c822ec59aa
Implement cache for not found symbols 2021-06-11 15:24:51 +08:00
hyd-dev
ce7040075a
Disallow #[no_mangle]/#[export_name = ...] functions that have the same symbol name as built-in shims 2021-06-11 15:18:47 +08:00
hyd-dev
4f3718ef85
Fix the wrong EmulateByNameResult::NotSupported in syscall shim 2021-06-11 11:44:57 +08:00
bors
e5c3af6f51 Auto merge of #1818 - landaire:feature/panic-on-unsupported-syscalls, r=RalfJung
Add support for panicking in the emulated application when unsupported functionality is encountered

This PR fixes #1807 and allows an optional flag to be specified to panic when an unsupported syscall is encountered. In essence, instead of bubbling up an error in the context of the Miri application Miri will panic within the context of the *emulated* application. This feature is desired to allow CI pipelines to determine if a Miri failure is unsupported functionality or actual UB. Please read [this comment](https://github.com/rust-lang/miri/issues/1807#issuecomment-845425076) for the rationale behind this change.

Note: this change does not cover all cases where unsupported functionality errors may be raised. If you search the repo for `throw_unsup_format!` there are many cases that I think are less likely to occur and may still be problematic for some folks.

TODO:

- [x] README documentation on this new flag
- [x] Add tests
2021-06-09 18:09:06 +00:00
Ralf Jung
a38f02c44c isolated operations return EPERM; tweak isolation hint 2021-06-09 18:24:59 +02:00
Smit Soni
ba64f485c8 Fix parameter of io error helper function
`set_last_error_from_io_error` works with only the error kind, and
discards the payload. Fix its signature to make it explicit.
2021-06-09 06:28:35 -07:00
Smit Soni
892f706ce5 Add a support to execute isolated op without halting
In user interface, added a new flag `-Zmiri-isolation-error` which
takes one of the four values -- hide, warn, warn-nobacktrace, and
abort. This option can be used to configure Miri to either abort or
return an error code upon executing isolated op. If not aborted, Miri
prints a warning, whose verbosity can be configured using this flag.

In implementation, added a new enum `IsolatedOp` to capture all the
settings related to ops requiring communication with the
host. Old `communicate` flag in both miri configs and machine
stats is replaced with a new helper function `communicate()` which
checks `isolated_op` internally.

Added a new helper function `reject_in_isolation` which can be called
by shims to reject ops according to the reject_with settings. Use miri
specific diagnostics function `report_msg` to print backtrace in the
warning. Update it to take an enum value instead of a bool, indicating
the level of diagnostics.

Updated shims related to current dir to use the new APIs. Added a new
test for current dir ops in isolation without halting machine.
2021-06-09 05:50:52 -07:00
Lander Brandt
ae237098f8 Add support for panicking in the emulated application when unsupported syscalls are encountered 2021-06-07 15:21:53 -07:00
hyd-dev
3871c493b2
in_std -> frame_in_std 2021-06-06 11:21:20 +08:00
hyd-dev
545101040d
Don't unwrap() in in_std() 2021-06-06 11:12:13 +08:00
hyd-dev
879000b133
Detect std by checking if the crate defines #[lang = "start"] rather than string comparison 2021-06-06 11:12:05 +08:00
bors
28717a0e90 Auto merge of #1776 - hyd-dev:1170, r=RalfJung
Implement calls to exported symbols (#1170)

Closes #1170.
2021-06-03 15:59:56 +00:00
Ralf Jung
57e4f1d285
fix typo 2021-06-03 17:47:34 +02:00
hyd-dev
647ee17b40
original_crate_name -> crate_name 2021-06-03 10:22:31 +08:00
Aaron Hill
73700bc01c
Rustup for const_err changes 2021-05-31 10:50:25 -05:00
hyd-dev
e026ad584d
Use unwrap_or_else() 2021-05-31 11:57:15 +08:00
hyd-dev
b054a19f94
We don't need to check SymbolExportLevel 2021-05-31 11:57:14 +08:00
hyd-dev
382295cd47
Move check_abi() into EvalContextExt 2021-05-31 11:15:31 +08:00
hyd-dev
41f33a64f8
Implement calls to exported symbols 2021-05-31 11:15:29 +08:00
hyd-dev
71f4140550
Add -Zmiri-disable-abi-check 2021-05-31 11:14:23 +08:00
Ralf Jung
c89a5d62ee
add comment to debug impl 2021-05-30 17:13:49 +02:00
Aaron Hill
0317e5bfd6
Address more review comments 2021-05-30 10:04:57 -05:00
Aaron Hill
20f1b2a969
Run fmt 2021-05-29 17:16:12 -05:00
Aaron Hill
16f469280e
Address review comments 2021-05-29 17:10:54 -05:00
Aaron Hill
2166eaed90
Use active thread id 2021-05-29 17:01:54 -05:00
Aaron Hill
7e9da8d30e
Add measureme integration for profiling the interpreted program
This PR uses the `measureme` crate to profile the call stack of the
program being interpreted by Miri. This is accomplished by starting a
measureme 'event' when we enter a function call, and ending the event
when we exit the call. The `measureme` tooling can be used to produce a
call stack from the generated profile data.

Limitations:
* We currently record every single entry/exit. This might generate very
  large profile outputs for programs with a large number of function
  calls. In follow-up work, we might want to explore sampling (e.g. only
  recording every N function calls).
* This does not integrate very well with Miri's concurrency support.
  Each event we record starts when we push a frame, and ends when we pop
  a frame. As a result, switching between virtual threads will cause
  events from different threads to be interleaved. Additionally, the
  recorded for a particular frame will include all of the work Miri does
  before that frame completes, including executing another thread.

The `measureme` integration is off by default, and must be enabled via
`-Zmiri-measureme=<output_name>`
2021-05-29 17:01:52 -05:00
hyd-dev
9b2d42587f
unwind is no longer Option<BasicBlock> 2021-05-28 22:08:51 +08:00
Ralf Jung
c60efa0c69 allocate backtrace strings mutably 2021-05-23 18:04:13 +02:00
Ralf Jung
9e0e9386a6 better approach to skip ZST reborrows 2021-05-23 18:04:13 +02:00
Ralf Jung
e09c571eec avoid some borrow_mut calls in data_race 2021-05-23 18:04:13 +02:00
Ralf Jung
543777acbd avoid unnecessary RefCell calls in Stacked Borrows 2021-05-23 18:04:13 +02:00
Ralf Jung
d77d95d0a8 rustup 2021-05-23 12:39:27 +02:00
Ralf Jung
c73f8b1097 fmt 2021-05-22 14:55:33 +02:00
Ralf Jung
1bbd6e609c get rid of Rc in data_race 2021-05-22 14:47:14 +02:00
Ralf Jung
ca7283d746 get rid of Rc in Stacked Borrows 2021-05-22 13:24:08 +02:00
Ralf Jung
c151af5cf5 rustup 2021-05-20 13:32:18 +02:00
Ralf Jung
aba96b82b4 fix write_os_str_to_wide_str 2021-05-19 16:34:14 +02:00
Ralf Jung
e4a27150cb fmt 2021-05-19 16:10:28 +02:00
Ralf Jung
801a1744cd update for Memory API changes 2021-05-19 15:27:58 +02:00
Ralf Jung
1bfd9ac56c rustup 2021-05-18 00:11:05 +02:00
Ralf Jung
4f171d7fe3 stop relying on c_str/wide_str helpers in rustc 2021-05-17 14:31:59 +02:00
Ralf Jung
78f74c69e3 fix rustfmt fallout 2021-05-17 10:57:21 +02:00
Ralf Jung
cf3376e541 rustup 2021-05-17 09:34:39 +02:00
Ralf Jung
d6fdfaa047 hand-held formatting for remaining files 2021-05-16 11:51:39 +02:00
Ralf Jung
4e231bab5e format much of Miri 2021-05-16 11:48:28 +02:00
Andy Wang
0d2278c6c6
Prefer remapped filename in backtrace to match rustc behaviour 2021-05-12 15:49:33 +01:00
bors
bdce1ddf88 Auto merge of #1785 - Smittyvb:fast-math-ub, r=RalfJung
Throw UB if f*_fast intrinsic called with non-finite value

Calling these intrinsics with non-finite values is undefined behaviour, since they result in `f*` intrinsics in LLVM with the `fast` flag, and `fast` math on non-finite values results in `poison` values. (technically LLVM only considers it UB upon _using_ the value, but that shouldn't make much of a difference)
2021-05-03 17:32:50 +00:00
Smitty
e0e59f6020 Simplify finiteness checking 2021-05-03 10:08:42 -04:00
Ralf Jung
c3ae8a6f90 adjust for different 'yield' hint on aarch64 2021-05-03 11:25:05 +02:00
Ralf Jung
aac6e2ad3e fix checking os_family 2021-05-03 09:57:13 +02:00
Smitty
e591b83185 UB if f*_fast intrinsic called with nonfinite value 2021-05-02 12:25:00 -04:00
hyd-dev
b30c5fef5b
Rustup for rust-lang/rust#84401 2021-04-30 19:35:59 +08:00
bors
e6ffc689aa Auto merge of #1772 - RalfJung:less-timeout-checking, r=RalfJung
only check timeouts when a thread yields

Currently, we check for expired timeouts after each step of execution. That seems excessive. This changes the scheduler to only check for timeouts when the active thread cannot continue running any more.

`@vakaras` does this sound right? `pthread_cond_timedwait` anyway already yields, of course, since it blocks on getting the signal (or the timeout).
2021-04-11 14:59:27 +00:00
Vytautas Astrauskas
50f68dce21 Reference issue 1763 in the comment. 2021-04-11 13:39:03 +02:00
Ralf Jung
bda328e26a only check timeouts when a thread yields 2021-04-11 13:32:47 +02:00
Vytautas Astrauskas
72ca2a7a85 Attempt to fix #1763 by asking the scheduler to retry choosing an operation. 2021-04-10 20:23:32 +02:00
hyd-dev
3dff1d4fcd
Don't use MIRI_DEFAULT_ARGS to compile host crates 2021-04-09 00:57:59 +08:00
Ralf Jung
31bd77c7d8 bump miri dependencies 2021-04-04 11:48:20 +02:00
Ralf Jung
20e31dbdad fix newer getrandom on Windows 2021-04-04 11:41:04 +02:00
hyd-dev
4eed610723
Remove #![feature(or_patterns)] 2021-03-23 16:58:00 +08:00
bstrie
4f899ce9ac Replace deprecated collections::Bound 2021-03-17 18:34:44 -04:00
hyd-dev
7ec919daa4
Remove the macro and expand it manually 2021-03-17 22:27:57 +08:00
hyd-dev
3ee865461f
Revert "Don't duplicate check_abi()"
This reverts commit 1c7d7471da.
2021-03-17 21:51:07 +08:00
hyd-dev
bbc348539b
Unsupported foreign non-"C"/"system"-ABI function calls are not UB 2021-03-17 21:20:04 +08:00
hyd-dev
1c7d7471da
Don't duplicate check_abi() 2021-03-17 00:40:53 +08:00
bors
0788188c7b Auto merge of #1743 - RalfJung:callee-checks, r=RalfJung
Check callee ABI when Miri calls closures

Fixes https://github.com/rust-lang/miri/issues/1741
2021-03-14 18:05:18 +00:00
Ralf Jung
15465a5881 don't ICE when we unwind despite panic=abort 2021-03-14 17:10:45 +01:00
Ralf Jung
d1dec9cd23 don't ICE when callee has the wrong number of arguments 2021-03-14 15:38:22 +01:00
Ralf Jung
893843fd45 when Miri calls a function ptr, make sure it has the right ABI 2021-03-14 15:30:37 +01:00
Ralf Jung
98f28ac9c8 rustup 2021-03-11 09:07:05 +01:00
Mara Bos
5bd5ea21ea Remove unwrap_none as it won't be stabilized.
This upgrades to the latest rustc to be able to use try_insert()
instead.
2021-03-08 16:59:20 +01:00
Smittyvb
8d43d727f4
Check arg count
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-03-05 07:16:50 -05:00
Smitty
26e97ec54f Support breakpoint intrinsic 2021-03-04 07:48:28 -05:00
Ralf Jung
9f3dbad5d0 rename atomic_op_min_max -> atomic_op 2021-03-02 19:54:45 +01:00
bors
2670839e1a Auto merge of #1721 - henryboisdequin:add-atomic-min-and-max, r=oli-obk
Add atomic min and max

Closes #1718
Previous attempt: #1653

TODO:

- [x] Merge `atomic_op` and `atomic_min_max` functions
- [x] Fix CI

**Note:** this PR also removes arbitrary trailing whitespace and generally formats the affected files
2021-03-02 14:52:32 +00:00
Henry Boisdequin
f8440d6c99 Add in atomic_{min,max}_x intrinsics
Co-authored-by: Greg Bowyer <gbowyer@fastmail.co.uk>
2021-03-02 20:17:05 +05:30
Henry Boisdequin
7d1531f3c1 fmt data_race.rs and intrinsics.rs 2021-03-02 18:06:12 +05:30
Ralf Jung
48f7c8e2e6 fix reborrowing of tagged ZST references 2021-02-27 20:10:50 +01:00
Tomasz Miąsko
0eb341417c rustup to e7c23ab933 2021-02-20 00:00:00 +00:00
Ralf Jung
2672baafe1 rustup 2021-02-18 10:34:32 +01:00
Mara Bos
c5bb29141e Remove unnecessary format!() in panic!(). 2021-02-02 21:40:30 +01:00
Ralf Jung
052cd3bff7 rustup; remove some no-longer-needed Windows shims 2021-01-31 14:23:49 +01:00
bors
b38dc837f2 Auto merge of #1670 - unseddd:abi, r=RalfJung
Add ABI check for shims

Resolves #1631
2021-01-29 19:36:30 +00:00
Yuki Okushi
53612ece7c Rustup for rust-lang/rust#79951 2021-01-28 22:31:22 +09:00
Nym Seddon
de4eea9d49
Add ABI check for shims 2021-01-27 22:32:25 +00:00
Thom Chiovoloni
d310620c11 Allow configuring the failure rate with -Zmiri-compare-exchange-weak-failure-rate 2021-01-26 00:13:54 -08:00
Thom Chiovoloni
d4b592ed17 Fail 80% of the time on weak cmpxchg, not 50% 2021-01-26 00:13:54 -08:00
Thom Chiovoloni
c678bd722e Add random failures to compare_exchange_weak 2021-01-26 00:13:54 -08:00
Ralf Jung
13dd513254 adjust Windows shims for stdlib changes (Windows XP removal) 2021-01-25 10:43:48 +01:00
Ralf Jung
7d8f8c405f macos: support aarch64 link names 2021-01-23 18:14:57 +01:00
Ralf Jung
848be1bf82 implement aarch64 hint 'intrinsic' 2021-01-23 18:11:01 +01:00
Corey Farwell
2aedbf0993 Add shim for libc::sysconf(libc::_SC_NPROCESSORS_CONF) 2021-01-22 09:16:27 -05:00
bors
903bfd82bf Auto merge of #1681 - RalfJung:rustup, r=RalfJung
rustup; remove some intrinsics that are gone or moved to rustc
2021-01-18 12:02:12 +00:00
Ralf Jung
3d01ba11c0 rustup; remove some intrinsics that are gone or moved to rustc 2021-01-18 12:55:30 +01:00
hyd-dev
9949d9e417
Remove #![feature(const_generics)] and #![allow(incomplete_features)] 2021-01-17 23:28:20 +08:00
Ralf Jung
4a035103dc rustup; make tests pass again 2021-01-15 16:41:14 +01:00
Ralf Jung
8e15f3221e rustup 2021-01-11 12:35:13 +01:00
Ralf Jung
65f5c27d61 remove intrinsic that is now implemented in the rustc side 2020-12-22 12:47:59 +01:00
JCTyblaidd
c13aabcb45 Tidy new_allocation 2020-12-13 11:14:41 +00:00
JCTyblaidd
e73579632b Rework to work with machine hook. 2020-12-13 11:04:58 +00:00
JCTyblaidd
81c4eb7d74 Update src/data_race.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-12-13 11:04:58 +00:00
JCTyBlaidd
aaf8ca4c77 Fix review changes 2020-12-13 11:04:58 +00:00
JCTyBlaidd
296ba8b1c8 Fix bug with reporting wrong thread for races with reads & add thread ids to data-race tests 2020-12-13 11:04:58 +00:00
JCTyblaidd
c4ccd0b6a1 Fix nits
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2020-12-13 11:04:58 +00:00
JCTyBlaidd
1ded6d328a Remove old FIXME 2020-12-13 11:04:58 +00:00
JCTyBlaidd
c45b1b16be More tests, fix issue 1643 and detect races with allocation. 2020-12-13 11:04:58 +00:00
Ralf Jung
7bbd6bca77 rustup 2020-12-10 19:53:45 +01:00
JCTyblaidd
6db821537f
Fix caps
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-12-06 17:59:49 +00:00
JCTyBlaidd
4cf614ef33 Update release sequence handling to C++20 semantics. 2020-12-06 16:58:32 +00:00
Ralf Jung
6145709bfc remove miri-rustc-tests 2020-11-29 21:00:50 +01:00
bors
d473242ecd Auto merge of #1617 - JCTyblaidd:data_race_detector, r=RalfJung
Add simple data-race detector

Partially fixes data-race detection, see #1372, based on Dynamic Race Detection for C++11

- This does not explore weak memory behaviour, only exploring one sequentially consistent ordering.
- Data-race detection is only enabled after the first thread is created, so should have minimal overhead for non-concurrent execution.
- ~~Does not attempt to re-use thread id's so creating and joining threads lots of time in an execution will result in the vector clocks growing in size and slowing down program execution~~ It does now
2020-11-29 18:44:28 +00:00
Ralf Jung
cbb695f782
fix some typos 2020-11-29 19:43:44 +01:00
JCTyBlaidd
6c5722933e Fix typos - looked into the papers handling of timestamps, after looking into it again, it seems the paper only increments the timestamp after release operations, so changed to approximation of that implementation. 2020-11-28 17:17:07 +00:00
JCTyBlaidd
55fc552d99 Apply review changes, incrementing the clocks twice is an unnecessary hold-over from earlier versions so fixed. 2020-11-27 19:26:06 +00:00
JCTyBlaidd
3268f56a97 Fix review changes 2020-11-22 17:28:12 +00:00
Ralf Jung
697f6e36bd rustup 2020-11-20 14:07:52 +01:00