GithubHelp home page GithubHelp logo

facebook / infer Goto Github PK

View Code? Open in Web Editor NEW
13.7K 608.0 1.9K 159.82 MB

A static analyzer for Java, C, C++, and Objective-C

Home Page: http://fbinfer.com/

License: MIT License

Shell 0.34% Java 8.05% Objective-C 2.80% C 2.45% Makefile 2.00% Python 0.05% C++ 5.67% OCaml 54.37% CMake 0.01% Objective-C++ 0.18% M4 0.18% Assembly 0.01% Standard ML 2.60% Dockerfile 0.03% Starlark 0.02% OpenEdge ABL 0.07% AL 0.06% SMT 20.23% Erlang 0.89% Kotlin 0.02%
static-analysis static-code-analysis code-quality java c cpp objective-c

infer's Introduction

logo

Infer build website

Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml.

Installation

Read our Getting Started page for details on how to install packaged versions of Infer. To build Infer from source, see INSTALL.md.

Contributing

See CONTRIBUTING.md.

License

Infer is MIT-licensed.

Note: Enabling Java support may require you to download and install components licensed under the GPL.

infer's People

Contributors

artempyanykh avatar avarun42 avatar bennostein avatar da319 avatar davidpichardie avatar ddino avatar dulmarod avatar ezgicicek avatar fantazio avatar grievejia avatar hajduakos avatar hrutvik avatar jberdine avatar jeremydubreil avatar jvillard avatar kren1 avatar martinoluca avatar martintrojer avatar mbouaziz avatar mityal avatar ngorogiannis avatar peterogithub avatar phoebemay avatar rgrig avatar roro47 avatar ryanrhee avatar sblackshear avatar skcho avatar sofiaoreis avatar thizanne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infer's Issues

False positive with pointer returned through struct value (speex)

Thanks for the tool release! It's great to see new code in the static analysis space.

I found a false positive with the speex library. It sees a leak when a pointer is allocated and then returned as a member in a struct value. It may be more complicated than that, since I wasn't able to reproduce with a simpler test case.

src/skeleton.c:138: error: MEMORY_LEAK
   memory dynamically allocated to fp.message_header_fields by call to calloc() at line 135, column 82 is not reachable after line 138, column 5

https://github.com/xiph/speex/blob/master/src/skeleton.c#L138

Messy result with jdk 1.6

As I tried to use infer to analyze Android project with jdk 1.6. The result looks messy.

