Spinroot

A forum for Spin users

You are not logged in.

#1 Bug Reports » An infinite loop when running pan -C -r in Spin 6.0.1 » 2011-03-30 12:59:54

konnov
Replies: 1

It looks like spin 6.0.1 produces pan, which loops infinitely after reading a trail.

Try this:

spin -a pathfinder.pml
gcc -o pan pan.c
./pan
./pan -C -r

It prints the trail and then it just heats CPU. According to gdb the problem is in pangen1.h:390:

    "char *",
    "find_source(int tp, int s)",
    "{  int i;",
    "   for (i = 0; flref[tp]->fnm; i++)",
    "   {   if (s >= flref[tp]->from",                                          
    "       &&  s <= flref[tp]->upto)",
    "       {   return flref[tp]->fnm;",
    "   }   }",
    "   return PanSource; /* i.e., don't know */",
    "}",

Should it be fixed like that?

    "char *",
    "find_source(int tp, int s)",
    "{",
    "   if (s >= flref[tp]->from",                                          
    "       &&  s <= flref[tp]->upto)",
    "   {   return flref[tp]->fnm;",
    "   }",
    "   return PanSource; /* i.e., don't know */",
    "}",

Board footer

Powered by FluxBB