Skip to content

Box::into_inner() is double freeing #21

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

Closed
wada314 opened this issue Nov 15, 2024 · 1 comment
Closed

Box::into_inner() is double freeing #21

wada314 opened this issue Nov 15, 2024 · 1 comment

Comments

@wada314
Copy link
Contributor

wada314 commented Nov 15, 2024

As the title says. When I run the following code, it fails with the error message saying "Exited with signal 6 (SIGABRT): abort program" (in playground) or "process didn't exit successfully: C:\Users\wada3\Documents\projects\foo\target\debug\deps\foo-c5fce5ee08e1c1dc.exe (exit code: 0xc0000374, STATUS_HEAP_CORRUPTION)" in my Windows.

Please note that the Box::into_inner() is an unstable function and it's guarded behind box_into_inner feature flag in the std::boxed::Box for now.
So this might be something should not be supported by this library. Anyway, just for someone else who noticed this and came here from google search...

Minimum reproducing sample:

#![feature(allocator_api)]

use ::allocator_api2::boxed::Box;

pub fn main() {
    let b = Box::new(3);
    Box::into_inner(b);
}

allocator_api2 version: 0.2.20

thanks!

@wada314
Copy link
Contributor Author

wada314 commented Nov 15, 2024

Note: This issue happened even in 0.2.18.

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

No branches or pull requests

1 participant