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[MWC]: ntc channel execute after close #465

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

678098
Copy link
Collaborator

@678098 678098 commented Oct 15, 2024

It is possible to call NtcChannel::execute after NtcChannel::close. close frees d_streamSocket_sp, and execute didn't check for validity of this field and just dereferences it.

@678098 678098 force-pushed the t2530_ntcchannel_thread_safety branch 4 times, most recently from b834872 to f89e093 Compare October 17, 2024 14:47
@678098 678098 marked this pull request as ready for review October 17, 2024 14:47
@678098 678098 requested a review from a team as a code owner October 17, 2024 14:47
@@ -356,7 +356,8 @@ class NtcChannel : public mwcio::Channel,
/// this channel for the write to succeed.
void write(Status* status,
const bdlbb::Blob& blob,
bsls::Types::Int64 watermark) BSLS_KEYWORD_OVERRIDE;
bsls::Types::Int64 watermark = bsl::numeric_limits<int>::max())
BSLS_KEYWORD_OVERRIDE;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

virtual void
write(Status* status,
const bdlbb::Blob& blob,
bsls::Types::Int64 watermark = bsl::numeric_limits<int>::max()) = 0;

The interface has default for warermark

@@ -371,7 +372,7 @@ class NtcChannel : public mwcio::Channel,
/// Shutdown this channel, and cancel all pending read requests (but do
/// not invoke them). Pass the specified `status` to any registered
/// `CloseFn`s.
void close(const Status& status) BSLS_KEYWORD_OVERRIDE;
void close(const Status& status = Status()) BSLS_KEYWORD_OVERRIDE;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

virtual void close(const Status& status = Status()) = 0;

The interface has default for status

@678098 678098 force-pushed the t2530_ntcchannel_thread_safety branch 2 times, most recently from 201cc9f to 5a319c8 Compare October 17, 2024 14:55
Copy link

@bmq-oss-ci bmq-oss-ci bot left a comment

Choose a reason for hiding this comment

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

Build 319 of commit 5a319c8 has completed with FAILURE

@678098 678098 force-pushed the t2530_ntcchannel_thread_safety branch from 5a319c8 to 2d89761 Compare October 23, 2024 19:58
Copy link

@bmq-oss-ci bmq-oss-ci bot left a comment

Choose a reason for hiding this comment

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

Build 329 of commit 2d89761 has completed with FAILURE

@678098 678098 merged commit 527fa18 into bloomberg:main Oct 31, 2024
31 checks passed
@678098 678098 deleted the t2530_ntcchannel_thread_safety branch October 31, 2024 17:39
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

Successfully merging this pull request may close these issues.

2 participants