Project

General

Profile

Can't use JSignal, SIGABRT when render element

Added by Long Nguyễn Đức about 7 years ago

When I add JSignal to WMediaPlayer, the program seems to stop when rendering the element at first time.

Declaration:

class VideoPlayer : public Wt::WMediaPlayer
{
  /* ... */
private:
  Wt::JSignal<> restore_;
};

Implementation:

VideoPlayer::VideoPlayer()
  :
  /* ... */
  restore_(this, "restore", true)
{ /* ... */ };

Backtrace:

*** Error in `/home/looooooooong/Dropbox/c++/ubrand-private-server/server_d.wt': double free or corruption (out): 0x00007fffd001ef90 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe6ffd700 (LWP 30636)]
0x00007ffff5967267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0  0x00007ffff5967267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007ffff5968eca in __GI_abort () at abort.c:89
#2  0x00007ffff59aac53 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff5ac31a8 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff59b2c69 in malloc_printerr (ptr=<optimized out>, str=0x7ffff5ac32b8 "double free or corruption (out)", action=1)
    at malloc.c:4965
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3834
#5  0x00007ffff59b689c in __GI___libc_free (mem=<optimized out>) at malloc.c:2950
#6  0x00007ffff6a3eda1 in deallocate (this=<optimized out>, __p=0x7fffd001ef90) at /usr/include/c++/4.9/ext/new_allocator.h:110
#7  deallocate (__a=..., __n=<optimized out>, __p=0x7fffd001ef90) at /usr/include/c++/4.9/ext/alloc_traits.h:185
#8  _M_deallocate (this=<optimized out>, __n=<optimized out>, __p=0x7fffd001ef90) at /usr/include/c++/4.9/bits/stl_vector.h:178
#9  ~_Vector_base (this=0x7fffd001ef90, __in_chrg=<optimized out>) at /usr/include/c++/4.9/bits/stl_vector.h:160
#10 ~vector (this=0x7fffd001ef90, __in_chrg=<optimized out>) at /usr/include/c++/4.9/bits/stl_vector.h:425
#11 Wt::WWebWidget::TransientImpl::~TransientImpl (this=0x7fffd001ef30, __in_chrg=<optimized out>)
    at /home/looooooooong/winst/wt-git/src/Wt/WWebWidget.C:74
#12 0x00007ffff6a43be8 in Wt::WWebWidget::updateDom (this=this@entry=0x7fffd001ec00, element=..., all=all@entry=true)
    at /home/looooooooong/winst/wt-git/src/Wt/WWebWidget.C:1825
#13 0x00007ffff68de384 in Wt::WInteractWidget::updateDom (this=this@entry=0x7fffd001ec00, element=..., all=all@entry=true)
    at /home/looooooooong/winst/wt-git/src/Wt/WInteractWidget.C:519
#14 0x00007ffff6857034 in Wt::WContainerWidget::updateDom (this=0x7fffd001ec00, element=..., all=<optimized out>)
    at /home/looooooooong/winst/wt-git/src/Wt/WContainerWidget.C:529
#15 0x00007ffff6a3daea in Wt::WWebWidget::createDomElement (this=this@entry=0x7fffd001ec00, app=app@entry=0x7fffd0019d80)
    at /home/looooooooong/winst/wt-git/src/Wt/WWebWidget.C:2140
#16 0x00007ffff68577f0 in Wt::WContainerWidget::createDomElement (this=0x7fffd001ec00, app=0x7fffd0019d80, addChildren=<optimized out>)
    at /home/looooooooong/winst/wt-git/src/Wt/WContainerWidget.C:660
#17 0x00007ffff6a3de57 in Wt::WWebWidget::createActualElement (this=0x7fffd001ec00, self=self@entry=0x7fffd001ec00, 
    app=app@entry=0x7fffd0019d80) at /home/looooooooong/winst/wt-git/src/Wt/WWebWidget.C:2188
#18 0x00007ffff6a50f85 in Wt::WWidget::createSDomElement (this=0x7fffd001ec00, app=app@entry=0x7fffd0019d80)
    at /home/looooooooong/winst/wt-git/src/Wt/WWidget.C:365
#19 0x00007ffff6855542 in Wt::WContainerWidget::rootAsJavaScript (this=0x7fffd001b610, app=app@entry=0x7fffd0019d80, out=..., 
    all=all@entry=false) at /home/looooooooong/winst/wt-git/src/Wt/WContainerWidget.C:790
#20 0x00007ffff6bf9058 in Wt::WebRenderer::collectJavaScript (this=this@entry=0x7fffd000d0e8)
    at /home/looooooooong/winst/wt-git/src/web/WebRenderer.C:781
#21 0x00007ffff6bfa078 in Wt::WebRenderer::serveJavaScriptUpdate (this=this@entry=0x7fffd000d0e8, response=...)
    at /home/looooooooong/winst/wt-git/src/web/WebRenderer.C:578
#22 0x00007ffff6bfbf71 in Wt::WebRenderer::serveResponse (this=this@entry=0x7fffd000d0e8, response=...)
    at /home/looooooooong/winst/wt-git/src/web/WebRenderer.C:265
#23 0x00007ffff6be4e65 in Wt::WebSession::notify (this=0x7fffd000d000, event=...) at /home/looooooooong/winst/wt-git/src/web/WebSession.C:2081
#24 0x00007ffff6be8779 in Wt::WebSession::pushUpdates (this=0x7fffd000d000) at /home/looooooooong/winst/wt-git/src/web/WebSession.C:1964
#25 0x00007ffff6beefaf in Wt::WebSocketMessage::flush(Wt::WebRequest::ResponseState, boost::function<void (Wt::WebWriteEvent)> const&) (
    this=0x7fffd8000b20, state=Wt::WebRequest::ResponseDone, callback=...) at /home/looooooooong/winst/wt-git/src/web/WebSocketMessage.C:30
---Type <return> to continue, or q <return> to quit---
#26 0x00007ffff6bdcdda in Wt::WebSession::Handler::flushResponse (this=this@entry=0x7fffe6ffab40)
    at /home/looooooooong/winst/wt-git/src/web/WebSession.C:1057
#27 0x00007ffff6bdd002 in Wt::WebSession::serveResponse (this=this@entry=0x7fffd000d000, handler=...)
    at /home/looooooooong/winst/wt-git/src/web/WebSession.C:2678
#28 0x00007ffff6be2d92 in Wt::WebSession::render (this=this@entry=0x7fffd000d000, handler=...)
    at /home/looooooooong/winst/wt-git/src/web/WebSession.C:2614
#29 0x00007ffff6be4eca in Wt::WebSession::notify (this=0x7fffd000d000, event=...) at /home/looooooooong/winst/wt-git/src/web/WebSession.C:2118
#30 0x00007ffff6bdfde0 in Wt::WebSession::handleRequest (this=0x7fffd000d000, handler=...)
    at /home/looooooooong/winst/wt-git/src/web/WebSession.C:1646
#31 0x00007ffff6be94e4 in Wt::WebSession::handleWebSocketMessage (session=..., event=<optimized out>)
    at /home/looooooooong/winst/wt-git/src/web/WebSession.C:1877
#32 0x00007ffff6bebb7b in operator()<void (*)(boost::weak_ptr<Wt::WebSession>, Wt::WebReadEvent), boost::_bi::list1<Wt::WebReadEvent&> > (
    f=<optimized out>, a=<synthetic pointer>, this=<optimized out>) at /usr/local/include/boost/bind/bind.hpp:313
#33 operator()<Wt::WebReadEvent> (a1=<synthetic pointer>, this=<optimized out>) at /usr/local/include/boost/bind/bind_template.hpp:32
#34 boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, void (*)(boost::weak_ptr<Wt::WebSession>, Wt::WebReadEvent), boost::_bi::list2<boost::_bi::value<boost::weak_ptr<Wt::WebSession> >, boost::arg<1> > >, void, Wt::WebReadEvent>::invoke (function_obj_ptr=..., 
    a0=<optimized out>) at /usr/local/include/boost/function/function_template.hpp:159
#35 0x00007ffff63073b9 in operator() (a0=<optimized out>, this=0x7fffe6ffcd00) at /usr/local/include/boost/function/function_template.hpp:773
#36 operator()<boost::function<void(Wt::WebReadEvent)>, boost::_bi::list0> (a=<synthetic pointer>, f=..., this=0x7fffe6ffcd20)
    at /usr/local/include/boost/bind/bind.hpp:253
#37 operator() (this=0x7fffe6ffcd00) at /usr/local/include/boost/bind/bind_template.hpp:20
#38 asio_handler_invoke<boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void(Wt::WebReadEvent)>, boost::_bi::list1<boost::_bi::value<Wt::WebReadEvent> > > > (function=...) at /usr/local/include/boost/asio/handler_invoke_hook.hpp:69
#39 invoke<boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void(Wt::WebReadEvent)>, boost::_bi::list1<boost::_bi::value<Wt::WebReadEvent> > >, boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void(Wt::WebReadEvent)>, boost::_bi::list1<boost::_bi::value<Wt::WebReadEvent> > > > (context=..., function=...) at /usr/local/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#40 boost::asio::detail::completion_handler<boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void (Wt::WebReadEvent)>, boost::_bi::list1<boost::_bi::value<Wt::WebReadEvent> > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) (owner=0x6b6be0, base=<optimized out>)
    at /usr/local/include/boost/asio/detail/completion_handler.hpp:68
#41 0x00007ffff68e3181 in complete (bytes_transferred=<optimized out>, ec=..., owner=..., this=<optimized out>)
    at /usr/local/include/boost/asio/detail/task_io_service_operation.hpp:38
#42 do_run_one (ec=..., this_thread=..., lock=..., this=0x6b6be0) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:372
#43 boost::asio::detail::task_io_service::run (this=0x6b6be0, ec=...) at /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:149
#44 0x00007ffff68e0ad9 in run (this=0x6b5b78) at /usr/local/include/boost/asio/impl/io_service.ipp:59
#45 Wt::WIOService::run (this=0x6b5b70) at /home/looooooooong/winst/wt-git/src/Wt/WIOService.C:180
#46 0x00007ffff7496bfa in thread_proxy () from /usr/local/lib/libboost_thread.so.1.58.0
#47 0x00007ffff4f8b6aa in start_thread (arg=0x7fffe6ffd700) at pthread_create.c:333
#48 0x00007ffff5a38eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Replies (2)

RE: Can't use JSignal, SIGABRT when render element - Added by Long Nguyễn Đức about 7 years ago

Looks like I reached the maximum size/fields a C object can handle.

RE: Can't use JSignal, SIGABRT when render element - Added by Koen Deforche about 7 years ago

That looks like a genuine memory corruption. Can you try valgrind and see what it says about it?

    (1-2/2)