-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Android] Workaround for invalid return value from clock_nanosleep #64679
[Android] Workaround for invalid return value from clock_nanosleep #64679
Conversation
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsThere used to be a bug in Android libc implementation of Fixes dotnet/android#6600
|
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok, but maybe we can have less copy/pasted code if we added a utility function to eglib
…sival/fix-old-android-clock-nanosleep-inconsistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. Needs couple of changes
Thanks for the suggestions, @lambdageek!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows builds are unhappy. But we don't need clock_nanosleep
there, anyway.
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
There's a failing WASM test but it seems completely unrelated to this PR to me. I believe this PR could be merged. |
Yea the browser wasm windows System.Threading.Channels.Tests failures are #65012 |
@steveisok should we backport to net6? |
Yes. |
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1846939447 |
@akoeplinger backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Account for incorrect implementation of clock_nanosleep in older Android libc
Applying: Shorten comments
Applying: Add g_clock_nanosleep function
error: sha1 information is lacking or useless (src/mono/mono/mini/mini-posix.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Add g_clock_nanosleep function
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@simonrozsival can you please look into doing a manual PR for 6.0? thanks |
@akoeplinger Sure! I'll create one. |
…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
This is a follow-up of #64679 I realized that one invocation of `clock_nanosleep` wasn't replaced with `g_clock_nanosleep`.
…ono#21433) Fixes dotnet/android#6600 Backported from dotnet/runtime#64679 and dotnet/runtime#65373 (cherry picked from commit 36daf03)
…osleep (#21435) * [Android] Workaround for invalid return value from clock_nanosleep (#21433) Fixes dotnet/android#6600 Backported from dotnet/runtime#64679 and dotnet/runtime#65373 (cherry picked from commit 36daf03) * Fix Windows build Co-authored-by: Simon Rozsival <simon@rozsival.com>
…k_nanosleep (#65372) * [Android] Workaround for invalid return value from clock_nanosleep (#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 * Fix leftover direct call to clock_nanosleep
There used to be a bug in Android libc implementation of
clock_nanosleep
. The return value should beerrno
on errors but instead in it returns-1
and setserrno
. 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.Fixes dotnet/android#6600