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

Subject: [Bug 1982847] Re: cryptic error message "parse error: premature EOF"
From: Dirk Zimoch via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Thu, 28 Jul 2022 07:03:30 -0000
These are some error messages:
dbConvertJSON: Null objects not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                   [null]
                     (right here) ------^
... while parsing link lsi4.INP
dbConvertJSON: Boolean not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                   [true]
                     (right here) ------^
... while parsing link lsi5.INP
dbConvertJSON: Embedded arrays not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                      [[]]
                     (right here) ------^
... while parsing link lsi7.INP
dbConvertJSON: Map type not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                      [{}]
                     (right here) ------^
... while parsing link lsi8.INP
dbConvertJSON: Embedded arrays not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                      [[]]
                     (right here) ------^
... while parsing link w5.INP
dbConvertJSON: Map type not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                      [{a:1}]
                     (right here) ------^
... while parsing link w6.INP
dbConvertJSON: Boolean not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                               [0,1,true,false,4]
                     (right here) ------^
... while parsing link w7.INP
dbConvertJSON: Boolean not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                  [false,null,"text",0,1,true]
                     (right here) ------^
... while parsing link w8.INP
dbConvertJSON: Null objects not supported
dbConvertJSON: parse error: client cancelled parse via callback return value
                                   [null]
                     (right here) ------^
... while parsing link w9.INP
dbConvertJSON: String "text" provided, numeric value expected
dbConvertJSON: parse error: client cancelled parse via callback return value
                                 ["text"]
                     (right here) ------^
... while parsing link w10.INP

-- 
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/1982847

Title:
  cryptic error message "parse error: premature EOF"

Status in EPICS Base:
  New

Bug description:
  In EPICS 7, if an array input link (e.g. waveform.INP) is an explicit
  empty string, the parser prints a cryptic message without any helpful
  context.

  Example:
  record(waveform, "x")
  {
      field(INP, "")
  }

  
  dbConvertJSON: parse error: premature EOF
                                         
                       (right here) ------^

  Not very enlightening.

  It does not happen if INP is not set at all and it does not happen at least up to R3.16.1 but at least since 7.0.4.1 (I have not tested anything in between) and up to commit d82ab81.
  It also does not happen with scalar input links (e.g. ai.INP).

  First of all, any parser error should print a context (I prefer record.field) similar to this:
  dbConvertJSON: parse error: premature EOF in x.INP

  Unfortunately, dbPutConvertJSON (the function printing the
  dbConvertJSON message) does not have the context. All it has is the
  string. So maybe it should not print the message at all but leave it
  to the caller. The only callers are in dbConstLink.c. The interface
  should be modified to pass either the context (plink instead of
  plink->value.constantStr) or the error message (which is complicated)
  or an additional message should be printed by the outer context
  (difficult to find out when dbPutConvertJSON actually printed an error
  message).

  Second, passing "" should not result in an error at all.

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


References:
[Bug 1982847] [NEW] cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk

Navigate by Date:
Prev: [Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
Next: [Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: [Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
Next: [Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·