Boost logo

Boost Users :

Subject: Re: [Boost-users] [Multi-Index] crash on invariant_() violation
From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2009-04-02 16:24:03


Hi Dominique,

________________________________________
De: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] En nombre de Dominique Devienne [ddevienne_at_[hidden]]
Enviado el: jueves, 02 de abril de 2009 21:53
Para: boost-users
Asunto: [Boost-users] [Multi-Index] crash on invariant_() violation

> We've recently introduced a boost multi_index_container into our code base.

Congratulations! Thanks for using Boost.MultiIndex.

> Now another seemingly unrelated change triggers an invariant violation
> in the bmi code during a unit test.
> [...]
> Note that the indices use BOOST_MULTI_INDEX_CONST_MEM_FUN
> on a proxy object, which extracts the indexed value on the proxy-wrapped
> pointer.
> It's quite possible our code base makes a change to one of the indexed
> value without notifying the bmi. Is this something that would trigger
> an invariant violation?

This is definitely going to break the container's invariants, yes. Key
modification has to be done via modify() so as to give the container a
chance to reindex elements. So if you are quite sure this is happening
try to remove the offending behavior; after this my bet is that the
invariant assertion will go away. Otherwise please get back here.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net