#3946 assigned defect

capture-support: Dead Code (CID #1461469 \)

Reported by: Joel Sherrill Owned by: Needs Funding
Priority: normal Milestone: 7.1
Component: lib Version: 7
Severity: normal Keywords: coverity, small, tasks
Cc: Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

New report from Coverity. git blame says Chris.

*** CID 1461469:  Control flow issues  (DEADCODE)
/home/joel/rtems-work/rtems/cpukit/libmisc/capture/capture_support.c: 317 in rtems_capture_print_trace_records()
311                                                       &cpu->rec,
312                                                       sizeof (cpu->rec));
313             cpu->rec_valid = true;
314           }
315     
316           /* Find the next record to print, the earliest recond on any core */
>>>     CID 1461469:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "cpu->rec.time < this_time" inside this statement: "if (cpu->rec_valid && (this...".
317           if ((cpu->rec_valid) && ((this_time == 0) || (cpu->rec.time < this_time)))
318           {
319             rec_out = &cpu->rec;
320             cpu_out = i;
321             this_time = rec_out->time;
322           }}}}

Change History (4)

comment:1 Changed on 04/10/20 at 15:34:17 by Joel Sherrill

Description: modified (diff)
Keywords: coverity added

comment:2 Changed on 04/10/20 at 15:34:37 by Joel Sherrill

Keywords: small tasks added

comment:3 Changed on 04/17/20 at 03:46:24 by Gedare Bloom

Milestone: 5.16.1

I think this is a false positive when cpus > 1, then the loop can iterate multiple times.

comment:4 Changed on 11/29/22 at 22:08:03 by Chris Johns

Milestone: 6.17.1
Owner: changed from Chris Johns to Needs Funding
Version: 57
Note: See TracTickets for help on using tickets.