Skip to content

Fix segmentation fault caused by async_receive #330

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

Merged

Conversation

BewareMyPower
Copy link
Contributor

Motivation

#326 fixes the possible segmentation fault caused by async_write, but it could still crash when triggering the callback of async_receive while the socket is destroyed. See #324 (comment)

Modifications

Capture the shared_ptr in asyncReceive.

### Motivation

apache#326 fixes the possible
segmentation fault caused by async_write, but it could still crash when
triggering the callback of async_receive while the socket is destroyed.
See apache#324 (comment)

### Modifications

Capture the `shared_ptr` in `asyncReceive`.
@BewareMyPower BewareMyPower added the bug Something isn't working label Oct 19, 2023
@BewareMyPower BewareMyPower added this to the 3.4.0 milestone Oct 19, 2023
@BewareMyPower BewareMyPower self-assigned this Oct 19, 2023
@BewareMyPower BewareMyPower merged commit a0f2d32 into apache:main Oct 20, 2023
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-async-receive-crash branch October 20, 2023 02:39
BewareMyPower added a commit to streamnative/pulsar-client-cpp that referenced this pull request Oct 20, 2023
### Motivation

apache#326 fixes the possible
segmentation fault caused by async_write, but it could still crash when
triggering the callback of async_receive while the socket is destroyed.
See apache#324 (comment)

### Modifications

Capture the `shared_ptr` in `asyncReceive`.

(cherry picked from commit a0f2d32)
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.

2 participants