Skip to content

Fix segmentation fault caused by async_receive - #330

Merged
BewareMyPower merged 1 commit into
apache:mainfrom
BewareMyPower:bewaremypower/fix-async-receive-crash
Oct 20, 2023
Merged

Fix segmentation fault caused by async_receive#330
BewareMyPower merged 1 commit into
apache:mainfrom
BewareMyPower:bewaremypower/fix-async-receive-crash

Conversation

@BewareMyPower

Copy link
Copy Markdown
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`.
@BewareMyPowerBewareMyPower added the bug Something isn't working label Oct 19, 2023
@BewareMyPowerBewareMyPower added this to the 3.4.0 milestone Oct 19, 2023
@BewareMyPowerBewareMyPower self-assigned this Oct 19, 2023
@BewareMyPower
BewareMyPower merged commit a0f2d32 into apache:mainOct 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@BewareMyPower@shibd