google / google/EarlGrey

EarlGrey 2.0 | Incompatibility with LLVM ASAN

Open
#823 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

There are issues when running EarlGrey with Address Sanatizer (ASAN) (or TSAN/UBSAN) enabled. These sanitizers _also_ hook some of the same methods (e.g. dispatch_async, dispatch_sync, etc...) that EarlGrey hooks as well. The LLVM wrappers for these functions happen before the EarlGrey wrappers are hooked.

When tests call these wrapped functions, it first goes into the EarlGrey wrapper, which then calls what it suspects to be the original implementation of these methods, but is instead the LLVM sanitizer wrapper, which then makes a call back to what _it_ thinks is the original function, which is actually the EarlGrey wrapper. This causes an infinite loop.

The resulting stack trace looks like this:

grey_dispatch_async
wrap_dispatch_async
grey_dispatch_async
wrap_dispatch_async
grey_dispatch_async
wrap_dispatch_async
...
...
...

It would be really nice for me to be able to run my EarlGrey test suite under these sanitizers, to test for additional breakages. Is there a way that both of these wrappers can coexist in a way that would allow for this?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the recursion with EarlGrey and LLVM ASAN, TSAN, or UBSAN enabled, then trace the interaction between the named grey_dispatch_async and wrap_dispatch_async wrappers. Done means the EarlGrey test suite can run under these sanitizers without wrapper recursion.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.