EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: Problem writing enum entries from asyn driver (areaDetector) ino a databse record.
From: Jörn Dreyer via Tech-talk <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Fri, 18 Aug 2023 14:47:06 +0200
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



Replies:
Re: Problem writing enum entries from asyn driver (areaDetector) ino a databse record. Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Dante Siddons, David via Tech-talk
Next: Re: Problem writing enum entries from asyn driver (areaDetector) ino a databse record. Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: Re: Dante Mark Rivers via Tech-talk
Next: Re: Problem writing enum entries from asyn driver (areaDetector) ino a databse record. Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 01 Sep 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·