Skip to content

Fix exception in server#9

Open
m8mble wants to merge 1 commit intonghttp2:mainfrom
m8mble:fix-exception
Open

Fix exception in server#9
m8mble wants to merge 1 commit intonghttp2:mainfrom
m8mble:fix-exception

Conversation

@m8mble
Copy link
Copy Markdown

@m8mble m8mble commented Jan 20, 2023

It can happen that a connection handler calls writefun when the connection is already destroyed. This causes bad_weak_ptr exceptions thrown from the server.

Fix this issue by skipping the respective do_write invocations.

Problem encountered in a real-world server.

It can happen that a connection handler calls writefun when the
connection is already destroyed. This causes bad_weak_ptr exceptions
thrown from the server.

Fix this issue by skipping the respective do_write invocations.
@peckato1
Copy link
Copy Markdown

Thanks! We encountered the same problem with wild bad_weak_ptr exceptions in our RESTCONF server and this seems to fix things.

jktjkt added a commit to CESNET/rousette that referenced this pull request Sep 23, 2025
The latest upstream version does not build on Boost 1.87, and there's a
nasty crash in the destructor which led to a nice little heap of hair on
our desks. It's time to fork that thing.

Link: nghttp2/nghttp2-asio#9
Link: nghttp2/nghttp2-asio#25
Change-Id: Iec9619ce45e7e76f0781d39966d0b6c7cc6fa778
troglobit pushed a commit to kernelkit/rousette that referenced this pull request Mar 19, 2026
The latest upstream version does not build on Boost 1.87, and there's a
nasty crash in the destructor which led to a nice little heap of hair on
our desks. It's time to fork that thing.

Link: nghttp2/nghttp2-asio#9
Link: nghttp2/nghttp2-asio#25
Change-Id: Iec9619ce45e7e76f0781d39966d0b6c7cc6fa778
Signed-off-by: Mattias Walström <lazzer@gmail.com>
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