Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-05-09 16:35:22

Patel Priyank-PPATEL1 ha escrito:
> Hi all,
> I am getting following error in boost multi-index library. I am
> using following code to add and remove procedures by id in multi
> index container. Can somebody please let me know what might be
> wrong here? Really appreciate your quick response on this.

Hello Priyank,

OK, I've got some questions to ask and some things for
you to check. Let's see if we nail the problem down.

1. Does this happen the first time remove_by_id() is
called or after some running time?
2. When the crash happens, do you have some debugging
tool which allows you to inspect the contents
of the _procedure variable passed to remove_by_id()?
If so, does the object look OK, or garbled?
3. Note that Procedure_Pool holds *pointers* to
Procedure. Could it be, when remove_by_id()
crashes, that the Procedure object pointed to by
_procedure is already deleted? Check the unsubscribe()
routines and all the other procedures listed in the
stack trace.
4. Remember we were talking about why you cannot
change directly the Procedure internal variables,
but instead you have to use the updating mechanisms
provided by Boost.MultiIndex, as described at:

The original discussion was at

Are you respecting this? Could it be you have
inadvertently changed some procedure id by calling
some member function of Procedure interface?
5. You are using hashed indices, try, just for testing
purposes, replacing them with ordered indices (in
principle, you will only have to change the
Procedure_Hashed_Pool typedef) Rerun: does the crash
still persist?

Hopefully, some of thes points will shed some
more light. Looking fwd to your reporting.

On a side note, your code shows a Procedure_Hashed_Pool
with only one index, yet you define two
views on it, namely pool_ and procedure_by_id_,
which are the same. This is at most superfluous,
although maybe what you have sent is some reduced
form of the original code.

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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at