Project

General

Profile

Trouble with JSignal crashing on page reload

Added by Ben Ritter about 7 years ago

So I have created a widget that has a JSignal<> and constructs it in the constructor. This works fine and when the page loads and the widget is created, it properly responds to the JS call on the browser as needed. However, if I reload the page (F5) in the browser (Firefox) Wt crashes with the following error message:

/usr/local/include/boost/signals2/detail/slot_groups.hpp:150: boost::signals2::detail::grouped_list<Group, GroupCompare, ValueType>::iterator boost::signals2::detail::grouped_list<Group, GroupCompare, ValueType>::erase(const group_key_type&, const iterator&) [with Group = int; GroupCompare = std::less<int>; ValueType = boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass), boost::function<void(Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass)> >, boost::signals2::mutex> >; boost::signals2::detail::grouped_list<Group, GroupCompare, ValueType>::iterator = 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::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass), boost::function<void(Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass)> >, boost::signals2::mutex> > >; boost::signals2::detail::grouped_list<Group, GroupCompare, ValueType>::group_key_type = std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >]: Assertion `map_it != _group_map.end()' failed.

Here is a minimal example of my code:

class MyWidget : public Wt::WContainerWidget{
public:
  MyWidget(Wt::WContainerWidget* parent = nullptr) :
    Wt::WContainerWidget(parent),
    mySignal(this, "specialName")
  {}

  ...
private:
  ...
  Wt::JSignal<> mySignal;
};

This issue occurs even when I'm not doing anything with mySignal from the C end nor the JS end, just constructing it and then reloading the page. However, I do not observe the constructor of my widget being called a second time nor the destructor being called. It should also be noted that if I fire up a second instance of Firefox while the first one is connected and visit my page it behaves (until I reload that page), so the issue seems to be when a particular session reloads.

Any help in this matter would be appreciated, even what to look out for. After quite a while scouring the web, Wt tutorials and docs for differences and searching this forum, I was not able to find anything related to this.


Replies (5)

RE: Trouble with JSignal crashing on page reload - Added by Roel Standaert about 7 years ago

If all you're doing is creating a widget like that, I don't know what could cause that issue, because your code looks fine.

What version of boost are you using? Can you put a breakpoint on that line and see what the call stack is?

RE: Trouble with JSignal crashing on page reload - Added by Koen Deforche about 7 years ago

Hey,

Are you using non-default Wt configuration settings (wt_config.xml)? Can you provide it?

Koen

RE: Trouble with JSignal crashing on page reload - Added by Ben Ritter about 7 years ago

@Roel Janssen

I am using Boost 1.63. The stack trace is attached.

@Koen Deforche

I do not appear to be using any other configuration file.

RE: Trouble with JSignal crashing on page reload - Added by Roel Standaert about 7 years ago

Looks like you're still using Wt 3.3.4, which is almost two years old. Could you test with the latest master or release candidate?

RE: Trouble with JSignal crashing on page reload - Added by Ben Ritter about 7 years ago

@Roel Janssen

Hm, I did not realize I was using such an old version of Wt. This seems to have taken care of it.

    (1-5/5)