Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2665 closed task (fixed)

fix clang static analyzer issues

Reported by: jreed Owned by: jinmei
Priority: medium Milestone: Sprint-20130219
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 4 Add Hours to Ticket: 0
Total Hours: 0.5 Internal?: no

Description

See latest scan-build results, such as
http://git.bind10.isc.org/~tester/builder/BIND10-clang-static-analyzer/20130125080342-MacOS/logs/files/scan-build/2013-01-25-1/

They appear trivial fixes and not significant, but should clean this out for once once so this report is not ignored.

(Later I may try newer clang again.)

Subtickets

Change History (11)

comment:1 Changed 7 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:3 Changed 7 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20130219

comment:4 follow-up: Changed 7 years ago by jinmei

What's the right way to run scan-build?

I've downloaded and extracted http://bit.ly/13ekSoV
from http://clang-analyzer.llvm.org/installation.html

and do this on the bind10 directory of the latest master (9b16b11):

% <path-to-scan-build>/scan-build ./configure ...
% <path-to-scan-build>/scan-build make

but at the end of build it said:

scan-build: Removing directory '/tmp/scan-build-2013-02-08-1' because it contains no reports.

And there seemed to be no output.

comment:5 in reply to: ↑ 4 Changed 7 years ago by jinmei

Replying to jinmei:

This made it work:

% <path-to-scan-build>/scan-build -k make

and I fixed the remaining real issues at the trac2665 branch. The
errors about rrparamregistry and rrttl are false positive, and
scan-build that comes with checker-270 doesn't complain about them
any more.

I'm now getting the branch review (btw I'm okay with the first
commit by Curtis, so it can be excluded from review), and I suggest
upgrade checker to eliminate the other false positives.

comment:6 Changed 7 years ago by jinmei

  • Owner set to UnAssigned
  • Status changed from new to reviewing

comment:7 Changed 7 years ago by jelte

  • Owner changed from UnAssigned to jelte

comment:8 follow-up: Changed 7 years ago by jelte

  • Owner changed from jelte to jinmei

Hmm, my build-scan defaults to gcc for compilation and linking, while CLANGPP is set (so make will fail on -Qunused-arguments), so note to people trying to reproduce: use --use-cc and --use-c++ :)

I wonder if we should make a wiki page with some tips on how to run scan-build, as it is relatively easy but not quite trivial :)

BTW, apart from the paramregistry and rrttl false positives, mine also complains about CMSG_FIRSTHDR(&msghdr) returning null (and hence a subsequence null dereference), which also seems an invalid complaint.

As they are, the changes look fine and can be merged.

comment:9 in reply to: ↑ 8 Changed 7 years ago by jinmei

Replying to jelte:

I wonder if we should make a wiki page with some tips on how to run scan-build, as it is relatively easy but not quite trivial :)

I created a ticket: #2706

BTW, apart from the paramregistry and rrttl false positives, mine also complains about CMSG_FIRSTHDR(&msghdr) returning null (and hence a subsequence null dereference), which also seems an invalid complaint.

As they are, the changes look fine and can be merged.

Okay, thanks, merge done, closing.

comment:10 Changed 7 years ago by jinmei

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:11 Changed 7 years ago by jinmei

  • Total Hours changed from 0 to 0.5
Note: See TracTickets for help on using tickets.