Infer Workflow Infer command
For example, we analyze iOS projects, and normally we build iOS projects that require only Xcodebuild-target helloworldapp-configuration debug-sdk Iphonesimulator, The infer command simply joins the infer at the beginning of the build command-a prefix like this. This is solved from the infer workflow analysis. two phases of infer execution Transformation Phase
First of all, infer the original build system to bring the build command included, the purpose is to use infer the process of compiling it into infer to bring the language translated. is to wrap a layer of interpreter and transform what is already there, so that you can understand what the benefit is. is not to reinvent the wheel, because each language or framework has its own set of very good build implementation, we do not have to overturn, just to transform it into something infer can understand. At this time we will have such a meaning, where the converted things are placed. The default is the Infer-out directory in the sibling directory, but you can modify it with the-o parameter. Now we're still using the default path Infer-out,ok, and we've got everything we need for the second phase, which goes into the analysis phase. Analysis Phase
The second phase of infer will analyze the results of the first-stage compilation from the Infer-out directory, he will analyze each function (method), and once a function is found to have errors, Infer will stop at the top of this method with the wrong statement. Skips this function to continue parsing other functions. So the infer workflow does not just run the code stage definition for infer, but it is also possible to find more stages of the error during the repair error phase and to determine whether all errors have been fixed by this stage, all of which have I The process defined by the Nfer workflow.
When an error is found, infer will print it to the standard output stream and error it to infer-out/bug.txt, and we are also a CSV-formatted file to store the wrong information. Standard output Stream
Analysis Done 4 Files analyzed/users/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/helloworldapp/ Appdelegate.m:20:error:memory_leak MEMORY dynamically allocated to Shadowpath by call to Cgpathcreatewithrect () at Li NE, column reachable, column 5/users/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hel Lo/helloworldapp/appdelegate.m:25:error:resource_leak RESOURCE acquired to FP by call to fopen () at line, Column 8 Is isn't released after line, column 5/users/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/ Helloworldapp/appdelegate.m:29:warning:parameter_not_null_checked PARAMETER callback is isn't CHECKED for NULL, there C Ould be a null pointer Dereference:pointer callback could being null and is dereferenced at line, column 5/users/wuxian
/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/helloworldapp/appdelegate.m:34:error:null_dereference Pointer str last assigned on line could is null and Is dereferenced at line, column 12/users/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/helloworldapp/ Appdelegate.m:39:error:premature_nil_termination_argument Pointer str Last assigned on line could is NIL which res Ults in a call to Arraywithobjects:with 1 arguments instead of 3 (nil indicates, the last argument of this variadic m Ethod has been reached) @ Line, column 12/users/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/ Helloworldapp/hello.m:20:error:null_dereference pointer Hello last assigned on line could being NULL and is Dereferen CED at line, column 12/users/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/helloworldapp/hello.m:25 : warning:ivar_not_null_checked Instance variable Hello, _hello is isn't CHECKED for NULL, there could bes a null PO Inter dereference:pointer Ret_hello last assigned on line could being null and is dereferenced at line, column 12/us Ers/wuxian/downloads/infer-osx-v0.1.0/infer/examples/ios_hello/helloworldapp/hello.m:30:warning:parameter_not_null_checked PARAMETER Hello isn't CHECKED for n Ull, there could be a null pointer dereference:pointer Ret_hello last assigned on line could being null and is Dereferenc
Ed at line 12, column
Bug.txt
Report.csv
Do not know the title code what the meaning, and then again. meaning of incremental and non-incremental workflows
We know that every time we analyze the process will generate Infer-out directory, for this directory, if the next time the execution of infer, we must first delete this directory, rebuild, we call this workflow called non-incremental workflow. However, if we want to keep the Infer-out directory, we can only parse the information of the new file that is added at a time, which is changed by the parameter-I (or--incremental) so that our workflow is called an incremental workflow.
Different types of analysis, I have in the process of the analysis of the article details of the way to set the increment parameters, here is no longer elaborate.