Project

General

Profile

*Pls help* Ubuntu PLS PLS

Added by Hi AmNewb over 8 years ago

I am using:

*Ubuntu 14.04

libbost_all_dev 1.54.0.1

witty 3.3.4+dfsg-1~trusty~pgquiles1*

in my dir i have hello.cpp and builded hello.wt only. Do i need to include something more?

i build hello example with no errors (using "g -o hello.wt hello.cpp -lwthttp -lwt" command)

When i start it (using "./hello.wt ---docroot . ---http-address 0.0.0.0 ---http-port 9090" command)

i can connect to 0.0.0.0:9090 but when i press button it crashes with error "Segmentation fault (core dumped)"

i used hello example

#include <Wt/WApplication>
#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WLineEdit>
#include <Wt/WPushButton>
#include <Wt/WText>

class HelloApplication : public Wt::WApplication
{
public:
    HelloApplication(const Wt::WEnvironment& env);

private:
    Wt::WLineEdit *nameEdit_;
    Wt::WText *greeting_;

    void greet();
};

HelloApplication::HelloApplication(const Wt::WEnvironment& env)
    : Wt::WApplication(env)
{
    setTitle("Hello world");

    root()->addWidget(new Wt::WText("Your name, please ? "));
    nameEdit_ = new Wt::WLineEdit(root());
    Wt::WPushButton *button = new Wt::WPushButton("Greet me.", root());
    root()->addWidget(new Wt::WBreak());
    greeting_ = new Wt::WText(root());
    button->clicked().connect(this, &HelloApplication::greet);
}

void HelloApplication::greet()
{
    greeting_->setText("Hello there, " + nameEdit_->text());
}

Wt::WApplication *createApplication(const Wt::WEnvironment& env)
{
    return new HelloApplication(env);
}

int main(int argc, char **argv)
{
    return Wt::WRun(argc, argv, &createApplication);
}

ERROR SHOWN IN TERMINAL WHERE I RUN WITTY APP

[2016-Jan-15 15:20:26.915628] 5415 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = './hello.wt')"
[2016-Jan-15 15:20:26.917621] 5415 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2016-Jan-15 15:20:26.918401] 5415 - [info] "wthttp: started server: http://0.0.0.0:9090"
[2016-Jan-15 15:20:32.511149] 5415 - [info] "Wt: session created (#sessions = 1)"
[2016-Jan-15 15:20:32.511475] 5415 [/ 9QrlUsf1B2U6hpUb] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/47.0.2526.106 Chrome/47.0.2526.106 Safari/537.36"
127.0.0.1 - - [2016-Jan-15 15:20:32.513017] "GET / HTTP/1.1" 200 2569
[2016-Jan-15 15:20:32.513156] 5415 - [info] "WebRequest: took 2.239ms"
127.0.0.1 - - [2016-Jan-15 15:20:32.642019] "GET /?wtd=9QrlUsf1B2U6hpUb&request=style HTTP/1.1" 200 91
[2016-Jan-15 15:20:32.642165] 5415 - [info] "WebRequest: took 91.256ms"
127.0.0.1 - - [2016-Jan-15 15:20:32.650372] "GET /resources/webkit-transitions.css HTTP/1.1" 404 85
127.0.0.1 - - [2016-Jan-15 15:20:32.650682] "GET /resources/themes/default/wt.css HTTP/1.1" 404 85
127.0.0.1 - - [2016-Jan-15 15:20:32.676079] "GET /?wtd=9QrlUsf1B2U6hpUb&sid=-1413987416&webGL=true&scrW=1920&scrH=1080&tz=60&htmlHistory=true&deployPath=%2F&request=script&rand=3556206256 HTTP/1.1" 200 90661
[2016-Jan-15 15:20:32.676771] 5415 - [info] "WebRequest: took 37.333ms"
127.0.0.1 - - [2016-Jan-15 15:20:32.887065] "POST /?wtd=9QrlUsf1B2U6hpUb HTTP/1.1" 200 51
[2016-Jan-15 15:20:32.887210] 5415 - [info] "WebRequest: took 1.199ms"
Segmentation fault (core dumped)

PLS HELP WHAT TO DO SO IT WORKS, IF ANYONE GOT IT WORKING ON UBUNTU TELL ME I WILL INSTALL EXACT VERSION AND EVRYING SAME, OR BUILD FORM SURCE IF THAT HELPS


