EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Sequencer bug?
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Wed, 24 Feb 2010 12:11:03 +0100
Hello,

here is a trivial SNL program I wrote in order to reproduce a misbehaviour 
that occurs once in a while in one of our production state machines.

Two state sets communicate via a state variable "x" which is assigned to a 
bo record and monitored by the program. The master sets x to one, then waits 
for the slave to reset it to zero. The slave waits for x to become one, then 
resets it to zero. This all happens in an infinite loop.

Since there is only one place where x gets set to one (in the master), and 
one place where it gets reset to zero (in the slave), the assertions in the 
calls to check() should never fail.

Your IOC should load this simple database:

  record(bo,"x") {
  }

and this sequencer program:

program SeqTest

%{
#include <assert.h>

static int check(x) {
    assert(x);
    return 1;
}
}%

int done = 0;
int start = 1;

int x;
assign x to "x";
monitor x;

ss Master {
    state idle {
        when (check(!x)) {
            printf("Master: work\n");
        } state work
    }
    state work {
        entry {
            printf("Master: start slave\n");
            x = start;
            pvPut(x);
        }
        when (!x) {
            printf("Master: slave finished\n");
        } state idle
    }
}

ss Slave {
    state idle {
        when (x) {
            printf("Slave: start work\n");
        } state work
    }
    state work {
        entry {
            printf("Slave: enter state work\n");
        }
        when (check(x)) {
            printf("Slave: work done\n");
            x = done;
            pvPut(x);
        } state idle
    }
}


In my tests, the IOC will run for a while but inevitably crash with

STESTIOC1C: ../seqtest.st:7: test: Assertion `x' failed.
[1]    8507 abort      ./st.cmd

This looks like a bug in the sequencer to me. I am testing with 
base-3.14.8.2 and seq-2.0.12.

(BTW, changing the pvPut calls to SYNC makes no difference.)

Cheers
Ben
-- 
"...And you know what incurable diseases do: they invite the quacks and 
charlatans in, who in this case take the form of Software Engineering 
gurus." (Dijkstra, EWD1305)

Replies:
Re: Sequencer bug? Benjamin Franksen

Navigate by Date:
Prev: Problem Installing EDM Hiren Patel
Next: Re: Sequencer bug? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Problem Installing EDM Hiren Patel
Next: Re: Sequencer bug? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·