Boost logo

Boost Users :

Subject: Re: [Boost-users] [Mutli-Index, InterProcess] Multi-index stability issue with interprocess?
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-11-13 05:41:08


vibhor aggarwal <vibhor.aggarwal <at> yahoo.com> writes:

>
> I am creating a multi-index [...] and storing that in a managed
> memory mapped file (boos::interprocess) [...]
> All the data is first inserted into the multi-index once and then it
> is read from the muti-index with a query [...]
>
> boost::tie(l, u) = m_p_mi_ts->get<0>().
> equal_range(boost::make_tuple(i, j));
>
> We are testing this whole process over and over again (each iteration
> is a new run of the process), and once in every 50 or so iterations
> we get a segment fault inside boost on firing the query. Here is the
> boost part of the stack from the core dump:

With so little information, I can only guess: the crash is hapenning
at a very superficial level into equal_range, namely when dereferencing
the container's header node (the top of the rb-tree ordered indices are
based on). This suggests that the container layout is seriously screwed;
possible reasons:

* Memory overwrites from some adjacent structure
* File corruption (?)
* m_p_mi has been changed somewhere
* Some sort of overrun within the memory-mapped file

It'd be best if you could provide a testing case for this or some more
context. If this is not an option, you can activate Boost.MultiIndex
invariant-checking mode:

http://www.boost.org/libs/multi_index/doc/tutorial
/debug.html#invariant_check

which will assert as soon as some internal corruption is detected
(caveat: this mode will reduce performance drastically).

Joaquín M López Muñoz
Telefónica


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