On 2012-06-04 08:15, Koen Deforche wrote:
Hey Rutger,

We have several users using Wt with c++11, so that is not expected.

Your test-case works for me on MacOSX and Ubuntu Linux (gcc 4.4.3),
with boost 1.37 and boost 1.48, and using c++0x as C++ target.

What does valgrind say about the crashes you get ?

Regards,
koen


Hello Koen,

I'm compiling hello.C from the Wt examples, but from my own (cmake-based) compilation environment, using g++ 4.7.0, boost 1.49, and Wt 3.2.1,

/usr/bin/c++ -DBOOST_ASIO_DISABLE_MOVE -DQT_NO_KEYWORDS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore -I/home/rutger/.../sandbox/wt -Wall -std=c++0x -pedantic -Wno-long-long -g -o CMakeFiles/hello_wt.dir/hello.C.o -c /home/rutger/.../sandbox/wt/hello.C

/usr/bin/c++ CMakeFiles/hello_wt.dir/hello.C.o -o hello_wt -rdynamic -lwt -lwthttp -lboost_program_options-mt -lboost_signals-mt -lboost_system-mt -lboost_thread-mt

the application starts, but the creation of the new WApplication crashes due to connecting a signal. Also see the file attached.

The crash goes away when leaving out std=c++0x.

Regards,

Rutger

==8500== Memcheck, a memory error detector
==8500== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==8500== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==8500== Command: wt/hello_wt
==8500== Parent PID: 7560
==8500== 
==8500== Thread 11:
==8500== Invalid read of size 8
==8500==    at 0x5BF8BF0: 
boost::signals::detail::named_slot_map::insert(boost::signals::detail::stored_group
 const&, boost::signals::connection const&, boost::any const&, 
boost::signals::connect_position) (in /usr/lib/libboost_signals.so.1.49.0)
==8500==    by 0x5BFC545: 
boost::signals::detail::signal_base_impl::connect_slot(boost::any const&, 
boost::signals::detail::stored_group const&, 
boost::shared_ptr<boost::signals::detail::slot_base::data_t>, 
boost::signals::connect_position) (in /usr/lib/libboost_signals.so.1.49.0)
==8500==    by 0x40EC82: boost::signal1<void, Wt::WMouseEvent, 
boost::last_value<void>, int, std::less<int>, boost::function1<void, 
Wt::WMouseEvent> >::connect(boost::slot<boost::function1<void, Wt::WMouseEvent> 
> const&, boost::signals::connect_position) (signal_template.hpp:286)
==8500==    by 0x40E525: boost::signals::connection 
Wt::EventSignal<Wt::WMouseEvent>::connect<HelloApplication, 
HelloApplication>(HelloApplication*, void (HelloApplication::*)()) 
(WSignal:1007)
==8500==    by 0x40D375: HelloApplication::HelloApplication(Wt::WEnvironment 
const&) (hello.C:63)
==8500==    by 0x40D55D: createApplication(Wt::WEnvironment const&) (hello.C:93)
==8500==    by 0x40FD6B: 
boost::detail::function::function_invoker1<Wt::WApplication* 
(*)(Wt::WEnvironment const&), Wt::WApplication*, Wt::WEnvironment 
const&>::invoke(boost::detail::function::function_buffer&, Wt::WEnvironment 
const&) (function_template.hpp:95)
==8500==    by 0x52F985E: 
Wt::WebController::doCreateApplication(Wt::WebSession*) 
(function_template.hpp:760)
==8500==    by 0x5304C12: Wt::WebSession::start() (WebSession.C:583)
==8500==    by 0x530A314: 
Wt::WebSession::handleRequest(Wt::WebSession::Handler&) (WebSession.C:1360)
==8500==    by 0x52FCBCD: Wt::WebController::handleRequest(Wt::WebRequest*) 
(WebController.C:612)
==8500==    by 0x576097A: http::server::WtReply::consumeRequestBody(char 
const*, char const*, http::server::Request::State) (WtReply.C:137)
==8500==  Address 0xeeb0688 is not stack'd, malloc'd or (recently) free'd
==8500== 
==8500== Invalid read of size 8
==8500==    at 0x5BF8A7D: 
boost::signals::detail::named_slot_map::insert(boost::signals::detail::stored_group
 const&, boost::signals::connection const&, boost::any const&, 
boost::signals::connect_position) (in /usr/lib/libboost_signals.so.1.49.0)
==8500==    by 0x5BFC545: 
boost::signals::detail::signal_base_impl::connect_slot(boost::any const&, 
boost::signals::detail::stored_group const&, 
boost::shared_ptr<boost::signals::detail::slot_base::data_t>, 
boost::signals::connect_position) (in /usr/lib/libboost_signals.so.1.49.0)
==8500==    by 0x40EC82: boost::signal1<void, Wt::WMouseEvent, 
boost::last_value<void>, int, std::less<int>, boost::function1<void, 
Wt::WMouseEvent> >::connect(boost::slot<boost::function1<void, Wt::WMouseEvent> 
> const&, boost::signals::connect_position) (signal_template.hpp:286)
==8500==    by 0x40E525: boost::signals::connection 
Wt::EventSignal<Wt::WMouseEvent>::connect<HelloApplication, 
HelloApplication>(HelloApplication*, void (HelloApplication::*)()) 
(WSignal:1007)
==8500==    by 0x40D375: HelloApplication::HelloApplication(Wt::WEnvironment 
const&) (hello.C:63)
==8500==    by 0x40D55D: createApplication(Wt::WEnvironment const&) (hello.C:93)
==8500==    by 0x40FD6B: 
boost::detail::function::function_invoker1<Wt::WApplication* 
(*)(Wt::WEnvironment const&), Wt::WApplication*, Wt::WEnvironment 
const&>::invoke(boost::detail::function::function_buffer&, Wt::WEnvironment 
const&) (function_template.hpp:95)
==8500==    by 0x52F985E: 
Wt::WebController::doCreateApplication(Wt::WebSession*) 
(function_template.hpp:760)
==8500==    by 0x5304C12: Wt::WebSession::start() (WebSession.C:583)
==8500==    by 0x530A314: 
Wt::WebSession::handleRequest(Wt::WebSession::Handler&) (WebSession.C:1360)
==8500==    by 0x52FCBCD: Wt::WebController::handleRequest(Wt::WebRequest*) 
(WebController.C:612)
==8500==    by 0x576097A: http::server::WtReply::consumeRequestBody(char 
const*, char const*, http::server::Request::State) (WtReply.C:137)
==8500==  Address 0x98 is not stack'd, malloc'd or (recently) free'd
==8500== 
==8500== 
==8500== Process terminating with default action of signal 11 (SIGSEGV)
==8500==  Access not within mapped region at address 0x98
==8500==    at 0x5BF8A7D: 
boost::signals::detail::named_slot_map::insert(boost::signals::detail::stored_group
 const&, boost::signals::connection const&, boost::any const&, 
boost::signals::connect_position) (in /usr/lib/libboost_signals.so.1.49.0)
==8500==    by 0x5BFC545: 
boost::signals::detail::signal_base_impl::connect_slot(boost::any const&, 
boost::signals::detail::stored_group const&, 
boost::shared_ptr<boost::signals::detail::slot_base::data_t>, 
boost::signals::connect_position) (in /usr/lib/libboost_signals.so.1.49.0)
==8500==    by 0x40EC82: boost::signal1<void, Wt::WMouseEvent, 
boost::last_value<void>, int, std::less<int>, boost::function1<void, 
Wt::WMouseEvent> >::connect(boost::slot<boost::function1<void, Wt::WMouseEvent> 
> const&, boost::signals::connect_position) (signal_template.hpp:286)
==8500==    by 0x40E525: boost::signals::connection 
Wt::EventSignal<Wt::WMouseEvent>::connect<HelloApplication, 
HelloApplication>(HelloApplication*, void (HelloApplication::*)()) 
(WSignal:1007)
==8500==    by 0x40D375: HelloApplication::HelloApplication(Wt::WEnvironment 
const&) (hello.C:63)
==8500==    by 0x40D55D: createApplication(Wt::WEnvironment const&) (hello.C:93)
==8500==    by 0x40FD6B: 
boost::detail::function::function_invoker1<Wt::WApplication* 
(*)(Wt::WEnvironment const&), Wt::WApplication*, Wt::WEnvironment 
const&>::invoke(boost::detail::function::function_buffer&, Wt::WEnvironment 
const&) (function_template.hpp:95)
==8500==    by 0x52F985E: 
Wt::WebController::doCreateApplication(Wt::WebSession*) 
(function_template.hpp:760)
==8500==    by 0x5304C12: Wt::WebSession::start() (WebSession.C:583)
==8500==    by 0x530A314: 
Wt::WebSession::handleRequest(Wt::WebSession::Handler&) (WebSession.C:1360)
==8500==    by 0x52FCBCD: Wt::WebController::handleRequest(Wt::WebRequest*) 
(WebController.C:612)
==8500==    by 0x576097A: http::server::WtReply::consumeRequestBody(char 
const*, char const*, http::server::Request::State) (WtReply.C:137)
==8500==  If you believe this happened as a result of a stack
==8500==  overflow in your program's main thread (unlikely but
==8500==  possible), you can try to increase the size of the
==8500==  main thread stack using the --main-stacksize= flag.
==8500==  The main thread stack size used in this run was 8388608.
==8500== 
==8500== HEAP SUMMARY:
==8500==     in use at exit: 291,689 bytes in 4,691 blocks
==8500==   total heap usage: 7,015 allocs, 2,324 frees, 847,634 bytes allocated
==8500== 
==8500== LEAK SUMMARY:
==8500==    definitely lost: 0 bytes in 0 blocks
==8500==    indirectly lost: 0 bytes in 0 blocks
==8500==      possibly lost: 31,680 bytes in 612 blocks
==8500==    still reachable: 260,009 bytes in 4,079 blocks
==8500==         suppressed: 0 bytes in 0 blocks
==8500== Rerun with --leak-check=full to see details of leaked memory
==8500== 
==8500== For counts of detected and suppressed errors, rerun with: -v
==8500== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 18 from 6)
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to