infer icon indicating copy to clipboard operation
infer copied to clipboard

build fail with ios app

Open zhangying19871987 opened this issue 10 years ago • 14 comments

I build successful if I just use the commond xcodebuild

I build my ios app with command infer,but I got the error as follows: /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:16:1: error: expected identifier or '(' .text ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:1: error: unknown type name 'mov' mov r7, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:15: error: expected ';' after top level declarator mov r7, sp ^ ; /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:1: error: unknown type name 'ldr' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:14: error: use of undeclared identifier 'sp' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:13: error: expected identifier or '(' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:1: error: unknown type name 'mov' mov r2, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:15: error: expected ';' after top level declarator mov r2, sp ^ ; 8 errors generated. clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/QHCrashAsyncThread_current-e9c334.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed with exit code 1

** BUILD FAILED **

zhangying19871987 avatar Aug 30 '16 07:08 zhangying19871987

Could you paste the full output of infer please? Please use a paste site such as https://gist.github.com/.

jvillard avatar Aug 30 '16 18:08 jvillard

Could you try applying the following diff and running infer again to see if it fixes your issue? Thanks!

https://gist.github.com/jvillard/5fd9b9dc32a402aa5347edc5d327f45b

jvillard avatar Aug 31 '16 01:08 jvillard

please tell me what can I do

zhangying19871987 avatar Aug 31 '16 03:08 zhangying19871987

The all information that I can give is : I build successful if I just use the commond xcodebuild I build my ios app with command infer,but I got the error as follows: /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:16:1: error: expected identifier or '(' .text ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:1: error: unknown type name 'mov' mov r7, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:15: error: expected ';' after top level declarator mov r7, sp ^ ; /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:1: error: unknown type name 'ldr' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:14: error: use of undeclared identifier 'sp' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:13: error: expected identifier or '(' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:1: error: unknown type name 'mov' mov r2, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:15: error: expected ';' after top level declarator mov r2, sp ^ ; 8 errors generated. clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/QHCrashAsyncThread_current-e9c334.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed with exit code 1

** BUILD FAILED **

zhangying19871987 avatar Aug 31 '16 03:08 zhangying19871987

I do not change anything about infer

zhangying19871987 avatar Aug 31 '16 03:08 zhangying19871987

What I meant was: What happens if you replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with this: https://gist.github.com/jvillard/9649b78fff071179509cd2dc2a254680 ?

jvillard avatar Sep 01 '16 03:09 jvillard

I replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with this: https://gist.github.com/jvillard/9649b78fff071179509cd2dc2a254680 It seems I got the same errors. This is the all output 1.txt

zhangying19871987 avatar Sep 01 '16 03:09 zhangying19871987

I looked at full output and it seems that infer is failing to build code in assembler-with-cpp language. I'll try to play with some small examples to see if infer works at all with assembler-with-cpp, but I suspect issue may be hidden further.

@zhangying19871987 It would greatly help me to debug issue sooner if I could get my hands on standalone repro. It'd be great if you could run following command and upload result. The output may be pretty large: https://gist.github.com/akotulski/1889f58356837730bd2a9a6b91f7c652

Is the code in QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S same as in https://github.com/bang590/JSPatch?

akotulski avatar Sep 01 '16 16:09 akotulski

I couldn't reproduce the issue on small example (file that failed to compile and is coming from https://github.com/bang590/JSPatch) - it compiles fine for me. For posteriority, this is what I ran:

infer -- clang -x assembler-with-cpp -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fmodules -gmodules -fpascal-strings -O0 -fno-common -DDEBUG=1 -isysroot /Applications/Xcode7.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk  -fstrict-aliasing   -c darwin64_x86_64.S -I ../../headers/

akotulski avatar Sep 01 '16 17:09 akotulski

I run following command and the result is

repro.txt

And I can give you the file QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S

darwin64_x86_64.S.zip

zhangying19871987 avatar Sep 02 '16 01:09 zhangying19871987

I have another app, I replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with this: https://gist.github.com/jvillard/9649b78fff071179509cd2dc2a254680

I build successful if I just use the commond xcodebuild If I build my ios app with command infer, I got the error as follows: 1.txt

zhangying19871987 avatar Sep 02 '16 09:09 zhangying19871987

I believe I managed to reproduce similar problem and fix it in https://github.com/facebook/infer/commit/0817ab0ec221d97c6685e0f22f88c967b2b471df

To quickly test the change, could you replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with version from master?

https://github.com/facebook/infer/blob/0817ab0ec221d97c6685e0f22f88c967b2b471df/infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh

akotulski avatar Sep 09 '16 10:09 akotulski

It was fixed this issue. Thanks a lot.

zhangying19871987 avatar Sep 12 '16 08:09 zhangying19871987

Infer 0.9.3 has been released, please try and reopen this issue if the problem remains.

jberdine avatar Sep 22 '16 15:09 jberdine