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

Re: [ns] core dump when accessing contents of packet



Try to gdb ns and run again, print pkt to see if pkt is NULL.
It happened to me as well when pkt is NULL.
Regards,

On Wed, 14 Jun 2000, you wrote:
> Hi all,
> 
> in the following function I get a core dump whenever the comments are
> removed.
> The appropriate entries to tcl/lib/ns-default.tcl and
> tcl/lib/ns-packet.tcl have been
> performed. It does not need to be noted that "seqno_" is a member
> variable of
> hdr_foo and "number" is also a valid variable, i.e. I have had no
> problems printing
> its content.
> 
> void foo_Agent::sendit() {
>  Packet* pkt = allocpkt();
>  hdr_foo* hdr = (hdr_foo*)pkt->access(off_foo_);
> /*  hdr->seqno_ = number; */
>  seqno_ ++;
>  send(pkt, 0); // Connector::send()
> }
> 
> Any help would be appreciated,
> 
> Niko