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

Correct is_unique for Bytes from shared BytesMut #718

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

zyxw59
Copy link
Contributor

@zyxw59 zyxw59 commented Jul 6, 2024

The is_unique entry in the vtable for Bytes created from a shared BytesMut just called the shared_is_unique function from the bytes module. However, that function dereferences the data argument as crate::bytes::Shared, but the actual underlying type is crate::bytes_mut::Shared.

@Darksonn
Copy link
Contributor

Darksonn commented Jul 9, 2024

Thanks. Is there any chance we could have a test that would have caught this?

@Darksonn
Copy link
Contributor

Thank you for fixing this issue!

I'm updating this PR to merge it directly onto the 1.6.0 tag so that I can make a 1.6.1 release with just this change.

@Darksonn Darksonn changed the base branch from master to v1.6.x July 12, 2024 23:04
The `is_unique` entry in the vtable for `Bytes` created from a shared
`BytesMut` just called the `shared_is_unique` function from the `bytes`
module. However, that function dereferences the `data` argument` as
`bytes::Shared`, but the actual underlying type is `bytes_mut::Shared`.
@Darksonn Darksonn force-pushed the fix-buf-mut-shared-is-unique branch from 97a7850 to 4fe8b82 Compare July 12, 2024 23:08
@Darksonn Darksonn merged commit 6b4b0ed into tokio-rs:v1.6.x Jul 12, 2024
@zyxw59 zyxw59 deleted the fix-buf-mut-shared-is-unique branch July 13, 2024 00:04
marcus0x62 added a commit to marcus0x62/hickory-dns that referenced this pull request Jul 13, 2024
Cargo audit is failing because bytes 1.6.0 has been yanked due to a bug:

    This release fixes a bug where `Bytes::is_unique` returns incorrect values when
    the `Bytes` originates from a shared `BytesMut`

Upstream discussion: tokio-rs/bytes#718
djc pushed a commit to hickory-dns/hickory-dns that referenced this pull request Jul 13, 2024
Cargo audit is failing because bytes 1.6.0 has been yanked due to a bug:

    This release fixes a bug where `Bytes::is_unique` returns incorrect values when
    the `Bytes` originates from a shared `BytesMut`

Upstream discussion: tokio-rs/bytes#718
github-merge-queue bot pushed a commit to n0-computer/iroh that referenced this pull request Jul 15, 2024
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
GitHub Actions `cargo deny` is failing at
https://github.com/n0-computer/iroh/actions/runs/9928231752/job/27438879671

% `cargo update -p bytes`
```
    Updating crates.io index
     Locking 1 package to latest compatible version
    Updating bytes v1.6.0 -> v1.6.1
note: pass `--verbose` to see 152 unchanged dependencies behind latest
```
https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md to get the
fix in
* tokio-rs/bytes#718
## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
github-merge-queue bot pushed a commit to astriaorg/astria that referenced this pull request Jul 18, 2024
## Summary
Updated the `bytes` and `ics23` crates.

## Background
The version of `bytes` we currently use has been yanked due to [a
bug](tokio-rs/bytes#718). Running `cargo audit`
exposed this as an allowed warning.

We also got a report of an issue with the `ics23` crate and a
recommendation to update to v0.11.3.

## Changes
- Ran `cargo update -p bytes` and `cargo update -p ics23`.

## Testing
No additional tests required.
bharath-123 pushed a commit to astriaorg/astria that referenced this pull request Jul 25, 2024
## Summary
Updated the `bytes` and `ics23` crates.

## Background
The version of `bytes` we currently use has been yanked due to [a
bug](tokio-rs/bytes#718). Running `cargo audit`
exposed this as an allowed warning.

We also got a report of an issue with the `ics23` crate and a
recommendation to update to v0.11.3.

## Changes
- Ran `cargo update -p bytes` and `cargo update -p ics23`.

## Testing
No additional tests required.
rklaehn pushed a commit to n0-computer/iroh-blobs that referenced this pull request Oct 22, 2024
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
GitHub Actions `cargo deny` is failing at
https://github.com/n0-computer/iroh/actions/runs/9928231752/job/27438879671

% `cargo update -p bytes`
```
    Updating crates.io index
     Locking 1 package to latest compatible version
    Updating bytes v1.6.0 -> v1.6.1
note: pass `--verbose` to see 152 unchanged dependencies behind latest
```
https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md to get the
fix in
* tokio-rs/bytes#718
## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
rklaehn pushed a commit to n0-computer/iroh-blobs that referenced this pull request Oct 22, 2024
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
GitHub Actions `cargo deny` is failing at
https://github.com/n0-computer/iroh/actions/runs/9928231752/job/27438879671

% `cargo update -p bytes`
```
    Updating crates.io index
     Locking 1 package to latest compatible version
    Updating bytes v1.6.0 -> v1.6.1
note: pass `--verbose` to see 152 unchanged dependencies behind latest
```
https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md to get the
fix in
* tokio-rs/bytes#718
## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants