Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at hoster.c:616

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 78.28665
Procedure: pl_startup
Trace: view
Modified: Thu Nov 26 11:27:18 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/src/hoster.c
   Enter pl_startup
true480 pl_startup(num, hostlist) 
 481         int num;
 482         struct hst **hostlist;
 483 {
 484         int nxth = 0;                                           /* next host in list to start */ 
 485         struct slot *slact = 0;                         /* active list of slots */ 
 486         struct hst *hp;
 487         struct slot *sp, *sp2;
 488         struct timeval tnow;
 489         struct timeval tout;
 490 #ifdef FDSETNOTSTRUCT 
 491         fd_set rfds;                                            /* emx headers */ 
 492 #else 
 493         struct fd_set rfds; 
 494 #endif 
 495         int nfds;
 496         int i;
 497         int n;
 498         char *p;
 499  
 500         /* init slot free list */ 
 501  
 502         slfree = &slots[RSHNPLL+1];
 503         slfree->s_link = slfree->s_rlink = slfree;
 504         slact = &slots[RSHNPLL];
 505         slact->s_link = slact->s_rlink = slact;
 506         for (i = RSHNPLL; i-- > 0; ) {
 507                 LISTPUTAFTER(slfree, &slots[i], s_link, s_rlink);
 508         }
 509  
 510         /*
 511         * keep at this until all hosts in table are completed 
 512         */ 
 513  
 514         for (; ; ) {
 515  
 516                 /*
 517                 * if empty slots, start on new hosts 
 518                 */ 
 519  
 520                 for (; ; ) {
 521  
 522                         /* find a host for slot */ 
 523  
 524                         if (slfree->s_link != slfree && nxth < num)
 525                                 hp = hostlist[nxth++];
 526                         else 
 527                                 break;
 528  
 529                         sp = slfree->s_link;
 530                         LISTDELETE(sp, s_link, s_rlink);
 531                         sp->s_hst = hp;
 532                         sp->s_len = 0;
 533                         sp->s_elen = 0;
 534                         if (pvmdebmask & PDMSTARTUP) {
 535                                 pvmlogprintf("pl_startup() trying %s\n", hp->h_name);
 536                         }
 537                         phase1(sp);
 538                         if (hp->h_result) {
 539                                 /* error or fully started (manual startup) */ 
 540  
 541                                 if (pvmdebmask & PDMSTARTUP) {
 542                                         pvmlogprintf( 
 543                                         "pl_startup() got result \"%s\" for %s phase1()\n",
 544                                                 hp->h_result, hp->h_name);
 545                                 }
 546  
 547                                 LISTPUTBEFORE(slfree, sp, s_link, s_rlink);
 548  
 549                         } else {
 550                                 /* partially started */ 
 551  
 552                                 LISTPUTBEFORE(slact, sp, s_link, s_rlink);
 553                                 pvmgetclock(&sp->s_bail);
 554                                 tout.tv_sec = RSHTIMEOUT;
 555                                 tout.tv_usec = 0;
 556                                 TVXADDY(&sp->s_bail, &sp->s_bail, &tout);
 557                         }
 558                 }
 559  
 560                 /* if no hosts in progress, we are finished */ 
 561  
 562                 if (slact->s_link == slact)
 563                         break;
 564  
 565                 /*
 566                 * until next timeout, get output from any slot 
 567                 */ 
 568  
 569                 FD_ZERO(&rfds);
 570                 nfds = 0;
 571                 TVCLEAR(&tout);
 572                 pvmgetclock(&tnow);
 573                 for (sp = slact->s_link; sp != slact; sp = sp->s_link) {
 574                         if (TVXLTY(&sp->s_bail, &tnow)) {
 575                                 pvmlogprintf("pl_startup() giving up on host %s after %d secs\n",
 576                                                 sp->s_hst->h_name, RSHTIMEOUT);
 577                                 sp->s_hst->h_result = STRALLOC("PvmCantStart");   /* Null Pointer Dereference (ID: 76.28666) */
 578                                 sp2 = sp->s_rlink;
 579                                 close_slot(sp);
 580                                 sp = sp2;
 581                                 continue;
 582                         }
 583  
 584                         if (!TVISSET(&tout) || TVXLTY(&sp->s_bail, &tout))
 585                                 tout = sp->s_bail;
 586                         if (sp->s_rfd >= 0)
 587                                 FD_SET(sp->s_rfd, &rfds);
 588                         if (sp->s_rfd > nfds)
 589                                 nfds = sp->s_rfd;
 590                         if (sp->s_efd >= 0)
 591                                 FD_SET(sp->s_efd, &rfds);
 592                         if (sp->s_efd > nfds)
 593                                 nfds = sp->s_efd;
 594                 }
 595  
 596                 if (slact->s_link == slact)
 597                         break;
 598  
 599                 nfds++;
 600  
 601                 if (TVXLTY(&tnow, &tout)) {
 602                         TVXSUBY(&tout, &tout, &tnow);
 603                 } else {
 604                         TVCLEAR(&tout);
 605                 }
 606                 if (pvmdebmask & PDMSTARTUP) {
 607                         pvmlogprintf("pl_startup() select timeout is %d.%06d\n",
rfds is uninitialized608                                         tout.tv_sec, tout.tv_usec);
 609                 }
*hostlist is uninitialized610                 if ((n = select(nfds,
 611 #ifdef  FDSETISINT 
 612                                 (int *)&rfds, (int *)0, (int *)0, 
 613 #else 
 614                                 (fd_set *)&rfds, (fd_set *)0, (fd_set *)0,
 615 #endif 
rfds is uninitialized616                                 &tout)) == -1) {     /* Uninitialized Variable */
Preconditions
num >= 1
&$unknown_76410 != &slots[0].s_link + 3312
&$unknown_76412 != &slots[0].s_link + 2760
$unknown_76412 = &slots[0].s_link + 2760
$unknown_76412 >= 6856
((char*)&$unknown_76412)[16] <= tnow.tv_usec - 1
((char*)&$unknown_76412)[20] = -1
rfds.__fds_bits[0] != -1
tnow.tv_usec >= 0
Postconditions
((char*)$unknown_76412)[4]' = ((char*)&$unknown_76412)[4]
((char*)&((char*)$unknown_76412)[8])[32]' = &$heap_3848
((char*)$unknown_76412)[4]' = $unknown_76412
((char*)&$unknown_76410)[544]' = 0
((char*)&$unknown_76410)[548]' = 0
$unknown_76412' = &slots[0].s_link + 3312
((char*)&$unknown_76412)[4]' = &$unknown_76414
$unknown_76414' = &$unknown_76412
atnewline' = 0
$heap_3848' = 80
bytes_after(&$heap_3848)' = 13
$heap_3848' is allocated by malloc
$heap_3848' is allocated
bytes_before(&$heap_3848)' = 0
strlen(&$heap_3848)' = 12
tocttou($heap_3848)' = tocttou(#string12)
i' = -1
nfds' = 1
nxth' = num
slact' = &slots[0].s_link + 2760
slfree' = &slots[0].s_link + 3312
slots[5].s_link' = &$unknown_76412
slots[6].s_link' = &$unknown_76410
slots[6].s_rlink' = &$unknown_76412
sp' = $unknown_76412
sp2' = ((char*)&$unknown_76412)[4]
tmbuf.tm_sec' = &$unknown_76415
tnow.tv_sec' = 0
tout.tv_sec' = 0
tout.tv_usec' = 0




Change Warning 78.28665 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: