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

Re: [ns] What does this error means?-Help



Hi, Haifeng,

Thanks for your help.
It still don't work, even after modification according to your mail. (But I
thought they are equivalent, and queue.h include packet.h) 
I print pointer this, it display  

(gdb) p this
$2 = (Packet *) 0x0

Which indicates that p is NULL, why would this occur?
In fact, the tcl scripts is ok for WFQ simulation. Packets are generated by UDP
agents. Why will p be NULL?

Best regards,

Pang

On Mon, 12 Jun 2000, you wrote:
> You might have got hdr NULL.  You may try:
> 
> hdr_cmn * hdr = hdr_cmn::access(p);
> 
> Don't forget to include packet.h (and maybe flag.h or ip.h, you may check
> the ns manual).
> 
> On Tue, 13 Jun 2000, Anaking wrote:
> 
> > Hi, all,
> > 
> > I have developed a queue for TDMA scheduling based on token model.
> > I derive the UpSched and DnSched class from Queue and declare my own
> > enque/deque function. Make is ok, however when run there is error as follows:
> > 
> > (gdb) r mactest.tcl
> > Starting program: /root/software/ns2/ns-allinone-2.1b5/bin/ns mactest.tcl
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x81053d6 in Packet::access (this=0x0, off=936) at packet.h:222
> > 222                     return (&bits_[off]); 
> > 
> > it seems the error is at line:
> > hdr_cmn* hdr  = (hdr_cmn*)p->access(off_cmn_);
> > int pktSize = hdr->size();
> > 
> > I have use this both in enque() and deque() to acquire packetsize.
> > I can't figure out what the bug is.
> > 
> > I will appreciate any comment you give me.
> > 
> > Thanks.
> >