Comments (3)
The segfault happens as part of updating internal structures in a callback function supplied by my code to the SDK, when the SDK signals the completion of a read request.
Somehow the array of the values provided to the callback seems to have invalid data (or the array is only partial?) so that assigning the status code that I get as an argument in the callback to a local variable segfaults.
That could match a situation, where a read request (possibly the read request done on all items after the connection comes up) times out. The session gets the callback that the connection status changed to WatchdogTimeout and then the read completion callback (of the read that timed out) is called with missing or zero values.
Since I have not seen this WatchdogTimeout status and don’t know how to produce it, I have not tested that situation.
(Adding tests using mock versions of the SDK classes is on my list, but that’s not trivial and not done yet.)
That part of the code has changed for 0.6 and will again for 0.7, so I am not really inclined to further investigate… of course, invalid values in the read completion callback could still create some havoc. I will add simple consistency checks in 0.7 – I was always assuming data coming up from the SDK to be sane, but that might not be the case, after all.
from opcua.
Console log:
efe358d.mpsid-i.4087 > OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from Connected to ConnectionErrorApiReconnect
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from ConnectionErrorApiReconnect to NewSessionCreated
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from NewSessionCreated to Connected
OPC UA session MPSoS:Ctrl-IOC-01:Mag: (readBatchOfNodes) beginRead service ok (transaction id 3; retrieving 309 nodes)
Session MPSoS:Ctrl-IOC-01:Mag: (readComplete) getting data for read service (transaction id 3; data for 309 items)
Session MPSoS:Ctrl-IOC-01:Mag: (requestWrite) beginWrite service ok (transaction id 4; writing 1 nodes)
Session MPSoS:Ctrl-IOC-01:Mag: (writeComplete) getting results for write service (transaction id 4; results for 1 items)
OPC UA session MPSoS:Ctrl-IOC-01:VAC: connection status changed from Connected to ConnectionWarningWatchdogTimeout
OPC UA session MPSoS:Ctrl-IOC-01:VAC: connection status changed from ConnectionWarningWatchdogTimeout to Connected
OPC UA session MPSoS:Ctrl-IOC-01:VAC: (readBatchOfNodes) beginRead service ok (transaction id 3; retrieving 357 nodes)
Session MPSoS:Ctrl-IOC-01:VAC: (readComplete) getting data for read service (transaction id 3; data for 357 items)
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from Connected to ConnectionWarningWatchdogTimeout
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from ConnectionWarningWatchdogTimeout to Connected
OPC UA session MPSoS:Ctrl-IOC-01:Mag: (readBatchOfNodes) beginRead service ok (transaction id 5; retrieving 309 nodes)
Session MPSoS:Ctrl-IOC-01:Mag: (readComplete) getting data for read service (transaction id 5; data for 309 items)
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from Connected to ConnectionWarningWatchdogTimeout
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from ConnectionWarningWatchdogTimeout to Connected
OPC UA session MPSoS:Ctrl-IOC-01:Mag: (readBatchOfNodes) beginRead service ok (transaction id 6; retrieving 309 nodes)
Session MPSoS:Ctrl-IOC-01:Mag: (readComplete) getting data for read service (transaction id 6; data for 0 items)
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from Connected to ConnectionWarningWatchdogTimeout
/home/iocuser/epics/base-7.0.3/require/3.1.1/bin/iocsh.bash: line 145: 4102 Segmentation fault (core dumped) ${__CHRT__}${EPICS_BASE}/bin/${EPICS_HOST_ARCH}/softIoc${__PVA__} -D ${EPICS_BASE}/dbd/softIoc${__PVA__}.dbd "${IOC_STARTUP}" 2>&1
from opcua.
Two issues:
Extraneous initial read() operation
The transition WatchdogTimeout
to Connected
triggers the initial read() of all items. That is wrong, as the server never went away.
Segfault on empty read() reply
A service request that gets an empty answer because of a server side issue
OPC UA session MPSoS:Ctrl-IOC-01:Mag: (readBatchOfNodes) beginRead service ok (transaction id 6; retrieving 309 nodes)
Session MPSoS:Ctrl-IOC-01:Mag: (readComplete) getting data for read service (transaction id 6; data for 0 items)
OPC UA session MPSoS:Ctrl-IOC-01:Mag: connection status changed from Connected to ConnectionWarningWatchdogTimeout
/home/iocuser/epics/base-7.0.3/require/3.1.1/bin/iocsh.bash: line 145: 4102 Segmentation fault (core dumped)
causes the client to segfault. That's a bug, which needs to be fixed by checking consistency between request and reply.
from opcua.
Related Issues (20)
- Detect if server uses an inconsistent certificate
- mbbo record doesn't convert using ...VL fields when reading from OPC UA server HOT 1
- Error when build the module on Windows: [...] /RULES_BUILD:249: devOpcua.obj] Error 2 HOT 6
- Accessing OPCUA nodes on Siemens S7-1200 using signal names HOT 10
- Error Building on Ubuntu 18: Can't open perl script "/makeFromList.pl": No such file or directory HOT 3
- Support records that are disabled when connection comes up
- Support server-side changes in AddressSpace HOT 1
- Writing to write-only variables fails HOT 8
- Segfault after reconnect (using structured data)
- Network disconnect doesn't change record status/severity
- Update bidirectional output records without fully processing them
- Empty options should be ignored silently HOT 10
- Array type matches are too strict HOT 2
- opcuaOptions without key=value args should show options HOT 1
- Binary distribution: library doesn't get installed HOT 1
- Windows: INSTALL deploy mode does not work
- Support servers without DataTypeDictionaries by using DataTypeDefinition Attribute
- Compiling for other EPICS base versions HOT 3
- Crash when using "sub-Items"
- Add support for alternative input/output linking
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opcua.