Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2006-06-20 04:54:23


Bugs item #1509154, was opened at 2006-06-20 01:54
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1509154&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: serialization
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Robert Ramey (ramey)
Summary: runtime check triggered when deserializing collections

Initial Comment:
Hello,

a runtime check is triggered in serialization code when
trying to deserialize a large tree (collections).

I'm using "boost-RC_1_34_0.tar.bz2" from 2006/06/20.

This does not appear in 1.33.1 final.

----------------------

MSVC 7.1:

"Run-Time Check Failure #3 - The variable
'item_version' is being used without being defined."
----------------------

File: collections_load_impl.cpp:

template<class Archive, class Container, class
InputFunction, class R>
inline void load_collection(Archive & ar, Container &s)
{
    s.clear();
    // retrieve number of elements
    unsigned int count;
    unsigned int item_version;
    ar >> BOOST_SERIALIZATION_NVP(count);
    if(3 < ar.get_library_version()){
        ar >> BOOST_SERIALIZATION_NVP(item_version);
    }
    R rx;
    rx(s, count);
    InputFunction ifunc;
    while(count-- > 0){
        ifunc(ar, s, item_version);
    }
}

----------------------

I've check my serialized xml archive signature:

<boost_serialization signature="serialization::archive"
version="3">

The code is using uninitialized "item_version" because
my archive version is already v3???

I changed
---------------
unsigned int item_version;
---------------
to
---------------
unsigned int item_version(0);
---------------

and it works now.

Regards,

A. Focht

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1509154&group_id=7586

_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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