On the provided input files, I run the project as a Java App and then get back a SmartThings0.prom
file as expected. I don't append any additional LTL properties to the file. Then I do the following:
spin -search -DVECTORSZ=36736 -DSAFETY -DBITSTATE -E -NOBOUNDCHECK -NOFAIR -NOCOMP -n -w36 SmartThings0.prom
pan.c: In function ‘wrap_stats’:
pan.c:11875:9: warning: too many arguments for format [-Wformat-extra-args]
printf("random seed used: 0\n", (uint) (s_rand-1));
^~~~~~~~~~~~~~~~~~~~~~~
pan.c: In function ‘make_trail’:
pan.c:5851:19: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 512 [-Wformat-overflow=]
sprintf(fnm, "%s%d.%s",
^~
pan.c:5851:16: note: directive argument in the range [1, 2147483647]
sprintf(fnm, "%s%d.%s",
^~~~~~~~~
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 3 or more bytes (assuming 523) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5859:22: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf(fnm, "%s.%s", MyFile, tprefix);
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 513) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5866:21: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 512 [-Wformat-overflow=]
sprintf(fnm, "%s%d.%s",
^~
pan.c:5866:18: note: directive argument in the range [1, 2147483646]
sprintf(fnm, "%s%d.%s",
^~~~~~~~~
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 3 or more bytes (assuming 523) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5869:24: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf(fnm, "%s.%s", MyFile, tprefix);
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 513) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c: In function ‘findtrail’:
pan.c:5466:22: warning: ‘%s’ directive writing 5 bytes into a region of size between 0 and 511 [-Wformat-overflow=]
pan.c:5438:12:
tprefix = "trail";
~~~~~~~
pan.c:5466:22:
{ sprintf(fnm, "%s.%s", MyFile, tprefix);
^~
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 518 bytes into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5477:24: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf(fnm, "%s.%s", MyFile, tprefix);
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 513) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5442:23: warning: ‘.’ directive writing 1 byte into a region of size between 0 and 511 [-Wformat-overflow=]
{ sprintf(fnm, "%s%d.%s",
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 8 and 529 bytes into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5454:23: warning: ‘.’ directive writing 1 byte into a region of size between 0 and 511 [-Wformat-overflow=]
sprintf(fnm, "%s%d.%s",
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 3 or more bytes (assuming 514) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5516:21: warning: ‘%s’ directive writing 5 bytes into a region of size between 0 and 511 [-Wformat-overflow=]
pan.c:5503:12:
tprefix = "trail";
~~~~~~~
pan.c:5516:21:
{ sprintf(fnm, "%s.%s", MyFile, tprefix);
^~
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 518 bytes into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5520:23: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf(fnm, "%s.%s", MyFile, tprefix);
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 513) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5506:22: warning: ‘.’ directive writing 1 byte into a region of size between 0 and 511 [-Wformat-overflow=]
{ sprintf(fnm, "%s%d.%s", MyFile, whichtrail, tprefix);
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 8 and 529 bytes into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pan.c:5510:22: warning: ‘.’ directive writing 1 byte into a region of size between 0 and 511 [-Wformat-overflow=]
sprintf(fnm, "%s%d.%s",
^
In file included from /usr/include/stdio.h:873,
from pan.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 3 or more bytes (assuming 514) into a destination of size 512
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: only one claim defined, -N ignored
warning: only one claim defined, -N ignored
warning: only one claim defined, -N ignored
(Spin Version 6.4.6 -- 2 December 2016)
+ Partial Order Reduction
Bit statespace search for:
never claim - (none specified)
assertion violations +
cycle checks - (disabled by -DSAFETY)
invalid end states - (disabled by -E flag)
State-vector 10920 byte, depth reached 1753, errors: 0
659442 states, stored
3150 states, matched
662592 transitions (= stored+matched)
496053 atomic steps
hash factor: 104209 (best if > 100.)
bits set per state: 3 (-k3)
Stats on memory usage (in Megabytes):
6880.088 equivalent memory usage for states (stored*(State-vector + overhead))
8192.000 memory used for hash array (-w36)
0.076 memory used for bit stack
0.534 memory used for DFS stack (-m10000)
10.921 other (proc and chan stacks)
2.482 memory lost to fragmentation
8206.014 total actual memory usage
pan: elapsed time 12.4 seconds
pan: rate 53266.721 states/second
Right away, I notice the error or warning or whatever appears to be similar to the one shown in the screenshot in the README. Then, still following the directions, I run:
spin -p -replay SmartThings0.prom > log.txt
using statement merging
spin: trail ends after -4 steps
#processes: 1
doorLock_STLock = 0
tomPresence_STPresSensor = 0
frontDoorSensor_STMotionSensor = 0
livingRoomBulb_STSwitch = 0
bedRoomBulb_STSwitch = 0
livingRoomSensor_STMotionSensor = 0
bedRoomSensor_STMotionSensor = 0
bedRoomDoor_STContactSensor = 0
_g_STLockArr.length = 0
_g_STLockArr.element[0].id = 0
_g_STLockArr.element[0].gArrIndex = 0
_g_STLockArr.element[0].events.length = 0
_g_STLockArr.element[0].events.element[0].name = 0
_g_STLockArr.element[0].events.element[0].value = 0
_g_STLockArr.element[0].events.element[0].physical = 0
_g_STLockArr.element[0].events.element[0].deviceId = 0
_g_STLockArr.element[0].events.element[0].date = 0
_g_STLockArr.element[0].events.element[0].id = 0
_g_STLockArr.element[0].events.element[0].unit = 0
_g_STLockArr.element[0].events.element[0].type = 0
_g_STLockArr.element[0].events.element[0].isAlive = 0
_g_STLockArr.element[0].events.element[0].EvtType = 0
_g_STLockArr.element[0].events.element[1].name = 0
_g_STLockArr.element[0].events.element[1].value = 0
_g_STLockArr.element[0].events.element[1].physical = 0
_g_STLockArr.element[0].events.element[1].deviceId = 0
_g_STLockArr.element[0].events.element[1].date = 0
etc etc etc
grep -v 'allEvtsHandled' log.txt | grep -v 'generatedEvent.EvtType = g_' | grep -E 'generatedEvent.EvtType =|ST_Command.EvtType =|BroadcastChans|Handle|assert|location.mode' > filterLog.txt
_g_STLockArr.element[0].BroadcastChans[0] = 0
_g_STLockArr.element[0].BroadcastChans[1] = 0
_g_STLockArr.element[0].BroadcastChans[2] = 0
_g_STLockArr.element[0].BroadcastChans[3] = 0
_g_STLockArr.element[0].BroadcastChans[4] = 0
_g_STLockArr.element[0].BroadcastChans[5] = 0
_g_STLockArr.element[0].BroadcastChans[6] = 0
_g_STLockArr.element[0].BroadcastChans[7] = 0
_g_STLockArr.element[0].BroadcastChans[8] = 0
_g_STLockArr.element[0].BroadcastChans[9] = 0
_g_STLockArr.element[1].BroadcastChans[0] = 0
_g_STLockArr.element[1].BroadcastChans[1] = 0
_g_STLockArr.element[1].BroadcastChans[2] = 0
_g_STLockArr.element[1].BroadcastChans[3] = 0
_g_STLockArr.element[1].BroadcastChans[4] = 0
_g_STLockArr.element[1].BroadcastChans[5] = 0
etc etc etc
.... is that an error was thrown in the process of compiling the c code with Spin, which has something to do with that line of code that is shown as erroneous in the screenshot and also shown in the errors I showed above. As a result, this trail
file didn't come out as expected, so the logs didn't come out as expected, so I ended up with garbage output.
Do you have any recommendations/ideas for how to fix my code/setup/dependencies/etc. so that Spin successfully runs the specification output?