Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at trccompat.c:544

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 22151.29160
Similar Warnings: 22151.29151, 22151.29152, 22151.29153
Procedure: trc_store_old_trace_event
Trace: view
Modified: Thu Nov 26 11:35:21 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /kat0/fletcher/SATE/2010/pvm3/tracer/trccompat.c
   Enter trc_store_old_trace_event
true121 trc_store_old_trace_event( ID, tsec, tusec, tid, eid ) 
 122 TRC_ID ID;
 123 int tsec;
 124 int tusec;
 125 int tid;
 126 int eid;
 127 {
 128         static int *tids = (int *) NULL;
 129         static int ntids = 0;
 130  
 131         TRC_TEVTASK TT;
   ...
 148         int stid;
 149         int omit;
 150         int len;
 151         int buf;
 152         int num;
 153         int cc;
 154         int i;
 155  
 156         /* Set Leftover Event Omit Flag */ 
 157  
 158         TT = trc_get_tevtask_tid( ID, tid );
 159  
 160         omit = ( ID->trace_out == NULL 
 161                 || ( TT != NULL && TRC_TASK_OMIT( TT ) ) ) 
 162                         ? TRC_TRUE : TRC_FALSE;
 163  
 164         /* Initialize Event Counter */ 
 165  
 166         ecnt = 0;
 167  
 168         if ( !omit )
 169         {
 170                 /* Output Trace Event Descriptor (if necessary) */ 
 171  
 172                 if ( !( TRC_OLD_TEV_TRACE[ eid ] ) )
 173                 {
 174                         fprintf( ID->trace_out, "\n" );
 175  
 176                         if ( ID->event_dump_hdr )
 177                                 (ID->event_dump_hdr)( ID, tid );
 178  
 179                         fprintf( ID->trace_out, "#%d: %s\n", eid + 1,
 180                                 TRC_OLD_TRACE_DESCRIPTORS[ eid ] );
 181  
 182                         (TRC_OLD_TEV_TRACE[ eid ])++;
 183                 }
 184  
 185                 /* Update Trace Time */ 
 186  
 187                 trc_update_trace_time( tsec, tusec );
 188  
 189                 /* Output Trace Event Header */ 
 190  
 191                 if ( ID->event_dump_hdr )
 192                         (ID->event_dump_hdr)( ID, tid );
 193  
 194                 fprintf( ID->trace_out, "\"%s\" { %d, %d, %d",
 195                         TRC_OLD_TEV_TRACE_NAMES[ eid ], tsec, tusec, tid );  /* } */ 
 196         }
 197  
 198         /* Convert Trace to Output File */ 
 199  
 200         switch ( eid ) 
 201         {
 202                 case TRC_OLD_TEV_NEWTASK: 
 203                 {
 204                         if ( omit )
 205                                 break;
 206  
 207                         pvm_upkint( &ptid, 1, 1 );
 208                         pvm_upkint( &flags, 1, 1 );
 209                         pvm_upkstr( name );
 210  
   ...
 509                         if ( omit )
 510                                 break;
 511  
 512                         pvm_upkint( &buf, 1, 1 );
 513  
 514                         fprintf( ID->trace_out, ", %d, 0, 0, 0", buf );   /* Uninitialized Variable (ID: 22155.29164) */
 515  
 516                         break;
 517                 }
 518  
 519                 case TRC_OLD_TEV_NRECV1: 
 520                 {
 521                         if ( omit )
 522                                 break;
 523  
 524                         pvm_upkint( &buf, 1, 1 );
 525  
 526                         if ( buf > 0 )
 527                         {
 528                                 pvm_upkint( &nbytes, 1, 1 );
 529  
 530                                 if ( nbytes >= 0 )
 531                                 {
 532                                         pvm_upkint( &msgtag, 1, 1 );
 533                                         pvm_upkint( &stid, 1, 1 );
 534                                 }
 535  
 536                                 else 
 537                                         msgtag = stid = -1;
 538                         }
 539  
 540                         else 
 541                                 nbytes = msgtag = stid = -1;
 542  
 543                         fprintf( ID->trace_out, ", %d, %d, %d, %d",
stid is uninitialized544                                 buf, nbytes, msgtag, stid );     /* Uninitialized Variable */
Preconditions
eid = 57
&$unknown_11577449 >= 1
ID->trace_out != 0
ID->tevtask_list->tevstatus != 4
ID->tevtask_list->outstatus != 3
ID->tevtask_list->tid = tid
myfmt = -1
pvmautoerr = 0
pvmmytid = -1
pvmrbuf != 0
pvmtoplvl != 0
pvmtrc.trctid >= 1
Postconditions
TT' = ID->tevtask_list
$unknown_11577448' is allocated by fopen
bytes_before(&$unknown_11577448)' = 0
buf' = &$unknown_11577449
ecnt' = 0
errno' != 0
nbytes' >= 0
omit' = 0
pvm_errno' = -15
pvmmytid' != -1
pvmrbuf' = 0
pvmtrc.trctid' <= 0
topvmd' = 0




Change Warning 22151.29160 : Uninitialized Variable

Because they are very similar, this warning shares annotations with warnings 22151.29151, 22151.29152, and 22151.29153.
CodeSonar has selected warning 22151.29151 to represent this group of similar warnings. In order to edit this group, you must edit warning 22151.29151.