On Sat, Aug 01, 2015 at 09:23:17PM +0800, Fengguang Wu wrote: > On Sat, Aug 01, 2015 at 04:12:20PM +0300, Dan Carpenter wrote: > > On Sat, Aug 01, 2015 at 08:22:41PM +0800, Fengguang Wu wrote: > > > Hi Dan, > > > > > > On Fri, Jul 31, 2015 at 05:03:20PM +0300, Dan Carpenter wrote: > > > > We're getting a lot of false positives today because the database is > > > > out of sync with the kernel we are testing. > > > > > > Sorry we just fixed a bug that prevented smatch checks for long time. > > > So here comes a bunch of smatch reports. > > > > > > Since the database is expensive to build, we typically reuse the same > > > database across a number of kernels, which may lead to the false > > > positives you noticed. > > > > > > I'll try improving the test process. > > > > > > > I understand. I'm not complaining, I'm just explaining why. > > > > Most of the false positives were things like: > > > > memset(foo, 0, sizeof(*foo)); > > > > That should have been fixable on my end. It seemed like a simple thing > > and I tried to do that some months back but it just made Smatch segfault > > and I was never able to figure it out. I will look again next week. > > OK, thank you! > > I just did a patch to force rebuild smatch db on every branch, which > would add cost by about 1+ hour. It's reasonably acceptable for me. > However it will no longer be a big problem, I can still revert that > change. That 1+ hour is mainly the time spend in this function. # borrowed from Dan's smatch_scripts/build_kernel_data.sh update_smatchdb() { # Smatch db won't be complete for a broken build. We may either # 1) reuse any old smatch db # 2) don't do smatch check at all # Prefer (2) for now. [[ "$build_error" ]] && ! grep -q vmlinux.o $kbuild_log && return local SCRIPT_DIR=/c/smatch/smatch_scripts local DATA_DIR=/c/smatch/smatch_data local PROJECT=kernel local info_file=/c/smatch/smatch-warns.txt find $SMATCH_OUT_ROOT -type f | xargs cat > $info_file du -s $info_file for i in $SCRIPT_DIR/gen_* ; do $i $info_file & done wait mv ${PROJECT}.* $DATA_DIR mv no_return_funcs $DATA_DIR/${PROJECT}.no_return_funcs $DATA_DIR/db/create_db.sh -p=kernel $info_file rm $info_file } The log file is Fri Jul 31 12:32:26 CST 2015 9658260 /c/smatch/smatch-warns.txt Done. List saved as 'kernel.expects_err_ptr' Done. List saved as 'kernel.returns_err_ptr' Done. List saved as 'kernel.returns_held_funcs' Done. List saved as 'no_return_funcs' Copy it to smatch_data/<project>.no_return_funcs Done. List saved as 'kernel.frees_argument' Done. List saved as 'kernel.allocation_funcs' Done. List saved as 'kernel.unwind_functions' Done. List saved as 'kernel.sizeof_param' Done. List saved as 'kernel.bit_shifters' Done. List saved as 'kernel.puts_argument' Done. List saved as 'kernel.dma_funcs' Done. List saved as 'kernel.rosenberg_funcs' Done. List saved as 'kernel.gfp_flags' 2147483646 off off Fri Jul 31 14:06:36 CST 2015 Thanks, Fengguang -- To unsubscribe from this list: send the line "unsubscribe smatch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html