Hi Philip,
I think I found another problem concerning restart of Motes:
I have a running simulation where I stop after not getting any debug
message from my motes for a specified time and then restart all motes by
doing :
simt = tossim.time()
for i in range(0,maxNodes):
tossim.turnOff(i)
for i in range(maxNodes-1,-1,-1):
tossim.bootAtTime(simt+50)
tossim.turnOn(i)
This works for a couple of times and then I get another Segfault. I ran
it throug gdb and appended the output.
Can you tell a problem or do you need more information ?
Marek
Starting program: /usr/bin/python2.5 ./Mult.py
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1210767152 (LWP 11242)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
Creating parameters.h
Compiling project
mkdir -p build/micaz
placing object files in build/micaz
writing XML schema to app.xml
compiling ProbAppC to object file sim.o
ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim
-fnesc-nido-tosnodes=1000 -fnesc-s imulate
-fnesc-nido-motenumber=sim_node\(\) -finline-limit=100000 -Wall
-Wshadow -Wnesc-a ll -target=micaz -fnesc-cfile=build/micaz/app.c
-board=micasb -Wno-nesc-data-race ProbAppC .nc -fnesc-dump=components
-fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typede fs
-fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
compiling Python support and C libraries into pytossim.o, tossim.o,
and c-support.o
g++ -c -shared -fPIC -o build/micaz/pytossim.o -g
-O0 /data/hiwi/tinyos/tinyos-2.x/tos/li b/tossim/tossim_wrap.cxx
-I/usr/include/python2.5 -I/data/hiwi/tinyos/tinyos-2.x/tos/lib/to ssim
-DHAVE_CONFIG_H
g++ -c -shared -fPIC -o build/micaz/tossim.o -g
-O0 /data/hiwi/tinyos/tinyos-2.x/tos/lib/ tossim/tossim.c
-I/usr/include/python2.5 -I/data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim
g++ -c -shared -fPIC -o build/micaz/c-support.o -g
-O0 /data/hiwi/tinyos/tinyos-2.x/tos/l ib/tossim/hashtable.c
-I/usr/include/python2.5 -I/data/hiwi/tinyos/tinyos-2.x/tos/lib/tossi m
linking into shared object ./_TOSSIMmodule.so
g++ -shared -fPIC build/micaz/pytossim.o build/micaz/sim.o
build/micaz/tossim.o build/mica z/c-support.o -lstdc++ -o
_TOSSIMmodule.so
copying Python script interface TOSSIM.py from lib/tossim to local
directory
*** Successfully built micaz TOSSIM library.
Starting new tossim instance
Simulation: reloading TOSSIM module
<module 'TOSSIM' from
'/data/hiwi/tinyos/tinyos-2.x/apps/ProbFlooding/TOSSIM.py'>
Simulation: TOSSIM module reloaded
Starting new simulation
Current parameters [[MoteParameter:0]] [MoteNumberParameter:10]
[[ScriptParameter:1]]
Simuation: Status set to Running
[New Thread -1215095920 (LWP 11375)]
[New Thread -1223484528 (LWP 11376)]
checking status
Running
Simulation: Stopped due to lack of Events
[Thread -1215095920 (LWP 11375) exited]
Stopped
Mult:resetting
Mult:Simulation stopped
Permutations left
<open file 'output-1', mode 'w' at 0xb7d06a40>
Setoutputfile <open file 'output-1', mode 'w' at 0xb7d06a40>
here
simtime 169829531
here ?
Turning off 0
Turning off 1
Turning off 2
Turning off 3
Turning off 4
Turning off 5
Turning off 6
Turning off 7
Turning off 8
Turning off 9
Turning on 9
Turning on 8
Turning on 7
Turning on 6
Turning on 5
Turning on 4
Turning on 3
Turning on 2
Turning on 1
Turning on 0
finally here
nothere
Simulation resetted
Starting new simulation
Current parameters [[MoteParameter:0]] [MoteNumberParameter:10]
[[ScriptParameter:2]]
Simuation: Status set to Running
[New Thread -1215095920 (LWP 11377)]
[New Thread -1231877232 (LWP 11378)]
checking status
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Running
Watcher: stopping Simulation
Simulation: Stopped by stop()
[Thread -1215095920 (LWP 11377) exited]
Stopped
Mult:resetting
Mult:Simulation stopped
Permutations left
<open file 'output-2', mode 'w' at 0xb7d06ad0>
Setoutputfile <open file 'output-2', mode 'w' at 0xb7d06ad0>
here
simtime 6150475117943
here ?
Turning off 0
Turning off 1
Turning off 2
Turning off 3
Turning off 4
Turning off 5
Turning off 6
Turning off 7
Turning off 8
Turning off 9
Turning on 9
Turning on 8
Turning on 7
Turning on 6
Turning on 5
Turning on 4
Turning on 3
Turning on 2
Turning on 1
Turning on 0
finally here
nothere
Simulation resetted
Starting new simulation
Current parameters [[MoteParameter:0]] [MoteNumberParameter:10]
[[ScriptParameter:3]]
Simuation: Status set to Running
[New Thread -1215095920 (LWP 11379)]
[New Thread -1240265840 (LWP 11380)]
checking status
Running
Watcher: stopping Simulation
Simulation: Stopped by stop()
[Thread -1215095920 (LWP 11379) exited]
Stopped
Mult:resetting
Mult:Simulation stopped
Permutations left
<open file 'output-3', mode 'w' at 0xb7d06a40>
Setoutputfile <open file 'output-3', mode 'w' at 0xb7d06a40>
here
simtime 6399846221199
here ?
Turning off 0
Turning off 1
Turning off 2
Turning off 3
Turning off 4
Turning off 5
Turning off 6
Turning off 7
Turning off 8
Turning off 9
Turning on 9
Turning on 8
Turning on 7
Turning on 6
Turning on 5
Turning on 4
Turning on 3
Turning on 2
Turning on 1
Turning on 0
finally here
nothere
Simulation resetted
Starting new simulation
Current parameters [[MoteParameter:0]] [MoteNumberParameter:10]
[[ScriptParameter:4]]
Simuation: Status set to Running
[New Thread -1215095920 (LWP 11381)]
[New Thread -1248654448 (LWP 11382)]
checking status
Running
Simulation: Stopped due to lack of Events
[Thread -1215095920 (LWP 11381) exited]
Simulation has been stopped
Watcher stopped
[Thread -1223484528 (LWP 11376) exited]
Simulation has been stopped
Watcher stopped
[Thread -1231877232 (LWP 11378) exited]
Stopped
Mult:resetting
Mult:Simulation stopped
Permutations left
<open file 'output-4', mode 'w' at 0xb7d06ad0>
Setoutputfile <open file 'output-4', mode 'w' at 0xb7d06ad0>
here
simtime 0
here ?
Turning off 0
Turning off 1
Turning off 2
Turning off 3
Turning off 4
Turning off 5
Turning off 6
Turning off 7
Turning off 8
Turning off 9
Turning on 9
Turning on 8
Turning on 7
Turning on 6
Turning on 5
Turning on 4
Turning on 3
Turning on 2
Turning on 1
Turning on 0
finally here
nothere
Simulation resetted
Starting new simulation
Current parameters [[MoteParameter:0]] [MoteNumberParameter:10]
[[ScriptParameter:5]]
Simuation: Status set to Running
[New Thread -1231877232 (LWP 11383)]
[New Thread -1223484528 (LWP 11384)]
checking status
Running
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1231877232 (LWP 11383)]
0xb7ae36a1 in __nesc_ntoh_uint8 (source=0x6)
at /usr/lib/ncc/nesc_nx.h:237
237 return base[0];
(gdb) bt
#0 0xb7ae36a1 in __nesc_ntoh_uint8 (source=0x6)
at /usr/lib/ncc/nesc_nx.h:237
#1 0xb7ae18f4 in TossimActiveMessageP$AMPacket$type (amsg=0x0)
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/TossimActiveMessageP.nc:165
#2 0xb7ae691b in TossimActiveMessageP$Model$sendDone (msg=0x0, result=0
'\0')
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/TossimActiveMessageP.nc:103
#3 0xb7ae5f89 in TossimPacketModelC$Packet$sendDone
(arg_0x40762f00=0x0,
arg_0x407610b0=0 '\0')
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/TossimPacketModel.nc:68
#4 0xb7ae6780 in TossimPacketModelC$send_transmit_done (evt=0xb7b593a0)
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/TossimPacketModelC.nc:276
#5 0xb7adf56c in sim_run_next_event ()
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/sim_tossim.c:121
#6 0xb7ae8d53 in Tossim::runNextEvent (this=0x81cd5d8)
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/tossim.c:278
#7 0xb7ade39c in _wrap_Tossim_runNextEvent (self=0x0, args=0xb79885cc)
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:3219
#8 0x0805a0a7 in PyObject_Call ()
#9 0x080bfd8d in PyEval_CallObjectWithKeywords ()
#10 0x080bf6c9 in _PyBuiltin_Init ()
#11 0x080c6e6e in PyEval_EvalFrameEx ()
#12 0x080c7ccb in PyEval_EvalCodeEx ()
#13 0x080c5be6 in PyEval_EvalFrameEx ()
#14 0x080c7ccb in PyEval_EvalCodeEx ()
#15 0x0810ec85 in PyClassMethod_New ()
#16 0x0805a0a7 in PyObject_Call ()
#17 0x080c4af7 in PyEval_EvalFrameEx ()
#18 0x080c6f7a in PyEval_EvalFrameEx ()
#19 0x080c7ccb in PyEval_EvalCodeEx ()
#20 0x0810ebb9 in PyClassMethod_New ()
#21 0x0805a0a7 in PyObject_Call ()
#22 0x0806024e in PyClass_IsSubclass ()
#23 0x0805a0a7 in PyObject_Call ()
#24 0x080bfd8d in PyEval_CallObjectWithKeywords ()
#25 0x080f1998 in initthread ()
#26 0xb7ecb183 in start_thread () from /lib/libpthread.so.0
#27 0xb7e23a7e in clone () from /lib/libc.so.6
Am Donnerstag, den 14.06.2007, 17:44 -0700 schrieb Philip Levis:
> On Jun 12, 2007, at 8:57 AM, Philip Levis wrote:
>
> > On Jun 12, 2007, at 5:42 AM, Marek Jawurek wrote:
> >
> >> Well I tried turning the nodes off and on again but I get a
> >> segmentation
> >> fault. So I tried the example c++ Driver from Tutorial 11 to be
> >> able to
> >> use gdb on it.
> >>
> >> I appended the Driver sourcecode with my modifications.
> >>
> >> I compile it with:
> >> g++ -g -c -o ctest.o ctest.cpp\
> >> -I/data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim
> >>
> >> g++ -g -o ctest ctest.o build/micaz/tossim.o build/micaz/sim.o\
> >> build/micaz/c-support.o
> >>
> >>
> >> "gdb ctest" produces:
> >> (gdb) run
> >> Starting program: /data/hiwi/tinyos/tinyos-2.x/apps/ProbFlooding/
> >> ctest
> >>
> >> Program received signal SIGSEGV, Segmentation fault.
> >> 0x00000000 in ?? ()
> >> (gdb) bt
> >> #0 0x00000000 in ?? ()
> >> #1 0x0804bd70 in sim_run_next_event ()
> >> at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/sim_tossim.c:118
> >> #2 0x0804ae67 in Tossim::runNextEvent (this=0x80d3008)
> >> at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/tossim.c:278
> >> #3 0x08049980 in main () at ctevst.cpp:21
> >>
> >>
> >> As I receive dbg output from my program's channel and Tossim dbg
> >> here is
> >> the complete output of ctest (without gdb) http://jawurek.net/
> >> ProbCDUMP
> >> At the end it appears if the sim_ticks var has overrun ?
> >>
> >> Is this now a problem in my program for the nodes or some internal
> >> TOSSIM error ?
> >>
> >> Any help greatly appreciated.
> >>
> >
> > It could be either, but it's more likely TOSSIM. I've never tested
> > trying to reset a simulation. I'll try to reproduce the bug and
> > hopefully the fix(es) will make their way into 2.0.2.
>
> The bug is the following:
>
> TossimPacketModelC statically allocates a TOSSIM event within its
> frame for MAC backoff (this seemed easier than dynamically
> allocating). The problem that occurs is when you reboot a mote, its
> memory is wiped clean to the state it should be at boot: all memory
> is initialized to zero, except variables that have initializers. So
> the event structure is being zeroed out when a node reboots.
>
> The bug occurs when the node is in the midst of MAC backoff. It has a
> MAC backoff event pending in the queue and is rebooted. The event is
> zeroed out, and the function pointers to handle() and cleanup()
> become null (as does the time). When TOSSIM executes the event, it
> hits seg fault.
>
> The easy fix for you is to, rather than turnOff/turnOn, turnOff and
> schedule a bootAtTime in the near future (50ms should be fine). The
> TOSSIM fix for 2.0.2 (which I'm about to check in) is to check that
> the function pointers are non NULL before using them.
>
> Phil
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
Marek Jawurek <[EMAIL PROTECTED]>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help