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  <20182019  2020  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020 
<== Date ==> <== Thread ==>

Subject: Re: Bug in mbbo and mbbi records in Base 7.0
From: "Johnson, Andrew N." <anj@anl.gov>
To: "core-talk@aps.anl.gov" <core-talk@aps.anl.gov>
Date: Mon, 24 Sep 2018 23:07:17 +0000
Hi Mark,

On 09/24/2018 05:59 PM, Mark Rivers wrote:
> Just a heads up that I found there is a bug in the mbbo and mbbi records
> in 7.0 today.  The problem is that one cannot modify the ZRVL through
> FFVL fields at run-time, which is a problem on our beamlines. 
> 
> Andrew found the problem in the special() functions in these records and
> should have a patch soon.

I filed this bug in Launchpad:
  https://bugs.launchpad.net/epics-base/+bug/1794196

The git patch is attached ("git apply filename.patch" should work),
please test and let me know the results.

Thanks,

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon
diff --git a/modules/database/src/std/rec/mbbiRecord.c b/modules/database/src/std/rec/mbbiRecord.c
index d04161d..5995288 100644
--- a/modules/database/src/std/rec/mbbiRecord.c
+++ b/modules/database/src/std/rec/mbbiRecord.c
@@ -217,16 +217,6 @@ static long special(DBADDR *paddr, int after)
 
     switch (paddr->special) {
     case SPC_MOD:
-        if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST) {
-            int event = DBE_PROPERTY;
-
-            if (!after) return 0;
-            init_common(prec);
-            if (prec->val == fieldIndex - mbbiRecordZRST)
-                event |= DBE_VALUE | DBE_LOG;
-            db_post_events(prec, &prec->val, event);
-            return 0;
-        }
         if (fieldIndex == mbbiRecordSIMM) {
             if (!after)
                 recGblSaveSimm(prec->sscn, &prec->oldsimm, prec->simm);
@@ -234,6 +224,20 @@ static long special(DBADDR *paddr, int after)
                 recGblCheckSimm((dbCommon *)prec, &prec->sscn, prec->oldsimm, prec->simm);
             return 0;
         }
+
+        if (!after)
+            return 0;
+        init_common(prec);
+        /* Note: ZRVL..FFVL are also SPC_MOD */
+        if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST) {
+            int event = DBE_PROPERTY;
+
+            if (prec->val == fieldIndex - mbbiRecordZRST)
+                event |= DBE_VALUE | DBE_LOG;
+            db_post_events(prec, &prec->val, event);
+        }
+        return 0;
+
     default:
         recGblDbaddrError(S_db_badChoice, paddr, "mbbi: special");
         return S_db_badChoice;
diff --git a/modules/database/src/std/rec/mbboRecord.c b/modules/database/src/std/rec/mbboRecord.c
index 2e2a35b..e708380 100644
--- a/modules/database/src/std/rec/mbboRecord.c
+++ b/modules/database/src/std/rec/mbboRecord.c
@@ -273,16 +273,6 @@ static long special(DBADDR *paddr, int after)
 
     switch (paddr->special) {
     case SPC_MOD:
-        if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST) {
-            int event = DBE_PROPERTY;
-
-            if (!after) return 0;
-            init_common(prec);
-            if (prec->val == fieldIndex - mbboRecordZRST)
-                event |= DBE_VALUE | DBE_LOG;
-            db_post_events(prec, &prec->val, event);
-            return 0;
-        }
         if (fieldIndex == mbboRecordSIMM) {
             if (!after)
                 recGblSaveSimm(prec->sscn, &prec->oldsimm, prec->simm);
@@ -290,6 +280,20 @@ static long special(DBADDR *paddr, int after)
                 recGblCheckSimm((dbCommon *)prec, &prec->sscn, prec->oldsimm, prec->simm);
             return 0;
         }
+
+        if (!after)
+            return 0;
+        init_common(prec);
+        /* Note: ZRVL..FFVL are also SPC_MOD */
+        if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST) {
+            int event = DBE_PROPERTY;
+
+            if (prec->val == fieldIndex - mbboRecordZRST)
+                event |= DBE_VALUE | DBE_LOG;
+            db_post_events(prec, &prec->val, event);
+        }
+        return 0;
+
     default:
         recGblDbaddrError(S_db_badChoice, paddr, "mbbo: special");
         return S_db_badChoice;

Replies:
RE: Bug in mbbo and mbbi records in Base 7.0 Mark Rivers
References:
Bug in mbbo and mbbi records in Base 7.0 Mark Rivers

Navigate by Date:
Prev: Bug in mbbo and mbbi records in Base 7.0 Mark Rivers
Next: RE: Bug in mbbo and mbbi records in Base 7.0 Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020 
Navigate by Thread:
Prev: Bug in mbbo and mbbi records in Base 7.0 Mark Rivers
Next: RE: Bug in mbbo and mbbi records in Base 7.0 Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020 
ANJ, 24 Sep 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·