Bug #2869
closedSegfault with Wt 3.3.2 when loading wt_config.xml using setServerConfiguration()
0%
Description
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=0.0.0.0","--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);
server.start();
Files
Updated by Koen Deforche over 10 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
- Target version set to 3.3.3
Hey,
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 = 0.0.0.0
http-port = 9090
Regards,
koen
Updated by Peter K over 10 years ago
- File wt_config.xml wt_config.xml added
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 over 10 years ago
- Target version changed from 3.3.3 to 3.3.4
Hey,
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).
Regards,
koen
Updated by Peter K over 10 years ago
Hi Koen,
This is with Boost 1.52, under Windows (which is possibly why you are having difficulty reproducing the issue).
Peter
Updated by Wim Dumon over 10 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?
Wim.
Updated by Peter K over 10 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?
Thanks,
Peter
Updated by Wim Dumon over 10 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 over 10 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.
Peter
Updated by Koen Deforche about 10 years ago
- Status changed from InProgress to Resolved
Updated by Koen Deforche about 10 years ago
- Status changed from Resolved to Closed