Bug #4370
closedWt::WServer setServerConfiguration segfaults /crashes with any non-sufficent argument
0%
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;
}
}
@
Updated by Markus Klemm over 9 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)
Updated by Wim Dumon over 9 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.
Updated by Koen Deforche about 9 years ago
- Status changed from Resolved to Closed