Project

General

Profile

Actions

Bug #2619

closed

Crash in WtReply

Added by Mark Snelling about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
01/29/2014
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Koen Deforche about 10 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

Actions #2

Updated by Koen Deforche about 10 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

Actions #3

Updated by Mark Snelling about 10 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.

Actions #4

Updated by Koen Deforche about 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF