Bug #2619
closedCrash in WtReply
0%
Description
I believe there is a problem in the WtReply class that is causing my application to crash. When I load the application into the debugger at the point of the crash ( WtReply::consumeWebSocketMessage
at WtReply.C:292
) I can see that the connection
pointer is empty and the library is attempting to call the server()
method on the connection
.
ConnectionPtr connection = getConnection();
connection->server()->service().post
(boost::bind(cb, Wt::WebRequest::MessageEvent));
When I check the call stack to the previous function WtReply::readWebSocketMessage
I can see that the WtReply::consumeWebSocketMessage
is called when the connection
instance returned by getConnection()
is empty.
if (!connection) {
/*
* Simulate a connection_close to the application
*/
Buffer b;
consumeWebSocketMessage(connection_close, b.begin(), b.begin(),
Request::Complete);
} else {
...
So if getConnection()
in the calling function returns an empty connection it follows that getConnection()
will also return an empty connection in consumeWebSocketMessage()
. This looks like a bug to me, there should be checks on the connection
instance returned by getConnection()
in WtReply::consumeWebSocketMessage
to avoid this scenario.
Updated by Koen Deforche almost 11 years ago
- Status changed from New to Feedback
- Assignee set to Koen Deforche
- Target version set to 3.3.2
Hey,
I believe your analysis is right, and in a development branch I am currently working we have reorganized the wthttpd to eliminate this weak pointer.
I am hoping to merge this branch into master in anticipation of a new release in the coming days / week, so I would certainly be looking forward to hearing if indeed we fixed this issue.
Regards,
koen
Updated by Koen Deforche almost 11 years ago
- Status changed from Feedback to Resolved
Hey,
We've merged our dev branch in master; could you confirm that this indeed fixes the issue for you?
Regards,
koen
Updated by Mark Snelling almost 11 years ago
Koen Deforche wrote:
Hey,
We've merged our dev branch in master; could you confirm that this indeed fixes the issue for you?
Regards,
koen
Thanks, yes this does appear to resolve the issue.
Updated by Koen Deforche almost 11 years ago
- Status changed from Resolved to Closed