Project

General

Profile

Actions

Bug #4370

closed

Wt::WServer setServerConfiguration segfaults /crashes with any non-sufficent argument

Added by Markus Klemm over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
08/03/2015
Due date:
% Done:

0%

Estimated time:

Description

I'm using Wt commit 43ce974c29ed97948c8641951808235f4e789458 Date: Tue Mar 3 13:43:16 2015 +0100 (master) on windows, compiled with mingw.

I have found out that Wt::WServer setServerConfiguration causes a segmentation fault e.g. crash any time it get non sufficant parameters for starting the server, for example by just passing the one default argument (agrv[0]) or by changing a working argument list a bit and running into the destructor of the WServer. Following code produced the bug:

@

#include

#include

int main(int argc, char argv) {

try {

Wt::WServer server;

server = Wt::WServer(argv[0]);

server.setServerConfiguration(argc,argv);

std::cout << "The End" << std::endl;

} catch (std::exception &e) {

std::cout << e.what() << std::endl;

}

}

@

Actions #1

Updated by Markus Klemm over 8 years ago

Sorry I forgot a callstack:

_InterlockedCompareExchange (Comperand=0, ExChange=0, Destination=0xa4)

interlocked_read_acquire (x=0xa4)

try_recursive_lock (current_thread_id=4840, this=0xa0)

lock (this=0xa0)

boost::unique_lockboost::recursive_mutex::lock (this=0x22f9f0, this@entry=0x22f9f0)

unique_lock (this=0x22f9f0)

Wt::WebController::shutdown (this=0x0)

Wt::WServer::stop (this=0x22fc30, this@entry=0x22fc30)

Wt::WServer::~WServer (this=0x22fc30)

main (argc=1, argv=0x7295aa0)

Actions #2

Updated by Wim Dumon over 8 years ago

  • Status changed from New to Resolved

Hello,

You're using the operator= of WServer, which is not ok. It's an oversight of us not to generate a compilation error for this code, I fixed this.

Best regards,

Wim.

Actions #3

Updated by Markus Klemm over 8 years ago

Thank you.

Actions #4

Updated by Koen Deforche over 8 years ago

  • Status changed from Resolved to Closed
Actions #5

Updated by Koen Deforche over 8 years ago

  • Target version set to 3.3.5
Actions

Also available in: Atom PDF