asyn icon indicating copy to clipboard operation
asyn copied to clipboard

Warning messages from devAsynXXXArray in testAsynPortDriver

Open MarkRivers opened this issue 2 years ago • 4 comments

A problem is manifested in testAsynPortDriver if P_Run is set to 1 in the .cpp file.

The driver will print these messages right after iocInit:

2023/05/24 07:33:12.002 testAPD:scope1:Waveform_RBV devAsynXXXArray::process, warning: multiple interrupt callbacks between processing
2023/05/24 07:33:12.503 testAPD:scope1:Waveform_RBV devAsynXXXArray::process, warning: multiple interrupt callbacks between processing
2023/05/24 07:33:13.003 testAPD:scope1:Waveform_RBV devAsynXXXArray::process, warning: multiple interrupt callbacks between processing
  • If P_Run is set to 0 in the .cpp file, and then changed to 1 at run-time the warnings do not occur.
  • If P_Run is set to 1 in the .cpp file the warnings occur immediately after iocInit because the default value of the Waveform_RBV.SCAN field is “I/O Intr”. If that SCAN field is changed from “I/O Intr” to “1 second” and back to “I/O Intr” at run time then the warning messages stop.

Both of these observations suggest a problem in the initialization of devAsynXXXArray.cpp. That was completely re-written in asyn R4-44.

MarkRivers avatar May 24 '23 12:05 MarkRivers

Thanks for following up. To provide more info, it can also be reproduced on asyn-R4-43 and asyn-R4-42.

wanglin86769 avatar May 24 '23 15:05 wanglin86769

To provide more info, it can also be reproduced on asyn-R4-43 and asyn-R4-42.

I believe I have identified the issue. The problem is that devAsynXXXArray::interruptCallback should be returning immediately if interruptAccept is not yet 1. It currently does this if a ring buffer is being used: https://github.com/epics-modules/asyn/blob/f9d492ed58f4bd730cf49ac7feccc201cd2b17b0/asyn/devEpics/devAsynXXXArray.cpp#L431

But it needs to do this even if a ring buffer is not being used.

This problem is not new in R4-44, it was also present in older versions when devAsynXXXArray.h was a giant C macro.

MarkRivers avatar May 24 '23 15:05 MarkRivers

I have fixed the problem. interruptCallback() now returns immediately if interruptAccept is 0. I have pushed the fix to the master branch.

MarkRivers avatar May 24 '23 15:05 MarkRivers

It works, wonderful.

wanglin86769 avatar May 24 '23 16:05 wanglin86769