Boost logo

Boost :

Subject: Re: [boost] [1.37.0][serialization] Assertion failed atlibs/serialization/src/extended_type_info.cpp:92
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-10-22 14:16:12


When I look at the code I can explain what I had in mind.

The ktmap ([export]key - type)map should have an entry for each
instance of an exported type. These entries are static variables.
So, when one of these static items are destroyed, its ktmap entry
should be erased. The assertion is meant to trap a the case
where the key isn't found in the map. Such a circumstance would
indicate the map has become out of sync with the variable involved.
In the absense of multi-threading should never happen.

The code subsequent to the assertion presumes that at least
one entry exists in the ktmap (do ...) so the assertion was
there to detected an error in this presumption. So trapping on
this condition inidicates that there must be an error somewhere
else. I would expect that this is somewhere in the library
rather than in the user's program.

I could implement your suggestion, but I would much rather
get to the bottom of it.

dlopen(RTLD_GLOBAL|RTLD_LAZY) suggests to me that
dlls are being loaded/unloaded outside of your control. The
serialization library presumes that dlls are not loaded/unloaded
but more than one thread at at time. Its concievable that this might
be an issue.

Robert Ramey

Hartmut Kaiser wrote:
> Robert,
>
> Would it be possible to get an answer to my initial questions, please?
>
> Thanks!
> Regards Hartmut
>
>
>> 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);
>>
>> 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
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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