Boost logo

Boost :

Subject: Re: [boost] [1.37.0][serialization] Assertion failed at libs/serialization/src/extended_type_info.cpp:92
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2008-10-21 09:30:26


> Anything I can do about this?
> What does this assertion mean?
>
> My setup: Linux 64Bit, gcc 4.2.4, serialization is used for polymorphic
> objects loaded from different shared libraries, shared libraries are
> loaded with dlopen(RTLD_GLOBAL|RTLD_LAZY).
>
> Assertion (extended_type_info.cpp:92) occurs during program termination
> (after main returned), during dlclose().
>
> If anything else isn't possible, would it be appropriate to change the
> related code (before the release!) from:
>
> assert(start != end);
>
> // remove entry in map which corresponds to this type
> do{
> if(this == *start)
> x.erase(start++);
> else
> ++start;
> }while(start != end);

After looking at this code again I have the impression that it is broken
anyways. You can't safely increment an iterator after deleting the object it
points to: erase(start++). This code relies on the fact that in order to be
incremented the iterator doesn't need the object it points to (which at
least for lists is a wrong assumption).

Regards Hartmut

>
> To:
>
> assert(start != end);
>
> // remove entry in map which corresponds to this type
> while(start != end) {
> if(this == *start)
> x.erase(start++);
> else
> ++start;
> }
>
> Which wouldn't remove the problem, but at least avoids hanging the
> program if assertions are off...
>
> Regards Hartmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk