Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal handling causes segfault #26

Open
zenker opened this issue Nov 23, 2017 · 2 comments
Open

Signal handling causes segfault #26

zenker opened this issue Nov 23, 2017 · 2 comments
Labels

Comments

@zenker
Copy link
Collaborator

zenker commented Nov 23, 2017

I just discovered that the OPC-UA adapter crashes when receiving two times a SIGINT signal in series. I did not investigate the reason for the crash. Maybe you could have a look.

@ichrispa
Copy link
Collaborator

Hi zenker. The problem might be located in the task manager attempting to re-stop an already stopped thread while "collecting" the OPC UA Server thread during shutdown. We need to include a mutex to prevent multiple stop-operations running on the task manager at the same time.

@ichrispa ichrispa added the bug label Feb 27, 2018
@mhier
Copy link
Member

mhier commented Jul 5, 2022

I am still seeing this issue. I think it is also related to fishy memory management / destructor calls. For instance, the csa_opcua_adapter destructor calls this->adapter->~ua_uaadapter(), which destroys the instance this->adapter without deleting it. This pattern can be found all over the adapter. I do not understand the intentions behind this, but it causes duplicate calls to the destructors, which is illegal by the C++ standard.

My advice would be to change the memory management to use smart pointers rather than plain pointers with new/delete, where necessary. Where possible, pointers should be completely avoided and instead just ordinary object instances should be used. For instance the aforementioned csa_opcua_adapter::adapter pointer points to an object with the same lifetime as the owning csa_opcua_adapter object. In that case just a plain member object without any pointer should be used.

killenb pushed a commit that referenced this issue Mar 23, 2023
* project-template: use lib install dir defined by GNUInstallDirs

this should fix library search problems on Tumbleweed
project-template installs cmake-config files to library destination
note, individual projects also need to be changed, for installation of actual libs
killenb added a commit that referenced this issue Mar 23, 2023
project-template: use lib install dir defined by GNUInstallDirs (#26)
andreasebner pushed a commit that referenced this issue Apr 24, 2023
* project-template: use lib install dir defined by GNUInstallDirs

this should fix library search problems on Tumbleweed
project-template installs cmake-config files to library destination
note, individual projects also need to be changed, for installation of actual libs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants