Comment 12 for bug 1882520

Revision history for this message
Andrew Johnson (anj) wrote :

tux% cat bad.db
record(ai, "") {
  field(DESC, "Test")
}
tux% softIoc -d bad.db dbLoadDatabase("/home/phoebus4/ANJ/epics/base/7.0/bin/linux-x86_64/../../dbd/softIoc.dbd")
softIoc_registerRecordDeviceDriver(pdbbase)
Error: dbRecordHead: Record name can't be empty
 at or before ")" in path "." file "bad.db" line 1
Error: syntax error
dbLoadRecords: failed to load 'bad.db'
Error: Failed to load: bad.db

tux% cat bad.db
record(ai, "a b") {
  field(DESC, "Test")
}
record(ai, "a.b") {
  field(DESC, "Test")
}
record(ai, "a$b") {
  field(DESC, "Test")
}
record(ai, "a\"b") {
  field(DESC, "Test")
}
tux% softIoc -d bad.db
dbLoadDatabase("/home/phoebus4/ANJ/epics/base/7.0/bin/linux-x86_64/../../dbd/softIoc.dbd")
softIoc_registerRecordDeviceDriver(pdbbase)
Bad character ' ' in record name "a b"
Bad character '.' in record name "a.b"
Bad character '$' in record name "a$b"
Bad character '"' in record name "a\"b"
dbLoadRecords("bad.db")
iocInit()
Starting iocInit
############################################################################
## EPICS R7.0.3.2-DEV
## Rev. R7.0.3.1-294-g75a3442669af831d8a6b
############################################################################
iocRun: All initialization complete
epics> dbl
a b
a.b
a$b
a\"b

The fact that the messages are printed before the command that caused them is a feature of the new version of softIoc, but all those record names do actually generate an error message when you load them. I did that instead of erroring out because we didn't used to reject such names, and as you have noticed some of those characters do work in some situations.

Note that if I had been strict about checking names the BNL naming convention that includes {} characters inside record names would have been prohibited. As it is since we added JSON link types records cannot be named "{something}", and the brace characters have not been added to the documented list of legal record name characters.

I'm not in favor of our getting too strict about record names too quickly.