EPICS Home

Experimental Physics and Industrial Control System


 
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  <20192020  2021  2022  2023  2024  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  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Segmentation fault when Record Processing in StreamDevice
From: Donny Domagoj Cosic via Tech-talk <[email protected]>
To: [email protected]
Date: Mon, 11 Nov 2019 10:48:36 +0100
Hi,

I have an IOC to read data from a radiation monitor that continuously send out data, however every so often the device sends out a header which is formatted differently and this is causing a Segmentation fault and crashing the IOC.

The output from the probe:

??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
<\f>User File Number:          1<\r>
<\r>
  Date     Time    M.Time       A           B    <\r>
                    min       uSv/h       uSv/h  <\r>
--------------------------------------------------<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>


My DB file:

record (ai, "RAD:P10Probe1")
{
	field(DTYP, "stream")
	field(INP, "@rad.proto getProbe1(RAD:message) PORT10")
	field(SCAN, "I/O Intr")
	field(HIHI, "10.0")
	field(HIGH, "1.0")
	field(HHSV, "MAJOR")
	field(HSV, "MINOR")
	field(LOPR, "0")
	field(EGU, "uS/hr")
}

record (ai, "RAD:P10Probe2")
{
	field(DTYP, "stream")
	field(INP, "@rad.proto getProbe2(RAD:message) PORT10")
	field(SCAN, "I/O Intr")
	field(HIHI, "10.0")
	field(HIGH, "1.0")
	field(HHSV, "MAJOR")
	field(HSV, "MINOR")
	field(LOPR, "0")
	field(EGU, "uS/hr")
}

My proto file:

Terminator = CR;

getProbe1
{
  in "%*8s\_%*8s\_%*f\_%f(%*d)\_%*f(%*d)";
  ExtraInput = Ignore;
  @mismatch
  {
    in "%(\$1)52c";
  }

}

getProbe2
{
  in "%*8s\_%*8s\_%*f\_%*f(%*d)\_%f(%*d)";
  ExtraInput = Ignore;
  @mismatch
  {
    in "%(\$1)52c";
  }

}

I noticed that when the header is received, the mismatch exception handler is not triggered, but this might because the SCAN field is set to "I/O Intr" as the data rate depends on the dose measured at the probe. Why would this reading error cause a Segmentation Error and crash the IOC? Is there any other way read the string from the probe?

Thank you in advance for you time,

Regards,
Donny

--
Donny Domagoj Cosic
 Institut Ruđer Bošković, Bijenička cesta 54, 10000 Zagreb, Croatia

Replies:
RE: Segmentation fault when Record Processing in StreamDevice Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Linux DMA driver and device support for Xilinx FPGA Hinko Kocevar via Tech-talk
Next: Re: Linux DMA driver and device support for Xilinx FPGA Cobb, Tom (DLSLtd,RAL,LSCI) via Tech-talk
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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: using stream failed =?gb18030?b?t+fQ0Muu?= via Tech-talk
Next: RE: Segmentation fault when Record Processing in StreamDevice Mark Rivers via Tech-talk
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  <20192020  2021  2022  2023  2024