Replies (5)

RE: *Pls help* Ubuntu PLS PLS - Added by Steven Descheemaeker over 8 years ago

try debugging with gdb so you can see where the segmentation fault comes from?

RE: *Pls help* Ubuntu PLS PLS - Added by Hi AmNewb over 8 years ago

First ty for replying

OK i got this running with gdb

 r --docroot . --http-address 0.0.0.0 --http-port 9090
Starting program: /home/me/Documents/Witty/nahnovije/hello.wt --docroot . --http-address 0.0.0.0 --http-port 9090
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[2016-Jan-15 18:26:56.102077] 12000 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/home/me/Documents/Witty/nahnovije/hello.wt')"
[2016-Jan-15 18:26:56.104817] 12000 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2016-Jan-15 18:26:56.105585] 12000 - [info] "wthttp: started server: http://0.0.0.0:9090"
[New Thread 0x7fffebb65700 (LWP 12004)]
[New Thread 0x7fffeb364700 (LWP 12005)]
[New Thread 0x7fffeab63700 (LWP 12006)]
[New Thread 0x7fffea362700 (LWP 12007)]
[New Thread 0x7fffe9b61700 (LWP 12008)]
[New Thread 0x7fffe9360700 (LWP 12009)]
[New Thread 0x7fffe8b5f700 (LWP 12010)]
[New Thread 0x7fffe3fff700 (LWP 12011)]
[New Thread 0x7fffe37fe700 (LWP 12012)]
[New Thread 0x7fffe2ffd700 (LWP 12013)]
[2016-Jan-15 18:27:07.122768] 12000 - [info] "Wt: session created (#sessions = 1)"
[2016-Jan-15 18:27:07.123141] 12000 [/ gy4atPBs6xMLq0Ug] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/47.0.2526.106 Chrome/47.0.2526.106 Safari/537.36"
[2016-Jan-15 18:27:07.123275] 12000 [/ gy4atPBs6xMLq0Ug] [info] "Wt: signal from dead session, sending reload."
[2016-Jan-15 18:27:07.123369] 12000 - [info] "WebController: Removing session gy4atPBs6xMLq0Ug"
[2016-Jan-15 18:27:07.123406] 12000 [/ gy4atPBs6xMLq0Ug] [info] "Wt: session destroyed (#sessions = 0)"
127.0.0.1 - - [2016-Jan-15 18:27:07.124055] "POST /?wtd=MIphpV1xap7RLYVe HTTP/1.1" 200 76
[2016-Jan-15 18:27:07.124247] 12000 - [info] "WebRequest: took 1.825ms"
[2016-Jan-15 18:27:09.617537] 12000 - [info] "Wt: session created (#sessions = 1)"
[2016-Jan-15 18:27:09.617725] 12000 [/ 1VBZjQnpCud3rqy6] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/47.0.2526.106 Chrome/47.0.2526.106 Safari/537.36"
127.0.0.1 - - [2016-Jan-15 18:27:09.619094] "GET / HTTP/1.1" 200 2567
[2016-Jan-15 18:27:09.619204] 12000 - [info] "WebRequest: took 1.778ms"
127.0.0.1 - - [2016-Jan-15 18:27:09.708657] "GET /?wtd=1VBZjQnpCud3rqy6&request=style HTTP/1.1" 200 91
[2016-Jan-15 18:27:09.708830] 12000 - [info] "WebRequest: took 70.108ms"
127.0.0.1 - - [2016-Jan-15 18:27:09.718460] "GET /resources/webkit-transitions.css HTTP/1.1" 404 85
127.0.0.1 - - [2016-Jan-15 18:27:09.718622] "GET /resources/themes/default/wt.css HTTP/1.1" 404 85
127.0.0.1 - - [2016-Jan-15 18:27:09.734556] "GET /?wtd=1VBZjQnpCud3rqy6&sid=-391106979&webGL=true&scrW=1920&scrH=1080&tz=60&htmlHistory=true&deployPath=%2F&request=script&rand=2520243687 HTTP/1.1" 200 90665
[2016-Jan-15 18:27:09.734693] 12000 - [info] "WebRequest: took 27.745ms"
127.0.0.1 - - [2016-Jan-15 18:27:09.942481] "POST /?wtd=1VBZjQnpCud3rqy6 HTTP/1.1" 200 50
[2016-Jan-15 18:27:09.942632] 12000 - [info] "WebRequest: took 1.051ms"

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe9360700 (LWP 12009)]
0x00007ffff6d0541b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

I guess now it has to do somthing with libstdc.so.6 i checked if there is one in /usr/lib/x86_64-linux-gnu/ and there is 1 libstdc.so.6: symbolic link to `libstdc.so.6.0.19'. Any suggestion now?

RE: *Pls help* Ubuntu PLS PLS - Added by Hi AmNewb over 8 years ago

ok i got bt that i frogot to post

(gdb) bt
#0  0x00007ffff6d0541b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff74baed9 in Wt::WString::toUTF8 (this=this@entry=0x7fffd8006800) at /build/buildd/witty-3.3.4+dfsg/src/Wt/WString.C:255
#2  0x00007ffff74bb953 in Wt::WString::operator+= (this=this@entry=0x7fffe9b5d960, rhs=...)
    at /build/buildd/witty-3.3.4+dfsg/src/Wt/WString.C:130
#3  0x00007ffff74bbb76 in Wt::operator+ (lhs=<optimized out>, rhs=...) at /build/buildd/witty-3.3.4+dfsg/src/Wt/WString.C:512
#4  0x000000000040390e in HelloApplication::greet (this=0x7fffd8001610) at hello.cpp:35
#5  0x000000000040e7fb in boost::_mfi::mf0<void, HelloApplication>::operator() (this=0x7fffd8008020, p=0x7fffd8001610)
    at /usr/include/boost/bind/mem_fn_template.hpp:49
#6  0x000000000040d89a in boost::_bi::list1<boost::_bi::value<HelloApplication*> >::operator()<boost::_mfi::mf0<void, HelloApplication>, boost::_bi::list1<Wt::WMouseEvent&> > (this=0x7fffd8008030, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
#7  0x000000000040c6ae in boost::_bi::bind_t<void, boost::_mfi::mf0<void, HelloApplication>, boost::_bi::list1<boost::_bi::value<HelloApplication*> > >::operator()<Wt::WMouseEvent> (this=0x7fffd8008020, a1=...) at /usr/include/boost/bind/bind_template.hpp:32
#8  0x000000000040b40d in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf0<void, HelloApplication>, boost::_bi::list1<boost::_bi::value<HelloApplication*> > >, void, Wt::WMouseEvent>::invoke (function_obj_ptr=..., a0=...)
    at /usr/include/boost/function/function_template.hpp:153
#9  0x00007ffff73c320b in operator() (a0=..., this=0x7fffd8008018) at /usr/include/boost/function/function_template.hpp:767
#10 m_invoke<boost::function<void(Wt::WMouseEvent)>, 0u, Wt::WMouseEvent&> (args=..., func=..., this=<optimized out>)
    at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:92
#11 operator()<boost::function<void(Wt::WMouseEvent)>, Wt::WMouseEvent&, 1ul> (args=..., func=..., this=<optimized out>)
    at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:81
#12 m_invoke<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > > (
    connectionBody=..., this=<optimized out>) at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:117
#13 operator()<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > > (
    connectionBody=..., this=<optimized out>) at /usr/include/boost/signals2/detail/variadic_slot_invoker.hpp:110
#14 dereference (this=0x7fffe9b5db40) at /usr/include/boost/signals2/detail/slot_call_iterator.hpp:82
#15 dereference<boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::WMouseEvent>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > > (f=...)
    at /usr/include/boost/iterator/iterator_facade.hpp:514
#16 operator* (this=0x7fffe9b5db40) at /usr/include/boost/iterator/iterator_facade.hpp:639
#17 operator()<boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::WMouseEvent>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > > (last=..., first=..., 
---Type <return> to continue, or q <return> to quit---
    this=<optimized out>) at /usr/include/boost/signals2/optional_last_value.hpp:55
#18 operator()<boost::signals2::optional_last_value<void>, boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::WMouseEvent>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::WMouseEvent), boost::function<void(Wt::WMouseEvent)> >, boost::signals2::mutex> > > (last=..., first=..., combiner=..., this=<optimized out>) at /usr/include/boost/signals2/detail/result_type_wrapper.hpp:64
#19 boost::signals2::detail::signal_impl<void (Wt::WMouseEvent), boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void (Wt::WMouseEvent)>, boost::function<void (boost::signals2::connection const&, Wt::WMouseEvent)>, boost::signals2::mutex>::operator()(Wt::WMouseEvent) (this=<optimized out>, args#0=...) at /usr/include/boost/signals2/detail/signal_template.hpp:246
#20 0x00007ffff754a85f in operator() (args#0=..., this=0x7fffd8006db0) at /usr/include/boost/signals2/detail/signal_template.hpp:695
#21 Wt::EventSignal<Wt::WMouseEvent>::processDynamic (this=0x7fffd8006d40, jse=...) at /build/buildd/witty-3.3.4+dfsg/src/Wt/WSignal:1180
#22 0x00007ffff7685086 in Wt::WebSession::processSignal (this=this@entry=0x7fffdc001af0, s=0x7fffd8006d40, se="", request=..., 
    kind=kind@entry=Wt::WebSession::Dynamic) at /build/buildd/witty-3.3.4+dfsg/src/web/WebSession.C:2818
#23 0x00007ffff768c938 in Wt::WebSession::notifySignal (this=this@entry=0x7fffdc001af0, e=...)
    at /build/buildd/witty-3.3.4+dfsg/src/web/WebSession.C:2792
#24 0x00007ffff768e5d3 in Wt::WebSession::notify (this=0x7fffdc001af0, event=...)
    at /build/buildd/witty-3.3.4+dfsg/src/web/WebSession.C:2351
#25 0x00007ffff76892fb in Wt::WebSession::handleRequest (this=0x7fffdc001af0, handler=...)
    at /build/buildd/witty-3.3.4+dfsg/src/web/WebSession.C:1619
#26 0x00007ffff767be63 in Wt::WebController::handleRequest (this=0x65cfb0, request=0x7fffd00019d0)
    at /build/buildd/witty-3.3.4+dfsg/src/web/WebController.C:713
#27 0x00007ffff7baec0f in operator() (a1=0x7fffd00019d0, p=0x65cfb0, this=<synthetic pointer>)
    at /usr/include/boost/bind/mem_fn_template.hpp:165
#28 operator()<boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list0> (a=<synthetic pointer>, 
    f=<synthetic pointer>, this=<synthetic pointer>) at /usr/include/boost/bind/bind.hpp:313
#29 operator() (this=<synthetic pointer>) at /usr/include/boost/bind/bind_template.hpp:20
#30 asio_handler_invoke<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > > (function=...)
    at /usr/include/boost/asio/handler_invoke_hook.hpp:64
#31 invoke<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > >, boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > > (
    context=<synthetic pointer>, function=<synthetic pointer>) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#32 boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > >::do_complete (owner=0x661e90, 
    base=0x7fffe4025910) at /usr/include/boost/asio/detail/completion_handler.hpp:68
#33 0x00007ffff7b81e9f in complete (bytes_transferred=<optimized out>, ec=..., owner=..., this=0x7fffe4025910)
    at /usr/include/boost/asio/detail/task_io_service_operation.hpp:37
#34 do_run_one (ec=..., this_thread=..., lock=..., this=0x661e90) at /usr/include/boost/asio/detail/impl/task_io_service.ipp:384
---Type <return> to continue, or q <return> to quit---
#35 boost::asio::detail::task_io_service::run (this=0x661e90, ec=...) at /usr/include/boost/asio/detail/impl/task_io_service.ipp:153
#36 0x00007ffff740e90c in run (this=0x665ea8) at /usr/include/boost/asio/impl/io_service.ipp:59
#37 Wt::WIOService::run (this=0x665ea0) at /build/buildd/witty-3.3.4+dfsg/src/Wt/WIOService.C:180
#38 0x00007ffff5581a4a in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.54.0
#39 0x00007ffff5794182 in start_thread (arg=0x7fffe9b61700) at pthread_create.c:312
#40 0x00007ffff676947d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

RE: *Pls help* Ubuntu PLS PLS - Added by Koen Deforche over 8 years ago

Try adding -std=cxx11 ((or something along those lines, I am currently on flaky Internet) to your computer flags.

RE: *Pls help* Ubuntu PLS PLS - Added by Hi AmNewb over 8 years ago

got it working buy bulding from scrach with

cmake -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick -DWT_CPP_11_MODE=-std=c++0x -DCONNECTOR_FCGI=OFF -DWT_SIGNALS_IMPLEMENTATION=boost.signals2 ..

    (1-5/5)