Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at trccompat.c:478

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2849.2910
Similar Warnings: 2849.2911, 2849.2912
Procedure: trc_store_old_trace_event
Trace: View
Modified: Wed Sep 2 12:49:59 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
   /u1/paul/SATE/2010/c/pvm/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  
   ...
 456                                         else 
 457                                                 fprintfID->trace_out, " %d", tids[i] );   /* Uninitialized Variable (ID: 2847.2908) */
 458                                 }
 459                         }
 460  
 461                         fprintfID->trace_out, " }" );
 462  
 463                         break;
 464                 }
 465  
 466                 case TRC_OLD_TEV_PSEND0: 
 467                 {
 468                         if ( omit )
 469                                 break;
 470  
 471                         pvm_upkint( &dtid, 1, 1 );
 472                         pvm_upkint( &msgtag, 1, 1 );
 473                         pvm_upkint( &addr, 1, 1 );
 474                         pvm_upkint( &len, 1, 1 );
 475                         pvm_upkint( &type, 1, 1 );
 476  
 477                         fprintfID->trace_out, ", %d, %d, %d, %d, %d",
msgtag is uninitialized478                                 dtid, msgtag, addr, len, type );     /* Uninitialized Variable */
Preconditions
$param_2 = -1
$param_5 = 168
&$unknown_2576072 != 0
((char*)&((char*)*$param_1)[24])[4] != 4
((char*)&((char*)*$param_1)[24])[8] != 3
((char*)*$param_1)[24] = $param_4
myfmt != -1
pvmautoerr != 0
pvmautoerr != 2
pvmautoerr != 3
pvmmytid = -1
pvmrbuf = 0
pvmtoplvl != 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
ID' = $param_1
TT' = ((char*)$param_1)[24]
ecnt' = 0
eid' = $param_5
errno' != 0
omit' = 0
pvm_errno' = -15
pvmmytid' = -1
pvmrbuf' = &$unknown_2576072
td' != 0
tid' = $param_4
tsec' = $param_2
tusec' = $param_3




Change Warning 2849.2910 : Uninitialized Variable

Because they are very similar, this warning shares annotations with warnings 2849.2911 and 2849.2912.

Priority:
State:
Finding:
Owner:
Note: