Project

General

Profile

Actions

Bug #13733

open

Dbo::QueryModel and category chart

Added by Andrey Alekseev about 19 hours ago. Updated about 19 hours ago.

Status:
New
Priority:
High
Assignee:
-
Target version:
-
Start date:
05/08/2025
Due date:
% Done:

0%

Estimated time:

Description

I have a QueryModel<tuple<string, int, int>> and a category chart
My application instantly crashes

/usr/include/c++/15.1.1/bits/stl_vector.h:1263: constexpr std::vector< <template-parameter-1-1>, <template-parameter-1-2> >::reference std::vector< <template-parameter-1-1>, <template-parameter-1-2> >::operator[](size_type) [with _Tp = std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int>; _Alloc = std::allocator<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int> >; reference = std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

I tried replacing chart with TableView and can confirm that there are no issues with the query itself.

According to the debugger, QueryModel::data is somehow called with invalid index, which is not checked

Actions #1

Updated by Andrey Alekseev about 19 hours ago

Temporarily solved this by a proxy model

class HotfixProxy : public WIdentityProxyModel {
public:
    cpp17::any data(const WModelIndex &index, ItemDataRole role) const override {
        if ( index.isValid() )
            return WIdentityProxyModel::data(index, role);
        return {};
    }
};
Actions

Also available in: Atom PDF