-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Task that outlives root task leaks memory #126
Comments
This is because the task fails to unwind correctly if it's never executed. Here child2() never gets a chance to start before it is killed by main(). At this point the task's stack is in an inconsistent state which confuses the unwind glue. The frame pointer should be in the right place, and the frame_glue_fns should be initialized. The unwind glue fails to drop the reference to the string, thus causing a leak. |
My memory of the case I reduced this from indicates that "outliving" also causes leaks, not just "never starting". But that could be obsolete. I'll try to produce a test case along those lines after "never started" is fixed. |
I'll try to add support for putting tasks to sleep, should make these types of bugs easier to explore. |
WONTFIX (not required for bootstrapping, also likely to change semantics when tasking is implemented in rustc) |
* avx: _mm256_zextps128_ps256 * avx: _mm256_zextpd128_pd256 * avx: _mm256_set_m128 * avx: _mm256_set_m128d * avx: _mm256_castpd_ps * avx: _mm256_castps_pd * avx: _mm256_castps_si256 * avx: _mm256_castsi256_ps * avx: _mm256_zextsi128_si256 * avx: _mm256_set_m128i
Small fixes to the expressions section
Rustup to the latest nightly
rust-lang#126) ### Description This PR includes contracts and proof harnesses for the four APIs as_ptr, cast, as_mut_ptr, and as_non_null_ptr which are part of the NonNull library in Rust. ### Changes Overview: Covered APIs: NonNull::as_ptr: Acquires the underlying *mut pointer NonNull::cast: Casts to a pointer of another type NonNull:: as_mut_ptr: Returns raw pointer to array's buffer NonNull::as_non_null_ptr: Returns a non-null pointer to slice's buffer Proof harness: non_null_check_as_ptr non_null_check_cast non_null_check_as_mut_ptr non_null_check_as_non_null_ptr Revalidation To revalidate the verification results, run kani verify-std -Z unstable-options "path/to/library" -Z function-contracts -Z mem-predicates --harness ptr::non_null::verify. This will run all four harnesses in the module. All default checks should pass: ``` SUMMARY: ** 0 of 128 failed VERIFICATION:- SUCCESSFUL Verification Time: 0.8232234s Complete - 4 successfully verified harnesses, 0 failures, 4 total. ``` Towards issue rust-lang#53 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Zyad Hassan <[email protected]> Co-authored-by: Zyad Hassan <[email protected]> Co-authored-by: Michael Tautschnig <[email protected]> Co-authored-by: Qinyuan Wu <[email protected]>
Passing an int instead of a str (as spawn.rs does) doesn't leak, and having the main thread yield several times (as spawn-fn.rs does) allows the child to exit, which also avoids the leak.
The text was updated successfully, but these errors were encountered: