info field may be bound to alias instead of record
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
EPICS Base | Status tracked in 7.0 | |||||
3.14 |
Won't Fix
|
Undecided
|
Unassigned | |||
3.15 |
Fix Released
|
Undecided
|
Unassigned | |||
3.16 |
Fix Released
|
Undecided
|
Unassigned | |||
7.0 |
Fix Released
|
Undecided
|
Andrew Johnson |
Bug Description
In a record like this (modified dbStaticTest.db)
record(x, "testrec") {
alias(
info("A", "B")
}
The info field "A" is not bound to the record "testrec" but to the alias "testalias".
This modification (swap order of alias and info) makes the dbStaticTest fail.
The reason is that the dbCreateAlias function overwrites the DBENTRY which is passed by reference. Thus any info() after alias() is bound to the most recent alias name.
The attached patch (for 3.16) contains the modification to dbStaticTest.db which makes the test fail as well as the fix of dbCreateAlias which makes the test succeed again.
I noticed this when adding info access in https:/
Changed in epics-base: | |
status: | New → In Progress |
assignee: | nobody → Andrew Johnson (anj) |
I can replicate this problem and your fix works fine, but it's doing a bit more work than it actually needs to. I'm going to commit a streamlined (and cleaned up) version of dbCreateAlias() to the 3.15 branch and merge it up (there were other changes to it between 3.14 and 3.15 that I just decided I don't want to deal with).
Note that the dbStaticTest.db file only exists on the 3.16 branch, and I don't want to add it during the merge up from 3.15, so the automated test will only appear when we merge your info_fields branch. My changes to dbCreateAlias() will conflict with yours in that branch, but I will correct that during the merge (the Merge Request will probably start to show a conflict, which you can ignore).
I wonder if we'll ever find a use for creating an info field on an alias? With this fix there shouldn't be any way to create one from a .db file, but it will still be possible.