facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.97k stars 2.02k forks source link

Internal Error: Non-assignable LHS expression (1 * 1) #1637

Open yunwei37 opened 2 years ago

yunwei37 commented 2 years ago

infer version

the infer is build from source using git clone:

infer/infer/bin/infer --version
Infer version v1.1.0-c0e6baf2b
Copyright 2009 - present Facebook. All Rights Reserved.

environment:

cat /proc/version
Linux version 5.17.4-200.fc35.x86_64 (mockbuild@bkernel02.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9), GNU ld version 2.37-10.fc35) #1 SMP PREEMPT Wed Apr 20 15:37:53 UTC 2022

cat /etc/os-release
NAME="Fedora Linux"
VERSION="35 (Server Edition)"

command and test cases

infer run --bufferoverrun --debug-exceptions -- clang -c test.c

test.c

/* good cases: no issue found */
void func(void)
{
  *(int*)((int)(1)) = 1;
}

/* bad cases: Internal Error: Non-assignable LHS expression ()(1 * 1) */
void func1(void)
{
  *(int*)((int)(1 * 1)) = 1;
}

full output

infer run --bufferoverrun --debug-exceptions -- clang -c test.c
Capturing in make/cc mode...
Found 1 source file to analyze in infer-out
In instruction *(1 * 1):int=1 [line 10, column 3]....................................] 0% 30.748ms
While analysing function test.c:func1 at test.c:8:1, raised ("IBase.Die.InferInternalError(\"Non-assignable LHS expression (1 * 1) at test.c:10:3\")")
Internal Error: Non-assignable LHS expression (1 * 1) at test.c:10:3
Error backtrace:
Raised at Stdlib__Map.Make.min_binding in file "map.ml", line 231, characters 17-32
Called from Absint__Scheduler.ReversePostorder.pop in file "src/absint/Scheduler.ml", line 87, characters 31-55
Re-raised at IBase__Die.raise_error.do_raise in file "src/base/Die.ml" (inlined), line 26, characters 8-56
Called from IBase__Logging.die.(fun) in file "src/base/Logging.ml", line 333, characters 6-39
Called from Absint__HilInstr.of_sil in file "src/absint/HilInstr.ml", line 81, characters 12-126
Called from Absint__LowerHil.Make.hil_instr_of_sil in file "src/absint/LowerHil.ml", line 68, characters 6-96
Called from Absint__LowerHil.Make.exec_instr in file "src/absint/LowerHil.ml", line 89, characters 12-43
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node_instrs.exec_instr in file "src/absint/AbstractInterpreter.ml", line 414, characters 21-78
Re-raised at Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node_instrs.exec_instr in file "src/absint/AbstractInterpreter.ml", line 438, characters 10-58
Called from Base__Array.foldi.foldi_loop in file "src/array.ml" (inlined), line 347, characters 54-68
Called from Base__Array.foldi in file "src/array.ml" (inlined), line 349, characters 2-24
Called from IR__Instrs.foldi in file "src/IR/Instrs.ml" (inlined), line 196, characters 6-33
Called from Absint__AbstractInterpreter.SimpleNodeTransferFunctions.exec_node_instrs in file "src/absint/AbstractInterpreter.ml" (inlined), line 132, characters 4-47
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node_instrs in file "src/absint/AbstractInterpreter.ml", line 442, characters 4-75
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node.update_inv_map in file "src/absint/AbstractInterpreter.ml" (inlined), line 450, characters 21-88
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node in file "src/absint/AbstractInterpreter.ml", line 488, characters 9-47
Called from Absint__AbstractInterpreter.MakeWithScheduler.exec_worklist in file "src/absint/AbstractInterpreter.ml", line 565, characters 16-125
Called from Absint__AbstractInterpreter.MakeWithScheduler.exec_cfg_internal in file "src/absint/AbstractInterpreter.ml" (inlined), line 588, characters 4-64
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.make_compute_post in file "src/absint/AbstractInterpreter.ml" (inlined), line 545, characters 18-86
Called from Absint__AbstractInterpreter.MakeWithScheduler.compute_post in file "src/absint/AbstractInterpreter.ml" (inlined), line 595, characters 37-93
Called from Absint__AbstractInterpreter.MakeWithScheduler.compute_post in file "src/absint/AbstractInterpreter.ml" (inlined), line 595, characters 37-93
Called from Absint__LowerHil.MakeAbstractInterpreterWithConfig.compute_post in file "src/absint/LowerHil.ml", line 129, characters 4-80
Called from Concurrency__RacerDProcAnalysis.analyze in file "src/concurrency/RacerDProcAnalysis.ml", line 351, characters 4-58
Called from Backend__CallbackOfChecker.interprocedural_with_field in file "src/backend/CallbackOfChecker.ml", line 55, characters 15-36
Called from Backend__Callbacks.iterate_procedure_callbacks.(fun) in file "src/backend/callbacks.ml", line 58, characters 22-49
Called from Base__List.fold_right.(fun) in file "src/list.ml" (inlined), line 482, characters 29-34
Called from Stdlib__List.fold_left in file "list.ml", line 121, characters 24-34
Called from Backend__Ondemand.analyze in file "src/backend/ondemand.ml", line 155, characters 16-76
Re-raised at IStdlib__IExn.reraise_if in file "src/istd/IExn.ml" (inlined), line 18, characters 15-63
Called from Backend__Ondemand.run_proc_analysis in file "src/backend/ondemand.ml", line 225, characters 4-752
Called from Backend__Ondemand.analyze_proc_name_no_caller in file "src/backend/ondemand.ml" (inlined), line 342, characters 2-58
Called from Backend__Ondemand.analyze_procedures.analyze_proc_name_call in file "src/backend/ondemand.ml" (inlined), line 348, characters 12-53
Called from Stdlib__List.iter in file "list.ml" (inlined), line 110, characters 12-15
Called from Stdlib__List.iter in file "list.ml" (inlined), line 108, characters 13-64
Called from Base__List0.iter in file "src/list0.ml" (inlined), line 25, characters 16-35
Called from Backend__Ondemand.analyze_procedures in file "src/backend/ondemand.ml", line 350, characters 2-54
Called from Backend__Ondemand.analyze_file in file "src/backend/ondemand.ml" (inlined), line 361, characters 2-64
Called from Backend__InferAnalyze.analyze_target.analyze_source_file.(fun) in file "src/backend/InferAnalyze.ml" (inlined), line 51, characters 10-51
Called from IBase__Logging.task_progress in file "src/base/Logging.ml" (inlined), line 226, characters 15-19
Called from Backend__InferAnalyze.analyze_target.analyze_source_file in file "src/backend/InferAnalyze.ml", line 49, characters 4-342
Re-raised at IBase__Logging.task_progress in file "src/base/Logging.ml" (inlined), line 226, characters 15-19
Called from Backend__InferAnalyze.analyze_target.analyze_source_file in file "src/backend/InferAnalyze.ml", line 49, characters 4-342
Called from IBase__ProcessPool.child_loop in file "src/base/ProcessPool.ml", line 352, characters 12-19
Re-raised at IStdlib__IExn.reraise_if in file "src/istd/IExn.ml" (inlined), line 18, characters 15-63
Called from IBase__ProcessPool.child_loop in file "src/base/ProcessPool.ml", line 354, characters 10-433
Called from IBase__ProcessPool.child_loop in file "src/base/ProcessPool.ml" (inlined), line 333, characters 19-1023
Called from IBase__ProcessPool.child_loop in file "src/base/ProcessPool.ml" (inlined), line 333, characters 19-1023
Called from IBase__ProcessPool.child_loop in file "src/base/ProcessPool.ml" (inlined), line 333, characters 19-1023
Called from IBase__ProcessPool.fork_child in file "src/base/ProcessPool.ml", line 414, characters 6-99
Called from Stdlib__Array.init in file "array.ml", line 54, characters 22-27
Called from IBase__ProcessPool.create in file "src/base/ProcessPool.ml", line 438, characters 4-178
Called from Backend__Tasks.Runner.create in file "src/backend/Tasks.ml" (inlined), line 25, characters 6-287
Called from Backend__InferAnalyze.analyze in file "src/backend/InferAnalyze.ml", line 196, characters 6-130
Called from Integration__Driver.execute_analyze.(fun) in file "src/integration/Driver.ml" (inlined), line 193, characters 2-34
Called from Backend__GCStats.log_f in file "src/backend/GCStats.ml" (inlined), line 90, characters 10-14
Called from Integration__Driver.execute_analyze in file "src/integration/Driver.ml", line 190, characters 2-239
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Integration__Driver.analyze_and_report in file "src/integration/Driver.ml" (inlined), line 300, characters 2-144
Called from Dune__exe__Infer.run in file "src/infer.ml" (inlined), line 21, characters 2-47
Called from IBase__Utils.timeit in file "src/base/Utils.ml" (inlined), line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94

