Hi all,
I'm trying to write some unit test for our application.

I'm experiencing a segmentation fault when the application class instance
is destroyed, the following example is enough:


////////////// main.cpp ///////////////////////////////////
#include <Wt/Test/WTestEnvironment>

class WebToTest : public Wt::WApplication {
 public:
  WebToTest(const Wt::WEnvironment& anEnv)
      :Wt::WApplication(anEnv)
  {}
};

int main(int /*argc*/, char **/*argv*/){
  Wt::Test::WTestEnvironment myEnv;

  WebToTest myApplication(myEnv);

  myApplication.quit();
}
////////////////////////////////////////////////////////////////


$ g++ main.cpp -lwt
$ ./a.out
Reading: /etc/wt/wt_config.xml
[2010-Nov-25 11:06:18.796511] 9390 - [notice] "Wt: initializing test
environment"
[2010-Nov-25 11:06:18.796586] 9390 - [notice] "Reading Wt config file:
/etc/wt/wt_config.xml (location = '/')"
[2010-Nov-25 11:06:18.796733] 9390 [/ testwtd] [notice] "Session
created (#sessions = 1)"
Segmentation fault (core dumped)

this is the stack trace:

#0  0x00007f86f3082bbe in std::ostream::sentry::sentry(std::ostream&)
() from /usr/lib/libstdc++.so.6
#1  0x00007f86f30834b8 in std::basic_ostream<char,
std::char_traits<char> >& std::__ostream_insert<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*, long) ()
   from /usr/lib/libstdc++.so.6
#2  0x00007f86f353e48a in operator<< <char, std::char_traits<char>,
std::allocator<char> > (this=<value optimized out>, s=<value optimized
out>) at /usr/include/c++/4.4/bits/basic_string.h:2506
#3  Wt::WLogger::addLine (this=<value optimized out>, s=<value
optimized out>) at /root/Installed/wt-3.1.6/src/Wt/WLogger.C:197
#4  0x00007f86f353ee19 in ~WLogEntry (this=0x7fffde9e9a10,
__in_chrg=<value optimized out>) at
/root/Installed/wt-3.1.6/src/Wt/WLogger.C:27
#5  0x00007f86f366f417 in ~WebSession (this=0x2544220,
__in_chrg=<value optimized out>) at
/root/Installed/wt-3.1.6/src/web/WebSession.C:158
#6  0x00007f86f3635d12 in checked_delete<Wt::WebSession> (this=<value
optimized out>) at /usr/include/boost/checked_delete.hpp:34
#7  boost::detail::sp_counted_impl_p<Wt::WebSession>::dispose
(this=<value optimized out>) at
/usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#8  0x00007f86f3635b9a in boost::detail::sp_counted_base::release
(this=0x7fffde9ea060, __in_chrg=<value optimized out>) at
/usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
#9  ~shared_count (this=0x7fffde9ea060, __in_chrg=<value optimized
out>) at /usr/include/boost/smart_ptr/detail/shared_count.hpp:217
#10 ~shared_ptr (this=0x7fffde9ea060, __in_chrg=<value optimized out>)
at /usr/include/boost/smart_ptr/shared_ptr.hpp:169
#11 ~WTestEnvironment (this=0x7fffde9ea060, __in_chrg=<value optimized
out>) at /root/Installed/wt-3.1.6/src/Wt/Test/WTestEnvironment.C:82
#12 0x000000000040151a in main ()


am I missing something?

Regards
Gaetano Mendola


-- 
cpp-today.blogspot.com

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to