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

Fix Android device issues related to filesystem/IO #58586

Merged
merged 3 commits into from
Sep 3, 2021

Conversation

akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Sep 2, 2021

  • Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag
  • Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized
  • Make ping test a bit more forgiving if the process returns a few milliseconds before the timeout
    - Make sure System.IO.Net5Compat.Tests.csproj builds for $(NetCoreAppCurrent) since it is now supposed to be running on all platforms. moved to run System.IO.Tests .NET 5 compat tests on every OS #58611

@ghost
Copy link

ghost commented Sep 2, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag
  • Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized
  • Make ping test a bit more forgiving if the process returns a few milliseconds before the timeout
  • Disable System.IO.Net5Compat.Tests.csproj on Helix for non-Windows platforms like intended, we were still building it since we pass /p:ArchiveTests=true on CI
Author: akoeplinger
Assignees: -
Labels:

area-System.IO

Milestone: -

@ghost
Copy link

ghost commented Sep 2, 2021

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag
  • Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized
  • Make ping test a bit more forgiving if the process returns a few milliseconds before the timeout
  • Disable System.IO.Net5Compat.Tests.csproj on Helix for non-Windows platforms like intended, we were still building it since we pass /p:ArchiveTests=true on CI
Author: akoeplinger
Assignees: -
Labels:

area-System.IO, os-android

Milestone: -

- Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag
- Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized
- Make ping test a bit more forgiving if the process returns a few milliseconds _before_ the timeout
- Disable System.IO.Net5Compat.Tests.csproj on Helix for non-Windows platforms like intended, we were still building it since we pass `/p:ArchiveTests=true` on CI
Comment on lines +1563 to +1569
#if defined(TARGET_ANDROID) && defined(HAVE_FLOCK64)
// On Android, fcntl is always implemented by fcntl64 but before https://github.com/aosp-mirror/platform_bionic/commit/09e77f35ab8d291bf88302bb9673aaa518c6bcb0
// there was no remapping of F_SETLK to F_SETLK64 when _FILE_OFFSET_BITS=64 (which we set in eng/native/configurecompiler.cmake) so we need to always pass F_SETLK64
int command = F_SETLK64;
#else
int command = F_SETLK;
#endif
Copy link
Member

@am11 am11 Sep 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a case where generic condition won't work:

Suggested change
#if defined(TARGET_ANDROID) && defined(HAVE_FLOCK64)
// On Android, fcntl is always implemented by fcntl64 but before https://github.com/aosp-mirror/platform_bionic/commit/09e77f35ab8d291bf88302bb9673aaa518c6bcb0
// there was no remapping of F_SETLK to F_SETLK64 when _FILE_OFFSET_BITS=64 (which we set in eng/native/configurecompiler.cmake) so we need to always pass F_SETLK64
int command = F_SETLK64;
#else
int command = F_SETLK;
#endif
#ifdef F_SETLK64
int command = F_SETLK64;
#else
int command = F_SETLK;
#endif

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure and since I want the change to go back to release/6.0 I thought it's better to keep the existing code as is. We can try your version for 7.0.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @akoeplinger !

@akoeplinger akoeplinger merged commit 462ab6e into dotnet:main Sep 3, 2021
@akoeplinger akoeplinger deleted the android-fixes branch September 3, 2021 14:07
akoeplinger added a commit to mdh1418/runtime that referenced this pull request Sep 9, 2021
- Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag
- Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized
- Make ping test a bit more forgiving if the process returns a few milliseconds _before_ the timeout

(cherry picked from commit 462ab6e)
steveisok pushed a commit that referenced this pull request Sep 13, 2021
…t and test fixes for Android (#58841)

Manual backport of #57208, #58519, #58562, #58210, #57732, #58428, #58586, #58745, #57687 to release/6.0

Numerous test suites have been failing for iOS/tvOS/MacCatalyst consistently on CI without useful logs as to why. Moreover, some of these suites pass locally.

This PR looks to reduce the failures on CI by skipping the problematic suites
Skips test suites logged in #53624

ActiveIssues
#58440
#58418
#58367
#58584

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Jo Shields <directhex@apebox.org>
@ghost ghost locked as resolved and limited conversation to collaborators Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants