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

Subject: [Bug 2029482] Re: pvget json error
From: Andrew Johnson via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Mon, 07 Aug 2023 18:42:56 -0000
Does that work okay for you though?

Quotes are optional in JSON-5 for map keys that meet the requirements
for an identifier, so the yajl generator checks map keys and only uses
quotes when they're needed. A JSON-5 parser that accepts NaN values
should also accept unquoted keys. An older JSON parser would not allow
them, but then it should also reject Infinity and NaN as numeric values.

I did suggest in my GitHub PR the alternative solution of providing a
separate "-M json5" mode, but that idea would require rather more work.
If unquoted keys are a problem though I would raise that suggestion
again and also have the strict JSON generator convert NaN and Infinity
values into strings.

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/2029482

Title:
  pvget json error

Status in EPICS Base:
  Fix Committed
Status in EPICS Base 7.0 series:
  Fix Committed

Bug description:
  I’ve been using `pvget -M json` and have noticed a problem with it
  when the PV has the alarm fields set like so:

  double lowAlarmLimit nan
  double lowWarningLimit nan
  double highWarningLimit nan
  double highAlarmLimit nan

  When I run pvget I get the following:

  > pvget -M json IOC:m1.RBV
  IOC:m1.RBV {"value":88.129999999999995,"alarm":{"severity":0,"status":0,"message":"NO_ALARM"},"timeStamp":{"secondsPastEpoch":1691063460,"nanoseconds":182366000,"userTag":0},"display":{"limitLow":-100.0,"limitHigh":100.0,"description":"motor 1","units":"degrees","precision":5,"form":{"index":0,"choices":["Default","String","Binary","Decimal","Hex","Exponential","Engineering"]}},"control":{"limitLow":-100.0,"limitHigh":100.0,"minStep":0.0},"valueAlarm":{"active":false,"lowAlarmLimit"Error in monitor handler : yajl_gen_invalid_number

  It looks like YAJL doesn’t like the nan values. If I set them to non-
  nan values then the error goes away.

  This is with base 7.0.7.

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/2029482/+subscriptions


References:
[Bug 2029482] [NEW] pvget json error Matt Clarke via Core-talk

Navigate by Date:
Prev: [Bug 2029482] Re: pvget json error Matt Clarke via Core-talk
Next: [Bug 2029482] Re: pvget json error Matt Clarke via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: [Bug 2029482] Re: pvget json error Matt Clarke via Core-talk
Next: [Bug 2029482] Re: pvget json error Matt Clarke via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 08 Aug 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·