bkuner / opcUaUnifiedAutomation

EPICS opcUa device support with Unified Automation C++ based client sdk.
Other
0 stars 4 forks source link

IOC crashes if drvOpcUaSetup() is not called #6

Closed ralphlange closed 6 years ago

ralphlange commented 7 years ago

If the call to drvOpcUaSetup() is missing from st.cmd, the IOC crashes immediately in iocInit.

$ ../../bin/linux-x86_64/client ./st.cmd
#!../../bin/linux-x86_64/client
## You may have to change client to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("IOC","iocclient")
epicsEnvSet("TOP","/blabla/OPCUATEST")
epicsEnvSet("EPICS_BASE","/opt/codac-5.4/epics")
cd "/blabla/OPCUATEST"
## Register all support components
dbLoadDatabase "dbd/client.dbd"
client_registerRecordDeviceDriver pdbbase
## Load record instances
dbLoadRecords "db/freeopcuaTEST.db"
## Run this to trace the stages of iocInit
#traceIocInit
cd "/blabla/OPCUATEST/iocBoot/iocclient"
iocInit
Starting iocInit
############################################################################
## EPICS R3.15.5
## EPICS Base built Dec 14 2016
############################################################################
Segmentation fault (core dumped)
bkuner commented 7 years ago

Then call drvOpcUaSetup()! Garbage in -> garbage out

What I did is to avoid an segmentation fault if the opcua server can't be connected.This was realy awfull. I will fix your issue in the next release - if I don't forget.

ralphlange commented 7 years ago

The IOC should fail to start - of course. But IMHO segfaulting without any message is not an appropriate failure mode.

bkuner commented 6 years ago

done