Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Leak  at trcmess.c:639

Categories: LANG.ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 2859.2922
Similar Warnings: 2859.2923
Procedure: trc_handle_trace_message
Trace: View
Modified: Wed Sep 2 12:50:41 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/trcmess.c
   Enter trc_handle_trace_message
 377 trc_handle_trace_message( ID, src ) 
 378 TRC_ID ID;
 379 int src;
 380 {
 381         TRC_DATADESC DD;
 382  
 383         TRC_TEVDESC TD;
 384  
 385         TRC_TEVTASK TT;
 386  
 387         TRC_HOST H;
   ...
 404         int tusec;
 405         int tsec;
 406         int ecnt;
 407         int eid;
 408         int tid;
 409         int dt;
 410  
 411         int marker;
 412         int nest;
 413  
 414         ecnt = 0;
 415  
 416         TRC_PVMCKERR( pvm_upkint( &marker, 1, 1 ),
 417                 "Unpacking Trace Message", return( ecnt ) );
 418  
 419         /* Old PVM 3.3 Trace Format */ 
 420  
 421         if ( marker > 0 )
 422         {
 423                 tsec = marker;
 424  
 425                 TRC_PVMCKERR( pvm_upkint( &tusec, 1, 1 ),
 426                         "Event Parse Error", return( ecnt ) );
 427  
 428                 TRC_PVMCKERR( pvm_upkint( &tid, 1, 1 ),
 429                         "Event Parse Error", return( ecnt ) );
 430  
 431                 TRC_PVMCKERR( pvm_upkint( &eid, 1, 1 ),
   ...
 433  
 434                 ecnt += trc_store_old_trace_event( ID, tsec, tusec, tid, eid );   /* Uninitialized Variable (ID: 2863.2928) */
 435  
 436                 return( ecnt );
 437         }
 438  
 439         /* New PVM 3.4 Format */ 
 440  
 441         /* Get Task & Host Info */ 
 442  
 443         TT = trc_get_tevtask_tid( ID, src );
 444  
 445         pvmd_tid = pvm_tidtohost( src );
 446  
 447         if ( !pvmd_tid )
 448                 pvmd_tid = pvm_tidtohost( TRC_TID );
 449  
 450         H = trc_get_host_tid( pvmd_tid );
 451  
 452         /* Set Leftover Event Omit Flag */ 
 453  
 454         omit = ( ID->trace_out == NULL 
 455                 || ( TT != NULL && TRC_TASK_OMIT( TT ) ) ) 
 456                         ? TRC_TRUE : TRC_FALSE;
 457  
 458         /* Process Event Message */ 
 459  
 460         nest = 0;
 461  
 462         done = 0;
 463  
 464         do 
 465         {
 466                 switch ( marker ) 
 467                 {
 468                         case TEV_MARK_EVENT_BUFFER
 469                         {
 470                                 nest++;
 471  
 472                                 break;
 473                         }
 474  
 475                         case TEV_MARK_EVENT_BUFFER_END
 476                         {
   ...
 627  
 628                                 if ( !omit )
 629                                         ecnt++;
 630  
 631                                 if ( !nest )
 632                                         done++;
 633  
 634                                 break;
 635                         }
 636  
 637                         case TEV_MARK_USER_EVENT_RECORD: 
 638                         {
allocated inside call639                                 TD = trc_create_tevdesc();     /* Leak */
     /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcutil.c
     Enter trc_handle_trace_message / trc_create_tevdesc
 886   trc_create_tevdesc() 
 887   {
 888           TRC_TEVDESC tmp;
 889    
referenced by returned value890           tmp = (TRC_TEVDESC) malloc( sizeof( struct trc_tevdesc_struct ) );
referenced by tmp891           trc_memcheck( tmp, "Trace Event Descriptor Structure" );
 892    
 893           tmp->name = (char *) NULL;
 894    
 895           tmp->eid = -1;
 896    
 897           tmp->entry_exit = -1;
 898    
 899           tmp->index = -1;
 900    
 901           tmp->hid = -1;
 902    
 903           tmp->dump = -1;
 904    
 905           tmp->ddesc = (TRC_DATADESC) NULL;
 906    
 907           tmp->refcount = -1;
 908    
 909           tmp->next = (TRC_TEVDESC) NULL;
 910    
 911           return( tmp );
referenced by returned value912   } 
     Exit trc_handle_trace_message / trc_create_tevdesc
 640  
referenced by TD641                                 TD->refcount = 1;
 642  
 643                                 TRC_PVMCKERR( pvm_upkint( &eid, 1, 1 ),
 644                                         "Event Descriptor ID", return( ecnt ) );
 645  
 646                                 TD->eid = eid & ~( TEV_EVENT_ENTRY | TEV_EVENT_EXIT );
 647  
 648                                 if ( eid & TEV_EVENT_ENTRY )
 649                                         TD->entry_exit = TRC_ENTRY_TEV;
 650  
 651                                 else if ( eid & TEV_EVENT_EXIT )
 652                                         TD->entry_exit = TRC_EXIT_TEV;
 653  
 654                                 else 
   ...
 777  
 778                 if ( !done )
 779                 {
 780                         TRC_PVMCKERR( pvm_upkint( &marker, 1, 1 ),
 781                                 "Unpacking Trace Message", return( ecnt ) );
 782                 }
 783         }
 784         while ( !done );
 785  
 786         return( ecnt );
 787 } 
Preconditions
((char*)$param_1)[40] = 0
TRC_HOST_LIST->pvmd_tid != 0
((char*)*$param_1)[24] != $param_2
pvmmytid = -1
pvmtoplvl != 0
pvmtrc.trctid >= 1
Postconditions
TRC_TMP_CC' <= -1




Change Warning 2859.2922 : Leak

Because they are very similar, this warning shares annotations with warning 2859.2923.

Priority:
State:
Finding:
Owner:
Note: