Subject: Re: [boost] [Serialization] Bizarre bug
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-08-04 01:36:16
I looked into this a little bit. Looks like a bug to me.
The problem is that the presence of ar << ptr is use to trigger
the instantication of code for saving pointers. This code
enables tracking. Also ar >> ptr is used to trigger instantiation
of code for loading pointers. The motivation is to avoid
instantiation of code that is never called. This system is
broken for the case where ar << ptr is invoked but
ar >> ptr isn't. I'll look into it. For now you could work around this by
a) including more dummy code.
b) removing the dummy code
c) explicitly setting tracking for the type to track_alwyas or track_never.
Jarl Lindrud wrote:
> troy d. straszheim <troy <at> resophonic.com> writes:
>> Looks like UB to me. From the C++ standard:
>> Note: in particular, a null reference cannot exist in a well-defined
>> program, because the only way to create such a reference would be to
>> bind it to the "object" obtained by dereferencing a null pointer,
>> which causes undefined behavior. (§ 8.3.2, ¶ 4)
> The dummy() function never even gets executed. The point is that the
> mere compile-time presence of a particular line in it, causes a
> deserialization error in main().
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk