infer icon indicating copy to clipboard operation
infer copied to clipboard

[Bug] CompileC failure

Open cyw3 opened this issue 8 years ago • 8 comments

macOS High Sierra 10.13.2 Xcode Version 9.1 (9B55)

First, I can build this project successfully.

When infer-v0.14.0, use commands below:

xcodebuild -scheme FirstStep -configuration Debug
infer run --keep-going --jobs 8 -- xcodebuild -scheme AppName -configuration Debug -arch arm64

And Whenever I use the --no-xcpretty or infer compile, I occured: image

When infer-v0.15.0, image

After i use LD=/usr/bin/true infer run --keep-going --jobs 8 -- xcodebuild -scheme AppName -configuration Debug -arch arm64 it also become: image

So, What is the reason about this?And how to handle with ?

cyw3 avatar Jun 07 '18 02:06 cyw3

Could you paste the contents of infer-out/log somewhere? (eg gist.github.com)

That said, the xcodebuild integration is not very robust so since it's not working for your project I'd suggest generating a compilation database with xcpretty and passing it to infer separately. This workflow is outlined in the online docs here. Let me know if that helps.

jvillard avatar Jun 07 '18 14:06 jvillard

@jvillard

commands:

xcodebuild -scheme AppName -configuration Debug -arch arm64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee  xcodebuild.log
xcpretty -r json-compilation-database -o compile_commands.json < xcodebuild.log > /dev/null
infer run --skip-analysis-in-path Pods --clang-compilation-db-files-escaped compile_commands.json

But still have a error:

