Support #3696
closedWServer instantiation in GTest environment
0%
Description
Hi!
I'm developing a simple REST service using Wt WServer and WClient classes.
Here is my problem: if I instantiate a WServer in a GTest environment (in my continuous integration suite), I'm not able to set http options.
This simple code bring me to a segfault error (the same code, outside the test env, works fine):
@
std::vector<const char*> myArgs;
myArgs.push_back("fsserver");
myArgs.push_back("---docroot");
myArgs.push_back(".");
myArgs.push_back("---http-address");
myArgs.push_back("0.0.0.0");
myArgs.push_back("---http-port");
myArgs.push_back("8888");
Wt::WServer myServer(myArgs[0]);
myServer.setServerConfiguration(myArgs.size(),
const_cast<char>(myArgs.data()),
WTHTTP_CONFIGURATION);
@
Here you have the stack trace
#0 0x00007fad2fe7f10d in Wt::WServer::setServerConfiguration (this=0x7fff23482830, argc=7, argv=0x2d7a730, serverConfigurationFile=...) at /root/Software/Installed/wt-3.3.1/src/http/WServer.C:110
#1 0x00007fad3010d680 in restful::WtRestServer::WtRestServer (this=0x7fff23482830, aParams=...) at /spare/msciolla/workspace/test/wtrestserver.cpp:20
#2 0x00007fad3a1abc5b in TestWtRestServer_test_manage_remote_file_Test::TestBody (this=0x2d7ab80) at /spare/msciolla/workspace/test/testwtrestserver.cpp:64
#3 0x00007fad3196b322 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x2d7ab80, method=&virtual testing::Test::TestBody(),
location=0x7fad3197820b "the test body") at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2078
#4 0x00007fad31966bfe in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x2d7ab80, method=&virtual testing::Test::TestBody(), location=0x7fad3197820b "the test body")
at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2114
#5 0x00007fad3194e915 in testing::Test::Run (this=0x2d7ab80) at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2151
#6 0x00007fad3194f0a3 in testing::TestInfo::Run (this=0x2ce7200) at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2326
#7 0x00007fad3194f6de in testing::TestCase::Run (this=0x2ce7300) at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2444
#8 0x00007fad31955e99 in testing::internal::UnitTestImpl::RunAllTests (this=0x2cac5b0)
at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:4315
#9 0x00007fad3196c167 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x2cac5b0,
method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7fad31955bfc <testing::internal::UnitTestImpl::RunAllTests()>,
location=0x7fad31978a60 "auxiliary test code (environments or event listeners)") at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2078
#10 0x00007fad31967986 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x2cac5b0,
method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7fad31955bfc <testing::internal::UnitTestImpl::RunAllTests()>,
location=0x7fad31978a60 "auxiliary test code (environments or event listeners)") at /spare/msciolla/workspace/test/../externals/GMock/gtest/src/gtest.cc:2114
#11 0x00007fad31954c25 in testing::UnitTest::Run (this=0x7fad31ba1080 <testing::UnitTest::GetInstance()::instance>)
at /spare/msciolla/test/../externals/GMock/gtest/src/gtest.cc:3929
#12 0x0000000000c1d973 in RUN_ALL_TESTS () at /spare/msciolla/workspace/test/../externals/GMock/gtest/include/gtest/gtest.h:2288
#13 0x0000000000c1d671 in main (argc=1, argv=0x7fff23483038) at /spare/msciolla/workspace/test/TestUnit/testunit.cpp:59
Do you know the reason of the different behaviour?
Thanks in advance
Updated by Koen Deforche over 9 years ago
- Status changed from New to Feedback
- Assignee set to Koen Deforche
Hey,
No idea --- but, this is your first call inside the Wt library in this process, so there may be a simple misbuild that is the reason?
Can you check if anything else does work correctly, e.g. instantiating a WSvgImage with a WPainter?
Koen
Updated by Koen Deforche about 9 years ago
- Tracker changed from Bug to Support
- Status changed from Feedback to Closed