Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at pvmgs_core.c:366

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2959.3042
Procedure: gs_handle
Trace: View
Modified: Wed Sep 2 12:55:06 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/pvmgs/pvmgs_core.c
   Enter gs_handle
true245 gs_handle( hash_list, ngroups, gstid ) 
 246 GROUP_LIST_PTR hash_list;
 247 int *ngroups, *gstid;
 248 {
 249         int len, msgtag, tid, gid, cc, ftid, inst, i, size, ntids, listsize;
 250         int cnt, hosttid, nhosts, nmem_onhost, pcoord;
 251         int *nmem_onhostv = (int *) NULL, *pcoordv = (int *) NULL;  
 252         int mxupklen = 0;
 253         GROUP_STRUCT_PTR group;
 254         char *groupname = (char *) NULL;
 255         int *tidlist = (int *) NULL;
 256         int maxntids = 0, info;
 257         int gstate;
 258  
 259         while ( 1 )  
 260         {
 261                 if ( (cc = pvm_recv( -1, -1 )) < 0 )  /* receive a request */ 
 262                 {
 263                         pvm_perror( "gs_handle(recv)" );
 264                         return( cc );
 265                 }
 266                 /* get: length of message, message tag, and sending tid */ 
 267                 if ( (cc = pvm_bufinfo( pvm_getrbuf(), &len, &msgtag, &tid )) 
 268                                 < 0 )  
 269                 {
 270                         pvm_perror("gs_handle(bufinfo)");
 271                         return( cc );
 272                 }
 273  
 274                 /* Most group functions require unpacking a group name, so */ 
 275                 /* Make sure variable groupname is always long enough */ 
 276                 REALLOCSTRING( len, mxupklen , groupname, "gs_handle(entry)" );   /* Ignored Return Value (ID: 2979.3065) */
 277  
 278                 switch( msgtag ) 
 279                 {
 280                         case (DIE):             /* leave a suicide note */ 
 281                                 gs_pstate( "pvmgs", hash_list, ngroups );
 282                                 return( PvmOk );
 283  
 284                         case (JOIN):    /* join a group with the lowest avail gid */ 
 285                                 pvm_upkstr( groupname );
 286                                 gid = gs_join( groupname, tid, hash_list, ngroups );
 287                                 /* tell me if the tid dies */ 
 288                                 if ( pvm_notify( PvmTaskExit, DEADTID, 1, &tid ) < 0 )  
   ...
 348                                 pvm_upkstr( groupname );
 349                                 pvm_upkint( &ftid, 1, 1 );
 350                                 inst = gs_getinst( groupname, ftid, hash_list, ngroups,
 351                                                 &gstate );
 352                                 PK_IRESULT( inst, "gs_handle(getinst)" );
 353                                 PK_STATE( tid, gstate, groupname, hash_list, ngroups,
 354                                                 "gs_handle(getinst)" );
 355                                 SENDRESULT( tid, msgtag, "gs_handle(getinst)" );
 356                                 break;
 357  
 358                         case (GETTID):  /* return tid from (group,instance) pair */ 
 359                                 pvm_upkstr( groupname );
 360                                 pvm_upkint( &inst, 1, 1 );
 361                                 ftid = gs_gettid( groupname, inst, hash_list, ngroups,
 362                                                 &gstate );
 363                                 PK_IRESULT( ftid, "gs_handle(gettid)" );
 364                                 PK_STATE( tid, gstate, groupname, hash_list, ngroups,
 365                                                 "gs_handle(gettid)" );   /* Uninitialized Variable (ID: 2958.3041) */
tid is uninitialized366                                 SENDRESULT( tid, msgtag, "gs_handle(gettid)" );     /* Uninitialized Variable */
Preconditions
&$unknown_3877807 != -1
len >= 1
msgtag = 6
pvmautoerr = 0
pvmmytid != -1
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
pvmtrc.trcopt != 1
pvmtrc.trcopt != 2
pvmtrc.trcopt != 3
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
cc' = 0
groupname' = 0
gstate' = 2
gstid' = $param_3
hash_list' = $param_1
maxntids' = 0
mxupklen' = len
ngroups' = $param_2
nmem_onhostv' = 0
pcoordv' = 0
pvm_errno' = -2
pvmmytid' = &$unknown_3877807
tidlist' = 0




Change Warning 2959.3042 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: