]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agorustup, adjust error messages
Ralf Jung [Fri, 1 May 2020 08:29:39 +0000 (10:29 +0200)]
rustup, adjust error messages

4 years agoAuto merge of #1379 - RalfJung:macos-fn-name, r=RalfJung
bors [Thu, 30 Apr 2020 17:40:40 +0000 (17:40 +0000)]
Auto merge of #1379 - RalfJung:macos-fn-name, r=RalfJung

make sure macos function has 'macos' in its name

also tiny README tweak

4 years agoREADME tweak
Ralf Jung [Thu, 30 Apr 2020 17:39:56 +0000 (19:39 +0200)]
README tweak

4 years agomake sure macos function has 'macos' in its name
Ralf Jung [Thu, 30 Apr 2020 17:38:17 +0000 (19:38 +0200)]
make sure macos function has 'macos' in its name

4 years agoAuto merge of #1284 - vakaras:add-threads-cr2, r=RalfJung
bors [Thu, 30 Apr 2020 16:21:43 +0000 (16:21 +0000)]
Auto merge of #1284 - vakaras:add-threads-cr2, r=RalfJung

Implement basic support for concurrency (Linux/macos only)

Changes  (most new code is in `src/threads.rs` and `src/shims/foreign_items/posix.rs`):

1. Move the stack from `Machine` to a newly created `Thread` struct.
2. Add a `ThreadSet` struct that manages the threads.
3. Change `canonical_alloc_id` to create a unique allocation id for each thread local and thread (the responsible struct is `ThreadLocalStorage`)
4. Change the code to execute the thread local destructors immediately when a thread terminates.
5. Add the most basic round-robin scheduler.

This pull request depends on [these changes to the compiler](https://github.com/rust-lang/rust/pull/70598).

4 years agoFix prctl SET_NAME and GET_NAME behaviour.
Vytautas Astrauskas [Thu, 30 Apr 2020 15:35:59 +0000 (08:35 -0700)]
Fix prctl SET_NAME and GET_NAME behaviour.

4 years agoAuto merge of #1377 - brson:servo-trophy, r=RalfJung
bors [Thu, 30 Apr 2020 08:41:33 +0000 (08:41 +0000)]
Auto merge of #1377 - brson:servo-trophy, r=RalfJung

Add servo_arc to trophy case

4 years agoTweak error wording
Ralf Jung [Thu, 30 Apr 2020 08:24:57 +0000 (10:24 +0200)]
Tweak error wording

4 years agoAuto merge of #1378 - RalfJung:workspace-error, r=RalfJung
bors [Thu, 30 Apr 2020 08:20:25 +0000 (08:20 +0000)]
Auto merge of #1378 - RalfJung:workspace-error, r=RalfJung

more helpful error on workspaces

4 years agomore helpful error on workspaces
Ralf Jung [Thu, 30 Apr 2020 08:19:34 +0000 (10:19 +0200)]
more helpful error on workspaces

4 years agoAdd servo_arc to trophy case
Brian Anderson [Thu, 30 Apr 2020 00:03:43 +0000 (00:03 +0000)]
Add servo_arc to trophy case

4 years agoFix a regression in Windows dtors.
Vytautas Astrauskas [Wed, 29 Apr 2020 22:20:26 +0000 (15:20 -0700)]
Fix a regression in Windows dtors.

4 years agoUse Entry API in set_dtors_running.
Vytautas Astrauskas [Wed, 29 Apr 2020 22:12:09 +0000 (15:12 -0700)]
Use Entry API in set_dtors_running.

4 years agoImprove code readability and comments.
Vytautas Astrauskas [Wed, 29 Apr 2020 20:16:22 +0000 (13:16 -0700)]
Improve code readability and comments.

4 years agoAuto merge of #1375 - RalfJung:rustup, r=RalfJung
bors [Tue, 28 Apr 2020 08:31:05 +0000 (08:31 +0000)]
Auto merge of #1375 - RalfJung:rustup, r=RalfJung

rustup for more LocalDefId changes

4 years agorustup for more LocalDefId changes
Ralf Jung [Tue, 28 Apr 2020 08:30:21 +0000 (10:30 +0200)]
rustup for more LocalDefId changes

4 years agoFix MacOS and Windows builds.
Vytautas Astrauskas [Mon, 27 Apr 2020 22:21:01 +0000 (15:21 -0700)]
Fix MacOS and Windows builds.

4 years agoDelete remaining tls entries after all destructors completed.
Vytautas Astrauskas [Mon, 27 Apr 2020 21:00:39 +0000 (14:00 -0700)]
Delete remaining tls entries after all destructors completed.

4 years agoMake From implementations non-failing.
Vytautas Astrauskas [Mon, 27 Apr 2020 19:32:57 +0000 (12:32 -0700)]
Make From implementations non-failing.

4 years agoImprove comments.
Vytautas Astrauskas [Mon, 27 Apr 2020 18:01:35 +0000 (11:01 -0700)]
Improve comments.

4 years agoAdd a test for joining in a destructor.
Vytautas Astrauskas [Mon, 27 Apr 2020 05:05:09 +0000 (22:05 -0700)]
Add a test for joining in a destructor.

4 years agoMerge dtors_running and last_dtor_key fields.
Vytautas Astrauskas [Mon, 27 Apr 2020 04:49:36 +0000 (21:49 -0700)]
Merge dtors_running and last_dtor_key fields.

4 years agoAdd a FIXME.
Vytautas Astrauskas [Mon, 27 Apr 2020 04:25:46 +0000 (21:25 -0700)]
Add a FIXME.

4 years agoImprove comments and code clarity.
Vytautas Astrauskas [Mon, 27 Apr 2020 04:13:33 +0000 (21:13 -0700)]
Improve comments and code clarity.

4 years agoChange representation and conversion of ThreadId and BlockSetId.
Vytautas Astrauskas [Mon, 27 Apr 2020 04:01:03 +0000 (21:01 -0700)]
Change representation and conversion of ThreadId and BlockSetId.

4 years agoUse DLL_THREAD_DETACH when calling windows TLS destructor.
Vytautas Astrauskas [Mon, 27 Apr 2020 03:51:21 +0000 (20:51 -0700)]
Use DLL_THREAD_DETACH when calling windows TLS destructor.

4 years agoMake sure to remove thread local data only if we have destructor.
Vytautas Astrauskas [Mon, 27 Apr 2020 03:50:58 +0000 (20:50 -0700)]
Make sure to remove thread local data only if we have destructor.

4 years agoImprove style and comments.
Vytautas Astrauskas [Mon, 27 Apr 2020 03:49:53 +0000 (20:49 -0700)]
Improve style and comments.

4 years agoMany small changes to clean up code.
Vytautas Astrauskas [Sun, 26 Apr 2020 22:52:45 +0000 (15:52 -0700)]
Many small changes to clean up code.

4 years agoRename global tls dtor to thread dtor.
Vytautas Astrauskas [Sun, 26 Apr 2020 22:52:01 +0000 (15:52 -0700)]
Rename global tls dtor to thread dtor.

4 years agoMove prctl test to the same file as other libc tests.
Vytautas Astrauskas [Sun, 26 Apr 2020 21:56:31 +0000 (14:56 -0700)]
Move prctl test to the same file as other libc tests.

4 years agoDelete a duplicate test.
Vytautas Astrauskas [Sun, 26 Apr 2020 21:44:59 +0000 (14:44 -0700)]
Delete a duplicate test.

4 years agoImprove comments.
Vytautas Astrauskas [Sun, 26 Apr 2020 21:42:07 +0000 (14:42 -0700)]
Improve comments.

4 years agoAdded a test that joining main is UB.
Vytautas Astrauskas [Sun, 26 Apr 2020 21:24:48 +0000 (14:24 -0700)]
Added a test that joining main is UB.

4 years agoImprove Debug formatting of the thread name.
Vytautas Astrauskas [Fri, 24 Apr 2020 23:47:18 +0000 (16:47 -0700)]
Improve Debug formatting of the thread name.

4 years agoMove copying of the thread name to the client side.
Vytautas Astrauskas [Fri, 24 Apr 2020 23:46:51 +0000 (16:46 -0700)]
Move copying of the thread name to the client side.

4 years agoUnify TLS dtors; move stepping outside.
Vytautas Astrauskas [Fri, 24 Apr 2020 22:16:24 +0000 (15:16 -0700)]
Unify TLS dtors; move stepping outside.

4 years agoChange the test not to rely on internals.
Vytautas Astrauskas [Tue, 21 Apr 2020 00:23:51 +0000 (17:23 -0700)]
Change the test not to rely on internals.

4 years agoAdd an explanatory comment to the test.
Vytautas Astrauskas [Tue, 21 Apr 2020 00:13:22 +0000 (17:13 -0700)]
Add an explanatory comment to the test.

4 years agoIgnore prctl test on MacOS because it does not support it.
Vytautas Astrauskas [Tue, 21 Apr 2020 00:10:25 +0000 (17:10 -0700)]
Ignore prctl test on MacOS because it does not support it.

4 years agoMake multiple threads to try to join a thread while it is still running.
Vytautas Astrauskas [Tue, 21 Apr 2020 00:02:43 +0000 (17:02 -0700)]
Make multiple threads to try to join a thread while it is still running.

4 years agoClarify FIXME.
Vytautas Astrauskas [Mon, 20 Apr 2020 23:57:30 +0000 (16:57 -0700)]
Clarify FIXME.

4 years agoCheck prctl argument types and fix the test.
Vytautas Astrauskas [Mon, 20 Apr 2020 23:49:27 +0000 (16:49 -0700)]
Check prctl argument types and fix the test.

4 years agoClarify test comments.
Vytautas Astrauskas [Mon, 20 Apr 2020 20:23:11 +0000 (13:23 -0700)]
Clarify test comments.

4 years agoFix the test annotation.
Vytautas Astrauskas [Mon, 20 Apr 2020 20:22:51 +0000 (13:22 -0700)]
Fix the test annotation.

4 years agoMake the main thread detached.
Vytautas Astrauskas [Mon, 20 Apr 2020 20:22:28 +0000 (13:22 -0700)]
Make the main thread detached.

4 years agoFix merge error.
Vytautas Astrauskas [Mon, 20 Apr 2020 18:53:19 +0000 (11:53 -0700)]
Fix merge error.

4 years agoPrint the thread name in Debug.
Vytautas Astrauskas [Mon, 20 Apr 2020 04:21:22 +0000 (21:21 -0700)]
Print the thread name in Debug.

4 years agoSmall style fix.
Vytautas Astrauskas [Mon, 20 Apr 2020 04:03:23 +0000 (21:03 -0700)]
Small style fix.

4 years agoClarify comments about TLS destructor handling in Windows, add a test for TLS destruc...
Vytautas Astrauskas [Mon, 20 Apr 2020 03:52:53 +0000 (20:52 -0700)]
Clarify comments about TLS destructor handling in Windows, add a test for TLS destructors.

4 years agoTrack if a thread was already joined.
Vytautas Astrauskas [Sun, 19 Apr 2020 23:43:40 +0000 (16:43 -0700)]
Track if a thread was already joined.

4 years agoAdd more concurrency tests.
Vytautas Astrauskas [Sun, 19 Apr 2020 23:42:58 +0000 (16:42 -0700)]
Add more concurrency tests.

4 years agoFix how a pthread_create function argument is constructed.
Vytautas Astrauskas [Sun, 19 Apr 2020 22:23:30 +0000 (15:23 -0700)]
Fix how a pthread_create function argument is constructed.

4 years agoImprove concurrency tests.
Vytautas Astrauskas [Sun, 19 Apr 2020 21:22:55 +0000 (14:22 -0700)]
Improve concurrency tests.

4 years agoMany small changes to thread management.
Vytautas Astrauskas [Sun, 19 Apr 2020 21:21:18 +0000 (14:21 -0700)]
Many small changes to thread management.

4 years agoImprove prctl, add a test.
Vytautas Astrauskas [Sun, 19 Apr 2020 21:18:30 +0000 (14:18 -0700)]
Improve prctl, add a test.

4 years agoChange the warning message.
Vytautas Astrauskas [Sun, 19 Apr 2020 21:01:56 +0000 (14:01 -0700)]
Change the warning message.

4 years agoMove prctl to Linux specific shims.
Vytautas Astrauskas [Sun, 19 Apr 2020 21:01:12 +0000 (14:01 -0700)]
Move prctl to Linux specific shims.

4 years agoRename MacOS set global dtor function.
Vytautas Astrauskas [Sun, 19 Apr 2020 19:24:46 +0000 (12:24 -0700)]
Rename MacOS set global dtor function.

4 years agoUpdate a comment in README about what concurrency checks we support.
Vytautas Astrauskas [Sun, 19 Apr 2020 19:22:33 +0000 (12:22 -0700)]
Update a comment in README about what concurrency checks we support.

4 years agoAdd concurrency tests.
Vytautas Astrauskas [Sat, 18 Apr 2020 19:25:11 +0000 (12:25 -0700)]
Add concurrency tests.

4 years agoImplement thread::yield_now.
Vytautas Astrauskas [Sat, 18 Apr 2020 22:39:53 +0000 (15:39 -0700)]
Implement thread::yield_now.

4 years agoAdd a comment explaining global destructors on MacOS.
Vytautas Astrauskas [Fri, 17 Apr 2020 22:38:23 +0000 (15:38 -0700)]
Add a comment explaining global destructors on MacOS.

4 years agoFix support for MacOS.
Vytautas Astrauskas [Fri, 17 Apr 2020 02:40:02 +0000 (19:40 -0700)]
Fix support for MacOS.

4 years agoRename threads to thread to match the Rust standard library.
Vytautas Astrauskas [Thu, 16 Apr 2020 20:52:14 +0000 (13:52 -0700)]
Rename threads to thread to match the Rust standard library.

4 years agoAdd a missing newline.
Vytautas Astrauskas [Thu, 16 Apr 2020 20:39:21 +0000 (13:39 -0700)]
Add a missing newline.

4 years agoCleanup the implementation of adjust_global_const.
Vytautas Astrauskas [Thu, 16 Apr 2020 20:32:40 +0000 (13:32 -0700)]
Cleanup the implementation of adjust_global_const.

4 years agoFix typo in a comment.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:26:32 +0000 (12:26 -0700)]
Fix typo in a comment.

4 years agoMake an assert message consistent with other asserts.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:22:58 +0000 (12:22 -0700)]
Make an assert message consistent with other asserts.

4 years agoFix imports.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:22:30 +0000 (12:22 -0700)]
Fix imports.

4 years agoAdd a missing newline in the test.
Vytautas Astrauskas [Thu, 16 Apr 2020 19:21:01 +0000 (12:21 -0700)]
Add a missing newline in the test.

4 years agoRename eval_maybe_thread_local_static_const to adjust_global_const.
Vytautas Astrauskas [Thu, 16 Apr 2020 15:34:30 +0000 (08:34 -0700)]
Rename eval_maybe_thread_local_static_const to adjust_global_const.

4 years agoAddress some of the reviewers comments.
Vytautas Astrauskas [Thu, 16 Apr 2020 04:25:12 +0000 (21:25 -0700)]
Address some of the reviewers comments.

4 years agoGenerate thread local allocations in eval_maybe_thread_local_static_const.
Vytautas Astrauskas [Wed, 15 Apr 2020 21:34:34 +0000 (14:34 -0700)]
Generate thread local allocations in eval_maybe_thread_local_static_const.

4 years agoGenerate fresh allocation ids for thread locals in eval_maybe_thread_local_static_const.
Vytautas Astrauskas [Wed, 15 Apr 2020 00:21:52 +0000 (17:21 -0700)]
Generate fresh allocation ids for thread locals in eval_maybe_thread_local_static_const.

