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  <20202021  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  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: ADUrl Segfault on initialization
From: Simon Rose via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 10 Mar 2020 14:14:12 +0000

Hello all –

 

We are having an issue with the ADUrl module: it crashes with a segfault on initialization. It seems to build find, but it does not work when we try to actually initialize it.

 

We are running a startup script which starts as follows (note that at ESS we are using a similar architecture to PSI i.e. a require module which dynamically loads shared libraries; moreover, we are building our modules within Conda):

 

require adurl

require busy

require sscan

require calc

 

epicsEnvSet("IOC",         "iocURLTest")

epicsEnvSet("TOP",         ".")

epicsEnvSet("PREFIX", "URL1:")

epicsEnvSet("CALC",        "/home/iocuser/e3/e3-calc")

 

epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","64000000")

 

### The port name for the detector

epicsEnvSet("PORT",   "URL1")

### Queue size

epicsEnvSet("QSIZE",  "5")  

### The maximim image width; used for row profiles in the NDPluginStats plugin

epicsEnvSet("XSIZE",  "2048")

### The maximim image height; used for column profiles in the NDPluginStats plugin

epicsEnvSet("YSIZE",  "1556")

### The maximum number of time series points in the NDPluginStats plugin

epicsEnvSet("NCHANS", "2048")

### The maximum number of frames buffered in the NDPluginCircularBuff plugin

epicsEnvSet("CBUFFS", "500")

### The search path for database files

# epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db")

### Define NELEMENTS

epicsEnvSet("NELEMENTS", "12582912")

 

# Create a URL driver

# URLDriverConfig(const char *portName, int maxBuffers, size_t maxMemory,

#                 int priority, int stackSize)

URLDriverConfig("$(PORT)", 0, 0)

 

 

Etc.

 

At this point, the IOC crashes with the following error. Note that iocsh.bash is essentially just a wrapper for softIocPVA.

 

../_h_env/bin/iocsh.bash: line 116:  3062 Segmentation fault      (core dumped) softIoc${_PVA_} -D ${EPICS_BASE}/dbd/softIoc${_PVA_}.dbd "${IOC_STARTUP}" 2>&1

 

 

 

The full output from the startup is the following:

 

registerChannelProviderLocal firstTime true

#

# Start at "2020-W11-Mar10-1341-15-UTC"

#

# Version information:

# European Spallation Source ERIC : iocsh.bash (3.1.0-PID-3039)

#

# --->--> snip -->-->

# Please Use Version and other environment variables

# in order to report or debug this shell

#

# HOSTDISPLAY=""

# WINDOWID=""

# PWD="/opt/conda/conda-bld/debug_1583846564892/work"

# USER="conda"

# LOGNAME="conda"

# EPICS_HOST_ARCH="linux-x86_64"

# EPICS_BASE="/opt/conda/conda-bld/debug_1583846564892/_h_env/base"

# E3_REQUIRE_NAME="require"

# E3_REQUIRE_VERSION="3.1.0"

# E3_REQUIRE_LOCATION="/opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0"

# E3_REQUIRE_BIN="/opt/conda/conda-bld/debug_1583846564892/_h_env/bin"

# E3_REQUIRE_DB="/opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0/db"

# E3_REQUIRE_DBD="/opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0/dbd"

# E3_REQUIRE_INC="/opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0/include"

# E3_REQUIRE_LIB="/opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0/lib"

# EPICS_DRIVER_PATH="/opt/conda/conda-bld/debug_1583846564892/_h_env/modules"

# EPICS_CA_AUTO_ADDR_LIST=""

# EPICS_CA_ADDR_LIST=""

# PATH="/opt/conda/conda-bld/debug_1583846564892/_build_env/bin:/opt/conda/conda-bld/debug_1583846564892/_h_env/base/bin/linux-x86_64:/opt/conda/conda-bld/debug_1583846564892/_build_env:/opt/conda/conda-bld/debug_1583846564892/_build_env/bin:/opt/conda/conda-bld/debug_1583846564892/_h_env:/opt/conda/conda-bld/debug_1583846564892/_h_env/bin:/opt/conda/conda-bld/debug_1583846564892/_h_env/bin:/opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# --->--> snip -->-->

#

# Set REQUIRE_IOC for its internal PVs

epicsEnvSet REQUIRE_IOC "REQMOD:26E3270A7C7F-3055"

