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

Subscriber: Segmentation fault when deleting subscriber configuration #2849

Open
1 task done
Fischer-Thomas opened this issue Jun 27, 2019 · 0 comments
Open
1 task done

Comments

@Fischer-Thomas
Copy link
Contributor

Description

Deleting the subscriber configuration results in a segmentation fault due to an unremoved repeated callback during the deletion of the ReaderGroup/DataSetReader.

Proposal for fixing the bug:
Adding
UA_PubSubManager_removeRepeatedPubSubCallback(server, readerGroup->subscribeCallbackId);
inside this function

UA_StatusCode
UA_Server_removeReaderGroup(UA_Server *server, UA_NodeId groupIdentifier) {
UA_ReaderGroup* readerGroup = UA_ReaderGroup_findRGbyId(server, groupIdentifier);
if(readerGroup == NULL) {
return UA_STATUSCODE_BADNOTFOUND;
}
/* Search the connection to which the given readergroup is connected to */
UA_PubSubConnection *connection = UA_PubSubConnection_findConnectionbyId(server, readerGroup->linkedConnection);
if(connection == NULL) {
return UA_STATUSCODE_BADNOTFOUND;
}
#ifdef UA_ENABLE_PUBSUB_INFORMATIONMODEL
/* To Do:RemoveGroupRepresentation(server, &readerGroup->identifier) */
#endif
/* UA_Server_ReaderGroup_delete also removes itself from the list */
UA_Server_ReaderGroup_delete(server, readerGroup);
/* Remove readerGroup from Connection */
LIST_REMOVE(readerGroup, listEntry);
UA_free(readerGroup);
return UA_STATUSCODE_GOOD;
}

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant