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

Fix issue in ZmqSubscriber that can cause a segfault #91

Merged

Conversation

eflumerf
Copy link
Member

@eflumerf eflumerf commented Jul 7, 2023

No description provided.

Copy link
Contributor

@dingp dingp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found an interesting post about different ways of returning empty string.

https://stackoverflow.com/questions/26587110/returning-an-empty-string-efficient-way-in-c

Looks like return {} might be better.

@eflumerf
Copy link
Member Author

eflumerf commented Jul 7, 2023

Interesting, if almost certainly a micro-optimization in this case, since ZmqSubscriber::connect_for_sends should only be called 1/s in the worst case where the other end of the connection is never published to the Connectivity Service

Copy link
Contributor

@dingp dingp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bieryAtFnal
Copy link
Contributor

My tests have all run fine so far, but I haven't yet been able to find where the code that calls connect_for_receives() checks whether the returned string is empty...

@eflumerf
Copy link
Member Author

eflumerf commented Jul 8, 2023

It doesn't, at the moment (it would be in NetworkManager::create_receiver). While debugging this without the change in iomanager, there was an exception raised from that code when it tried to decode the empty string as a ZMQ connection string and failed...

@dingp
Copy link
Contributor

dingp commented Jul 9, 2023

Going to merge this PR, and create a new tag to be used for the third candidate release for v4.1.0 (rc-v4.1.0-3 and fd-v4.1.0-c3).

@dingp dingp merged commit 3189851 into prep-release/dunedaq-v4.1.0 Jul 9, 2023
@dingp dingp deleted the eflumerf/FixZmqSubscriberSegfault branch July 9, 2023 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants