Hi Abdalla,
It sounds to me like you may have a buffer overflow problem. That buffer overflow could be corrupting the link field in the record.
The example code you sent does not do anything with the buffer except print it, so it is hard to know what is wrong with the actual driver code. It is also using a small buffer size of 48.
Here are some things I can say:
-
It is definitely possible to have separate threads that read large buffers and do callbacks to asyn device support for waveform records. The areaDetector module has many such examples. They are using array sizes of many MB.
-
I don’t think EPICS supports variable length waveform records. You need to create the waveform record in dbLoadRecords with a size that is the largest you plan to use. That is what areaDetector does with NDPluginStdArrays.
Mark
From: Abdalla Ahmad <Abdalla.Ahmad at sesame.org.jo>
Sent: Tuesday, November 3, 2020 10:04 AM
To: tech-talk at aps.anl.gov; Mark Rivers <rivers at cars.uchicago.edu>
Subject: AsynPortDriver separate thread causes Segmentation fault with "dbGetLinkValue" error message
I am writing an AsynPortDriver class for the libera spark and I would like to do the waveforms data acquisition in a separate thread (attached is my initial implementation). Whenever
a large data size requested (Using command "ADC 100" for example), the IOC crashes with the following message:
dbGetLinkValue: Illegal link type -13664
Noticing that this number is random at every time the IOC crashes. Right now I am trying to enable core dumps on my machine (for some reason they are not dumped), but in the meantime,
what is wrong with my thread implementation?
Is it possible to have a variable length waveform record in EPICS? If yes, how does asyn implements this?