-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Box syntax and generator_clone can lead to double free #105084
Copy link
Copy link
Closed
Labels
A-coroutinesArea: CoroutinesArea: CoroutinesC-bugCategory: This is a bug.Category: This is a bug.F-coroutine_clone`#![feature(coroutine_clone)]``#![feature(coroutine_clone)]`F-coroutines`#![feature(coroutines)]``#![feature(coroutines)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-coroutinesArea: CoroutinesArea: CoroutinesC-bugCategory: This is a bug.Category: This is a bug.F-coroutine_clone`#![feature(coroutine_clone)]``#![feature(coroutine_clone)]`F-coroutines`#![feature(coroutines)]``#![feature(coroutines)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
Playground
I expected to see this happen: compilation fails.
Instead, this happened: double free
Note: if we do not
resumethe generators after the copy, we get a memory leak.Meta
rustc version: tested on playground nightly on 2022-11-30.