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

RE: wireless.tcl




>I have managed to compile ns2.1b6 on my Windows95 system but when
>I tried to run tcl/ex/wireless.tcl, I have the following message:
>
>Loading connection pattern...
>Loading scenario file..
>Load complete...
>Starting Simulation...
>(null) - invalid packet type ((null)).

I am also experiencing this error when I run "ns tcl/ex/wireless-test.tcl"
on an x86-based FreeBSD system.   The problem doesn't arise when I compile
the code on a Solaris 2.6 Sun machine.

After a bit of investigation, I suspect there is a pointer bug somewhere in
the wireless code that's only revealing itself on certain architectures
(e.g., x86).  The code that produces the "invalid packet type" message is as
follows:

-----------------------------------------------------------

void CMUTrace::format(Packet* p, const char *why)
{
	hdr_cmn *ch = HDR_CMN(p);
	int offset = 0;

	/*
	 * Log the MAC Header
	 */
	format_mac(p, why, offset);
	offset = strlen(wrk_);

	switch(ch->ptype()) {

	case PT_MAC:
		break;

	case PT_ARP:
		format_arp(p, offset);
		break;

	default:
		format_ip(p, offset);
		offset = strlen(wrk_);

		switch(ch->ptype()) {

...MUCH DELETED...

			default:
			fprintf(stderr, "%s - invalid packet type (%s).\n",
				__PRETTY_FUNCTION__, packet_info.name(ch->ptype()));
			exit(1);
		}
	}
}

-----------------------------------------------------------

I did a little debugging and found that after handling several dozen
packets, this function is called on a packet with a ch->ptype() equal to
134217729.  This value is obviously gibberish, most likely resulting from
some pointer bug in the wireless code that is overriding the contents of the
packet's common header.  Given the difficulty of tracking down pointer bugs
and my lack of familiarity with the CMU wireless code, I didn't want to
expend anymore time trying to locate this bug.  Has anyone else
investigated?

Brett