Spinroot

A forum for Spin users

You are not logged in.

#1 2011-03-30 12:59:54

konnov
Member
Registered: 2011-03-30
Posts: 1

An infinite loop when running pan -C -r in Spin 6.0.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 */",
    "}",

Offline

#2 2011-04-01 18:18:26

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: An infinite loop when running pan -C -r in Spin 6.0.1

wow, that's a fascinating bug -- i believe you're right about the fix.
now i have to scratch my head to figure out how this got written this way in the first place.
thanks for the report -- it'll be fixed in the next release!

Offline

Board footer

Powered by FluxBB