[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re: new nsallinone version
Haobo;
I ran the simulation with the debugger and you are correct about the
location of the segfault. Your solution did not work. Instead I
changed the initialization of the variable from:
const char* sname = 0;
to:
const char* sname = "null";
In both Trace::format(...) and DequeTrace::recv(...). This seems to
fix the problem and the simulations ran ok.
Question: Is there any reason why this new version of nsallinone
contains a version of nam which will not work with the new version
of ns? In order to get nam to work I had to get a version off of
their web page. (Why package it together if they won't work
together?)
Thanks, Hugh
>
> Did you try to build a debug version of ns and use a debugger to see where
> the segv happens? If my guess is correct, it happens in trace.cc,
> Trace::format() and DequeueTrace::recv(). Check for "sname" in those
> functions, and change the following lines:
>
> if (strcmp(name,"SRM") == 0 || strcmp(name,"cbr") == 0) {
> if ( sh->type() < 5 && sh->type() >=0 ) {
> sname = srm_names[sh->type()];
> }
> }
> to:
> if (strcmp(name,"SRM") == 0 || strcmp(name,"cbr") == 0) {
> if ( sh->type() < 5 && sh->type() >=0 ) {
> sname = srm_names[sh->type()];
> }
> } else
> sname = "null";
>
> The previous problem is, sname is assigned to 0 and sprintf tries to get a
> string out of it.
>
> Let me know if it works.
>
> - Haobo
>
> On Thu, 16 Jul 1998, Hugh Smith wrote:
>
> > I'm still having trouble with version 2.1b3 and the allinone
> > installation. I get a segfault when I try to run simulations on
> > the tutorial examples or the file tcl/ex/simple-dyn.tcl.
> >
> > The segfault goes away if I comment out the line:
> >
> > $ns namtrace-all $nf
> >
> >
> > The steps I have taken are:
> >
> > 1) Reinstalled the allinone version. (This cleared up the problem
> > of xgraph not compiling.)
> >
> > 2) I checked that my LD_LIBRARY_PATH was correct (it was).
> >
> > 3) Just in case I did the cd octl; make. This worked ok but did not
> > clear up the problem.
> >
> > Thoughts?
> >
> > Also, is there any documentation on the changes talked about in Ya
> > Xu's message regarding version v2.1b3.
> >
> > Thanks, Hugh
> >