[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with Multicast classifier: Segmentation Fault



There was a bug in in MCastClassifier::clearHash().  Please apply the
following patch, or wait for a while and grab it off the cvs
tree.  I'll commit the fix right now.

 -Yuri

*** classifier-mcast.cc 1999/03/13 03:52:44     1.23
--- classifier-mcast.cc 1999/06/25 20:04:09
***************
*** 106,112 ****
  
  void MCastClassifier::clearHash(hashnode* h[], int size) 
  {
!       for (int i = 0; i < HASHSIZE; ++i) {
                hashnode* p = h[i];
                while (p != 0) {
                        hashnode* n = p->next;
--- 106,112 ----
  
  void MCastClassifier::clearHash(hashnode* h[], int size) 
  {
!       for (int i = 0; i < size; ++i) {
                hashnode* p = h[i];
                while (p != 0) {
                        hashnode* n = p->next;
***************
*** 114,120 ****
                        p = n;
                }
        }
!       memset(h, 0, size * sizeof(hashnode));
  }
  
  void MCastClassifier::clearAll()
--- 114,120 ----
                        p = n;
                }
        }
!       memset(h, 0, size * sizeof(hashnode*));
  }
  
  void MCastClassifier::clearAll()

  
Joerg Diederich <[email protected]> writes:

> Hi!
> 
> I played around a (very) little bit with multicast support in ns and
> got the following problem in ns-2.1b5 and the current snapshot from
> June, 16th (using also both tclcl-1.0b8 and tclcl-1.0b8-current from
> June, 16th):
> 
> % set mc [new Classifier/Multicast]
> _o4
> % delete $mc
> Segmentation fault
> 
> The problem does not appear in ns-2.1b4.
> 
> I could not really track down the problem, but the SegFault happens
> somewhere in delete-shadow at different (changing) locations.
> 
> gdb output does not help, either:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x4016c132 in __libc_free (mem=0x0)
> Current language:  auto; currently c
> (gdb) bt
> #0  0x4016c132 in __libc_free (mem=0x0)
> #1  0x8383c40 in ?? ()
> #2  0x841 in ?? ()
> Cannot access memory at address 0x2d70a.
> 
> 
> I compiled ns with both gcc-2.7.2 and egcs-2.91.66, same results.
> 
> This is not really a problem for me as I am not using multicast that
> much and as you can simply omit deleting objects, but it may be a hint
> for other strange errors in that field...
> 
> 
> With best regards,
> 
> /J"org
> -----
> J"org Diederich
> Institute of Operating Systems and Computer Networks, 
> Technical University Braunschweig, Germany
> e-mail: [email protected]