Hi
The problem is actually that the first argument to interruptStart, pasynPvt, is 0. That is why pinterruptBase is 0.
static asynStatus interruptStart(void *pasynPvt,ELLLIST **plist)
{
interruptBase *pinterruptBase = (interruptBase *)pasynPvt;
This is line 3363 in asynPortDriver.cpp
pasynManager->interruptStart(this->asynStdInterfaces.enumInterruptPvt, &pclientList);
That means that this->asynStdInterfaces.enumInterruptPvt is null, but it should not be.
If you can execute a command before it crashes then do this:
asynReport 5 "portName"
where portName is the name of your asyn port. That will print out the values of all of the interruptPvt pointers.
It is acting like you did not put asynEnum in the interruptMask in the asynPortDriver constructor, but you said you did.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Jörn Dreyer via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, August 18, 2023 7:47 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Problem writing enum entries from asyn driver (areaDetector) ino a databse record.
Hello,
I have a strange problem in a areaDetector plugin I currently writing. I want
to fill a mbbo record with the strings from an std::vector I get from a
library function. I copy the elements of the std::vestor to a pre allocated
char** array and fill values and severities arrays. In my writeInt32 function
I do a call to
doCallbacksEnum(strings, values, severities, nEntries, function, 0)
This leads to a crash with SIGSEGV. After recompiling my code and the asyn
module with debug symbols I managed to track down the problem to an
uninitialized variable in asynManager:
#0 0x00007ffff7f33417 in interruptStart (pasynPvt=0x0, plist=0x7fffc37f9568)
at ../../asyn/asynDriver/asynManager.c:2438
2438 port *pport = pinterruptBase->pport;
looking at pinterruptBase it returns 0x0.
The backtrace leading to this crash is:
#0 0x00007ffff7f33417 in interruptStart (pasynPvt=0x0, plist=0x7fffc37f9568)
at ../../asyn/asynDriver/asynManager.c:2438
#1 0x00007ffff7f56b57 in asynPortDriver::doCallbacksEnum(char**, int*, int*,
unsigned long, int, int)
(this=0x745a90, strings=0x73f4b0, values=0x744000, severities=0x744060,
nElements=7, reason=80, address=0)
at ../../asyn/asynPortDriver/asynPortDriver.cpp:3363
#2 0x00007ffff7df1e4b in NDFileOpenPMD::writeInt32(asynUser*, int)
(this=<optimized out>, pasynUser=<optimized out>, value=<optimized out>)
at ../NDFileOpenPMD.cpp:192
My driver is derived from NDFilePlugin as:
NDPluginFile(portName, queueSize, blockingCallbacks,
NDArrayPort, NDArrayAddr, 1,
0, 0, asynGenericPointerMask | asynEnumMask,
asynGenericPointerMask | asynEnumMask,
ASYN_CANBLOCK, 1, priority, stackSize, 1, true)
So in my understanding it should be configured to be able to use enum
functions.
Can anybody help me to figure out what I'm doing wrong? I did a crosscheck
with other areaDetector plugin drivers if there is a special setting missing
and also looked at the examples from asy, but could not figur out whjat is
wrong in my code.
Regards,
Jörn Dreyer
|