Bug #2611
closedWTableView using Dbo::QueryModel, segfaults on 'selectedIndex' call
0%
Description
1/ Set up the Wt::Dbo::QueryModel using a select statement
2/ Add relevant column
3/ Set up the tableview using the previously set QueryModel.
4/ Connect the tableview's selectionChanged() signal to a custom handler.
5/ In the custom handler, retrieve the selected items using selectedIndexes()
This works fine as long as the QueyModel is no updated.
If I update the query in the QueyModel, using setQuery():
1/ selectedIndexes signal is fired
2/ the selectedIndexes() call crashes (_selectionModel does not seem to be valid)
5315 Process terminating with default action of signal 11 (SIGSEGV)
5315 Access not within mapped region at address 0x110
5315 at 0x597A10D: Wt::WAbstractItemView::selectedIndexes() const (WAbstractItemView.C:925)
5315 by 0x449DB1: AudioDatabaseWidget::handleArtistOrReleaseSelected() (AudioDatabaseWidget.cpp:213)
5315 by 0x4609C1: boost::signals2::detail::signal_impl<void (Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass), boost::signals2::optional_last_value, int, std::less, boost::function<void (Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass)>, boost::signals2::mutex>::operator()(Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass) (function_template.hpp:767)
5315 by 0x597E8C7: Wt::Signal<Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass>::emit(Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass, Wt::NoClass) const [clone .isra.790] (signal_template.hpp:695)
5315 by 0x597EDBF: Wt::WAbstractItemView::handleClick(Wt::WModelIndex const&, Wt::WMouseEvent const&) (WAbstractItemView.C:1272)
5315 by 0x5B18251: Wt::WTableView::handleSingleClick(bool, Wt::WMouseEvent const&) (WTableView.C:1514)
5315 by 0x5A1825A: boost::signals2::detail::signal_impl<void (Wt::WMouseEvent), boost::signals2::optional_last_value, int, std::less, boost::function<void (Wt::WMouseEvent)>, boost::function<void (boost::signals2::connection const&, Wt::WMouseEvent)>, boost::signals2::mutex>::operator()(Wt::WMouseEvent) (function_template.hpp:767)
5315 by 0x5B7190E: Wt::EventSignalWt::WMouseEvent::processDynamic(Wt::JavaScriptEvent const&) (signal_template.hpp:695)
5315 by 0x5C68FC5: Wt::WebSession::processSignal(Wt::EventSignalBase*, std::string const&, Wt::WebRequest const&, Wt::WebSession::SignalKind) (WebSession.C:2625)
5315 by 0x5C6F987: Wt::WebSession::notifySignal(Wt::WEvent const&) (WebSession.C:2599)
5315 by 0x5C722B4: Wt::WebSession::notify(Wt::WEvent const&) (WebSession.C:2160)
5315 by 0x5C6CD0C: Wt::WebSession::handleRequest(Wt::WebSession::Handler&) (WebSession.C:1509)
5315 If you believe this happened as a result of a stack
5315 overflow in your program's main thread (unlikely but
Updated by Emeric Poupon almost 11 years ago
More details:
1/ setSelectionMode(ExtendedSelection) is called for the table view.
2/ setQuery is called with param to keep Columns
3/ the selectedIndexes() call in the handler of the selectionChanged() signal crashes even without updating the QueryModel.
Maybe I'm missing something obvious, but this crash is very strange.
Let me know if you want more information.
Updated by Emeric Poupon almost 11 years ago
My bad, I badly initialized the WTableTreeView!
You can close this issue.