|
Boost Users : |
From: Lothar Werzinger (lothar_at_[hidden])
Date: 2008-06-11 14:59:39
On Wednesday 11 June 2008, Ion Gaztañaga wrote:
> Unless there is a bug (something that is of course, possible) if the
> assertion reaises in this function of avltree.hpp:
>
> iterator insert_unique_commit
> (node_algorithms::unique(to_insert));
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> means that you've using a safe hook (the default one) and before
> inserting an object, the container checks that the hook is in default
> position (unique() is true). If it's not that means that the hook is
> still use (the value is still inserted in another container). The
> testsuite includes avl containers with offset_ptr<> pointers but this
> might indicate a bug in Intrusive. Please check if that object is still
> in another container and if not, it would be nice if you could provide a
> test case that raises the bug.
>
> Regards,
>
> Ion
Hi Ion,
find a simplified test case attached that reproduces my findings.
Hopefully this will allow you to find the problem wether it is in my code or
the library.
g++ -o avltest -I/opt2/linux/x86_64/include/boost-1_35 -DUSE_OFFSET_PTR=1
avltest.cpp
avltest.cpp:23:2: warning: #warning with offet_ptr
rm /tmp/avltest.img; ./avltest
sizeof(BalanceNode)=32
sizeof(BalanceSet)=32
creating file ...
creating file done
header.get_address()=0x7fb86cc72000
header.get_size()=128
region.get_address()=0x7fb86cc71080
region.get_size()=224
p_set=0x7fb86cc71080
p_values (before)=0x7fb86cc71080
offset=64
initializing header ...
initializing header done
p_header->m_avail=5
p_header->m_count=0
initializing set ...
initializing set done
p_values (after) =0x7fb86cc710c0
creating entry 0 ...
creating entry 0 done
int=84
inserting entry 0 ...
avltest: /opt2/linux/x86_64/include/boost-1_35/boost/intrusive/avltree.hpp:618:
boost::intrusive::tree_iterator<boost::intrusive::avltree_impl<Config>,
false> boost::intrusive::avltree_impl<Config>::insert_unique_commit(typename
std::iterator_traits<typename
boost::intrusive::detail::eval_if_c<boost::intrusive::avltree_impl<Config>::external_value_traits,
boost::intrusive::detail::eval_value_traits<typename Config::value_traits>,
boost::intrusive::detail::identity<typename Config::value_traits>
>::type::pointer>::reference, const typename
boost::intrusive::avltree_algorithms<typename
boost::intrusive::detail::eval_if_c<boost::intrusive::avltree_impl<Config>::external_value_traits,
boost::intrusive::detail::eval_value_traits<typename Config::value_traits>,
boost::intrusive::detail::identity<typename Config::value_traits>
>::type::node_traits>::insert_commit_data&) [with Config =
boost::intrusive::avl_setopt<boost::intrusive::detail::base_hook_traits<BalanceNode,
boost::intrusive::avltree_node_traits<boost::interprocess::offset_ptr<void>,
true>, safe_link, boost::intrusive::default_tag, 6>, std::less<BalanceNode>,
long unsigned int, true>]: Assertion `node_algorithms::unique(to_insert)'
failed.
Aborted
g++ -o avltest -I/opt2/linux/x86_64/include/boost-1_35 -DUSE_OFFSET_PTR=0
avltest.cpp
avltest.cpp:20:2: warning: #warning without offet_ptr
rm /tmp/avltest.img; ./avltest
sizeof(BalanceNode)=32
sizeof(BalanceSet)=32
creating file ...
creating file done
header.get_address()=0x7f31b2dd4000
header.get_size()=128
region.get_address()=0x7f31b2dd3080
region.get_size()=224
p_set=0x7f31b2dd3080
p_values (before)=0x7f31b2dd3080
offset=64
initializing header ...
initializing header done
p_header->m_avail=5
p_header->m_count=0
initializing set ...
initializing set done
p_values (after) =0x7f31b2dd30c0
creating entry 0 ...
creating entry 0 done
int=84
inserting entry 0 ...
inserting entry 0 done
creating entry 1 ...
creating entry 1 done
int=85
inserting entry 1 ...
inserting entry 1 done
creating entry 2 ...
creating entry 2 done
int=86
inserting entry 2 ...
inserting entry 2 done
creating entry 3 ...
creating entry 3 done
int=87
inserting entry 3 ...
inserting entry 3 done
creating entry 4 ...
creating entry 4 done
int=88
inserting entry 4 ...
inserting entry 4 done
created/inserted 5 entries
int=84
int=85
int=86
int=87
int=88
int=84
int=85
int=86
int=87
int=88
Thanks in advance!
Lothar
-- Lothar Werzinger Dipl.-Ing. Univ. framework & platform architect Tradescape Inc. - Enabling Efficient Digital Marketplaces 1754 Technology Drive, Suite 128 San Jose, CA 95110 web: http://www.tradescape.biz
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net