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

Re: SEGMENTATION FAULT




> From daemon Thu Jul 23 20:55:29 1998
> >From [email protected]  Thu Jul 23 20:55:22 1998
> Date: Thu, 23 Jul 1998 12:39:06 -0700 (PDT)
> From: Haobo Yu <[email protected]>
> To: Harlisya Harun <[email protected]>
> cc: [email protected]
> Subject: Re: SEGMENTATION FAULT
> MIME-Version: 1.0
> 
> Look at your trace file, you must have got a incomplete nam trace file
> with the last line lacking a '}' to close the brace there. Then
> get_trace_line in nam will fail there. I think I've checked in fixes to
> make nam print out error messages instead of crash in such cases. 
> 
Hi Haobo,
	Thank you for your email.  I am not really sure what you meant by nam trace file...I have checked few files that I thought are the nam trace files, which are: nam-trace.cc,nam-trace.h,nam.tcl.tk in nsallinone/ns-2/nam and trace.h, trace.cc and nam.tcl ( I checked all of these files because I do not know which is the nam trace file???)...unluckily, there is not any line that lacking a '}'....
	But, from the trace.cc file, I have found a line that lacking ',', correct me if I'm wrong!...The line is the third row in case 'v'(the end of skip '-t')...Should there be a ',' before the next line, which is: if (*cp == '-') cp += 2; // skip '-t',   

	(FROM TRACE.CC FILE)

	void
Trace::scan()
{
	/*
	 * Read the next line in the trace file and store its contents
	 * depending on line type.
	 */
	while (1) {
		(.....)			break;
		case 'v':
			/*   v <-t> <time> <tcl expr> */
			while (isspace(*cp)) cp++;
			if (*cp == '-') cp += 2; // skip '-t'  
			n = sscanf(cp, " %lg", &p.time);

	Please correct me if my assuption is wrong...Anyway, I just tried to compile the file after I have made the changes, with the command: gcc trace.cc -o trace.o -lsocket, but received these error messages:

	 > gcc trace.cc -o trace.o -lsocket
In file included from trace.cc:52:
trace.h:39: tclcl.h: No such file or directory
In file included from trace.h:40,
                 from trace.cc:52:
animator.h:4: tclcl.h: No such file or directory
In file included from packet.h:39,
                 from trace.cc:54:
animation.h:39: tcl.h: No such file or directory
In file included from animation.h:41,
                 from packet.h:39,
                 from trace.cc:54:
paint.h:40: tk.h: No such file or directory
In file included from packet.h:42,
                 from trace.cc:54:
view.h:39: tk.h: No such file or directory
In file included from view.h:40,
                 from packet.h:42,
                 from trace.cc:54:
tkcompat.h:47: #error "you need to include tk.h first"

Your cooperation is highly appreciated.  Thank you.

[email protected]