Comment 1 for bug 1824277

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

Tricky issue, not quite as simple as I thought it would be.

I first wrote a regression test program which demonstrates the regression 4 times using a calcout record by putting different strings into its INP* fields and looking at the * and IN*V field values that resulted.

To fix it I created a fix that makes dbAccess.c's dbPutFieldLink() routine call dbAddLink() before the second dbPutSpecial() when the new link type is CONSTANT, PV_LINK or JSON_LINK, instead of lower down. This change fixes the bug, but unfortunately breaks the initialization of the dev*softCallback device supports, because they expect their add_record() routines to be called before dbAddLink() resolves a PV_LINK into either a DB_LINK or CA_LINK (they turn it into a PN_LINK instead).

I can resolve the CONSTANT or JSON_LINK types before the second dbPutSpecial(), but the calcout record's special() routine still notices the difference for DB and CA links because it calculates a new INAV field value, and if that happens before dbAddLink() gets called it's going to give the wrong result for them.

I need to back-port my regression test to 3.15 and 3.14 (or run it by hand) to confirm what broke when before I commit anything.