Summary: The infer results directories in buck-out/ are "cleaned up" to avoid polluting the Buck cache with too much data or non-deterministic data. In particular, the runstate is deleted, which confused subsequent infer processes trying to read the pre-existing results directory. Add a special case in infer to delete pre-existing results directories in buck-out instead of trying to load their state. Reviewed By: mbouaziz Differential Revision: D6845128 fbshipit-source-id: 5c716aamaster
parent
025f3109bd
commit
586582c311
@ -0,0 +1 @@
|
|||||||
|
{}
|
@ -0,0 +1,55 @@
|
|||||||
|
# Copyright (c) 2017 - 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.
|
||||||
|
|
||||||
|
TESTS_DIR = ../..
|
||||||
|
INFER_OUT = infer-out
|
||||||
|
include $(TESTS_DIR)/differential.make
|
||||||
|
|
||||||
|
DIFFERENTIAL_ARGS = --differential-filter-files changed_files.txt
|
||||||
|
|
||||||
|
include ../../differential.make
|
||||||
|
|
||||||
|
BUCK_TARGET = //src:hello
|
||||||
|
INFER_OPTIONS = $(DIFFERENTIAL_ARGS) --flavors --reactive --debug-exceptions
|
||||||
|
SRC_DIR = $(CURDIR)/../codetoanalyze
|
||||||
|
|
||||||
|
.PHONY: compare_reports
|
||||||
|
compare_reports: current.exp.test previous.exp.test
|
||||||
|
$(QUIET)$(call check_no_diff,current.exp,current.exp.test)
|
||||||
|
$(QUIET)$(call check_no_diff,previous.exp,previous.exp.test)
|
||||||
|
|
||||||
|
.PHONY: replace_reports
|
||||||
|
replace_reports: current.exp.test previous.exp.test
|
||||||
|
$(COPY) current.exp.test current.exp
|
||||||
|
$(COPY) previous.exp.test previous.exp
|
||||||
|
|
||||||
|
current.exp.test: $(CURRENT_REPORT)
|
||||||
|
$(QUIET)$(INFER_BIN) report -o $(<D) \
|
||||||
|
--from-json-report $(CURRENT_DIR)/report.json \
|
||||||
|
--issues-tests current.exp.test
|
||||||
|
|
||||||
|
previous.exp.test: $(PREVIOUS_REPORT)
|
||||||
|
$(QUIET)$(INFER_BIN) report -o $(<D) \
|
||||||
|
--from-json-report $(PREVIOUS_DIR)/report.json \
|
||||||
|
--issues-tests previous.exp.test
|
||||||
|
|
||||||
|
test: compare_reports
|
||||||
|
print: current.exp.test previous.exp.test
|
||||||
|
replace: replace_reports
|
||||||
|
|
||||||
|
$(CURRENT_REPORT):
|
||||||
|
$(QUIET)$(REMOVE_DIR) buck-out
|
||||||
|
$(QUIET)$(COPY) $(SRC_DIR)/some_bugs.c src/hello.c
|
||||||
|
$(QUIET)$(call silent_on_success,Running Buck diff analysis: current,\
|
||||||
|
$(INFER_BIN) $(INFER_OPTIONS) run --results-dir $(CURRENT_DIR) -- \
|
||||||
|
$(BUCK) build --no-cache $(BUCK_TARGET))
|
||||||
|
|
||||||
|
$(PREVIOUS_REPORT):
|
||||||
|
$(QUIET)$(COPY) $(SRC_DIR)/some_different_bugs.c src/hello.c
|
||||||
|
$(QUIET)$(call silent_on_success,Running Buck diff analysis: previous,\
|
||||||
|
$(INFER_BIN) $(INFER_OPTIONS) run --results-dir $(PREVIOUS_DIR) -- \
|
||||||
|
$(BUCK) build --no-cache $(BUCK_TARGET))
|
@ -0,0 +1 @@
|
|||||||
|
src/hello.c
|
@ -0,0 +1,3 @@
|
|||||||
|
src/hello.c, test1, 2, NULL_DEREFERENCE, [start of procedure test1()]
|
||||||
|
src/hello.c, test2, 2, NULL_DEREFERENCE, [start of procedure test2(),start of procedure nullify()]
|
||||||
|
src/hello2.c, test_hello2, 2, NULL_DEREFERENCE, [start of procedure test_hello2()]
|
@ -0,0 +1 @@
|
|||||||
|
MEMORY_LEAK, src/hello.c, test3, 3, test3.8ad8757baa8564dc136c1e07507f4a98, test3
|
@ -0,0 +1 @@
|
|||||||
|
NULL_DEREFERENCE, src/hello.c, test2, 2, test2.ad0234829205b9033196ba818f7a872b, test2
|
@ -0,0 +1 @@
|
|||||||
|
NULL_DEREFERENCE, src/hello.c, test1, 2, test1.5a105e8b9d40e1329780d62ea2265d8a, test1
|
@ -0,0 +1,3 @@
|
|||||||
|
src/hello.c, test1, 2, NULL_DEREFERENCE, [start of procedure test1()]
|
||||||
|
src/hello.c, test3, 3, MEMORY_LEAK, [start of procedure test3(),Condition is true]
|
||||||
|
src/hello2.c, test_hello2, 2, NULL_DEREFERENCE, [start of procedure test_hello2()]
|
@ -0,0 +1,6 @@
|
|||||||
|
cxx_library(
|
||||||
|
name = 'hello',
|
||||||
|
srcs = [
|
||||||
|
'hello.c', 'hello2.c',
|
||||||
|
],
|
||||||
|
)
|
@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 - 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void test_hello2() {
|
||||||
|
int* s = NULL;
|
||||||
|
*s = 42;
|
||||||
|
}
|
Loading…
Reference in new issue