Thank you for your response.

We think we are adding more than 100 noise readings. We are using the
meyer-heavy.txt that comes with the TOS distribution to add noise readings.

Our driver cpp program can be seen below. Any ideas or obvious flaws in that
respect?

Again, any help is appreciated.


#include <tossim.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <sstream>

using namespace std;

int main(int argc, char *argv[])
{

  Tossim* t = new Tossim(NULL);
  Radio* r = t->radio();

  FILE* pFile;
  pFile = fopen("topo.txt", "r");

  int source = 0;
  int dest = 0;
  float gain = 0.0;


  while((fscanf(pFile, "%u %u %f", &source, &dest, &gain)) != EOF)
  {
    r->add(source, dest, gain);
  }

  FILE* pFile1;
  pFile1 = fopen("meyer-heavy.txt", "r");
  int noise = 0;

  while((fscanf(pFile1, "%d", &noise)) != EOF)
  {
    for(int i = 0; i < 6; i++)
    {
      t->getNode(i)->addNoiseTraceReading(noise);
    }
  }

  for(int i = 0; i < 6; i++)
  {
    t->getNode(i)->createNoiseModel();
  }

  int startTime = 1000;
  for(int i = 0; i < 6 ; i++)
  {
    t->getNode(i)->bootAtTime(startTime);
    startTime += 100;
  }

  while(true)
  {
    t->runNextEvent();
  }

  return 0;
}



On Tue, Jun 17, 2008 at 6:12 PM, Paul Stickney <[EMAIL PROTECTED]> wrote:

> Ensure that you are adding 100 noise trace readings before trying to
> build a model.
>
> HTH,
> Paul
>
> On Tue, Jun 17, 2008 at 4:07 AM, Elvar Ólafsson <[EMAIL PROTECTED]>
> wrote:
> > Hello
> >
> > We are having some problems with TOSSIM segfaulting when we are running
> > longer
> > simulations.
> >
> > We are trying to let a node sleep for a large amount of time
> (1346153000'ish
> > milliseconds).
> > To do this we first call SplitControl.stop() on the radio
> (ActiveMessageC)
> > and
> > then start a TimerMilliC for this period of time. After the timer is
> started
> > nothing else happens in the program as we wait for the timer to fire.
> >
> > But before we apparently get the fired event, the program segfaults with
> the
> > trace below. The simulation runs for quite some time after starting the
> > timer, with nothing apparently
> > happening until this happens though.
> >
> > We are using the meyer-heavy.txt noise readings, and are running an
> > unbounded number of events.
> >
> > Does anyone know what might be going on? ANY help is appreciated!
> >
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x0804f748 in sim_noise_generate (node_id=5, cur_t=1314806650) at
> > /opt/tinyos-2.x/tos/lib/tossim/sim_noise.c:362
> > Current language:  auto; currently c
> >
> > (gdb) backtrace
> > #0  0x0804f748 in sim_noise_generate (node_id=5, cur_t=1314806650)
> >     at /opt/tinyos-2.x/tos/lib/tossim/sim_noise.c:362
> > #1  0x08053994 in CpmModelC$noise_hash_generation () at
> > /opt/tinyos-2.x/tos/lib/tossim/CpmModelC.nc:128
> > #2  0x080537d7 in CpmModelC$packetNoise (msg=0x0) at
> > /opt/tinyos-2.x/tos/lib/tossim/CpmModelC.nc:264
> > #3  0x080536c7 in CpmModelC$Model$clearChannel () at
> > /opt/tinyos-2.x/tos/lib/tossim/CpmModelC.nc:203
> > #4  0x0805368d in TossimPacketModelC$GainRadioModel$clearChannel ()
> >     at /opt/tinyos-2.x/tos/lib/tossim/GainRadioModel.nc:48
> > #5  0x08052617 in TossimPacketModelC$send_backoff (evt=0x816456c)
> >     at /opt/tinyos-2.x/tos/lib/tossim/TossimPacketModelC.nc:205
> > #6  0x0804d2da in sim_run_next_event () at
> > /opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:121
> > #7  0x0804ab81 in Tossim::runNextEvent (this=0x8171008) at
> > /opt/tinyos-2.x/tos/lib/tossim/tossim.c:278
> > #8  0x0804a9f9 in main () at Driver.cpp:59
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to