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

Can't use ASan on Android/ARM64 #12014

Closed
bjacob opened this issue Jan 31, 2023 · 5 comments
Closed

Can't use ASan on Android/ARM64 #12014

bjacob opened this issue Jan 31, 2023 · 5 comments
Labels
bug 🐞 Something isn't working platform/android 🤖 Android-specific build, execution, benchmarking, and deployment

Comments

@bjacob
Copy link
Contributor

bjacob commented Jan 31, 2023

At the moment, with IREE_ENABLE_ASAN=ON, many tests are failing with Illegal instruction, on Android/ARM64.

Unlike TSan where we are specifically building modules with TSAN instrumentation, with ASAN we have been working under the assumption that it was fine to run non-ASAN-instrumented module code with TSAN-instrumented IREE runtime. Maybe that's not the case anymore ? EDIT: Nope, I tried, it's not the same issue as TSan, and the equivalent fix here (compiling modules with --iree-llvm-sanitize=address --iree-llvm-link-embedded=false) does not make a difference.

@bjacob bjacob added bug 🐞 Something isn't working platform/android 🤖 Android-specific build, execution, benchmarking, and deployment labels Jan 31, 2023
@bjacob
Copy link
Contributor Author

bjacob commented Feb 2, 2023

We are running into exactly this general issue: google/sanitizers#1469

Verified - we are hitting Illegal instruction in this pthread_create call:

rc = pthread_create(&thread->handle, &thread_attr,

@bjacob bjacob changed the title Can't run module code with ASan on Android/ARM64 Can't use ASan on Android/ARM64 Feb 2, 2023
@benvanik
Copy link
Collaborator

benvanik commented Feb 2, 2023

Apparently ASAN doesn't support pthread on arm64 (only arm32).

Ouch :|

@bjacob
Copy link
Contributor Author

bjacob commented Feb 2, 2023

I'd guess that the downsides of shipping a new version of Android without ASan support outweighs the benefits, but what do I know.

@github-project-automation github-project-automation bot moved this to Not Started in (Deprecated) IREE Feb 21, 2023
@allieculp allieculp moved this from Not Started to Inbox in (Deprecated) IREE Apr 5, 2023
@allieculp
Copy link

@bjacob Marking as P2, but please adjust priority and status if needed.

@allieculp allieculp moved this from Inbox to Not Started in (Deprecated) IREE Apr 5, 2023
@bjacob
Copy link
Contributor Author

bjacob commented Apr 6, 2023

We can close this for now. Android/arm64 is in the midst of a transition from ASan to HWAsan. HWASan currently requires a Pixel device with a special OS image flashed on it, so that's quite a high barrier to entry. Android team is working on reducing this friction. If someone wants to act here, 2 courses of action that could deserve their own new Issue (describing for future reference):

  • The old ASan path is unsupported but may still be made to work with some half-documented tips. Figure that out and document. Maybe automate what can be automated in our CMake build.
  • Track HWASan status, play with it, document and/or enable in CMake build as appropriate. (Technically should be orthogonal to build, unlike old ASan, but I don't know what we'll run into).

@bjacob bjacob closed this as completed Apr 6, 2023
@github-project-automation github-project-automation bot moved this from Not Started to Done in (Deprecated) IREE Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working platform/android 🤖 Android-specific build, execution, benchmarking, and deployment
Projects
No open projects
Status: No status
Development

No branches or pull requests

3 participants