4 years agoSmall refactoring in pthread sync: extract common functionallity to separate functions.
Vytautas Astrauskas [Thu, 9 Apr 2020 20:37:38 +0000 (13:37 -0700)]
Small refactoring in pthread sync: extract common functionallity to separate functions.

4 years agoRename ThreadSet to ThreadManager.
Vytautas Astrauskas [Thu, 9 Apr 2020 19:06:33 +0000 (12:06 -0700)]
Rename ThreadSet to ThreadManager.

4 years agoRebase on PR 1157.
Vytautas Astrauskas [Wed, 8 Apr 2020 03:20:41 +0000 (20:20 -0700)]
Rebase on PR 1157.

4 years agoFix pthread_self.
Vytautas Astrauskas [Mon, 6 Apr 2020 23:30:30 +0000 (16:30 -0700)]
Fix pthread_self.

4 years agoRustfmt the test.
Vytautas Astrauskas [Mon, 6 Apr 2020 23:12:25 +0000 (16:12 -0700)]
Rustfmt the test.

4 years agoStore the thread name.
Vytautas Astrauskas [Mon, 6 Apr 2020 23:12:13 +0000 (16:12 -0700)]
Store the thread name.

4 years agoFix comments in TLS.
Vytautas Astrauskas [Mon, 6 Apr 2020 21:41:05 +0000 (14:41 -0700)]
Fix comments in TLS.

4 years agoReport that we do not support foreign thread local statics.
Vytautas Astrauskas [Mon, 6 Apr 2020 21:00:45 +0000 (14:00 -0700)]
Report that we do not support foreign thread local statics.

4 years agoMove pthread_create and related shims to a separate file.
Vytautas Astrauskas [Mon, 6 Apr 2020 20:44:47 +0000 (13:44 -0700)]
Move pthread_create and related shims to a separate file.

