Hi all:
When I debug ns2 ,I receive follow result:
Program received signal SIGSEGV, Segmentation fault.
0x081c6446 in DestHashClassifier::hashkey (this=0xa2f7330, dst=4)at
classifier/classifier-hash.h:180
180 long key = mshift(dst);
(gdb) i locals
key = Cannot access memory at address 0xbf43affc
(gdb) l
175 virtual int command(int argc, const char*const* argv);
176 int classify(Packet *p);
177 virtual void do_install(char *dst, NsObject *target);
178 protected:
179 const char* hashkey(nsaddr_t, nsaddr_t dst, int) {
180 long key = mshift(dst);
181 return (const char*) key;
182 }
183 };
184
(gdb) p key
Cannot access memory at address 0xbf43affc
(gdb) p dst
$1 = 4
(gdb) p shift_
$2 = 0
(gdb) p mask_
$3 = 2147483647
(gdb) p key
Cannot access memory at address 0xbf43affc
(gdb) p &key
$4 = (long int *) 0xbf43affc
(gdb)
Ps: inline int mshift(int val) { return ((val >> shift_) & mask_); }
I want to ask why can't I access the local variable key? How can I locate
the plalce where error happened?
Thanks!
Balbo.