Boost logo

Boost Users :

Subject: [Boost-users] [Multi-Index] crash on invariant_() violation
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2009-04-02 15:53:02


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

Now another seemingly unrelated change triggers an invariant violation
in the bmi code during a unit test. I've tried to look at what kind of
invariant is checked in the code, but got lost in its intricacies...
Could I please get some pointers on what I should specifically look
for, and maybe what invariant violations could be triggered from (or
have been in the past)?

Assertion failed: invariant_(), file
c:\...\boost-1.38.0-debug\boost\multi_index_container.hpp, line 683

I don't have all the details of the crash yet, but the invariant is
violated either during a call to empty() on the implicit index of the
container (a unique_hashed index), or a call to erase() on that same
index.

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? (it's on my todo list to avoid having
something like this happening).

Any insights in troubleshooting the above would be appreciated. Thanks, --DD


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