-
Notifications
You must be signed in to change notification settings - Fork 511
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
[release/8.0.1xx-xcode15.1] [runtime] Fix memory leak with BlockLiteral descriptors. Fixes #20503. #20562
Conversation
…n#20503. We're using two different functions to atomically decrement a reference count, the native `atomic_fetch_sub` and the managed `Interlocked.Decrement`. Unfortunately the return value is not the same: `atomic_fetch_sub` returns the original value before the subtraction, while `Interlocked.Decrement` returns the subtracted value, while our code assumed the functions behaved the same. This resulted in a memory leak, because we'd incorrectly expect `0` to be returned from `atomic_fetch_sub` when the reference count reaches zero, and thus not detect when the descriptor a block should be freed. The fix is to update the expected return value from `atomic_fetch_sub` to be `1` instead of `0`. Fixes xamarin#20503.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…se/8.0.1xx-xcode15.1-2024-05-06
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…se/8.0.1xx-xcode15.1-2024-05-06
📚 [PR Build] Artifacts 📚Packages generatedView packagesPipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
🔥 [PR Build] Build failed 🔥Build failed for the job 'Build macOS tests' Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)
✅ API diff vs stable.NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻✅ All tests on macOS M1 - Mac Ventura (13.0) passed. Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 95 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. [attempt 3] Html Report (VSDrops) Download Pipeline on Agent |
36b07b1
into
xamarin:release/8.0.1xx-xcode15.1
We're using two different functions to atomically decrement a reference count,
the native
atomic_fetch_sub
and the managedInterlocked.Decrement
.Unfortunately the return value is not the same:
atomic_fetch_sub
returns theoriginal value before the subtraction, while
Interlocked.Decrement
returnsthe subtracted value, while our code assumed the functions behaved the same.
This resulted in a memory leak, because we'd incorrectly expect
0
to bereturned from
atomic_fetch_sub
when the reference count reaches zero, andthus not detect when the descriptor a block should be freed.
The fix is to update the expected return value from
atomic_fetch_sub
to be1
instead of0
.Fixes #20503.
Backport of #20556.