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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: writing to aao crashes ioc |
From: | Eric Bjorklund <[email protected]> |
To: | EPICS tech-talk <[email protected]> |
Date: | Tue, 20 Apr 2010 11:29:58 -0600 |
Hi Dirk,
Now that Ben pointed this out, it rang a bell.
This probably does not help in any way, but almost exactly ten years
ago there was a discussion thread about aao record in tech-talk, starting from:
http://www.aps.anl.gov/epics/tech-talk/2000/msg00310.php
I thought however that these issues (memory allocation, etc) would have been solved already
a long time ago....
If I remember correctly, at that time I assumed Eric (Bjorklund) would do the changes,
he probably expected that I do and we never cross-checked. :-(
best regards,
Timo
Benjamin Franksen wrote:On Tuesday 20 April 2010, Dirk Zimoch wrote:
Tim Mooney wrote:
Hi Tim.Dirk, I was seeing something similar (though in 3.14.11), and "dbpr <recordname>,5" showed "DTYP: <nil>", until I added the line device(aao,CONSTANT,devAaoSoft,"Soft Channel") to the .dbd file.
That is not the problem: DTYP: Soft Channel
The ioc also crashes when the aao record is not processed! Thus DTYP cannot be the problem.
I believe the aao record support is at fault.
The problem is that it does not allocate bptr itself but leaves this to device support. However, when device support's init_record method is called, it is too late. Because by then links have already been initialized, thus cvt_db_addr has been called, which sets the field address to bptr, i.e. NULL.
This explains why regular puts work but puts via db links lead to a crash. If you dbpf from the ioc shell or do caput, the cvt_db_addr gets called and since this is after device support init, bptr will contain a valid pointer to the array.
You could verify my theory by issuing a 'caput aao1.OUT aao2'. After this, the IOC should not crash when processing aao1. It shoudl still crash when processing ao1, until you re-initialize thits OUT link, too.
Solution: Fix aao (and probably aai) record support to either allocate bptr itself or else call device support's init_record during the first pass of record support initialization.
Cheers Ben
--
Timo Korhonen PSI (Paul Scherrer Institut, http:// www.psi.ch) CH-5232 Villigen PSI tel + 41- 56 3103262 fax + 41 - 56 310 5090 e-mail: [email protected]
<><><><><><><><><><><><><><><><><><><><><><><><><><><><> Eric Björklund Los Alamos Neutron Science Center (LANSCE)