EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [Merge] ~bfrk/epics-base:zero-size-array-request into epics-base:7.0
From: Ben Franksen via Core-talk <core-talk at aps.anl.gov>
To: mp+381308 at code.launchpad.net
Date: Mon, 30 Mar 2020 06:45:48 -0000
I did that and found three commits that added these lines, see below. None of them explains /why/ it is deemed necessary to save and restore the pfield member.

I still think this is redundant. If record support is free to swap out the pfield when we call get_array_info, then accessing (dereferencing) the original pfield potentially accesses invalid memory and must be regarded as incorrect.

commit 4f6040d35b936c60e4e4f35f0d07307251490941
Author: Michael Davidsaver <mdavidsaver at bnl.gov>
Date:   Wed Jan 23 10:38:30 2013 -0500

    get_array_info() can modifiy DBADDR::pfield
    
    Allow the record support function get_array_info()
    to modify its first argument to provide a different
    pointer from which values should be read.
    
    Remember the original and restore it afterwards.

commit 3bb8536494e536faa9db54dccef31126b06d6465
Author: Michael Davidsaver <mdavidsaver at bnl.gov>
Date:   Mon Sep 15 11:42:38 2014 -0400

    dbAccess: dbPut() handle changing BPTR
    
    Forgot to update dbPut(), oops...

commit 62efa2e96a4145e79c6c3032172ce39d57bb0c3f
Author: Andrew Johnson <anj at aps.anl.gov>
Date:   Thu Feb 25 17:50:33 2016 -0600

    Fix the dbGet() array with field-log bug.
    
    This also fixes a problem where the array is used in circular buffer
    mode and the request has an offset, but the array is not actually
    full at the time; to copy the data out of the array the convert()
    routine needs to know the capacity of the array to know when to wrap
    around, but we were passing it the current length instead.

(BTW. The comment in the commit was helpful to explain how circular buffer mode works. I previously thought it wraps at the current number of elements.)
-- 
https://code.launchpad.net/~bfrk/epics-base/+git/epics-base/+merge/381308
Your team EPICS Core Developers is requested to review the proposed merge of ~bfrk/epics-base:zero-size-array-request into epics-base:7.0.

References:
[Merge] ~bfrk/epics-base:zero-size-array-request into epics-base:7.0 Ben Franksen via Core-talk

Navigate by Date:
Prev: Re: double filters Johnson, Andrew N. via Core-talk
Next: Re: [Merge] ~bfrk/epics-base:zero-size-array-request into epics-base:7.0 mdavidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [Merge] ~bfrk/epics-base:zero-size-array-request into epics-base:7.0 Ben Franksen via Core-talk
Next: Re: [Merge] ~bfrk/epics-base:zero-size-array-request into epics-base:7.0 mdavidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 30 Mar 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·