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  <20192020  2021  2022  2023  2024  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  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Segmentation Fault when exiting certain Area Detector IOCs
From: Mark Rivers via Tech-talk <[email protected]>
To: "Wlodek, Jakub" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Fri, 18 Jan 2019 17:26:35 +0000
Hi Jacob,


> Segmentation Fault: line of st.cmd file that calls ioc binary.


Does this happen every time you exit the IOC, or only occasionally?


I just tested a ADProsilica on Linux several times and I don't get this error, I see the following:


epics> exit

Disconnecting camera PS1

Uninitializing PvAPI


> and it occurs in the line pPvt->lock(), meaning that most likely pPvt is NULL.

> Is there anything I should check for that could be causing this?


I suspect that what is happening is that the asynPortDriver destructor has been called, so asynPortDriver::mutexId has been destroyed.   That causes pPvt->lock() to seg fault.  The question is why the connect() method is being called after the destructor has been called.  This seems like things are not shutting down in the correct order.  Can you send a more complete stack trace when the error occurs so we can see where connect() is being called from?


Mark



________________________________
From: [email protected] <[email protected]> on behalf of Wlodek, Jakub via Tech-talk <[email protected]>
Sent: Friday, January 18, 2019 10:35 AM
To: [email protected]
Subject: Segmentation Fault when exiting certain Area Detector IOCs


Hello EPICS Tech-Talk!


I have a question regarding a segmentation fault I am getting when exiting certain area detector IOCs. Thus far, I have noticed it on several detectors, including a prosilica IOC and a new driver I have developed for USB Video Class cameras. In the IOC shell, the only information given is:


Segmentation Fault: line of st.cmd file that calls ioc binary.


Using the Visual Studio Code debugger I was able to trace the segmentation fault to the following function in the asynPortDriver.cpp file:


extern "C" {static asynStatus connect(void *drvPvt, asynUser *pasynUser)
{
    asynPortDriver *pPvt = (asynPortDriver *)drvPvt;
    asynStatus status;

    pPvt->lock();
    status = pPvt->connect(pasynUser);
    pPvt->unlock();
    return(status);
}}



and it occurs in the line pPvt->lock(), meaning that most likely pPvt is NULL. Is there anything I should check for that could be causing this?


Thank you all in advance,


Jakub Wlodek

Replies:
Re: Segmentation Fault when exiting certain Area Detector IOCs Mark Rivers via Tech-talk
References:
Segmentation Fault when exiting certain Area Detector IOCs Wlodek, Jakub via Tech-talk

Navigate by Date:
Prev: Segmentation Fault when exiting certain Area Detector IOCs Wlodek, Jakub via Tech-talk
Next: Re: Segmentation Fault when exiting certain Area Detector IOCs 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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Segmentation Fault when exiting certain Area Detector IOCs Wlodek, Jakub via Tech-talk
Next: Re: Segmentation Fault when exiting certain Area Detector IOCs 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  <20192020  2021  2022  2023  2024 
ANJ, 18 Jan 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·