EPICS Home

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: Re: Tektronic Scope DPO7254 over VXI-11 crashes IOC
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Fri, 19 Mar 2010 12:34:22 +0100
On Wednesday 17 March 2010, Benjamin Franksen wrote:
> On Wednesday 17 March 2010, Benjamin Franksen wrote:
> > I'm trying to talk to the mentioned scope via asyn/stream and get
> >  mysterious crashes the first time the IOC tries to communicate over
> > the link. Below is a trace of the IOC shell up to the crash. I am using
> > the latest and greatest versions of everything except EPICS base:
> > base-3.14.8.2, asyn-4.11a (supposedly the last version that works with
> > base-3.14.8), StreamDevice-2- snapshot20081007. The crash happens on
> > the latest ubuntu version as well as on a debian stable system. I
> > should point out that with the exact same setup I can talk fine with
> > e.g. a GPIB controller.
> 
> Ok I did dome more research. GÃtz suggested valgrind and indeed I got
> interesting results:
> 
> (1) When I run the IOC under valgrind it doesn't crash, it even talks to
>  the device. Nice.
> 
> (2) Valgrind complains about StreamDevice doing "Mismatched free() /
>  delete / delete []". See below for a transcript.
> 
> My current theory is that these mismatched calls cause the memory free
>  list to become corrupted. Note that VXI-11 is based on RPC which heavily
>  uses malloc/free internally during runtime, so there is some probability
>  that a corrupted free list will lead to a crash inside the RPC library.

I had to abandon this theory. I managed to fix the mismatched delete calls 
(so that valgrind no longer complained) but it did not fix anything. No 
wonder, the calls where valgrind wants a 'delete[]' instead of just 'delete' 
are for an array of chars. No destructor for type char, so this should not 
matter at all and indeed it doesn't.

Still, IOC works under valgrind, but crashes without.

I tried electric-fence but this tool just makes any soft IOC crash almost 
immediately.

Then I removed the call to vxiCreateIrqChannel from vxiConnectPort (in file 
drvVxi11.c). This finally let the IOC run without crashing.

So, it seems, streamDevice is innocent, after all. There must be something 
wrong (no idea what, exactly) with the vxi-11 SRQ implementation in asyn.

Cheers
Ben


Replies:
Bug in asyn and patch [was: Tektronic Scope DPO7254 over VXI-11 crashes IOC] Benjamin Franksen
Re: Tektronic Scope DPO7254 over VXI-11 crashes IOC Eric Norum
References:
Tektronic Scope DPO7254 over VXI-11 crashes IOC Benjamin Franksen
Re: Tektronic Scope DPO7254 over VXI-11 crashes IOC Benjamin Franksen

Navigate by Date:
Prev: EPICS support for PI C-867 motor controller Rau, Steffen
Next: Bug in asyn and patch [was: Tektronic Scope DPO7254 over VXI-11 crashes IOC] 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: Re: Tektronic Scope DPO7254 over VXI-11 crashes IOC Benjamin Franksen
Next: Bug in asyn and patch [was: Tektronic Scope DPO7254 over VXI-11 crashes IOC] 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