#

# Set E3_IOCSH_TOP for the absolute path where iocsh.bash is executed.

epicsEnvSet E3_IOCSH_TOP "/opt/conda/conda-bld/debug_1583846564892/work"

#

#

# Load require module, which has the version 3.1.0

#

dlload /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0/lib/linux-x86_64/librequire.so

dbLoadDatabase /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/require/3.1.0/dbd/require.dbd

require_registerRecordDeviceDriver

Loading module info records for require

#

# Set E3_CMD_TOP for the absolute path where st.ADURL_test.cmd exists

epicsEnvSet E3_CMD_TOP "/opt/conda/conda-bld/debug_1583846564892/work/cmds"

#

iocshLoad 'cmds/st.ADURL_test.cmd',''

require adurl

Module adurl version 2.2.0 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adurl/2.2.0/

Module adurl depends on adcore 3.7.0

Module adcore version 3.7.0 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adcore/3.7.0/

Module adcore depends on adsupport 1.9.0

Module adsupport version 1.9.0 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adsupport/1.9.0/

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adsupport/1.9.0/lib/linux-x86_64/libadsupport.so

Loaded adsupport version 1.9.0

adsupport has no dbd file

Loading module info records for adsupport

Module adcore depends on asyn 4.36.0

Module asyn version 4.36.0 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/asyn/4.36.0/

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/asyn/4.36.0/lib/linux-x86_64/libasyn.so

Loaded asyn version 4.36.0

Loading dbd file /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/asyn/4.36.0/dbd/asyn.dbd

Calling function asyn_registerRecordDeviceDriver

Loading module info records for asyn

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adcore/3.7.0/lib/linux-x86_64/libadcore.so

Loaded adcore version 3.7.0

Loading dbd file /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adcore/3.7.0/dbd/adcore.dbd

Calling function adcore_registerRecordDeviceDriver

Loading module info records for adcore

Module adurl depends on asyn 4.36.0

Module asyn version 4.36.0 already loaded

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adurl/2.2.0/lib/linux-x86_64/libadurl.so

Loaded adurl version 2.2.0

Loading dbd file /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/adurl/2.2.0/dbd/adurl.dbd

Calling function adurl_registerRecordDeviceDriver

Loading module info records for adurl

require busy

Module busy version 1.7.0 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/busy/1.7.0/

Module busy depends on asyn 4.36.0

Module asyn version 4.36.0 already loaded

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/busy/1.7.0/lib/linux-x86_64/libbusy.so

Loaded busy version 1.7.0

Loading dbd file /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/busy/1.7.0/dbd/busy.dbd

Calling function busy_registerRecordDeviceDriver

Loading module info records for busy

require sscan

Module sscan version 2.11.2 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/sscan/2.11.2/

Module sscan depends on seq 2.2.7

Module seq version 2.2.7 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/seq/2.2.7/

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/seq/2.2.7/lib/linux-x86_64/libseq.so

Loaded seq version 2.2.7

seq has no dbd file

Loading module info records for seq

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/sscan/2.11.2/lib/linux-x86_64/libsscan.so

Loaded sscan version 2.11.2

Loading dbd file /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/sscan/2.11.2/dbd/sscan.dbd

Calling function sscan_registerRecordDeviceDriver

Loading module info records for sscan

require calc

Module calc version 3.7.1 found in /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/calc/3.7.1/

Module calc depends on seq 2.2.7

Module seq version 2.2.7 already loaded

Module calc depends on sscan 2.11.2

Module sscan version 2.11.2 already loaded

Loading library /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/calc/3.7.1/lib/linux-x86_64/libcalc.so

Loaded calc version 3.7.1

Loading dbd file /opt/conda/conda-bld/debug_1583846564892/_h_env/modules/calc/3.7.1/dbd/calc.dbd

Calling function calc_registerRecordDeviceDriver

Loading module info records for calc

epicsEnvSet("IOC",         "iocURLTest")

epicsEnvSet("TOP",         ".")

epicsEnvSet("PREFIX", "URL1:")

epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","64000000")

### The port name for the detector

epicsEnvSet("PORT",   "URL1")

### Queue size

epicsEnvSet("QSIZE",  "5")

### The maximim image width; used for row profiles in the NDPluginStats plugin

epicsEnvSet("XSIZE",  "2048")

