Project

General

Profile

Actions

Bug #3928

closed
DD BD

Wt::WServer::postAll can SEGFAULT in constructor

Bug #3928: Wt::WServer::postAll can SEGFAULT in constructor

Added by Drew Dormann over 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
High
Assignee:
Benoit Daccache
Target version:
Start date:
03/29/2015
Due date:
% Done:

0%

Estimated time:

Description

I discovered a reproducible crash in Wt 3.3.4 by (indirectly) calling postAll() from a derived constructor.

I believe that this bug is unique to WServer instances constructed as WServer::WServer(const std::string& applicationPath, const std::string& wtConfigurationFile) as that constructor does not call setServerConfiguration(), which means webController_ will be a NULL pointer.

Here is a minimal program that will SEGFAULT. (Tested in Linux, gcc 4.9.2)

#include <Wt/WServer>

class Server : public Wt::WServer
{
public:
    Server() : Wt::WServer{ ".", "wt_config.xml" }
    {
        postAll( []{} ); // (A do-nothing lambda)
    }
};

int main()
{
    Server my_server;
}

Within the constructor, I wouldn't expect any sessions to be active, therefore I would expect a call to postAll to be a no-op.

KD Updated by Koen Deforche over 11 years ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Benoit Daccache

BD Updated by Benoit Daccache over 11 years ago Actions #2

  • Status changed from InProgress to Resolved

KD Updated by Koen Deforche almost 11 years ago Actions #3

  • Status changed from Resolved to Closed

KD Updated by Koen Deforche almost 11 years ago Actions #4

  • Target version set to 3.3.5
Actions

Also available in: PDF Atom