Bug #2869

Segfault with Wt 3.3.2 when loading wt_config.xml using setServerConfiguration()

Added by Peter K over 8 years ago. Updated over 7 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


When I try to load the configuration file, wt_config.xml, I get a crash in the setServerConfiguration() call. Here's the code snippet that always crashes when the configuration file actually exists at the specified location:

int argc=5;

char* argv[]={"blah","--http-address=","--http-port=80","--deploy-path=/","--docroot=."};

//Crash on this call if configuration file actually exists there. If path empty or incorrect, no crash

server.setServerConfiguration(argc, argv, "C:\\Config\\wt_config.xml");

server.addEntryPoint(Wt::Application, &createApplication);



wt_config.xml (22.8 KB) wt_config.xml Peter K, 03/27/2014 03:53 PM

Updated by Koen Deforche over 8 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.3


The crash shouldn't happen, but may be related to the fact that this 'configuration file' is not the wt_config.xml but a configuration file for the front-end only (containing something like this):

$ cat /etc/wt/wthttpd 
docroot = .
http-address =
http-port = 9090




Updated by Peter K over 8 years ago

Hi Koen, as far as I can tell, it's a full config file that I am pointing setServerConfiguration() to (attached).


Updated by Koen Deforche about 8 years ago

  • Target version changed from 3.3.3 to 3.3.4


I cannot reproduce this: I get a nice:

Error: the options configuration file contains an invalid line '<!--' 

What version of boost are you using (this functionality is entirely implemented inside boost::program_options).




Updated by Peter K about 8 years ago

Hi Koen,

This is with Boost 1.52, under Windows (which is possibly why you are having difficulty reproducing the issue).



Updated by Wim Dumon about 8 years ago

Tested your wt_config.xml as wthttp config file on boost 1.55 on windows (MSVS 2013) without crash, I get the same error reported as Koen.

As koen points out, wt_config.xml is not to be confused with the wthttpd config file, they are two different things.

Can you provide a stack trace?



Updated by Peter K about 8 years ago

Wim, so you are saying that the file given to setServerConfiguration() should NOT be a full wt_config.xml file, but rather a special short version of it? I think I am somewhat confused...

How is the full wt_config.xml used, if not in a setServerConfiguration() call?




Updated by Wim Dumon about 8 years ago

Hi Peter,

These are two separate configuration files that have nothing to do with each other.

The path to wt_config.xml is to be passed in the constructor of WServer, and are related to the Wt library.

The configuration of Wt's built-in httpd (the wthttp library) is to be passed as parameter of setServerConfiguration(). This contains ports and addresses to listen, SSL pem files, parameters related to the httpd, ... It contains the configurations that you can also specify at the command line of a Wt application (run a wt application with the ---help option).

See the reference documentation of both methods, which links to the two configuration files.

The parameters configured in wt_config.xml cannot be configured in the httpd configuration file and vice versa.


Updated by Peter K about 8 years ago

Ok, now it all makes sense. I was passing the path to wt_config.xml where an wthttp config file was expected... No wonder it wasn't behaving the way it should. Thanks for the explanation.



Updated by Koen Deforche over 7 years ago

  • Status changed from InProgress to Resolved

Updated by Koen Deforche over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF