Compress record FIFO/LIFO not working
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
EPICS Base | Status tracked in 7.0 | |||||
3.16 |
Fix Released
|
Undecided
|
Ralph Lange | |||
7.0 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Reported by Daniel Schick <daniel.
I am currently using epics base 3.16.1 and I have a problem with the compress record used as ring buffer.
In both, Epics 3.16.1 and 7.0 the update of the ring buffer is not FIFO or LIFO but happens somewhere in the middle of the array.
When I use the latest 3.15 branch everything works fine.
Here is an example of my test db-file and the output from camonitor:
record(
field(
field(SCAN,"1 second")
}
record(
field(DESC, "test")
field(NSAM,"10")
field(
field(
field(SCAN,"1 second")
field(BALG,"LIFO")
field(PREC,"1")
}
with epics 3.15 it is fine:
~ $ camonitor ring
ring *** Not connected (PV not found)
ring 2018-01-08 12:55:16.628324 8 0 1 2 3 4 5 6 7
ring 2018-01-08 12:55:17.628331 9 0 1 2 3 4 5 6 7 8
ring 2018-01-08 12:55:18.628323 10 0 1 2 3 4 5 6 7 8 9
ring 2018-01-08 12:55:19.628330 10 1 2 3 4 5 6 7 8 9 10
ring 2018-01-08 12:55:20.628326 10 2 3 4 5 6 7 8 9 10 11
ring 2018-01-08 12:55:21.628331 10 3 4 5 6 7 8 9 10 11 12
ring 2018-01-08 12:55:22.628327 10 4 5 6 7 8 9 10 11 12 13
ring 2018-01-08 12:55:23.628324 10 5 6 7 8 9 10 11 12 13 14
ring 2018-01-08 12:55:24.628325 10 6 7 8 9 10 11 12 13 14 15
ring 2018-01-08 12:55:25.628332 10 7 8 9 10 11 12 13 14 15 16
ring 2018-01-08 12:55:26.628326 10 8 9 10 11 12 13 14 15 16 17
ring 2018-01-08 12:55:27.628330 10 9 10 11 12 13 14 15 16 17 18
ring 2018-01-08 12:55:28.628323 10 10 11 12 13 14 15 16 17 18 19
ring 2018-01-08 12:55:29.628325 10 11 12 13 14 15 16 17 18 19 20
ring 2018-01-08 12:55:30.628327 10 12 13 14 15 16 17 18 19 20 21
ring 2018-01-08 12:55:31.628331 10 13 14 15 16 17 18 19 20 21 22
ring 2018-01-08 12:55:32.628327 10 14 15 16 17 18 19 20 21 22 23
with epics 3.16 and 7.0 I get the weird update behaviour:
~ $ camonitor ring
ring *** Not connected (PV not found)
ring 2018-01-08 14:23:50.889595 2 0 1
ring 2018-01-08 14:23:51.889598 3 0 1 2
ring 2018-01-08 14:23:52.889594 4 0 1 2 3
ring 2018-01-08 14:23:53.889596 5 0 1 2 3 4
ring 2018-01-08 14:23:54.889603 6 0 1 2 3 4 5
ring 2018-01-08 14:23:55.889601 7 0 1 2 3 4 5 6
ring 2018-01-08 14:23:56.889594 8 0 1 2 3 4 5 6 7
ring 2018-01-08 14:23:57.889598 9 0 1 2 3 4 5 6 7 8
ring 2018-01-08 14:23:58.889592 10 6 7 8 9 0 1 2 3 4 5
ring 2018-01-08 14:23:59.889607 10 7 8 9 10 1 2 3 4 5 6
ring 2018-01-08 14:24:00.889598 10 8 9 10 11 2 3 4 5 6 7
ring 2018-01-08 14:24:01.889599 10 9 10 11 12 3 4 5 6 7 8
ring 2018-01-08 14:24:02.889596 10 10 11 12 13 4 5 6 7 8 9
ring 2018-01-08 14:24:03.889594 10 11 12 13 14 5 6 7 8 9 10
ring 2018-01-08 14:24:04.889598 10 12 13 14 15 6 7 8 9 10 11
ring 2018-01-08 14:24:05.889596 10 13 14 15 16 7 8 9 10 11 12
ring 2018-01-08 14:24:06.889597 10 14 15 16 17 8 9 10 11 12 13
ring 2018-01-08 14:24:07.889598 10 15 16 17 18 9 10 11 12 13 14
ring 2018-01-08 14:24:08.889595 10 16 17 18 19 10 11 12 13 14 15
ring 2018-01-08 14:24:09.889616 10 17 18 19 20 11 12 13 14 15 16
ring 2018-01-08 14:24:10.889598 10 18 19 20 21 12 13 14 15 16 17
ring 2018-01-08 14:24:11.889599 10 19 20 21 22 13 14 15 16 17 18
ring 2018-01-08 14:24:12.889595 10 20 21 22 23 14 15 16 17 18 19
I have pached modules/ ca/database/ src/std/ rec/compressRec ord.c
In get_array_info was a query if prec-balg == bufferingALF_FIFO and if true
a new offset was computed. The correct sorting into bptr but already in put_value depends on FIFO or LIFO. One should not do that twice.
> ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ###### ####### ####### ####### ####### ####### ####### ####### ####### ####### ###### :mid") :mid") {
> ## EPICS R7.0.1.2-DEV
> ## EPICS Base built Apr 9 2018
> #######
>
> compress with ALG "N to 1 Average”.
>
> db-file:
>
> record(waveform, "$(P):TimeScale") {
> field(FTVL, "DOUBLE")
> field(NELM, "2500")
> field(EGU, "ns")
> field(FLNK, "$(P):TimeScale
> field(TPRO, "1")
> }
>
> record(compress, "$(P):TimeScale
> field(DESC, "Time scale (mid res)")
> field(INP, "$(P):TimeScale")
> field(ALG, "N to 1 Average")
> field(N, "5")
> field(NSAM, "500")
> field(EGU, "ns")
> field(TPRO, "1")
> }
>
before the patch:
caget dumm:TimeScale 2500 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000 1010 1020 1030 1040 1050 1060 1070 1080 1090 1100 1110 1120 1130 1140 1150 1160 1170 1180 1190 1200 1210 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 … 24960 24970 24980 24990
caget dumm:TimeScale:mid 500 14820 14870 14920 14970 15020 15070 15120 15170 15220 15270 15320 15370 15420 15470 15520 15570 15620 15670 15720 15770 15820 15870 15920 15970 16020 16070 16120 16170 16220 16270 16320 16370 16420 16470 16520 16570 16620 16670 16720 16770 16820 16870 16920 16970 17020 17070 17120 17170 17220 17270 17320 17370 17420 17470 17520 17570 17620 17670 17720 17770 17820 17870 17920 17970 18020 18070 18120 18170 18220 18270 18320 18370 18420 18470 18520 18570 18620 18670 18720 18770 18820 18870 18920 18970 19020 19070 19120 19170 19220 19270 19320 19370 19420 19470 19520 19570 19620 19670 19720 19770 19820 19870 19920 19970 20020 20070 20120 20170 20220 20270 20320 20370 20420 20470 20520 20570 20620 20670 20720 20770 20820 20870 20920 20970 21020 21070 21120 21170 21220 21270 21320 21370 21420 21470 21520 21570 21620 21670 21720 21770 21820 21870 21920 21970 22020 22070 22120 22170 22220 22270 22320 22370 22420 22470 22520 22570 22620 22670 22720 22770 22820 22870 22920 22970 23020 23070 23120 23170 23220 23270 23320 23370 23420 23470 23520 23570 23620 23670 23720 23770 23820 23870 23920 23970 24020 24070 24120 24170 24220 24270 24320 24370 24420 24470 24520 24570 24620 24670 24720 24770 24820 24870 24920 24970 20 70 120 170 220 270 320 370 420 470 520 570 620 670 720 770 820 870 920 970 1020 1070 1120 1170 1220 1270 1320 1370 1420 1470 1520 1570 1620 1670 1720 1770 1820 1870 1920 1970 2020 2070 2120 2170 2220 2270 2320 2370 2420 2470 2520 2570 2620 2670 2720 2770 2820 2870 2920 2970 3020 3070 3120 3170 3220 3270 3320 3370 3420 3470 3520 3570 3620 3670 3720 3770 3820 387...