>>>>> "William" == William Lupton <[email protected]> writes:
>>>>> "Benjamin" == Benjamin Franksen <[email protected]> writes:
William> Ben, You wrote:
Benjamin>> I have a problem with the State Notation Compiler...
William> Which version? Your example seems to compile fine with the
William> R3.13.0Beta11 version of the sequencer.
Hi,
I managed to get the snc source-code into ObjectCenter, and ObjectCenter
came to the conclusion that when compiling Benjamin's state-machine the snc
performs a "write past end of allocated array".
The exact position and error-message was:
FILE: sequencer/gen_tables.c
LINE: 462
FUNCTION: eval_event_mask
Illegal array index 2 into allocated data at <0x...>.
Maximum array index is 1.
it's the line
462: bitSet(pEventWords, cp->index + num_events + 1);
whith cp->index set to 58 and
num_events set to 5
So the bit-number evaluates to 64, which is *not* in the 2 allocated
words. Allocation is performed in line 215 of the same file
214: numEventWords = (num_events + num_channels + NBITS - 1)/NBITS;
215: pEventMask = (bitMask *)calloc(numEventWords, sizeof (bitMask));
where num_events is 6
num_channels is 58 and
NBITS is 32
Why is there a 1 added to the bitno in line 462? Is bit 0 used for special
purpose? If so, the number of used bits should be incremented in line 214.
So I applied the following patch to our snc:
--- gen_tables.c.ORIG Wed Mar 11 15:05:44 1998
+++ gen_tables.c Wed Mar 11 15:24:26 1998
@@ -211,7 +211,7 @@
/* Allocate an array for event mask bits */
- numEventWords = (num_events + num_channels + NBITS - 1)/NBITS;
+ numEventWords = (num_events + num_channels + NBITS)/NBITS;
pEventMask = (bitMask *)calloc(numEventWords, sizeof (bitMask));
/* for all state sets ... */
The .c-files produced by snc are identical in the case the "old" snc (we're
still talking about beta11) doesn't crash. And the "new" snc doesn't crash
with Benjamin's state-machine.
So long,
Thomas
--
_______________________________________________________________________________
/homas Birke BESSY II (+49)-30-6392-4934 (fax -4859) [email protected]
- References:
- Re: SNC crashes William Lupton
- Navigate by Date:
- Prev:
Re: Greenspring rs422 support Peregrine M. McGehee
- Next:
RE: Proposal for boosted Symb device support Jeff Hill
- Index:
1994
1995
1996
1997
<1998>
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: SNC crashes William Lupton
- Next:
Re: SNC crashes William Lupton
- Index:
1994
1995
1996
1997
<1998>
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|