4 years agoFix the problem of sending pointed to thread local statics. Add a regression test.
Vytautas Astrauskas [Fri, 3 Apr 2020 23:09:42 +0000 (16:09 -0700)]
Fix the problem of sending pointed to thread local statics. Add a regression test.

4 years agoAdd a test for thread locals.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:28:53 +0000 (16:28 -0700)]
Add a test for thread locals.

4 years agoUpdate to support the updated API.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:28:33 +0000 (16:28 -0700)]
Update to support the updated API.

4 years agoAdd a warning that Miri does not check for data-races.
Vytautas Astrauskas [Wed, 1 Apr 2020 23:26:41 +0000 (16:26 -0700)]
Add a warning that Miri does not check for data-races.

4 years agoImplement basic support for concurrency (Linux only).
Vytautas Astrauskas [Mon, 16 Mar 2020 23:48:44 +0000 (16:48 -0700)]
Implement basic support for concurrency (Linux only).

4 years agoAuto merge of #1373 - RalfJung:test-rename, r=RalfJung
bors [Mon, 27 Apr 2020 10:54:57 +0000 (10:54 +0000)]
Auto merge of #1373 - RalfJung:test-rename, r=RalfJung

rename tests: undefined -> uninit

4 years agoAuto merge of #1370 - samrat:add-scalar-size-test, r=RalfJung
bors [Mon, 27 Apr 2020 10:33:29 +0000 (10:33 +0000)]
Auto merge of #1370 - samrat:add-scalar-size-test, r=RalfJung

Add test to verify that argument size mismatch throws UB

Also, bump up `rust-version`

Closes #1355

4 years agorename tests: undefined -> uninit
Ralf Jung [Mon, 27 Apr 2020 10:27:56 +0000 (12:27 +0200)]
rename tests: undefined -> uninit

4 years agoReplace error-pattern with annotation; remove unreachable line
Samrat Man Singh [Mon, 27 Apr 2020 10:04:42 +0000 (15:34 +0530)]
Replace error-pattern with annotation; remove unreachable line

4 years agoAuto merge of #1354 - divergentdave:dump-alloc-on-undef-read, r=RalfJung
bors [Mon, 27 Apr 2020 09:33:30 +0000 (09:33 +0000)]
Auto merge of #1354 - divergentdave:dump-alloc-on-undef-read, r=RalfJung

Print hex dump of alloc on reading undef bytes

Here's a small addition I made locally to the UB diagnostics, in case you're interested in it. This PR calls `dump_alloc()` on the relevant allocation if Miri fails on UB due to reading undefined bytes. This came in handy when diagnosing such an issue in a large program using unsafe Rust, in part because it wasn't deterministic enough to use `-Zmiri-track-alloc-id=`. If you'd like to put this behind another -Z flag, let me know.

4 years agoFix shim_arg_size test for 32-bit machines
Samrat Man Singh [Mon, 27 Apr 2020 04:30:35 +0000 (10:00 +0530)]
Fix shim_arg_size test for 32-bit machines

4 years agoAdd test to verify arg size mismatch throws UB
Samrat Man Singh [Mon, 27 Apr 2020 04:05:19 +0000 (09:35 +0530)]
Add test to verify arg size mismatch throws UB

Also: bump up `rust-version`

4 years agoReview comments
David Cook [Mon, 27 Apr 2020 03:13:36 +0000 (22:13 -0500)]
Review comments

4 years agoAuto merge of #1368 - Robbepop:add-new-trophy-for-inks-lazyarray, r=RalfJung
bors [Sat, 25 Apr 2020 21:19:56 +0000 (21:19 +0000)]
Auto merge of #1368 - Robbepop:add-new-trophy-for-inks-lazyarray, r=RalfJung

Add miri trophy for LazyArray::swap (ink! PR)

Details to the found in https://github.com/rust-lang/miri/issues/1364.
Note that this was not a found in a `master` or production release of ink!, however without analysing the code via `miri` this could have potentially happened.

4 years agoUpdate README.md
Hero Bird [Sat, 25 Apr 2020 17:42:48 +0000 (19:42 +0200)]
Update README.md

4 years agoAdd miri trophy for LazyArray::swap (ink! PR)
Hero Bird [Sat, 25 Apr 2020 12:58:20 +0000 (14:58 +0200)]
Add miri trophy for LazyArray::swap (ink! PR)

Details to the found in https://github.com/rust-lang/miri/issues/1364.
Note that this was not a found in a `master` or production release of ink!, however without analysing the code via `miri` this could have potentially happened.