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  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  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  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: NDArrayPool::alloc failing
From: Phil Atkin <[email protected]>
To: [email protected]
Date: Thu, 28 Jul 2016 18:13:38 +0100
In my areaDetector plugin I'm calling this method in one of two ways, depending on a PV value:
  • With pData pointing to a memory buffer that I've allocated and manage myself;
  • With pData null

All seems to work well when operated continuously in either mode, but I see a crash in RtlFreeHeap when I process at least one frame in the first mode, and then switch to the second.  This does not happen if I perform the same sequence of steps but instead of passing the pData to my buffer, I pass null and then copy from my buffer to the output - but this is a large buffer so I'd like to avoid this.

I haven't found anything in the documentation that says as much but I had assumed that, if I pass my own buffer to alloc, NDArrayPool would regard me as its owner and would never try to deallocate it.  (I would also expect it to exclude my buffer's size from its allocation limit calculations, but that's a secondary concern).  However, that appears not to be the case: NDArrayPool::alloc is deciding to free a now-unused NDArray that's pointing to my buffer and so it's calling free(freeArray->pData); that's failing because the memory was allocated in a manner incompatible with free.  NDArray seems to contain nothing that indicates who allocated the buffer, so NDArrayPool cannot reasonably alter its behaviour accordingly.

This behaviour doesn't seem right to me (on general principles) - but maybe I've misunderstood how I'm supposed to use this API?

Thanks,

Phil
--
Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP

Replies:
RE: NDArrayPool::alloc failing Mark Rivers

Navigate by Date:
Prev: Re: EpicsQT and Archiver Appliance Michael Davidsaver
Next: Re: may I start a pcaspy ioc together with a streamdevice ioc? Rod Nussbaumer
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Epics-Digitizer Communication Hulusi Öz
Next: RE: NDArrayPool::alloc failing Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 09 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·