MobileNativeFoundation / MobileNativeFoundation/bluepill

App crashes with "ERROR: Interceptors are not working" when addressSanitizer enabled

Open
#331 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Objective-C
Stars
3.2k
Forks
227
PR merge metrics
No merged PRs in 30d

Description

Xcode : 10.1
Swift : 4.2.1

Steps:
Create a dummy Single View App
build using :
xcodebuild -project BluepillCrashTest.xcodeproj -scheme BluepillCrashTest -sdk iphonesimulator -destination 'platform=iOS Simulator,id=<simulator_id>, OS=12.1' build-for-testing -enableAddressSanitizer YES
run bluepill using :
bluepill --xctestrun-path <path_to_xctestrun> -n 1 -d 'iPhone Xs' -v on

App crashes with error below:

[  INFO  ] (BP-1) Running Tests. Attempt Number 1.
{54439} 20190515.125828 [  INFO  ] (BP-1) [Attempt 1] Create Simulator
{54439} 20190515.125828 [  INFO  ] (BP-1) Booting a simulator without launching Simulator app
{54419} 20190515.125828 [  INFO  ] (BLUEPILL) 1 BP still running. [1]
{54419} 20190515.125828 [  INFO  ] (BLUEPILL) Using 404 of 2128 processes.
{54439} 20190515.125829 [  INFO  ] (BP-1) Simulator 615CF8EC-E221-4261-B170-9C013FAD30FB achieved the BOOTED state Booted
{54439} 20190515.125829 [  INFO  ] (BP-1) Completed: [Attempt 1] Create Simulator 615CF8EC-E221-4261-B170-9C013FAD30FB
{54439} 20190515.125829 [  INFO  ] (BP-1) [Attempt 1] Install Application
{54439} 20190515.125829 [ DEBUG  ] (BP-1) installApplication: host bundleId: com.apple.test.BluepillCrashTestUITests-Runner, host BundlePath: /Users/kaansariveli/Library/Developer/Xcode/DerivedData/BluepillCrashTest-cpmdcidbqwkeugelllpjhovjdhdg/Build/Products/Debug-iphonesimulator/BluepillCrashTestUITests-Runner.app, testRunnerAppPath: /Users/kaansariveli/Library/Developer/Xcode/DerivedData/BluepillCrashTest-cpmdcidbqwkeugelllpjhovjdhdg/Build/Products/Debug-iphonesimulator/BluepillCrashTestUITests-Runner.app
{54439} 20190515.125838 [  INFO  ] (BP-1) Completed: [Attempt 1] Install Application
{54439} 20190515.125838 [  INFO  ] (BP-1) [Attempt 1] Launch Application
{54439} 20190515.125844 [  INFO  ] (BP-1) Launch succeeded
{54439} 20190515.125844 [  INFO  ] (BP-1) No error
{54439} 20190515.125844 [  INFO  ] (BP-1) Completion block for launch
{54439} 20190515.125844 [  INFO  ] (BP-1) Calling completion block with: (null) - 54571
{54439} 20190515.125844 [  INFO  ] (BP-1) Completed: [Attempt 1] Launch Application
**{54439} 20190515.125844 [ DEBUG  ] (BP-1) [OUTPUT] ==54571==ERROR: Interceptors are not working. This may be because AddressSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with:
{54439} 20190515.125844 [ DEBUG  ] (BP-1) [OUTPUT] DYLD_INSERT_LIBRARIES=/Users/kaansariveli/Library/Developer/Xcode/DerivedData/BluepillCrashTest-cpmdcidbqwkeugelllpjhovjdhdg/Build/Products/Debug-iphonesimulator/BluepillCrashTestUITests-Runner.app/PlugIns/BluepillCrashTestUITests.xctest/Frameworks/libclang_rt.asan_iossim_dynamic.dylib
{54439} 20190515.125844 [ DEBUG  ] (BP-1) [OUTPUT] "interceptors not installed" && 0
{54439} 20190515.125844 [ DEBUG  ] (BP-1) [OUTPUT] BP_APP_PROC_ENDED
{54439} 20190515.125844 [ CRASH  ] (BP-1) App crashed before tests started.**
{54439} 20190515.125844 [ DEBUG  ] (BP-1) Attempting to add empty test name or class to the executed list

It works well without addressSanitizer

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the shown xcodebuild and bluepill commands, comparing runs with and without AddressSanitizer. Trace Bluepill's application launch and environment handling around the reported interceptor error; done means AddressSanitizer-enabled UI tests launch and execute without the crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, swift
Domain
cli, mobile-dev, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.