### The maximim image height; used for column profiles in the NDPluginStats plugin

epicsEnvSet("YSIZE",  "1556")

### The maximum number of time series points in the NDPluginStats plugin

epicsEnvSet("NCHANS", "2048")

### The maximum number of frames buffered in the NDPluginCircularBuff plugin

epicsEnvSet("CBUFFS", "500")

### The search path for database files

# epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db")

### Define NELEMENTS

epicsEnvSet("NELEMENTS", "12582912")

# Create a URL driver

# URLDriverConfig(const char *portName, int maxBuffers, size_t maxMemory,

#                 int priority, int stackSize)

URLDriverConfig("URL1", 0, 0)

../_h_env/bin/iocsh.bash: line 116:  3062 Segmentation fault      (core dumped) softIoc${_PVA_} -D ${EPICS_BASE}/dbd/softIoc${_PVA_}.dbd "${IOC_STARTUP}" 2>&1

 

 

If I build the ADUrl library with the -ggdb flag, then I can run a backtrace and I find the following:

 

Thread 1 "softIocPVA" received signal SIGSEGV, Segmentation fault.

0x00007ff49c608cc0 in pthread_mutex_lock () from /lib64/libpthread.so.0

(gdb) bt

#0  0x00007ff49c608cc0 in pthread_mutex_lock () from /lib64/libpthread.so.0

#1  0x00007ff49847db27 in GmLockSemaphoreInfo () from /opt/conda/conda-bld/debug_1583846564892/_h_env/lib/libGraphicsMagick.so.3

#2  0x00007ff49847a8ff in GmGetMagickResourceLimit () from /opt/conda/conda-bld/debug_1583846564892/_h_env/lib/libGraphicsMagick.so.3

#3  0x00007ff49845ae09 in GmGetCacheInfo () from /opt/conda/conda-bld/debug_1583846564892/_h_env/lib/libGraphicsMagick.so.3

#4  0x00007ff4984388bd in GmAllocateImage () from /opt/conda/conda-bld/debug_1583846564892/_h_env/lib/libGraphicsMagick.so.3

#5  0x00007ff498379c5a in Magick::ImageRef::ImageRef() () from /opt/conda/conda-bld/debug_1583846564892/_h_env/lib/libGraphicsMagick++.so.12

#6  0x00007ff49836f5fe in Magick::Image::Image() () from /opt/conda/conda-bld/debug_1583846564892/_h_env/lib/libGraphicsMagick++.so.12

#7  0x00007ff49d5a55ac in URLDriver::URLDriver (this=0x559b447799f0, portName=<optimized out>, maxBuffers=<optimized out>, maxMemory=<optimized out>, priority=<optimized out>,

    stackSize=<optimized out>) at ../urlApp/src/URLDriver.cpp:387

#8  0x00007ff49d5a57e1 in URLDriverConfig (portName=0x559b4479e800 "URL1", maxBuffers=0, maxMemory=0, priority=0, stackSize=0) at ../urlApp/src/URLDriver.cpp:445

#9  0x00007ff49d093a88 in iocshBody () from /opt/conda/conda-bld/debug_1583846564892/_h_env/base/bin/linux-x86_64/../../lib/linux-x86_64/libCom.so.3.17.6

#10 0x00007ff49d093a88 in iocshBody () from /opt/conda/conda-bld/debug_1583846564892/_h_env/base/bin/linux-x86_64/../../lib/linux-x86_64/libCom.so.3.17.6

#11 0x0000559b434d04e1 in main ()

 

 

 

The version of ADUrl we are trying to build and run is 2.2.0. We are including graphicsmagick 1.3.33, and we are building for base 7.0.3.1 with asyn 4.36.0. The crash seems to happen at the call to the super constructor ADDriver(…), although I admit that I am a bit confused by that: as said, the line in question is the call to the super-class constructor. I am not sure how we end up in Magick::Image::Image().

 

Any help would be greatly appreciated.

 

Cheers,

 

Simon Rose

European Spallation Source


Replies:
Re: ADUrl Segfault on initialization Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Load or reload databases after IOC initialization bob dalesio via Tech-talk
Next: Re: ADUrl Segfault on initialization 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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Load or reload databases after IOC initialization bob dalesio via Tech-talk
Next: Re: ADUrl Segfault on initialization 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  <20202021  2022  2023  2024 
ANJ, 10 Mar 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·