From eec3d6b499821ffe5a67bad922b83d43b61ae7d7 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 27 Jan 2022 12:45:44 -0800 Subject: [PATCH 1/4] chore: prepare Tokio v1.16 release. --- README.md | 2 +- tokio/CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++ tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ad192fec706..8bbe79605be 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.15.0", features = ["full"] } +tokio = { version = "1.16.0", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index a17ffa9b8cd..124b7d4a9d7 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,51 @@ +# 1.16.0 (January 27, 2022) + +Fixes a soundness bug in `io::Take` ([#4428]). The unsoundness is exposed when +leaking memory in the given `AsyncRead` implementation and then overwriting the +supplied buffer: + +```rust +impl AsyncRead for Buggy { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &mut ReadBuf<'_> + ) -> Poll> { + let new_buf = vec![0; 5].leak(); + *buf = ReadBuf::new(new_buf); + buf.put_slice(b"hello"); + Poll::Ready(Ok(())) + } +} +``` + +Also, this release includes improvements to the multi-threaded scheduler that +can increase throughput by up to 20% in some cases ([#4383]). + +### Fixed + +- io: **soundness** don't expose uninitialized memory when using `io::Take` in edge case ([#4428]) +- fs: ensure `File::write` reaches the disk when the runtime shuts down ([#4316]) +- process: drop pipe after child exits in `wait_with_output` ([#4315]) +- rt: improve error message when spawning a thread fails ([#4398]) +- rt: reduce false-positive thread wakups in the multi-threaded scheduler ([#4383]) +- sync: don't inherit `Send` from `parking_lot::*Guard` ([#4359]) + +### Added + +- net: `TcpSocket::linger()` and `set_linger()` ([#4324]) +- net: impl `UnwindSafe` for socket types ([#4384]) +- rt: impl `UnwindSafe` for `JoinHandle` ([#4418]) +- sync: `watch::Receiver::has_changed()` ([#4342]) +- sync: `oneshot::Receiver::blocking_recv()` ([#4334]) +- `RwLock` blocking operations ([#4425]) + +### Unstable + +The following changes only apply when building with `--cfg tokio_unstable` + +- rt: **breaking change** overhaul runtime metrics API ([#4373]) + # 1.15.0 (December 15, 2021) ### Fixed diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 25d78465235..a5deb7e7bbd 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.15.0" +version = "1.16.0" edition = "2018" rust-version = "1.46" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index ad192fec706..8bbe79605be 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.15.0", features = ["full"] } +tokio = { version = "1.16.0", features = ["full"] } ``` Then, on your main.rs: From b029f78d8ca55792f2b997bb7d2d1b2822c22c5a Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 27 Jan 2022 14:04:02 -0800 Subject: [PATCH 2/4] Update tokio/CHANGELOG.md Co-authored-by: Alice Ryhl --- tokio/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 124b7d4a9d7..b42691b88c8 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -38,7 +38,7 @@ can increase throughput by up to 20% in some cases ([#4383]). - rt: impl `UnwindSafe` for `JoinHandle` ([#4418]) - sync: `watch::Receiver::has_changed()` ([#4342]) - sync: `oneshot::Receiver::blocking_recv()` ([#4334]) -- `RwLock` blocking operations ([#4425]) +- sync: `RwLock` blocking operations ([#4425]) ### Unstable From 15a24e7b2553adb1c6fddccfc964eeeda5022e61 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 27 Jan 2022 14:07:43 -0800 Subject: [PATCH 3/4] add links --- tokio/CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index b42691b88c8..726df653eed 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -46,6 +46,20 @@ The following changes only apply when building with `--cfg tokio_unstable` - rt: **breaking change** overhaul runtime metrics API ([#4373]) +[#4428]: https://github.com/tokio-rs/tokio/pull/4428 +[#4316]: https://github.com/tokio-rs/tokio/pull/4316 +[#4315]: https://github.com/tokio-rs/tokio/pull/4315 +[#4398]: https://github.com/tokio-rs/tokio/pull/4398 +[#4383]: https://github.com/tokio-rs/tokio/pull/4383 +[#4359]: https://github.com/tokio-rs/tokio/pull/4359 +[#4324]: https://github.com/tokio-rs/tokio/pull/4324 +[#4384]: https://github.com/tokio-rs/tokio/pull/4384 +[#4418]: https://github.com/tokio-rs/tokio/pull/4418 +[#4342]: https://github.com/tokio-rs/tokio/pull/4342 +[#4334]: https://github.com/tokio-rs/tokio/pull/4334 +[#4425]: https://github.com/tokio-rs/tokio/pull/4425 +[#4373]: https://github.com/tokio-rs/tokio/pull/4373 + # 1.15.0 (December 15, 2021) ### Fixed From 71ef40461855811c5935bf69fa2ef021a5df6095 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 27 Jan 2022 14:18:20 -0800 Subject: [PATCH 4/4] tweak commit message --- tokio/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 726df653eed..ba9df2fa94d 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -25,7 +25,7 @@ can increase throughput by up to 20% in some cases ([#4383]). ### Fixed - io: **soundness** don't expose uninitialized memory when using `io::Take` in edge case ([#4428]) -- fs: ensure `File::write` reaches the disk when the runtime shuts down ([#4316]) +- fs: ensure `File::write` results in a `write` syscall when the runtime shuts down ([#4316]) - process: drop pipe after child exits in `wait_with_output` ([#4315]) - rt: improve error message when spawning a thread fails ([#4398]) - rt: reduce false-positive thread wakups in the multi-threaded scheduler ([#4383])