id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11148,attribute_value_set.size() is busted,Chris Newbold,Andrey Semashev,"The problem can be illustrated with some code like this: {{{ using boost::log::attribute_value_set; const attribute_value_set& values(record.attribute_values()); const boost::log::attribute_value_set::size_type count( values.size()); for (attribute_value_set::value_type i : values) { ... } }}} Under some circumstances we see that the for loop iterates over more than 'count' attribute values. The problem is in attribute_value_set::implementation::size(), which looks like this: {{{ size_type size() { freeze(); return (m_pEnd - m_pStorage); } }}} This works correctly when the set does not contain more attributes than fit in the pre-allocated block pointed to by m_pStorage. But, looking at attribute_value_set::implementation::insert_node(), we see that once the internal node storage is exhausted, additional nodes are allocated on-the-fly and are not accounted for in the computation in size(): {{{ node* insert_node(key_type key, bucket& b, node* where, mapped_type data) { node* p; if (m_pEnd != m_pEOS) { p = m_pEnd++; new (p) node(key, data, false); } else { p = new node(key, data, true); } ... }}} I have not looked, but this problem may also exist in other attribute_value_set like containers.",Bugs,closed,To Be Determined,log,Boost 1.57.0,Regression,fixed,,