[tests] share javac.make more broadly

Summary:
- rename java.make -> javac.make, config.make -> java.make, and move to infer/tests/ so it's easier to use from infer/tests/build_systems/
- use these from ant's test Makefile, much code reuse!
- factor out common functionality between java and clang

A wrinkle: sorting is now done the same way for --issues-tests and
--issues-txt, which produces bogus (but still as deterministic) sorting for
--issues-txt. This is more of a cosmetic issue, but I hope to fix it in a later
diff that gets rid of calls to `sort` in favour of sorting directly from
`InferPrint`.

Reviewed By: jberdine

Differential Revision: D4166841

fbshipit-source-id: ed6f232
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 171d1d6d43
commit 70720798d8

@ -10,7 +10,7 @@ include $(ROOT_DIR)/Makefile.config
ifeq ($(IS_FACEBOOK_TREE),yes)
# With this makefile, all targets will default to have right env variables pointing to the sandbox
include $(ROOT_DIR)/facebook//Makefile.env
include $(ROOT_DIR)/facebook/Makefile.env
endif
BUILD_SYSTEMS_TESTS = ant assembly project_root_rel
@ -132,6 +132,12 @@ $(1): infer
| grep -v "warning: ignoring old commands for target" \
| grep -v "warning: overriding commands for target" \
; exit $$$${PIPESTATUS[0]}
.PHONY: $(1)_clean
$(1)_clean:
$(MAKE) -C \
$(INFER_DIR)/tests/codetoanalyze/$(shell printf $(1) | cut -f 1 -d _)/$(shell printf $(1) | cut -f 2 -d _) \
clean
endef
$(foreach test,$(DIRECT_TESTS) $(DIRECT_TESTS_REPLACE),\
@ -142,9 +148,13 @@ $(foreach test,$(DIRECT_TESTS) $(DIRECT_TESTS_REPLACE),\
direct_tests: $(DIRECT_TESTS)
define gen_build_system_test_rule
.PHONY: $(1)_test
.PHONY: build_$(1)_test
build_$(1)_test: infer
$(MAKE) -C $(INFER_DIR)/tests/build_systems/$(1) test
.PHONY: build_$(1)_clean
build_$(1)_clean:
$(MAKE) -C $(INFER_DIR)/tests/build_systems/$(1) clean
endef
$(foreach test,$(BUILD_SYSTEMS_TESTS), $(eval $(call gen_build_system_test_rule,$(test))))
@ -220,6 +230,10 @@ uninstall:
$(REMOVE) $(DESTDIR)$(bindir)/inferTraceBugs
$(REMOVE) $(DESTDIR)$(bindir)/infer
.PHONY: test_clean
test_clean: $(foreach test,$(DIRECT_TESTS),$(test)_clean) \
$(foreach test,$(BUILD_SYSTEMS_TESTS),build_$(test)_clean)
.PHONY: install
install: infer inferTraceBugs
# create directory structure
@ -325,7 +339,7 @@ ifeq ($(IS_FACEBOOK_TREE),yes)
endif
.PHONY: clean
clean:
clean: test_clean
ifeq ($(IS_RELEASE_TREE),no)
ifeq ($(BUILD_C_ANALYZERS),yes)
$(MAKE) -C $(FCP_DIR) clean
@ -363,3 +377,8 @@ conf-clean: clean
# print any variable for Makefile debugging
print-%:
@echo '$*=$($*)'
# print list of targets
.PHONY: show-targets
show-targets:
@$(MAKE) -pqrR . | grep --only-matching -e '^[a-zA-Z0-9][^ ]*:' | cut -d ':' -f 1 | sort

@ -0,0 +1,33 @@
# Copyright (c) 2016 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
ROOT_DIR = $(TESTS_DIR)/../..
include $(ROOT_DIR)/Makefile.config
default: compile
issues.exp.test: infer-out/report.json $(INFERPRINT_BIN)
$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $<
LC_ALL=C sort -t, -k1,1 -k2,2 -k3n,3 -o $@ $@
.PHONY: compile
compile: $(OBJECTS)
.PHONY: analyze
analyze: infer-out/report.json
.PHONY: print
print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
.PHONY: clean
clean:
rm -rf codetoanalyze issues.exp.test infer-out $(OBJECTS) $(CLEAN_EXTRA)

@ -5,41 +5,22 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
ANALYZER = infer
ROOT_DIR = ../../../..
include $(ROOT_DIR)/Makefile.config
TESTS_DIR = ../..
default: compile
ANALYZER = infer
SOURCES = $(wildcard src/infer/*.java)
OBJECTS = $(patsubst %.java,ant_out/%.class,$(SOURCES))
INFERPRINT_OPTIONS = --issues-tests
JAVA_SOURCE_FILES = $(wildcard src/infer/*.java)
JAVA_CLASS_FILES = $(patsubst %.java,ant_out/%.class,$(JAVA_SOURCE_FILES))
include $(TESTS_DIR)/java.make
include $(TESTS_DIR)/base.make
$(JAVA_CLASS_FILES): $(JAVA_SOURCE_FILES)
$(OBJECTS): $(SOURCES)
ant
infer-out/report.json: $(INFER_BIN) $(JAVA_SOURCE_FILES)
infer-out/report.json: $(INFER_BIN) $(SOURCES)
$(call silent_on_success,\
$(INFER_BIN) -a $(ANALYZER) -- ant)
issues.exp.test: infer-out/report.json $(INFERPRINT_BIN)
$(INFERPRINT_BIN) -q -a $(ANALYZER) --issues-tests $@ --from-json-report $<
LC_ALL=C sort -t: -k1,1 -k2n,2 -o $@ $@
.PHONY: compile
compile: $(JAVA_CLASS_FILES)
.PHONY: analyze
analyze: infer-out/report.json
.PHONY: print
print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
.PHONY: clean
clean:
ant clean
rm -rf issues.exp.test infer-out

@ -5,42 +5,15 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
ROOT_DIR = $(TESTS_DIR)/../..
include $(ROOT_DIR)/Makefile.config
INFERPRINT_OPTIONS = --issues-tests
OBJECTS = $(foreach source,$(SOURCES),$(basename $(source)).o)
CLEAN_EXTRA =
default: compile
include $(TESTS_DIR)/base.make
infer-out/report.json: $(CLANG_DEPS) $(SOURCES)
$(call silent_on_success,\
$(INFER_BIN) --check-duplicate-symbols $(INFER_OPTIONS) -a $(ANALYZER) -- clang $(CLANG_OPTIONS) $(SOURCES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0
issues.exp.test: infer-out/report.json $(INFERPRINT_BIN)
$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $<
LC_ALL=C sort -t, -k1,1 -k2,2 -k3n,3 -o $@ $@
$(OBJECTS): $(SOURCES)
clang $(CLANG_OPTIONS) $(SOURCES)
.PHONY: compile
compile: $(OBJECTS)
.PHONY: analyze
analyze: infer-out/report.json
.PHONY: print
print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
.PHONY: clean
clean:
$(REMOVE_DIR) duplicates.txt issues.exp.test infer-out $(OBJECTS) $(CLEAN_EXTRA)

@ -5,11 +5,11 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/java.make
TESTS_DIR = ../../..
ANALYZER = checkers
INFER_OPTIONS = --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java)
JAVA_SOURCE_FILES = $(wildcard *.java)
include $(TESTS_DIR)/javac.make

@ -5,18 +5,18 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/config.make
TESTS_DIR = ../../..
include $(TESTS_DIR)/java.make
ANALYZER = crashcontext
JAVA_SOURCE_FILES = $(wildcard *.java)
JAVA_CLASS_FILES = $(patsubst %.java,%.class,$(JAVA_SOURCE_FILES))
EXP_TESTs = $(sort $(patsubst %.java,%.exp.test,$(JAVA_SOURCE_FILES)))
INFER_OUTs = $(patsubst %.java,infer-out-%,$(JAVA_SOURCE_FILES))
SOURCES = $(wildcard *.java)
OBJECTS = $(patsubst %.java,%.class,$(SOURCES))
EXP_TESTs = $(sort $(patsubst %.java,%.exp.test,$(SOURCES)))
INFER_OUTs = $(patsubst %.java,infer-out-%,$(SOURCES))
$(JAVA_CLASS_FILES): $(JAVA_SOURCE_FILES)
javac -cp $(CLASSPATH) $(JAVA_SOURCE_FILES)
$(OBJECTS): $(SOURCES)
javac -cp $(CLASSPATH) $(SOURCES)
# analyze a single source file and generate the test results for it
%.exp.test: $(INFER_BIN) %.stacktrace.json %.java
@ -34,7 +34,7 @@ issues.exp.test: $(EXP_TESTs)
default: compile
.PHONY: compile
compile: $(JAVA_CLASS_FILES)
compile: $(OBJECTS)
.PHONY: analyze
analyze: $(EXP_TESTs)
@ -48,4 +48,4 @@ test: issues.exp.test
.PHONY: clean
clean:
$(REMOVE_DIR) $(INFER_OUTs) $(JAVA_CLASS_FILES) $(EXP_TESTs)
$(REMOVE_DIR) $(INFER_OUTs) $(OBJECTS) $(EXP_TESTs)

@ -5,11 +5,11 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/java.make
TESTS_DIR = ../../..
ANALYZER = eradicate
INFER_OPTIONS = --eradicate-return-over-annotated --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java)
JAVA_SOURCE_FILES = $(wildcard *.java)
include $(TESTS_DIR)/javac.make

@ -5,12 +5,12 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/java.make
TESTS_DIR = ../../..
ANALYZER = infer
INFER_OPTIONS = --android-harness --no-filtering --debug-exceptions
JAVA_SOURCE_FILES = \
INFERPRINT_OPTIONS = --issues-tests
SOURCES = \
BasicHarnessActivity.java \
include $(TESTS_DIR)/javac.make

@ -5,10 +5,11 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/java.make
TESTS_DIR = ../../..
ANALYZER = infer
INFER_OPTIONS = --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java)
JAVA_SOURCE_FILES = $(wildcard *.java)
include $(TESTS_DIR)/javac.make

@ -57,8 +57,8 @@ CursorLeaks.java, int CursorLeaks.cursorNotClosed(SQLiteDatabase), 4, RESOURCE_L
CursorLeaks.java, int CursorLeaks.getBucketCountNotClosed(), 10, RESOURCE_LEAK
CursorLeaks.java, int CursorLeaks.getImageCountHelperNotClosed(String), 13, RESOURCE_LEAK
CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderClosed(), 3, NULL_TEST_AFTER_DEREFERENCE
CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderNotClosed(), 11, RESOURCE_LEAK
CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderNotClosed(), 3, NULL_TEST_AFTER_DEREFERENCE
CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderNotClosed(), 11, RESOURCE_LEAK
CursorLeaks.java, void CursorLeaks.queryUVMLegacyDbNotClosed(), 4, RESOURCE_LEAK
CursorLeaks.java, void CursorLeaks.queryUVMLegacyDbNotClosed(), 4, RETURN_VALUE_IGNORED
DivideByZero.java, int DivideByZero.callDivideByZeroInterProc(), 1, DIVIDE_BY_ZERO
@ -143,16 +143,16 @@ GuardedByExample.java, void GuardedByExample.writeFBad(), 1, UNSAFE_GUARDED_BY_A
GuardedByExample.java, void GuardedByExample.writeFBadWrongLock(), 2, UNSAFE_GUARDED_BY_ACCESS
HashMapExample.java, Integer HashMapExample.getOrCreateInteger(HashMap,int), 8, RETURN_VALUE_IGNORED
HashMapExample.java, int HashMapExample.getOneIntegerWithoutCheck(), 6, NULL_DEREFERENCE
HashMapExample.java, void HashMapExample.containsIntegerTwiceThenGetTwice(HashMap), 10, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.containsIntegerTwiceThenGetTwice(HashMap), 9, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.containsIntegerTwiceThenGetTwice(HashMap), 10, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.getTwoIntegersWithOneCheck(Integer,Integer), 10, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.getTwoIntegersWithOneCheck(Integer,Integer), 11, NULL_DEREFERENCE
HashMapExample.java, void HashMapExample.getTwoIntegersWithOneCheck(Integer,Integer), 11, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.getTwoIntegersWithOneCheck(Integer,Integer), 7, Cannot_star
HashMapExample.java, void HashMapExample.putIntegerTwiceThenGetTwice(HashMap), 12, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.putIntegerTwiceThenGetTwice(HashMap), 13, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.putIntegerTwiceThenGetTwice(HashMap), 6, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.putIntegerTwiceThenGetTwice(HashMap), 7, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.putIntegerTwiceThenGetTwice(HashMap), 12, RETURN_VALUE_IGNORED
HashMapExample.java, void HashMapExample.putIntegerTwiceThenGetTwice(HashMap), 13, RETURN_VALUE_IGNORED
InvokeDynamic.java, int InvokeDynamic.lambda$npeInLambdaBad$1(String,String), 1, ANALYSIS_STOPS
InvokeDynamic.java, int InvokeDynamic.lambda$npeInLambdaBad$1(String,String), 1, NULL_DEREFERENCE
InvokeDynamic.java, void InvokeDynamic.invokeDynamicThenNpeBad(List), 5, ANALYSIS_STOPS
@ -305,8 +305,8 @@ ResourceLeaks.java, void ResourceLeaks.objectOutputStreamNotClosedAfterWrite(),
ResourceLeaks.java, void ResourceLeaks.objectOutputStreamNotClosedAfterWrite(), 7, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.openHttpURLConnectionNotDisconnected(), 7, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.openHttpsURLConnectionNotDisconnected(), 3, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 10, NULL_TEST_AFTER_DEREFERENCE
ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 5, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 10, NULL_TEST_AFTER_DEREFERENCE
ResourceLeaks.java, void ResourceLeaks.pipedInputStreamClosed(PipedOutputStream), 4, RETURN_VALUE_IGNORED
ResourceLeaks.java, void ResourceLeaks.pipedInputStreamNotClosedAfterRead(PipedOutputStream), 4, RETURN_VALUE_IGNORED
ResourceLeaks.java, void ResourceLeaks.pipedInputStreamNotClosedAfterRead(PipedOutputStream), 6, RESOURCE_LEAK
@ -317,9 +317,9 @@ ResourceLeaks.java, void ResourceLeaks.socketNotClosed(), 1, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 10, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 7, NULL_TEST_AFTER_DEREFERENCE
ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 8, NULL_TEST_AFTER_DEREFERENCE
ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 10, RESOURCE_LEAK
ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK
ReturnValueIgnored.java, void ReturnValueIgnored.returnValueIgnored(), 1, RETURN_VALUE_IGNORED
TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION

@ -1,48 +0,0 @@
# Copyright (c) 2016 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
# Makefiles that include this one must define JAVA_TEST_DIR and then include
# $(JAVA_TEST_DIR)/java.make in order for config.make to be found.
#
# Makefiles that include this one must define the ANALYZER and JAVA_SOURCE_FILES
# variables, and may optionally define INFER_OPTIONS and INFERPRINT_OPTIONS.
include $(JAVA_TEST_DIR)/config.make
INFERPRINT_OPTIONS = --issues-tests
JAVA_CLASS_FILES = $(patsubst %.java,%.class,$(JAVA_SOURCE_FILES))
$(JAVA_CLASS_FILES): $(JAVA_SOURCE_FILES)
javac -cp $(CLASSPATH) $(JAVA_SOURCE_FILES)
infer-out/report.json: $(INFER_BIN) $(JAVA_SOURCE_FILES)
$(call silent_on_success,\
$(INFER_BIN) $(INFER_OPTIONS) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(JAVA_SOURCE_FILES))
issues.exp.test: infer-out/report.json $(INFERPRINT_BIN)
$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $<
LC_ALL=C sort -t: -k1,1 -k2n,2 -o $@ $@
default: compile
.PHONY: compile
compile: $(JAVA_CLASS_FILES)
.PHONY: analyze
analyze: infer-out/report.json
.PHONY: print
print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
.PHONY: clean
clean:
rm -rf codetoanalyze issues.exp.test infer-out $(JAVA_CLASS_FILES)

@ -5,11 +5,11 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/java.make
TESTS_DIR = ../../..
ANALYZER = quandary
INFER_OPTIONS = --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-txt
SOURCES = $(wildcard *.java)
JAVA_SOURCE_FILES = $(wildcard *.java)
include $(TESTS_DIR)/javac.make

@ -4,6 +4,16 @@ Arrays.java:37: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.infer
Arrays.java:44: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 43]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 44])
Arrays.java:67: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 66]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 67])
Arrays.java:75: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 73]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 75])
Basics.java:103: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 100]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 103])
Basics.java:118: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 113]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 118])
Basics.java:132: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 129]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 132])
Basics.java:142: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 140]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 142])
Basics.java:153: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 150]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 153])
Basics.java:159: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 158]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 159])
Basics.java:160: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 158]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 160])
Basics.java:166: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 164]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 166])
Basics.java:209: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 206]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 209])
Basics.java:218: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 214]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 218])
Basics.java:24: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 24]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 24])
Basics.java:29: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 28]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 29])
Basics.java:35: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 33]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 35])
@ -15,34 +25,24 @@ Basics.java:67: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.infer
Basics.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 75]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77])
Basics.java:89: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 85]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 89])
Basics.java:95: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 93]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 95])
Basics.java:103: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 100]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 103])
Basics.java:118: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 113]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 118])
Basics.java:132: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 129]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 132])
Basics.java:142: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 140]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 142])
Basics.java:153: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 150]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 153])
Basics.java:159: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 158]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 159])
Basics.java:160: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 158]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 160])
Basics.java:166: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 164]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 166])
Basics.java:209: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 206]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 209])
Basics.java:218: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 214]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 218])
DynamicDispatch.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object DynamicDispatch$BadInterfaceImpl1.returnSource() at [line 76]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77]) (via { Object DynamicDispatch$Interface.returnSource() at [line 76] })
DynamicDispatch.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object DynamicDispatch$BadInterfaceImpl2.returnSource() at [line 76]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77]) (via { Object DynamicDispatch$Interface.returnSource() at [line 76] })
DynamicDispatch.java:82: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 81]) -> Other(void DynamicDispatch$BadInterfaceImpl1.callSink(Object) at [line 82])
DynamicDispatch.java:82: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 81]) -> Other(void DynamicDispatch$BadInterfaceImpl2.callSink(Object) at [line 82])
DynamicDispatch.java:88: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 86]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 88]) (via { Object DynamicDispatch$BadInterfaceImpl1.propagate(Object) at [line 87], Object DynamicDispatch$BadInterfaceImpl2.propagate(Object) at [line 87], Object DynamicDispatch$Interface.propagate(Object) at [line 87] })
DynamicDispatch.java:135: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object DynamicDispatch$BadSubtype.returnSource() at [line 134]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 135])
DynamicDispatch.java:140: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 139]) -> Other(void DynamicDispatch$BadSubtype.callSink(Object) at [line 140])
DynamicDispatch.java:146: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 144]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 146]) (via { Object DynamicDispatch$BadSubtype.propagate(Object) at [line 145] })
DynamicDispatch.java:154: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object DynamicDispatch$BadSubtype.returnSource() at [line 153]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 154])
DynamicDispatch.java:157: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 156]) -> Other(void DynamicDispatch$BadSubtype.callSink(Object) at [line 157])
DynamicDispatch.java:160: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 156]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 160]) (via { Object DynamicDispatch$BadSubtype.propagate(Object) at [line 159] })
DynamicDispatch.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object DynamicDispatch$BadInterfaceImpl1.returnSource() at [line 76]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77]) (via { Object DynamicDispatch$Interface.returnSource() at [line 76] })
DynamicDispatch.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object DynamicDispatch$BadInterfaceImpl2.returnSource() at [line 76]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77]) (via { Object DynamicDispatch$Interface.returnSource() at [line 76] })
DynamicDispatch.java:82: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 81]) -> Other(void DynamicDispatch$BadInterfaceImpl1.callSink(Object) at [line 82])
DynamicDispatch.java:82: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 81]) -> Other(void DynamicDispatch$BadInterfaceImpl2.callSink(Object) at [line 82])
DynamicDispatch.java:88: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 86]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 88]) (via { Object DynamicDispatch$BadInterfaceImpl1.propagate(Object) at [line 87], Object DynamicDispatch$BadInterfaceImpl2.propagate(Object) at [line 87], Object DynamicDispatch$Interface.propagate(Object) at [line 87] })
Exceptions.java:117: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 117]) -> Other(void Exceptions.callSinkThenThrow(Object) at [line 117])
Exceptions.java:23: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 19]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 23])
Exceptions.java:33: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 30]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 33])
Exceptions.java:44: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 38]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 44])
Exceptions.java:63: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 59]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 63])
Exceptions.java:73: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 71]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 73])
Exceptions.java:84: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 82]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 84])
Exceptions.java:117: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 117]) -> Other(void Exceptions.callSinkThenThrow(Object) at [line 117])
Fields.java:28: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 27]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 28])
Fields.java:33: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 32]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 33])
Fields.java:38: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 37]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 38])
@ -80,13 +80,6 @@ Intents.java:51: ERROR: QUANDARY_TAINT_ERROR Error: Intent(Intent Intent.parseIn
Intents.java:51: ERROR: QUANDARY_TAINT_ERROR Error: Intent(Intent Intent.parseUri(String,int) at [line 31]) -> Intent(void Activity.startActivityFromFragment(Fragment,Intent,int) at [line 51])
Intents.java:52: ERROR: QUANDARY_TAINT_ERROR Error: Intent(Intent Intent.parseIntent(Resources,XmlPullParser,AttributeSet) at [line 34]) -> Intent(ComponentName ContextWrapper.startService(Intent) at [line 52])
Intents.java:52: ERROR: QUANDARY_TAINT_ERROR Error: Intent(Intent Intent.parseUri(String,int) at [line 31]) -> Intent(ComponentName ContextWrapper.startService(Intent) at [line 52])
Interprocedural.java:39: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object Interprocedural.returnSourceDirect() at [line 39]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 39])
Interprocedural.java:44: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object Interprocedural.returnSourceDirect() at [line 43]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 44])
Interprocedural.java:48: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object Interprocedural.returnSourceIndirect() at [line 48]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 48])
Interprocedural.java:58: ERROR: QUANDARY_TAINT_ERROR Error: Other(Interprocedural$Obj Interprocedural.returnSourceViaField() at [line 58]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 58])
Interprocedural.java:67: ERROR: QUANDARY_TAINT_ERROR Error: Other(void Interprocedural.returnSourceViaParameter1(Interprocedural$Obj) at [line 66]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 67])
Interprocedural.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 75]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77]) (via { void Interprocedural.returnSourceViaParameter2(Interprocedural$Obj,Interprocedural$Obj) at [line 76] })
Interprocedural.java:92: ERROR: QUANDARY_TAINT_ERROR Error: Other(void Interprocedural.returnSourceViaGlobal() at [line 91]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 92])
Interprocedural.java:108: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 108]) -> Other(void Interprocedural.callSinkParam1(Object,Object) at [line 108])
Interprocedural.java:120: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 120]) -> Other(void Interprocedural.callSinkParam2(Object,Object) at [line 120])
Interprocedural.java:133: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 132]) -> Other(void Interprocedural.callSinkOnFieldDirect() at [line 133])
@ -105,6 +98,13 @@ Interprocedural.java:251: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferT
Interprocedural.java:262: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 260]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 262])
Interprocedural.java:309: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 309]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 309])
Interprocedural.java:314: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 313]) -> Other(void Interprocedural.sourceAndSink(Interprocedural$Obj) at [line 314])
Interprocedural.java:39: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object Interprocedural.returnSourceDirect() at [line 39]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 39])
Interprocedural.java:44: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object Interprocedural.returnSourceDirect() at [line 43]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 44])
Interprocedural.java:48: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object Interprocedural.returnSourceIndirect() at [line 48]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 48])
Interprocedural.java:58: ERROR: QUANDARY_TAINT_ERROR Error: Other(Interprocedural$Obj Interprocedural.returnSourceViaField() at [line 58]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 58])
Interprocedural.java:67: ERROR: QUANDARY_TAINT_ERROR Error: Other(void Interprocedural.returnSourceViaParameter1(Interprocedural$Obj) at [line 66]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 67])
Interprocedural.java:77: ERROR: QUANDARY_TAINT_ERROR Error: Other(Object InferTaint.inferSecretSource() at [line 75]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 77]) (via { void Interprocedural.returnSourceViaParameter2(Interprocedural$Obj,Interprocedural$Obj) at [line 76] })
Interprocedural.java:92: ERROR: QUANDARY_TAINT_ERROR Error: Other(void Interprocedural.returnSourceViaGlobal() at [line 91]) -> Other(void InferTaint.inferSensitiveSink(Object) at [line 92])
LoggingPrivateData.java:57: ERROR: QUANDARY_TAINT_ERROR Error: PrivateData(String TelephonyManager.getDeviceId() at [line 40]) -> Logging(int Log.e(String,String) at [line 57]) (via { String String.valueOf(double) at [line 25], String String.valueOf(double) at [line 31], String String.valueOf(double) at [line 34], String String.valueOf(float) at [line 28], String String.valueOf(float) at [line 37] })
LoggingPrivateData.java:57: ERROR: QUANDARY_TAINT_ERROR Error: PrivateData(String TelephonyManager.getLine1Number() at [line 43]) -> Logging(int Log.e(String,String) at [line 57]) (via { String String.valueOf(double) at [line 25], String String.valueOf(double) at [line 31], String String.valueOf(double) at [line 34], String String.valueOf(float) at [line 28], String String.valueOf(float) at [line 37] })
LoggingPrivateData.java:57: ERROR: QUANDARY_TAINT_ERROR Error: PrivateData(String TelephonyManager.getSimSerialNumber() at [line 46]) -> Logging(int Log.e(String,String) at [line 57]) (via { String String.valueOf(double) at [line 25], String String.valueOf(double) at [line 31], String String.valueOf(double) at [line 34], String String.valueOf(float) at [line 28], String String.valueOf(float) at [line 37] })

@ -5,10 +5,11 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
JAVA_TEST_DIR = ..
include $(JAVA_TEST_DIR)/java.make
TESTS_DIR = ../../..
ANALYZER = tracing
INFER_OPTIONS = --no-filtering --debug-exceptions
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java)
JAVA_SOURCE_FILES = $(wildcard *.java)
include $(TESTS_DIR)/javac.make

@ -5,7 +5,8 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
ROOT_DIR = ../../../../..
ROOT_DIR = $(TESTS_DIR)/../..
include $(ROOT_DIR)/Makefile.config
ANDROID19 = $(JAVA_LIB_DIR)/android/android-19.jar

@ -0,0 +1,25 @@
# Copyright (c) 2016 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
# Makefiles that include this one must define TESTS_DIR and then include
# $(TESTS_DIR)/javac.make.
#
# Makefiles that include this one must define the ANALYZER and SOURCES
# variables, and may optionally define INFER_OPTIONS, INFERPRINT_OPTIONS,
# CLEAN_EXTRA.
OBJECTS = $(patsubst %.java,%.class,$(SOURCES))
include $(TESTS_DIR)/java.make
include $(TESTS_DIR)/base.make
$(OBJECTS): $(SOURCES)
javac -cp $(CLASSPATH) $(SOURCES)
infer-out/report.json: $(INFER_BIN) $(SOURCES)
$(call silent_on_success,\
$(INFER_BIN) $(INFER_OPTIONS) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(SOURCES))
Loading…
Cancel
Save