Run the command again with `--keep-going` to try and ignore this error.
Internal Error: Subprocess 0: see backtrace above
Error backtrace:
Raised at Core__Core_unix.improve in file "src/core_unix.ml" (inlined), line 46, characters 4-43
Called from Core__Core_unix.wait_gen in file "src/core_unix.ml" (inlined), line 942, characters 4-246
Called from Core__Core_unix.wait in file "src/core_unix.ml" (inlined), line 971, characters 2-34
Called from IBase__ProcessPool.killall.(fun) in file "src/base/ProcessPool.ml", line 185, characters 10-30
Re-raised at IBase__Die.raise_error.do_raise in file "src/base/Die.ml" (inlined), line 26, characters 8-56
Called from IBase__Logging.die.(fun) in file "src/base/Logging.ml", line 333, characters 6-39
Called from Stdlib__List.iter in file "list.ml" (inlined), line 110, characters 12-15
Called from Base__List0.iter in file "src/list0.ml" (inlined), line 25, characters 16-35
Called from IBase__ProcessPool.process_updates in file "src/base/ProcessPool.ml" (inlined), line 254, characters 5-1023
Called from IBase__ProcessPool.process_updates in file "src/base/ProcessPool.ml", line 253, characters 2-1023
Called from Backend__InferAnalyze.analyze in file "src/backend/InferAnalyze.ml", line 199, characters 24-47
Called from Integration__Driver.execute_analyze.(fun) in file "src/integration/Driver.ml" (inlined), line 193, characters 2-34
Called from Backend__GCStats.log_f in file "src/backend/GCStats.ml" (inlined), line 90, characters 10-14
Called from Integration__Driver.execute_analyze in file "src/integration/Driver.ml", line 190, characters 2-239
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Integration__Driver.analyze_and_report in file "src/integration/Driver.ml" (inlined), line 300, characters 2-144
Called from Dune__exe__Infer.run in file "src/infer.ml" (inlined), line 21, characters 2-47
Called from IBase__Utils.timeit in file "src/base/Utils.ml" (inlined), line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94

Run the command again with `--keep-going` to try and ignore this error.

Please include the following information: