Thank you for the response. Here is the file I was running. It is
directly from the tutorial and does not use the meyer-heavy trace,
only 300 noise samples. Furthermore, I reduced this to 100 samples
(the minimum allowed, I believe), and I was still experiencing these
issues.

Thanks,
Tal

#include <tossim.h>
#include <stdlib.h>


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

  for (int i = 0; i < 999; i++) {
    Mote* m = t->getNode(i);
    m->bootAtTime(5000003 * i + 1);
    for (int j = 0; j < 2; j++) {
      if (i != j) {
        r->add(i, j, -50.0);
      }
    }
    for (int j = 0; i < 500; j++) {
       m->addNoiseTraceReading((char)(drand48() * 20) - 70);
    }
    m->createNoiseModel();
  }


  for (int i = 0; i < 1000000; i++) {
    t->runNextEvent();
  }
}

> On Jul 12, 2007, at 11:20 PM, Tal Rusak wrote:
>
>> Hi,
>>      I am trying to run C++ TOSSIM simulations in order to use the gdb
>> debugger to examine my code and the TinyOS library code. I have
>> followed the TOSSIM tutorial 11, at
>> http://www.tinyos.net/tinyos-2.x/doc/html/tutorial/lesson11.html
>>      I saved the suggested C++ file as Driver.c and the makefile
>> driver as
>> Makefile.Driver. Then I complied to TOSSIM by running
>> make micaz sim
>> (for python)
>> and
>> make -f Makefile.Driver
>> (for C++)
>>      Then I run gdb. To begin, I simply wanted to run the program to
>> completion, so I entered "run" 7.04 at the GDB plot. Whenever I try
>> to run the program in this way, I get the following error message
>> after the program runs for several minutes:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x0804dfe2 in sim_noise_trace_add (node_id=0, noiseVal=-60 '&#65533;')
>>     at /opt/tinyos-2.x/tos/lib/tossim/sim_noise.c:88
>> 88          memcpy(data, noiseData[node_id].noiseTrace,
>> noiseData[node_id].noiseTraceLen);
>>
>>      It may be applicable to note that the program took up an
>> increasing
>> amount or RAM space on Ubuntu 7.04. It used up 98.0% of the 1 GB RAM
>> (minus about 230 MB for the OS, ect) and, in one case, 51% of the my
>> 4.6 GB swap partition (increased from 1 GB specifically for the
>> purpose of running this program). In most subsequent runs, however,
>> swap usage was lower.
>>      Is there some sort of stack or heap overflow occurring due to
>> lack of
>> memory?
>>      I tried to optimize the file by reducing the number of motes
>> to 2 and
>> the noise traces to 100 (the minimum allowed). However, memory usage
>> was similar to the above and the error still occurred.
>>
>>      Are there any ideas about how I can resolve this issue? By the
>> way,
>> are the memory values that I cite reasonable? If so, is it possible
>> to optimize the C++ somehow so it runs on computers with about 1 GB
>> of RAM?
>>      Any help is appreciated in advance.
>
> How many nodes are you simulating?
>
> IIRC, The full meyer-heavy trace is about 50MB per node: it's 196,000
> entries, after all, and the simulator is storing statistical models
> based on that. That being said, if you are using shorter traces, then
> it should not be very big.
>
> Phil
>


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to