Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAssignments leave their place partially-destroyed if the destructor panics #30380
Comments
arielb1
added
I-wrong
I-nominated
T-compiler
labels
Dec 14, 2015
This comment has been minimized.
This comment has been minimized.
|
cc me |
This comment has been minimized.
This comment has been minimized.
|
It must be noted that the assigned location is supposed to be borrowed mutably while the drop glue is called, so underhanded tricks used by the drop-glue to get a reference to that location (e.g. #30228, which led to the discovery of this issue) are just aliasing-UB. |
pnkfelix
referenced this issue
Dec 15, 2015
Closed
Thread locals do not guard against recursive initialization. #30228
This comment has been minimized.
This comment has been minimized.
|
cc me. |
pnkfelix
self-assigned this
Dec 17, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium |
pnkfelix
added
the
P-medium
label
Dec 17, 2015
pnkfelix
added
A-destructors
and removed
I-nominated
labels
Jan 7, 2016
This comment has been minimized.
This comment has been minimized.
|
This is causing problems to my non-zeroing-drop work. |
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 17, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 17, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 18, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 18, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 21, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 21, 2016
bstrie
added
the
I-unsound 💥
label
May 25, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 25, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 25, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 27, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 27, 2016
bors
added a commit
that referenced
this issue
May 27, 2016
bors
added a commit
that referenced
this issue
May 29, 2016
bors
added a commit
that referenced
this issue
May 29, 2016
bors
added a commit
that referenced
this issue
May 30, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 30, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
May 30, 2016
bors
added a commit
that referenced
this issue
May 30, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Jun 3, 2016
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Jun 3, 2016
bors
added a commit
that referenced
this issue
Jun 3, 2016
bors
added a commit
that referenced
this issue
Jun 4, 2016
bors
added a commit
that referenced
this issue
Jun 5, 2016
bors
closed this
in
#33622
Jun 5, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
arielb1 commentedDec 14, 2015
STR
Results
The assignment to
*b.0withinfoocalls the drop-glue for the value inside. The new tuple("~", Bomb)is created, and then the drop glue for the old value ofbis executed. It first frees the original string, and then attempts to callsBomb's destructor. As the latter destructor panics, the function unwinds without storing a value in the place of the missingString, leaving a&mutreference that points to an invalid value, which can later be observed by a destructor orrecover.Fixes
The new value for the destination is available the whole time - the panic handler can just write it in.