I had trouble reproducing the testcase on an other system; please find attached a slightly modified main.cpp which guarantees a segfault (on this system, at least).

Thanks,

Rutger


Backtrace:

#0 0x0000000000412da3 in boost::asio::detail::reactive_socket_service_base::destroy (this=0x2a, impl=...) at /usr/include/boost/asio/detail/impl/reactive_socket_service_base.ipp:87 #1 0x0000000000414cdb in boost::asio::socket_acceptor_service<boost::asio::ip::tcp>::destroy (this=0x2, impl=...)
    at /usr/include/boost/asio/socket_acceptor_service.hpp:119
#2 0x00000000004145f5 in boost::asio::basic_io_object<boost::asio::socket_acceptor_service<boost::asio::ip::tcp>, true>::~basic_io_object (this=0x6541a0,
    __in_chrg=<optimized out>)
    at /usr/include/boost/asio/basic_io_object.hpp:196
#3 0x00000000004132ea in boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> >::~basic_socket_acceptor (this=0x6541a0, __in_chrg=<optimized out>)
    at /usr/include/boost/asio/basic_socket_acceptor.hpp:54
#4  0x00007ffff730cbcd in http::server::Server::Server (this=0x654050,
    config=..., wtServer=...)
    at /home/pgquiles/wt/b/witty-3.2.1/src/http/Server.C:65
#5  0x00007ffff732171e in Wt::WServer::start (this=0x7fffffffe110)
    at /home/pgquiles/wt/b/witty-3.2.1/src/http/WServer.C:147
#6  0x0000000000413436 in server::run (this=0x7fffffffe0e0)
    at /home/rutger/.../main.cpp:17
#7  0x000000000040f373 in main (argc=1, argv=0x7fffffffe298)
    at /home/rutger/.../main.cpp:36



#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/address.hpp>
#include <Wt/WServer>
#include <cstdlib>

struct server {
    
    server():
        acc( ios ) {}
    
    void run() {
        server_.setServerConfiguration( 1, 0, "/etc/wt/wthttpd" );
        bool success = server_.start();

        std::cout << "Server started: " << success << std::endl;
        
        // this point of code is never reached...
        // commenting out the following two lines will remove segfault
        boost::asio::ip::tcp::endpoint endpoint( boost::asio::ip::tcp::v4(), 1024 );
        this->acc.open( endpoint.protocol() );
        
    }
    
    void somewhere_else() {
    }
    
    
    boost::asio::io_service ios;
    boost::asio::ip::tcp::acceptor acc;
    Wt::WServer server_;

    
};


int main( int argc, char *argv[] ) {
    server a;
    a.run();
    return EXIT_SUCCESS;
}

------------------------------------------------------------------------------
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