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] [NEW] 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: Tue, 26 Jul 2022 13:58:47 -0000
Public bug reported:

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.

** Affects: epics-base
     Importance: Undecided
         Status: New

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


Replies:
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" mdavidsaver via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Andrew Johnson via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" mdavidsaver via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk
[Bug 1982847] Re: cryptic error message "parse error: premature EOF" Dirk Zimoch via Core-talk

Navigate by Date:
Prev: [Bug 1982817] Re: epicsNtp.c leaks file descriptors Chris Johns 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 1982817] Re: epicsNtp.c leaks file descriptors Chris Johns 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 ·