Skip to content
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/6.0] [Android] Workaround for invalid return value from clock_nanosleep #65372

Merged

Conversation

simonrozsival
Copy link
Member

@simonrozsival simonrozsival commented Feb 15, 2022

Backport of #64679 to release/6.0

Customer impact

There used to be a bug in Android libc implementation of clock_nanosleep. The return value should be errno on errors but instead in it returns -1 and sets errno. The libc (Bionic) bug has been fixed since Android 6 and newer but it causes problems to customers who are unable to update Android on their devices. Since we support Android 5.0 we need to workaround this bug.

This workaround will allow several customers to update their build environment: dotnet/android#6600

Testing

Existing CI tests pass.

Risk

Low.

…otnet#64679)

There used to be a bug in Android libc implementation of `clock_nanosleep`. The return value should be `errno` on errors  but instead in it returns `-1` and sets `errno`. The libc (Bionic) bug [has been fixed](https://android-review.googlesource.com/c/platform/bionic/+/110652/) since Android 6 and newer but it causes problems to [customers who are unable to update Android on their devices](dotnet/android#6600 (comment)).

Fixes dotnet/android#6600

* Account for incorrect implementation of clock_nanosleep in older Android libc

* Shorten comments

* Add g_clock_nanosleep function

* Add remap definition

* Fix build

* Make sure the extra check runs only on Android

* Make Windows builds happy

* Try making wasm builds happy
@akoeplinger akoeplinger added this to the 6.0.x milestone Feb 15, 2022
@akoeplinger akoeplinger added the Servicing-consider Issue for next servicing release review label Feb 15, 2022
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 15, 2022
@rbhanda rbhanda modified the milestones: 6.0.x, 6.0.4 Feb 15, 2022
@lewing lewing merged commit 1095bbd into dotnet:release/6.0 Mar 10, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-meta-mono Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants