Project

General

Profile

segfault on Wt::WServer::start();

Added by Marcelo Antunes over 3 years ago

I have this code to start my webserver:

std::unique_ptr<Wt::WApplication> createApplication(const Wt::WEnvironment& env)
{

    return std::make_unique<AuthApplication>(env);
}

int main(int argc, char **argv)
{
    try {
        Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION);
        server.run();
        server.addEntryPoint(Wt::EntryPointType::Application, createApplication);
        server.run();
    } catch (Wt::WServer::Exception& e) {
        std::cerr << e.what() << std::endl;
    } catch (std::exception &e) {
        std::cerr << "exception: " << e.what() << std::endl;
    }
}

But when i run the app i get a segfault on "server.run()".

Even if i remove this lines, still give me the segfault:

        server.run();
        server.addEntryPoint(Wt::EntryPointType::Application, createApplication);

On attachment i added the stack of the error.

Please help me

regards

erro.png (69.7 KB) erro.png stack of the segfault

Replies (2)

RE: segfault on Wt::WServer::start(); - Added by Christian Meyer over 3 years ago

Hi

you would need to remove the first server.run(), keep adding the entry point and then start the server with the second .run()

Good Luck =)

RE: segfault on Wt::WServer::start(); - Added by Marcelo Antunes over 3 years ago

I wrote it wrongly, inside the try clause is:

   Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION);
   server.addEntryPoint(Wt::EntryPointType::Application, createApplication);
   Session::configureAuth();
   server.run();

I upgraded to the last version of wt (4.4.0) and the problem is solve. I was using 4.3.1.

    (1-2/2)