Hi, I got this from the archives. On Feb 27, 2007, at 9:27 PM, Philip Levis wrote:
>* On Feb 27, 2007, at 10:49 AM, pavan kumar wrote:* > **>>* I am having a similar kind of error as posted in the link* >>* http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2006- * >>* December/021625.html* >> **>>* Python 2.4.2 (#1, Feb 12 2006, 03:59:46)* >>* [GCC 4.1.0 20060210 (Red Hat 4.1.0-0.24)] on linux2* >>* Type "help", "copyright", "credits" or "license" for more * >>* information.* >>* >>> from TOSSIM import ** >>* >>> t = Tossim([])* >>* >>> t.runNextEvent()* >>* False* >>* >>> m = t.getNode(32);* >>* >>> m.bootAtTime(1000);* >>* Segmentation fault* >>* The link does not provide any solution, we would like to know how * >>* you people* >>* solved it.* >> **> **>* Could you perhaps answer the two questions I asked in that thread?* Here are the next steps to take: If giving a trace doesn't tell you where you are, then you need to step through the code. The first thing to do is determine if the SEGV occurs before, during, or after the TOSSIM function underlying bootAtTime(). So start python in gdb, and break on bootAtTime. This function is defined in tossim.c. If you SEGV before you get there, it's happening on the way in (Python -> C++ -> C); if it SEGVs after the breakpoint, it's either the function or on the way out (C -> C++ -> Python). You can break at the C++ level by breaking on Mote::bootAtTime.
The issue is that I can't reproduce the problem, so I can't solve it
by myself. Phil
I used gdb ad traced the problem to simTime = t; in SimMoteP.nc... I tried the most recent CVS version, but I think the problem persisted. I get quite strange interpretations from stuff, especially from reading source codes and extracting information from it, but I may have gotten to the point now. You see, TOSSIM uses a C++ class to represent the mote, and when python calls a function it is wrapped to this class's corresponding function, which calls the SimMoteP's corresponding function. It seems that what happens is that the component itself was not created, so, when it tries to access variables such as startTime, which does not exist, segmentation fault happens. What I did was to prefix the variables with m_ (to avoid name clashes) and put them also into the class Mote. Although the node limit is 1000, which I also altered but whose effects I have not yet evaluated, I changed the tmp's in SimMoteP.nc from int to unsigned long int, which is the type of the value returned by sim_node() and the parameter type for sim_set_node(). I hope you forgive my mistakes in this message whatsoever =D -- "Segmentation Fault" ...de onde concluímos que a falha de segmentação é ninfomaníaca.
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help