Closed pemensik closed 2 years ago
@pemensik unfortunately, I'm not sure. This problem does not show up on master branch?
No, I were unable to reproduce it on commit c155af61c524df5d04060f5a692cdb1da7351070 on master branch.
I came across this bug today and found the cause of a DoH-related crash, which I think is the same.
The crash in HTTPSSession::~HTTPSSession() is due the _current_session
pointer (which is passed into nghttp2_session_del
) being uninitialized. That's because a) it's not nullified by the ctor, and b) init_nghttp2()
has not been called by the time the object is destroyed.
In my testing, this condition arises when a connection to the DoH endpoint cannot be established. This small patch fixes the uninitialized pointer which fixes the crash (because nghttp2_session_del
can deal with NULL) but it's likely worth looking at the logic flow of HTTP handling as well. I haven't had the time to do so, but figured I'd drop these finding in the meantime.
diff --git a/flame/httpssession.cpp b/flame/httpssession.cpp
index 241751e..22605b2 100644
--- a/flame/httpssession.cpp
+++ b/flame/httpssession.cpp
@@ -32,6 +32,7 @@ HTTPSSession::HTTPSSession(std::shared_ptr<uvw::TcpHandle> handle,
, _handshake_error{handshake_error_handler}
, _target{target}
, _method{method}
+ , _current_session{nullptr}
{
}
Hi, I just tested 0.11.0 build with backported http_parser usage to ensure it is no broken.
However, it received few crashes. Now always and reliable. I did just cherry pick current latest commit, it might be fixed by few missing commits already.
Is this one of issues already fixed?