android_hello  infer -- ./gradlew build 
15:04:09.479 [ERROR] [system.err] ???棺android/support/v7/app/ActionBarActivity.class(android/support/v7/app:ActionBarActivity.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.482 [ERROR] [system.err] ?????????˱???????
15:04:09.495 [ERROR] [system.err] ???棺android/os/Bundle.class(android/os:Bundle.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.496 [ERROR] [system.err] ?????????˱???????
15:04:09.519 [ERROR] [system.err] ???棺android/view/Menu.class(android/view:Menu.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.520 [ERROR] [system.err] ?????????˱???????
15:04:09.531 [ERROR] [system.err] ???棺android/view/MenuItem.class(android/view:MenuItem.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.531 [ERROR] [system.err] ?????????˱???????
15:04:09.540 [ERROR] [system.err] ???棺java/io/FileOutputStream.class(java/io:FileOutputStream.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.541 [ERROR] [system.err] ?????????˱???????
15:04:09.545 [ERROR] [system.err] ???棺java/io/IOException.class(java/io:IOException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.549 [ERROR] [system.err] ?????????˱???????
15:04:09.559 [ERROR] [system.err] ???棺java/util/Calendar.class(java/util:Calendar.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.560 [ERROR] [system.err] ?????????˱???????
15:04:09.564 [ERROR] [system.err] ???棺android/support/v7/app/ActionBar.class(android/support/v7/app:ActionBar.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.570 [ERROR] [system.err] ?????????˱???????
15:04:09.572 [ERROR] [system.err] ???棺android/support/v7/app/ActionBar$Callback.class(android/support/v7/app:ActionBar$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.573 [ERROR] [system.err] ?????????˱???????
15:04:09.580 [ERROR] [system.err] ???棺java/lang/Object.class(java/lang:Object.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.583 [ERROR] [system.err] ?????????˱???????
15:04:09.608 [ERROR] [system.err] ???棺java/lang/Iterable.class(java/lang:Iterable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.609 [ERROR] [system.err] ?????????˱???????
15:04:09.621 [ERROR] [system.err] ???棺android/support/v4/widget/DrawerLayoutImpl.class(android/support/v4/widget:DrawerLayoutImpl.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.622 [ERROR] [system.err] ?????????˱???????
15:04:09.627 [ERROR] [system.err] ???棺android/view/ViewGroup.class(android/view:ViewGroup.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.628 [ERROR] [system.err] ?????????˱???????
15:04:09.634 [ERROR] [system.err] ???棺android/view/ViewParent.class(android/view:ViewParent.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.634 [ERROR] [system.err] ?????????˱???????
15:04:09.637 [ERROR] [system.err] ???棺android/view/ViewManager.class(android/view:ViewManager.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.638 [ERROR] [system.err] ?????????˱???????
15:04:09.644 [ERROR] [system.err] ???棺android/view/View.class(android/view:View.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.645 [ERROR] [system.err] ?????????˱???????
15:04:09.655 [ERROR] [system.err] ???棺android/graphics/drawable/Drawable.class(android/graphics/drawable:Drawable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.656 [ERROR] [system.err] ?????????˱???????
15:04:09.659 [ERROR] [system.err] ???棺android/graphics/drawable/Drawable$Callback.class(android/graphics/drawable:Drawable$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.660 [ERROR] [system.err] ?????????˱???????
15:04:09.669 [ERROR] [system.err] ???棺android/view/KeyEvent.class(android/view:KeyEvent.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.670 [ERROR] [system.err] ?????????˱???????
15:04:09.676 [ERROR] [system.err] ???棺android/view/KeyEvent$Callback.class(android/view:KeyEvent$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.677 [ERROR] [system.err] ?????????˱???????
15:04:09.681 [ERROR] [system.err] ???棺android/os/Parcelable.class(android/os:Parcelable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.682 [ERROR] [system.err] ?????????˱???????
15:04:09.692 [ERROR] [system.err] ???棺android/view/InputEvent.class(android/view:InputEvent.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.693 [ERROR] [system.err] ?????????˱???????
15:04:09.700 [ERROR] [system.err] ???棺android/view/accessibility/AccessibilityEventSource.class(android/view/accessibility:AccessibilityEventSource.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.701 [ERROR] [system.err] ?????????˱???????
15:04:09.705 [ERROR] [system.err] ???棺android/support/v7/app/ActionBarDrawerToggle.class(android/support/v7/app:ActionBarDrawerToggle.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.706 [ERROR] [system.err] ?????????˱???????
15:04:09.709 [ERROR] [system.err] ???棺android/support/v7/app/ActionBarDrawerToggle$TmpDelegateProvider.class(android/support/v7/app:ActionBarDrawerToggle$TmpDelegateProvider.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.710 [ERROR] [system.err] ?????????˱???????
15:04:09.717 [ERROR] [system.err] ???棺android/app/Activity.class(android/app:Activity.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.717 [ERROR] [system.err] ?????????˱???????
15:04:09.721 [ERROR] [system.err] ???棺android/view/LayoutInflater.class(android/view:LayoutInflater.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.722 [ERROR] [system.err] ?????????˱???????
15:04:09.724 [ERROR] [system.err] ???棺android/view/LayoutInflater$Factory2.class(android/view:LayoutInflater$Factory2.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.725 [ERROR] [system.err] ?????????˱???????
15:04:09.726 [ERROR] [system.err] ???棺android/view/LayoutInflater$Factory.class(android/view:LayoutInflater$Factory.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.727 [ERROR] [system.err] ?????????˱???????
15:04:09.729 [ERROR] [system.err] ???棺android/view/Window.class(android/view:Window.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.730 [ERROR] [system.err] ?????????˱???????
15:04:09.732 [ERROR] [system.err] ???棺android/view/Window$Callback.class(android/view:Window$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.733 [ERROR] [system.err] ?????????˱???????
15:04:09.735 [ERROR] [system.err] ???棺android/view/View$OnCreateContextMenuListener.class(android/view:View$OnCreateContextMenuListener.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.736 [ERROR] [system.err] ?????????˱???????
15:04:09.739 [ERROR] [system.err] ???棺android/content/ComponentCallbacks2.class(android/content:ComponentCallbacks2.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.739 [ERROR] [system.err] ?????????˱???????
15:04:09.742 [ERROR] [system.err] ???棺android/content/ComponentCallbacks.class(android/content:ComponentCallbacks.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.742 [ERROR] [system.err] ?????????˱???????
15:04:09.743 [ERROR] [system.err] ???棺android/view/ContextThemeWrapper.class(android/view:ContextThemeWrapper.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.745 [ERROR] [system.err] ?????????˱???????
15:04:09.748 [ERROR] [system.err] ???棺android/content/ContextWrapper.class(android/content:ContextWrapper.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.749 [ERROR] [system.err] ?????????˱???????
15:04:09.752 [ERROR] [system.err] ???棺android/content/Context.class(android/content:Context.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.753 [ERROR] [system.err] ?????????˱???????
15:04:09.760 [ERROR] [system.err] ???棺java/lang/String.class(java/lang:String.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.760 [ERROR] [system.err] ?????????˱???????
15:04:09.783 [ERROR] [system.err] ???棺android/view/ViewDebug.class(android/view:ViewDebug.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.783 [ERROR] [system.err] ?????????˱???????
15:04:09.784 [ERROR] [system.err] ???棺android/view/ViewDebug$ExportedProperty.class(android/view:ViewDebug$ExportedProperty.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.785 [ERROR] [system.err] ?????????˱???????
15:04:09.787 [ERROR] [system.err] ???棺android/view/ViewDebug$IntToString.class(android/view:ViewDebug$IntToString.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.788 [ERROR] [system.err] ?????????˱???????
15:04:09.791 [ERROR] [system.err] ???棺java/lang/Override.class(java/lang:Override.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.791 [ERROR] [system.err] ?????????˱???????
15:04:09.794 [ERROR] [system.err] ???棺java/lang/annotation/Annotation.class(java/lang/annotation:Annotation.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.795 [ERROR] [system.err] ?????????˱???????
15:04:09.797 [ERROR] [system.err] ???棺java/lang/annotation/Target.class(java/lang/annotation:Target.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.798 [ERROR] [system.err] ?????????˱???????
15:04:09.799 [ERROR] [system.err] ???棺java/lang/annotation/ElementType.class(java/lang/annotation:ElementType.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.800 [ERROR] [system.err] ?????????˱???????
15:04:09.803 [ERROR] [system.err] ???棺java/lang/annotation/Retention.class(java/lang/annotation:Retention.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.805 [ERROR] [system.err] ?????????˱???????
15:04:09.806 [ERROR] [system.err] ???棺java/lang/annotation/RetentionPolicy.class(java/lang/annotation:RetentionPolicy.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.807 [ERROR] [system.err] ?????????˱???????
15:04:09.812 [ERROR] [system.err] ???棺java/lang/Error.class(java/lang:Error.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.813 [ERROR] [system.err] ?????????˱???????
15:04:09.820 [ERROR] [system.err] ???棺android/content/pm/PackageManager.class(android/content/pm:PackageManager.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.821 [ERROR] [system.err] ?????????˱???????
15:04:09.823 [ERROR] [system.err] ???棺android/content/pm/PackageManager$NameNotFoundException.class(android/content/pm:PackageManager$NameNotFoundException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.824 [ERROR] [system.err] ?????????˱???????
15:04:09.827 [ERROR] [system.err] ???棺android/util/AndroidException.class(android/util:AndroidException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.827 [ERROR] [system.err] ?????????˱???????
15:04:09.829 [ERROR] [system.err] ???棺java/lang/Exception.class(java/lang:Exception.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.830 [ERROR] [system.err] ?????????˱???????
15:04:09.833 [ERROR] [system.err] ???棺java/lang/Throwable.class(java/lang:Throwable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.833 [ERROR] [system.err] ?????????˱???????
15:04:09.835 [ERROR] [system.err] ???棺java/lang/RuntimeException.class(java/lang:RuntimeException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.835 [ERROR] [system.err] ?????????˱???????
15:04:09.838 [ERROR] [system.err] ???棺android/content/IntentSender.class(android/content:IntentSender.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.839 [ERROR] [system.err] ?????????˱???????
15:04:09.840 [ERROR] [system.err] ???棺android/content/IntentSender$SendIntentException.class(android/content:IntentSender$SendIntentException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.840 [ERROR] [system.err] ?????????˱???????
15:04:09.844 [ERROR] [system.err] ???棺java/io/FileNotFoundException.class(java/io:FileNotFoundException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.844 [ERROR] [system.err] ?????????˱???????
15:04:09.855 [ERROR] [system.err] ???棺java/io/Serializable.class(java/io:Serializable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.856 [ERROR] [system.err] ?????????˱???????
15:04:09.857 [ERROR] [system.err] ???棺java/lang/Cloneable.class(java/lang:Cloneable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.860 [ERROR] [system.err] ?????????˱???????
15:04:09.866 [ERROR] [system.err] ???棺java/lang/Comparable.class(java/lang:Comparable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.867 [ERROR] [system.err] ?????????˱???????
15:04:09.871 [ERROR] [system.err] ???棺java/io/FileDescriptor.class(java/io:FileDescriptor.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.872 [ERROR] [system.err] ?????????˱???????
15:04:09.874 [ERROR] [system.err] ???棺java/io/File.class(java/io:File.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.875 [ERROR] [system.err] ?????????˱???????
15:04:09.880 [ERROR] [system.err] ???棺java/io/OutputStream.class(java/io:OutputStream.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.882 [ERROR] [system.err] ?????????˱???????
15:04:09.885 [ERROR] [system.err] ???棺android/view/MenuInflater.class(android/view:MenuInflater.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.887 [ERROR] [system.err] ?????????˱???????
15:04:09.997 [ERROR] [system.err] ???棺java/lang/Boolean.class(java/lang:Boolean.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:09.999 [ERROR] [system.err] ?????????˱???????
15:04:10.004 [ERROR] [system.err] 65 ????
15:04:12.861 [ERROR] [system.err] ???棺android/support/v7/app/ActionBarActivity.class(android/support/v7/app:ActionBarActivity.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.862 [ERROR] [system.err] ?????????˱???????
15:04:12.865 [ERROR] [system.err] ???棺android/os/Bundle.class(android/os:Bundle.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.865 [ERROR] [system.err] ?????????˱???????
15:04:12.869 [ERROR] [system.err] ???棺android/view/Menu.class(android/view:Menu.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.869 [ERROR] [system.err] ?????????˱???????
15:04:12.870 [ERROR] [system.err] ???棺android/view/MenuItem.class(android/view:MenuItem.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.871 [ERROR] [system.err] ?????????˱???????
15:04:12.874 [ERROR] [system.err] ???棺java/io/FileOutputStream.class(java/io:FileOutputStream.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.874 [ERROR] [system.err] ?????????˱???????
15:04:12.876 [ERROR] [system.err] ???棺java/io/IOException.class(java/io:IOException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.876 [ERROR] [system.err] ?????????˱???????
15:04:12.879 [ERROR] [system.err] ???棺java/util/Calendar.class(java/util:Calendar.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.880 [ERROR] [system.err] ?????????˱???????
15:04:12.882 [ERROR] [system.err] ???棺android/support/v7/app/ActionBar.class(android/support/v7/app:ActionBar.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.882 [ERROR] [system.err] ?????????˱???????
15:04:12.891 [ERROR] [system.err] ???棺android/support/v7/app/ActionBar$Callback.class(android/support/v7/app:ActionBar$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.892 [ERROR] [system.err] ?????????˱???????
15:04:12.893 [ERROR] [system.err] ???棺java/lang/Object.class(java/lang:Object.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.893 [ERROR] [system.err] ?????????˱???????
15:04:12.898 [ERROR] [system.err] ???棺java/lang/Iterable.class(java/lang:Iterable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.898 [ERROR] [system.err] ?????????˱???????
15:04:12.903 [ERROR] [system.err] ???棺android/support/v4/widget/DrawerLayoutImpl.class(android/support/v4/widget:DrawerLayoutImpl.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.903 [ERROR] [system.err] ?????????˱???????
15:04:12.905 [ERROR] [system.err] ???棺android/view/ViewGroup.class(android/view:ViewGroup.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.905 [ERROR] [system.err] ?????????˱???????
15:04:12.908 [ERROR] [system.err] ???棺android/view/ViewParent.class(android/view:ViewParent.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.908 [ERROR] [system.err] ?????????˱???????
15:04:12.909 [ERROR] [system.err] ???棺android/view/ViewManager.class(android/view:ViewManager.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.910 [ERROR] [system.err] ?????????˱???????
15:04:12.911 [ERROR] [system.err] ???棺android/view/View.class(android/view:View.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.912 [ERROR] [system.err] ?????????˱???????
15:04:12.917 [ERROR] [system.err] ???棺android/graphics/drawable/Drawable.class(android/graphics/drawable:Drawable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.918 [ERROR] [system.err] ?????????˱???????
15:04:12.920 [ERROR] [system.err] ???棺android/graphics/drawable/Drawable$Callback.class(android/graphics/drawable:Drawable$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.920 [ERROR] [system.err] ?????????˱???????
15:04:12.922 [ERROR] [system.err] ???棺android/view/KeyEvent.class(android/view:KeyEvent.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.923 [ERROR] [system.err] ?????????˱???????
15:04:12.925 [ERROR] [system.err] ???棺android/view/KeyEvent$Callback.class(android/view:KeyEvent$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.926 [ERROR] [system.err] ?????????˱???????
15:04:12.927 [ERROR] [system.err] ???棺android/os/Parcelable.class(android/os:Parcelable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.928 [ERROR] [system.err] ?????????˱???????
15:04:12.929 [ERROR] [system.err] ???棺android/view/InputEvent.class(android/view:InputEvent.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.930 [ERROR] [system.err] ?????????˱???????
15:04:12.932 [ERROR] [system.err] ???棺android/view/accessibility/AccessibilityEventSource.class(android/view/accessibility:AccessibilityEventSource.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.932 [ERROR] [system.err] ?????????˱???????
15:04:12.933 [ERROR] [system.err] ???棺android/support/v7/app/ActionBarDrawerToggle.class(android/support/v7/app:ActionBarDrawerToggle.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.934 [ERROR] [system.err] ?????????˱???????
15:04:12.936 [ERROR] [system.err] ???棺android/support/v7/app/ActionBarDrawerToggle$TmpDelegateProvider.class(android/support/v7/app:ActionBarDrawerToggle$TmpDelegateProvider.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.937 [ERROR] [system.err] ?????????˱???????
15:04:12.941 [ERROR] [system.err] ???棺android/app/Activity.class(android/app:Activity.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.942 [ERROR] [system.err] ?????????˱???????
15:04:12.944 [ERROR] [system.err] ???棺android/view/LayoutInflater.class(android/view:LayoutInflater.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.945 [ERROR] [system.err] ?????????˱???????
15:04:12.946 [ERROR] [system.err] ???棺android/view/LayoutInflater$Factory2.class(android/view:LayoutInflater$Factory2.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.948 [ERROR] [system.err] ?????????˱???????
15:04:12.950 [ERROR] [system.err] ???棺android/view/LayoutInflater$Factory.class(android/view:LayoutInflater$Factory.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.951 [ERROR] [system.err] ?????????˱???????
15:04:12.952 [ERROR] [system.err] ???棺android/view/Window.class(android/view:Window.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.953 [ERROR] [system.err] ?????????˱???????
15:04:12.956 [ERROR] [system.err] ???棺android/view/Window$Callback.class(android/view:Window$Callback.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.956 [ERROR] [system.err] ?????????˱???????
15:04:12.958 [ERROR] [system.err] ???棺android/view/View$OnCreateContextMenuListener.class(android/view:View$OnCreateContextMenuListener.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.959 [ERROR] [system.err] ?????????˱???????
15:04:12.961 [ERROR] [system.err] ???棺android/content/ComponentCallbacks2.class(android/content:ComponentCallbacks2.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.961 [ERROR] [system.err] ?????????˱???????
15:04:12.962 [ERROR] [system.err] ???棺android/content/ComponentCallbacks.class(android/content:ComponentCallbacks.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.963 [ERROR] [system.err] ?????????˱???????
15:04:12.964 [ERROR] [system.err] ???棺android/view/ContextThemeWrapper.class(android/view:ContextThemeWrapper.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.965 [ERROR] [system.err] ?????????˱???????
15:04:12.966 [ERROR] [system.err] ???棺android/content/ContextWrapper.class(android/content:ContextWrapper.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.968 [ERROR] [system.err] ?????????˱???????
15:04:12.969 [ERROR] [system.err] ???棺android/content/Context.class(android/content:Context.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.970 [ERROR] [system.err] ?????????˱???????
15:04:12.972 [ERROR] [system.err] ???棺java/lang/String.class(java/lang:String.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.972 [ERROR] [system.err] ?????????˱???????
15:04:12.985 [ERROR] [system.err] ???棺android/view/ViewDebug.class(android/view:ViewDebug.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.986 [ERROR] [system.err] ?????????˱???????
15:04:12.987 [ERROR] [system.err] ???棺android/view/ViewDebug$ExportedProperty.class(android/view:ViewDebug$ExportedProperty.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.987 [ERROR] [system.err] ?????????˱???????
15:04:12.988 [ERROR] [system.err] ???棺android/view/ViewDebug$IntToString.class(android/view:ViewDebug$IntToString.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.989 [ERROR] [system.err] ?????????˱???????
15:04:12.990 [ERROR] [system.err] ???棺java/lang/Override.class(java/lang:Override.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.991 [ERROR] [system.err] ?????????˱???????
15:04:12.992 [ERROR] [system.err] ???棺java/lang/annotation/Annotation.class(java/lang/annotation:Annotation.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.993 [ERROR] [system.err] ?????????˱???????
15:04:12.994 [ERROR] [system.err] ???棺java/lang/annotation/Target.class(java/lang/annotation:Target.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.994 [ERROR] [system.err] ?????????˱???????
15:04:12.996 [ERROR] [system.err] ???棺java/lang/annotation/ElementType.class(java/lang/annotation:ElementType.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:12.997 [ERROR] [system.err] ?????????˱???????
15:04:12.999 [ERROR] [system.err] ???棺java/lang/annotation/Retention.class(java/lang/annotation:Retention.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.000 [ERROR] [system.err] ?????????˱???????
15:04:13.001 [ERROR] [system.err] ???棺java/lang/annotation/RetentionPolicy.class(java/lang/annotation:RetentionPolicy.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.002 [ERROR] [system.err] ?????????˱???????
15:04:13.004 [ERROR] [system.err] ???棺java/lang/Error.class(java/lang:Error.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.004 [ERROR] [system.err] ?????????˱???????
15:04:13.006 [ERROR] [system.err] ???棺android/content/pm/PackageManager.class(android/content/pm:PackageManager.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.007 [ERROR] [system.err] ?????????˱???????
15:04:13.009 [ERROR] [system.err] ???棺android/content/pm/PackageManager$NameNotFoundException.class(android/content/pm:PackageManager$NameNotFoundException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.010 [ERROR] [system.err] ?????????˱???????
15:04:13.012 [ERROR] [system.err] ???棺android/util/AndroidException.class(android/util:AndroidException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.012 [ERROR] [system.err] ?????????˱???????
15:04:13.013 [ERROR] [system.err] ???棺java/lang/Exception.class(java/lang:Exception.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.014 [ERROR] [system.err] ?????????˱???????
15:04:13.015 [ERROR] [system.err] ???棺java/lang/Throwable.class(java/lang:Throwable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.016 [ERROR] [system.err] ?????????˱???????
15:04:13.017 [ERROR] [system.err] ???棺java/lang/RuntimeException.class(java/lang:RuntimeException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.018 [ERROR] [system.err] ?????????˱???????
15:04:13.020 [ERROR] [system.err] ???棺android/content/IntentSender.class(android/content:IntentSender.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.020 [ERROR] [system.err] ?????????˱???????
15:04:13.022 [ERROR] [system.err] ???棺android/content/IntentSender$SendIntentException.class(android/content:IntentSender$SendIntentException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.023 [ERROR] [system.err] ?????????˱???????
15:04:13.025 [ERROR] [system.err] ???棺java/io/FileNotFoundException.class(java/io:FileNotFoundException.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.026 [ERROR] [system.err] ?????????˱???????
15:04:13.029 [ERROR] [system.err] ???棺java/io/Serializable.class(java/io:Serializable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.030 [ERROR] [system.err] ?????????˱???????
15:04:13.031 [ERROR] [system.err] ???棺java/lang/Cloneable.class(java/lang:Cloneable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.032 [ERROR] [system.err] ?????????˱???????
15:04:13.033 [ERROR] [system.err] ???棺java/lang/Comparable.class(java/lang:Comparable.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.033 [ERROR] [system.err] ?????????˱???????
15:04:13.035 [ERROR] [system.err] ???棺java/io/FileDescriptor.class(java/io:FileDescriptor.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.035 [ERROR] [system.err] ?????????˱???????
15:04:13.036 [ERROR] [system.err] ???棺java/io/File.class(java/io:File.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.037 [ERROR] [system.err] ?????????˱???????
15:04:13.037 [ERROR] [system.err] ???棺java/io/OutputStream.class(java/io:OutputStream.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.038 [ERROR] [system.err] ?????????˱???????
15:04:13.039 [ERROR] [system.err] ???棺android/view/MenuInflater.class(android/view:MenuInflater.class): ???汾 51 ?? 50 ?£??˱?????֧?????µ????汾??
15:04:13.040 [ERROR] [system.err] ?????????˱???????
15:04:13.127 [ERROR] [system.err] 64 ????
TODO: print error message
TODO: print error message
There was nothing to analyze, exiting

Looks like infer has skipped all the files.

When I upgrade to jdk 1.7, the messy code has gone. But still no files was analyzed.

android_hello  infer -- ./gradlew build
15:16:05.008 [ERROR] [org.gradle.api.Project] /Users/hahack/infer/examples/android_hello/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
15:16:21.593 [ERROR] [org.gradle.api.Project] /Users/hahack/infer/examples/android_hello/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
TODO: print error message
TODO: print error message
There was nothing to analyze, exiting

64 bit python

I've tried with 64 bit python on windows, with mingw / bash emulation. It complained about sys.maxsize has to be integer... It was, but 64 bit integer. I expect that all 64 bit python will fail that way.

It can be checked during program start and reported in more meaningful way, or simply add that info in troubleshoot.

Does infer support Makefile generated by CMake?

Hi,

I try to apply infer on the Makefile generated by CMake: infer -- make, but it seems infer cannot do any static analysis on any C source code in the workspace. Shall I give more arguments to infer to process the Makefile generated by CMake?

# cmake ../apps/test01/
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /vagrant/logs/ironman/work
06:42:31 [email protected] /vagrant/logs/ironman/work [0]
# ls -al
total 36
drwxr-xr-x 1 vagrant vagrant   204 Jun 12 06:42 .
drwxr-xr-x 1 vagrant vagrant   578 Jun 12 06:37 ..
-rw-r--r-- 1 vagrant vagrant 12278 Jun 12 06:42 CMakeCache.txt
drwxr-xr-x 1 vagrant vagrant   442 Jun 12 06:42 CMakeFiles
-rw-r--r-- 1 vagrant vagrant  1595 Jun 12 06:42 cmake_install.cmake
-rw-r--r-- 1 vagrant vagrant 16643 Jun 12 06:42 Makefile
06:42:34 [email protected] /vagrant/logs/ironman/work [0]
# infer -- make
Scanning dependencies of target test01
[ 10%] Building C object CMakeFiles/test01.dir/control.c.o
[ 20%] Building C object CMakeFiles/test01.dir/thread01.c.o
[ 30%] Building C object CMakeFiles/test01.dir/thread02.c.o
[ 40%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/httpie.c.o
[ 50%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/j_thread.c.o
[ 60%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/logger.c.o
[ 70%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/main.c.o
[ 80%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/reader.c.o
[ 90%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/sensorweb.c.o
[100%] Building C object CMakeFiles/test01.dir/vagrant/logs/ironman/framework/native/src/service.c.o
Linking C executable test01
[100%] Built target test01
Starting analysis (Infer version v0.1.0)
Analysis done

0 file analyzed


No issues found

Running Infer Problem : xcode-select: error: tool 'xcodebuild' requires Xcode

I am trying to do this in the terminal But I got the following error

xcodebuild -workspace mcollect.xcworkspace -scheme mcollect -configuration Debug -sdk iphonesimulator
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Am I missing some dependency in here, inorder to run the Xcode Project perfectly what all do I need to install.

Thanks

Android: subprocess.CalledProcessError

I got this error. The traceback is:

Traceback (most recent call last):
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/infer", line 142, in <module>
    main()
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/infer", line 119, in main
    capture_exitcode = imported_module.gen_instance(args, cmd).capture()
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/gradle.py", line 42, in capture
    return util.run_commands(cmds)
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
    if not cmd.start():
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 632, in start
    if self.capture() == os.EX_OK:
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 400, in capture
    return self.run_infer_frontend()
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
    self.args.analyzer
  File "/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
    raise e
subprocess.CalledProcessError: Command '[u'/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/InferJava', u'-results_dir', u'/Users/tuanchauict/workspace/Android/Sudoku/infer-out', u'-verbose_out', '/tmp/javac_S_WOLP.out', u'-models', u'/Users/tuanchauict/Data/Software/Dev/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2

Mac OS 10.10
Java 7 (for Android project)

Use system clang on OSX

This can avoid most errors with features which Apple is not pushed to upstream, like nullable

Getting "OSError: [Errno 8] Exec format error" while infer'ring Hello.java

Hi,

I am having i686 openSUSE and have installed 64 bit binary from fb-infer website.
I dont know how to build 32 bit binary for fb-infer.

So, when I used 64 bit binary for infer'ring Hello.java, I got the following error.
Am I missing something? I had followed the steps provided in the 'Getting Started'

File "/home/gansai/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferJ", line 19, in
stats = analysis.start()
File "/home/gansai/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/home/gansai/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/home/gansai/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/home/gansai/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 309, in run_command
return subprocess.check_call(cmd)
File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(_popenargs, *_kwargs)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(_popenargs, *_kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

Apologize for verbose dump above. Thanks for the help in advance.

Homebrew package

It would be marvellous if Infer could be installed and updated via Homebrew.
Any plans to offer this as an alternative to compiling Infer yourself or retrieving the hosted binary?

Stuck after analyzing all files

When i run infer with ./gradlew build and debug options , it analyses all my java files and then gets stuck. nothing happens after that. if i manually terminate using ctrl+c , then i see infer out directory is generated and captured folder has all the java files in it, but reports.json is missing.

Cannot analyze maven project with "mvn build"

This issue is similar to what was reported earlier - Cannot analyze maven project?

I have a single module maven project with following structure
Project

  • src
  • test
  • conf
  • Readme.md
  • pom.xml

I ran "infer -- mvn build". It seems like a no-op. There is no ./infer-out folder as described on workflow. No other output whatsoever.

I have tried this on both java 6 and java 8

$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
$ javac -version
javac 1.6.0_65

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
$ javac -version
javac 1.8.0_25

fatal error: 'UIKit/UIKit.h' file not found

In file included from AppDelegate.m:9:
./AppDelegate.h:9:9: fatal error: 'UIKit/UIKit.h' file not found

import <UIKit/UIKit.h>

I try infer for IOS project, but get this error.How can i do?Thanks.

C++ support

Is there any plan to ass C++ support?

Thanks in advance,
Kevin

Crash on infer -- gradlew veryLargeJavaProject

Traceback (most recent call last):
File "/Users/mponte/infer-0.1.0/infer/bin/infer", line 142, in
main()
File "/Users/mponte/infer-0.1.0/infer/bin/infer", line 119, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Users/mponte/infer-0.1.0/infer/bin/../lib/capture/gradle.py", line 42, in capture
return util.run_commands(cmds)
File "/Users/mponte/infer-0.1.0/infer/bin/../lib/capture/util.py", line 34, in run_commands
if not cmd.start():
File "/Users/mponte/infer-0.1.0/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/Users/mponte/infer-0.1.0/infer/bin/inferlib.py", line 398, in capture
javac_status = self.compile()
File "/Users/mponte/infer-0.1.0/infer/bin/inferlib.py", line 395, in compile
return self.javac.run()
File "/Users/mponte/infer-0.1.0/infer/bin/jwlib.py", line 44, in run
subprocess.check_call(javac_cmd, stderr=file_out)
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(_popenargs, *_kwargs)
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(_popenargs, *_kwargs).wait()
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 7] Argument list too long

I'm thinking this might have something to do with infer being untested on very large builds?

[iOS] Incorrect Memory Leak Detection

The following Objective-C code incorrectly results in a error: MEMORY_LEAK memory dynamically allocated to buffer by call to malloc() at line X, column X is not reachable after line X, column X.

void* buffer = malloc(bufferSize);
return [NSData dataWithBytesNoCopy:buffer length:bytesDecrypted freeWhenDone:YES];

The buffer is passed to the returned NSData object and will be deallocated when the NSData instance will be.

Support java classnames with $$

Many annotation libraries generate class names with $$ in them. It would be great if that could be supported. Currently Infer spits out the following...

Fatal error: exception Invalid_argument("Error : com.company.project.android.activity.TestActivity$$ViewInjector$1 is not a valid name for a class")

fatal error: 'map' file not found #include <map>

When launched against a ObjectiveC project with C++ headers it does not find the C++ headers for <map>

In file included from BodyWrapper.cpp:35:
BodyWrapper.h:100:10: fatal error: 'map' file not found
#include <map>
         ^
1 error generated.

** BUILD FAILED **


The following build commands failed:
    CompileC build/BodyWrapper.o BodyWrapper.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
None

compilation failure installing from source on Ubuntu 32 bit

I have Ubuntu (the most recent LTS version), and when compiling from source got an error to the effect that <asm/errno.h> could not be found when running:

./update-fcp.sh && ../facebook-clang-plugin/clang/setup.sh && ./compile-fcp.sh # go have a coffee :)

Sadly, the Screen session in which I ran this (twice) has been closed, and it takes two hours to hit the error, and the script which runs the thing seems to delete the /tmp/clang.XXXXX build directory on failure, so it's expensive for me to get the exact error message. I do, AFAICT, have the build-essentials etc prerequisites installed, though in my case it's linux-libc-dev:i386

Fatal error: exception Failure("Java model file is required")

I install infer by binary file,then run example Hello.java in OSX 10.10.2

58deMacBook-Pro:examples wuxian$ infer -- javac Hello.java
Fatal error: exception Failure("Java model file is required")
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']


Traceback (most recent call last):
  File "/Users/wuxian/Documents/sourcecode/self/infer/infer/bin/inferJ", line 19, in <module>
    stats = analysis.start()
  File "/Users/wuxian/Documents/sourcecode/self/infer/infer/bin/inferlib.py", line 632, in start
    if self.capture() == os.EX_OK:
  File "/Users/wuxian/Documents/sourcecode/self/infer/infer/bin/inferlib.py", line 400, in capture
    return self.run_infer_frontend()
  File "/Users/wuxian/Documents/sourcecode/self/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
    self.args.analyzer
  File "/Users/wuxian/Documents/sourcecode/self/infer/infer/bin/inferlib.py", line 318, in run_command
    raise e
subprocess.CalledProcessError: Command '[u'/Users/wuxian/Documents/sourcecode/self/infer/infer/bin/InferJava', u'-results_dir', '/Users/wuxian/Documents/sourcecode/self/infer/examples/infer-out', u'-verbose_out', '/var/folders/3j/s3hfvmy572vcn3h02c_rxcbm0000gn/T/javac_lqc4YC.out', u'-no-static_final']' returned non-zero exit status 2

Thanks.

Swift Support

Can I use Infer to analyze iOS apps written in Swift, not Objective-C?

Cannot analyze maven project?

I have a maven project with multiple modules, like the following structure:

MyProject
|- MyModule1
|- MyModule2
|- pom.xml

I ran "infer -- mvn package", but it just printing

TODO: print error message
There was nothing to analyze, exiting

Failed to build iOS project

What I use:
infer --incremental -- xcodebuild -workspace Training.xcworkspace -scheme 'Training' -configuration Debug -sdk iphonesimulator

What I got:

** BUILD FAILED **

The following build commands failed:
CompileC /Users/markddaa/Library/Developer/Xcode/DerivedData/Training-fexrtaxksrhecgdraobzsohhrqly/Build/Intermediates/Training.build/Debug-iphonesimulator/Training.build/Objects-normal/i386/NATViewController.o Training/NATViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
None

=====UPDATED====
I clean every time before build like this:

xcodebuild -workspace Training.xcworkspace -scheme 'Training' -configuration Debug -sdk iphonesimulator clean

Support @import of modules in Objective-C

While trying out infer on my project, it fails with the build error:

error: use of '@import' when modules are disabled
    @import Foundation;
    ^
1 error generated.

I tried passing CLANG_ENABLE_MODULES=YES as an environment variable (it is already enabled in my project and xcodebuild runs cleanly), but seems to be ignored.

Incorrect RESOURCE_LEAK warning

Infer throws an incorrect RESOURCE_LEAK warning for this code:

public void writeToFile(File file, String fileContent) {
  if (!file.exists()) {
    FileWriter writer = null;
    try {
      writer = new FileWriter(file);
      writer.write(fileContent);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      StreamUtils.closeCloseable(writer);
    }
  }
}
// In StreamUtils class
public static void closeCloseable(Closeable closeable) {
  try {
    if (closeable != null) {
      closeable.close();
    }
  } catch (Exception ex) {
  }
}

But the warning will goes away if I change the code to:

try {
  writer.close();
} catch (Exception e) {
}

Missing translation for Cast Kind

I encountered many warnings saying "Missing translation for Cast Kind " where XXX is one of

  • FunctionToPointerDecay
  • ArrayToPointerDecay
  • BuiltinFnToFnPtr
  • IntegralToPointer
  • NullToPointer

Are they being analyzed at all?

Does not work when /usr/bin/python is python3

On Arch Linux I get this error:

Traceback (most recent call last):
  File "infer/infer/infer/bin/infer", line 142, in <module>
    main()
  File "infer/infer/infer/bin/infer", line 100, in main
    mod_name = get_module_name(capture_module_name)
  File "infer/infer/infer/bin/infer", line 42, in get_module_name
    for module, commands in MODULE_TO_COMMAND.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

It works fine when I symlink /usr/bin/python to python2.

A solution for linux would be to replace every #!/usr/bin/env python line with #!/usr/bin/env python2

javalib incompatibility causes infer -- javac Hello.java to fail with no files analyzed

the log trace is as below:
[email protected]:~/workspace/test$ infer -- javac Hello.java
TODO: print error message
Starting analysis (Infer version v0.1.0)
Fatal error: exception Sys_error("/home/wyw/workspace/test/infer-out/captured: No such file or directory")
[ERROR] Failure during create_makefile, original command was

[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']

Traceback (most recent call last):
File "/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferJ", line 19, in
stats = analysis.start()
File "/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 634, in start
self.analyze_and_report()
File "/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 613, in analyze_and_report
if self.analyze() == os.EX_OK:
File "/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 489, in analyze
self.args.analyzer
File "/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/InferAnalyze', u'-results_dir', '/home/wyw/workspace/test/infer-out', u'-makefile', u'Makefile', u'-allow_specs_cleanup', u'-models', u'/home/wyw/Downloads/infer-linux64-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-project_root', '/home/wyw/workspace/test']' returned non-zero exit status 2

Anyone could explain?

No Files Analyzed when using "infer -- make" on cmake generated Makefiles

Encountered this on multiple cmake based projects:
cmake ./
infer -- make
[ 50%] Building C object CMakeFiles/testCmakeProj.dir/testCmakeProjStandalone.c.o
[100%] Building C object CMakeFiles/testCmakeProj.dir/testCmakeProjParse.c.o
Linking C executable testCmakeProj
[100%] Built target testCmakeProj
Starting analysis (Infer version v0.1.0)
Analysis done

0 file analyzed

No issues found

Infer reports errors in wrong location (a CoreFoundation header that is not analysed)

/Applications/Xcode 6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:131: error: MEMORY_LEAK
memory dynamically allocated to ref by call to SCNetworkReachabilityCreateWithAddress() at line 128, column 36 is not reachable after line 131, column 9

/Applications/Xcode 6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:258: error: MEMORY_LEAK
memory dynamically allocated to policies by call to array at line 251, column 32 is not reachable after line 258, column 5

/Applications/Xcode 6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:273: error: MEMORY_LEAK
memory dynamically allocated to pinnedCertificates by call to array at line 269, column 50 is not reachable after line 273, column 13

C: cleanup attribute not supported

The cleanup attribute does not seem to be supported. I get many many false positives for resource and mem leaks due to this.

cleanup (cleanup_function)
The cleanup attribute runs a function when the variable goes out of scope. This attribute can only be applied to auto function scope variables; it may not be applied to parameters or variables with static storage duration. The function must take one parameter, a pointer to a type compatible with the variable. The return value of the function (if any) is ignored.

If -fexceptions is enabled, then cleanup_function is run during the stack unwinding that happens during the processing of the exception. Note that the cleanup attribute does not allow the exception to be caught, only to perform an action. It is undefined what happens if cleanup_function does not return normally.
https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html

Don't escape from the build dir

The installer creates facebook-clang-plugin in the parent dir of the repo. That is unexpected behavior, I'd prefer any github repo not to modify any parent dirs.

Build failed - libraries:facebook:lint

I'm trying to execute "infer -- gradle build" on an Android project, at first it complained about LeakCanary (https://github.com/square/leakcanary) I suspect its something with its lint release configuration, after removing LeakCanary it complains about this -

22:41:36.360 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.360 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':libraries:facebook:lint'.
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] > Lint found errors in the project; aborting build.
22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter]

22:41:36.361 [ERROR] [org.gradle.BuildExceptionReporter] Fix the issues identified by lint, or add the following to your build script to proceed with errors:
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] ...
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] android {
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] lintOptions {
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] abortOnError false
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] }
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] }
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter] ...
22:41:36.362 [ERROR] [org.gradle.BuildExceptionReporter]
22:41:36.363 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
22:41:36.363 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.

My release config (gradle clean assembleGoogleRelease) is building fine...

Any ideas?

Fatal error: exception Sys_error

I use the infer to analysis the java file, but I get this info

TODO: print error message
Starting analysis (Infer version v0.1.0)
Fatal error: exception Sys_error("/Users/monkey/Documents/open_source/infer/examples/infer-out/captured: No such file or directory")
[ERROR] Failure during create_makefile, original command was

[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']


Traceback (most recent call last):
  File "/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/inferJ", line 19, in <module>
    stats = analysis.start()
  File "/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 634, in start
    self.analyze_and_report()
  File "/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 613, in analyze_and_report
    if self.analyze() == os.EX_OK:
  File "/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 489, in analyze
    self.args.analyzer
  File "/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
    raise e
subprocess.CalledProcessError: Command '[u'/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/InferAnalyze', u'-results_dir', '/Users/monkey/Documents/open_source/infer/examples/infer-out', u'-makefile', u'Makefile', u'-allow_specs_cleanup', u'-models', u'/Users/monkey/Documents/dev_tool/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-project_root', '/Users/monkey/Documents/open_source/infer/examples']' returned non-zero exit status 2

My java version is 1.7, python version is 2.7.

Unclear on howto use for cross compiler

It seems to be rather hard to use with a cross compiler. Rather than gcc, we have, say, powerpc64-linux-gcc being the compiler we use to compile our project. It appears as though if I symlink it to gcc in infer-linux64-v0.1.0/infer/infer/lib/wrappers/ I get further, but I think I then run foul of some compiler options we need.

It appears as though the facebook-clang-plugin is an actual copy of clang and targets x86-64 ? So, I likely need to build infer from source and build with it?

I'm happy to go do that and contribute docs, but was wondering if there's any other possible gotchas that I may be missing.

Library not found

Please integrate .xcworkspace so dynamic librarys also loaded ..
e.g. pods .. since there are nice pods out there

Infer should not specify -Werror flag for javac compilation

Currently when 'javac' maven builds with infer generates warnings, it treats them as errors since -Werror flag is specified. This results in false positives being reported. Should this be changed to treat warnings as warnings?

====== Command used ======

infer -- mvn install

====== Sample Logs ======

warning: [path] bad path element "/Users/foobar/.m2/repository/com/googlecode/htmlcompressor/htmlcompressor/1.4/guava-r08.jar": no such file or directory

error: warnings found and -Werror specified

Missing capture module when running infer -- <cmd>

Attempting to execute any command through infer like:
Traviss-MBP:kc Travis$ infer -- mvn install

Results in:

Traceback (most recent call last):
  File "/usr/local/bin/infer", line 142, in <module>
    main()
  File "/usr/local/bin/infer", line 104, in main
    imported_module = load_module(mod_name)
  File "/usr/local/bin/infer", line 50, in load_module
    pkg_info = imp.find_module(CAPTURE_PACKAGE, [LIB_FOLDER])
ImportError: No module named capture

Note: that I have python 2.7 installed via homebrew

iOS app build fails when using infer

When I build my app like this it succeeds: xcodebuild -workspace "foo" -scheme "bar" -configuration "baz" -sdk "iphonesimulator"

However when I use it with infer, I get a compilation error.

infer -- xcodebuild -workspace "foo" -scheme "bar" -configuration "baz" -sdk "iphonesimulator" gives me:

error: use of
      '@import' when modules are disabled
@import UIKit;

Does infer affect the build process?

Support __nullable arguments in Objective-C blocks

When compiling my project I get lots of errors like these:

In file included from /Users/../SomeClass.m:12:
/Users/../SomeOtherClass.h:32:55: error: expected ')'
- (void)someMethod:(void (^)(NSError* __nullable error))block;
                                                      ^
/Users/../SomeOtherClass.h:32:34: note: to match this '('
- (void)someMethod:(void (^)(NSError* __nullable error))block;

See https://developer.apple.com/swift/blog/?id=25 for more about the __nullable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.