[odb-users] query crash

Boris Kolpackov boris at codesynthesis.com
Fri Nov 3 08:54:33 EDT 2017


Патрушев Данил Андреевич <d.patrushev at prosoftsystems.ru> writes:

> Unfortunately, no exact stacktrace at hand.  But I can say that the latest
> crash happened during the destruction of query_base, specifically its
> "parameters_" member, which is of std::vector<details::shared_ptr<query_param> >
> type, the topmost line in the trace being
>
>     void dec (Y* p)
>         {
>           if (static_cast<shared_base*> (p)->_dec_ref ())
>             delete p; 
>         }
> which is contained in file "odb/details/shared-ptr/base.txx"
> 
> "delete p " is where the program crashed.
> 
> So I thought that there just might be a problem with details::shared_ptr,
> something along the lines of thread-safe increment and decrement of the
> shared pointer's counter. Just a wild guess.

Yes, this is helpful information, thanks. I will look closer into this.
In the meantime, a temporary workaround could be to move the query
condition into the lambda (so that you don't have copies).

Boris



More information about the odb-users mailing list