Closed hjr3 closed 8 months ago
Weird. So a revert is good enough?
I believe so. Playing with this more, miri added some additional information:
help: <122902> was created by a SharedReadOnly retag at offsets [0x0..0x60]
--> /Code/http/src/header/map.rs:815:22
|
815 | map: self as *const _ as *mut _,
| ^^^^
Which is here: https://github.com/hyperium/http/blob/f5f31f0651774a5d68f2d5051b70e0bd0ccae577/src/header/map.rs#L815
I think the issue with 78e3d37563b0fe83886abffdcd8569117d45fee9 is:
HeaderMap::iter
converts &HeaderMap<T>
to *mut HeaderMap<T>
IterMut::next_unsafe
uses that *mut HeaderMap<T>
to pull out a&mut Bucket<T>
Thus, we have a &mut
from something that was originally &
and that is undefined behavior.
Closes in #642
In https://github.com/hyperium/hyper/pull/3375 we ran into the following error:
It was observed that this error is not occurring in
v0.2.9
.I reproduced the error with this test in
test/header_map.rs
:I did a
git bisect
and identified the error:The above change was introduced in https://github.com/hyperium/http/pull/616
Note: I had to specify
RUSTFLAGS=-Adropping_copy_types
to avoid the following errors when buildingv0.2.9
onrustc 1.75.0-nightly (75b064d26 2023-11-01)
: