injectionforxcode icon indicating copy to clipboard operation
injectionforxcode copied to clipboard

Crash when trying to inject

Open seboslaw opened this issue 11 years ago • 11 comments

Hey,

when trying to inject code while running (in XCode 5.0.1) I'm getting an EXC_BAD_ACESS exception within dyldbootstrap::start(..):

Bundle "InjectionBundle2.bundle" loaded successfully.
dyld: lazy symbol binding failed: Symbol not found: _llvm_gcov_init
  Referenced from: /Users/svogelsang/Development/work/testproj/iOS/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle
  Expected in: flat namespace

dyld: Symbol not found: _llvm_gcov_init
  Referenced from: /Users/svogelsang/Development/work/testproj/iOS/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle
  Expected in: flat namespace

The console shows:

Using learnt compilation.


real  0m0.000s

user 0m0.000s

sys  0m0.000s



Building iOSInjectionProject/InjectionBundle.xcodeproj

bash ../iOSInjectionProject/i386/compile_commands.sh # xcodebuild  -configuration 
Debug -arch i386 -sdk iphonesimulator




real   0m0.041s

user    0m0.028s

sys 0m0.012s


real  0m0.211s

user    0m0.043s

sys 0m0.173s



/usr/bin/touch -c „/Users/svogelsang/Development/work/testproj/iOS/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle.bundle“



** COMPILE SUCCEEDED **



Renaming bundle so it reloads..

Loading Bundle…

Disconnected from: /Users/svogelsang/Library/Application Support/iPhone Simulator/7.0.3/Applications/D209C980-CF88-4BBE-BAE4-83303C809990/testproj.app/testproj
Connection from: /Users/svogelsang/Library/Application Support/iPhone Simulator/7.0.3/Applications/D209C980-CF88-4BBE-BAE4-83303C809990/testproj.app/testproj i386 (34)

Using learnt compilation.



real  0m0.000s

user    0m0.000s

sys 0m0.000s



Building iOSInjectionProject/InjectionBundle.xcodeproj

bash ../iOSInjectionProject/i386/compile_commands.sh # xcodebuild  -configuration 
Debug -arch i386 -sdk iphonesimulator




real   0m0.040s

user    0m0.027s

sys 0m0.012s


real  0m0.218s

user    0m0.046s

sys 0m0.178s



/usr/bin/touch -c „/Users/svogelsang/Development/work/testproj/iOS/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle.bundle“



** COMPILE SUCCEEDED **



Renaming bundle so it reloads..

Loading Bundle…


seboslaw avatar Oct 30 '13 11:10 seboslaw

Err.. never come across that before. Do you have a small test project that demonstrates the problem you can send through? Email is in the plugin menu.

johnno1962 avatar Oct 30 '13 13:10 johnno1962

phew....problem is that this is a rather large and complex project. I guess that is also the problem here. I'll try to setup a test project and add all my dependencies one by one and then send you the thing once it starts crashing again.

seboslaw avatar Oct 30 '13 14:10 seboslaw

sorry, otherwise I don’t have a lot to go on.. It seems to be something to do with testing: http://stackoverflow.com/questions/566472/where-are-the-gcov-symbols, try editing the bundle project and adding some of the flags they mention. Let me know how you get on.

johnno1962 avatar Oct 30 '13 19:10 johnno1962

Hi, I’m closing this now unless you’ve found what the problem is.

johnno1962 avatar Jan 08 '14 17:01 johnno1962

I have this same problem.

kunalbalani avatar May 01 '14 17:05 kunalbalani

I think that problem is caused by CLang Code Coverage. As mention in http://stackoverflow.com/questions/19290946/clang-code-coverage-mac-os-x-linker-error the best answer is to add following Linker Flags in InjectionBundle.xcodeproj:

-Wall -fprofile-arcs -ftest-coverage

MaciejGad avatar Jan 13 '15 07:01 MaciejGad

Thanks Maciej. Sebastian. is there any chance you can verify this works and I’ll push it onto github.

johnno1962 avatar Jan 13 '15 09:01 johnno1962

@johnno1962 I'm sorry. I cannot even reproduce my old issue with Xcode 6.1.1. Everything works fine now.

seboslaw avatar Jan 13 '15 13:01 seboslaw

Thanks for letting me know. I’ll leave things as they are for now and leave this open for reference.

johnno1962 avatar Jan 13 '15 14:01 johnno1962

Had the same problem. @MaciejGad suggestion worked for me as well. -Wall -fprofile-arcs -ftest-coverage

fschaper avatar Feb 08 '15 20:02 fschaper

Had the same problem,-Wall -fprofile-arcs -ftest-coverage worked for me. but after the bundle was loaded,all my viewcontrollers was gone.

luoqisheng avatar Dec 24 '15 05:12 luoqisheng