/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `printf "%s" /Users/xxx/Applications/C2CDBService(MultiTable).mm'
Uncaught Internal Error: End_of_file
Error backtrace:
Raised at file "pervasives.ml", line 440, characters 14-31
Called from file "src/in_channel.ml", line 72, characters 13-30
Called from file "base/Utils.ml" (inlined), line 218, characters 13-22
Called from file "base/Utils.ml" (inlined), line 165, characters 8-12
Called from file "base/Utils.ml", line 220, characters 2-40
Re-raised at file "istd/IExn.ml" (inlined), line 13, characters 2-50
Called from file "base/Utils.ml" (inlined), line 166, characters 6-141
Called from file "base/Utils.ml", line 220, characters 2-40
Called from file "integration/CompilationDatabase.ml", line 43, characters 8-127
Called from file "integration/CompilationDatabase.ml", line 64, characters 23-40
Called from file "list.ml", line 100, characters 12-15
Called from file "list.ml" (inlined), line 100, characters 17-25
Called from file "src/list0.ml" (inlined), line 26, characters 40-75
Called from file "integration/CompilationDatabase.ml", line 104, characters 8-37
Called from file "list.ml", line 100, characters 12-15
Called from file "integration/CompilationDatabase.ml" (inlined), line 147, characters 15-36
Called from file "list.ml" (inlined), line 100, characters 12-15
Called from file "list.ml" (inlined), line 98, characters 13-64
Called from file "src/list0.ml" (inlined), line 26, characters 40-75
Called from file "integration/CompilationDatabase.ml", line 147, characters 2-50
Called from file "integration/Driver.ml", line 183, characters 29-73
Called from file "integration/Driver.ml", line 203, characters 6-63
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54

cyw3 avatar Jun 08 '18 07:06 cyw3

Could you try running with --clang-compilation-db-files instead of --clang-compilation-db-files-escaped in the last command?

jvillard avatar Jun 15 '18 09:06 jvillard

infer run --skip-analysis-in-path Pods --clang-compilation-db-files compile_commands.json

Starting translating and linting 13767 files
error: error reading '/Users/xxx/Library/Developer/Xcode/DerivedData/xxxx/Index/DataStore'
error: error reading '/Users/xxx/Library/Developer/Xcode/DerivedData/xxxx/Index/DataStore'
1 error generated.
1 error generated.
error: error reading '/Users/xxx/Library/Developer/Xcode/DerivedData/xxxx/Index/DataStore'
1 error generated.
error: error reading '/Users/xxx/Library/Developer/Xcode/DerivedData/xxxx/Index/DataStore'
1 error generated.
Uncaught Internal Error: (Bi_inbuf.End_of_input)
Error backtrace:
Raised at file "src/bi_inbuf.ml", line 49, characters 6-24
Called from file "src/bi_io.ml" (inlined), line 508, characters 12-35
Called from file "atd/clang_ast_b.ml", line 27643, characters 7-24
Called from file "clang/Capture.ml", line 56, characters 8-39
Called from file "clang/Capture.ml" (inlined), line 101, characters 6-35
Called from file "clang/Capture.ml", line 170, characters 26-73
Re-raised at file "istd/IExn.ml" (inlined), line 18, characters 15-63
Called from file "clang/Capture.ml" (inlined), line 102, characters 4-60
Called from file "clang/Capture.ml", line 170, characters 26-73
Called from file "base/Utils.ml" (inlined), line 218, characters 13-22
Called from file "base/Utils.ml" (inlined), line 165, characters 8-12
Called from file "base/Utils.ml", line 220, characters 2-40
Re-raised at file "istd/IExn.ml" (inlined), line 13, characters 2-50
Called from file "base/Utils.ml" (inlined), line 166, characters 6-141
Called from file "base/Utils.ml", line 220, characters 2-40
Called from file "clang/Capture.ml" (inlined), line 113, characters 8-78
Called from file "clang/Capture.ml" (inlined), line 140, characters 2-37
Called from file "clang/Capture.ml", line 169, characters 8-138
Called from file "clang/ClangWrapper.ml" (inlined), line 171, characters 15-45
Called from file "list.ml" (inlined), line 100, characters 12-15
Called from file "list.ml" (inlined), line 98, characters 13-64
Called from file "src/list0.ml" (inlined), line 26, characters 40-75
Called from file "clang/ClangWrapper.ml", line 171, characters 2-54
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54

cyw3 avatar Jun 19 '18 06:06 cyw3

Have you solved this problem?

nicolasiJasica avatar Nov 19 '18 06:11 nicolasiJasica

@jvillard

commands:

xcodebuild -scheme AppName -configuration Debug -arch arm64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee  xcodebuild.log
xcpretty -r json-compilation-database -o compile_commands.json < xcodebuild.log > /dev/null
infer run --skip-analysis-in-path Pods --clang-compilation-db-files-escaped compile_commands.json

But still have a error:

/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `printf "%s" /Users/xxx/Applications/C2CDBService(MultiTable).mm'
Uncaught Internal Error: End_of_file
Error backtrace:
Raised at file "pervasives.ml", line 440, characters 14-31
Called from file "src/in_channel.ml", line 72, characters 13-30
Called from file "base/Utils.ml" (inlined), line 218, characters 13-22
Called from file "base/Utils.ml" (inlined), line 165, characters 8-12
Called from file "base/Utils.ml", line 220, characters 2-40
Re-raised at file "istd/IExn.ml" (inlined), line 13, characters 2-50
Called from file "base/Utils.ml" (inlined), line 166, characters 6-141
Called from file "base/Utils.ml", line 220, characters 2-40
Called from file "integration/CompilationDatabase.ml", line 43, characters 8-127
Called from file "integration/CompilationDatabase.ml", line 64, characters 23-40
Called from file "list.ml", line 100, characters 12-15
Called from file "list.ml" (inlined), line 100, characters 17-25
Called from file "src/list0.ml" (inlined), line 26, characters 40-75
Called from file "integration/CompilationDatabase.ml", line 104, characters 8-37
Called from file "list.ml", line 100, characters 12-15
Called from file "integration/CompilationDatabase.ml" (inlined), line 147, characters 15-36
Called from file "list.ml" (inlined), line 100, characters 12-15
Called from file "list.ml" (inlined), line 98, characters 13-64
Called from file "src/list0.ml" (inlined), line 26, characters 40-75
Called from file "integration/CompilationDatabase.ml", line 147, characters 2-50
Called from file "integration/Driver.ml", line 183, characters 29-73
Called from file "integration/Driver.ml", line 203, characters 6-63
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54

I have same issue.

dzp181 avatar Nov 21 '19 01:11 dzp181

This issue has had no activity for 18 months, so it is being marked as stale. If it is still relevant, please leave a comment (ideally confirming it reproduces on a current release of Infer, with a minimal example) and the stale label will be removed. Otherwise it will be closed in 30 days. Thank you for your contributions.

github-actions[bot] avatar Jul 07 '26 13:07 github-actions[bot]

Closing this issue as it has been inactive for 18 months plus a 30-day stale period. This is an automated cleanup and is not a judgment on the report's validity. If it still reproduces on a current release of Infer, please reopen or file a new issue with a minimal reproducer. Thanks!

github-actions[bot] avatar Aug 27 '26 08:08 github-actions[bot]