|
Boost : |
Subject: [boost] [interprocess] x86-64 bug?
From: Bartosz Marcinkiewicz (bma_at_[hidden])
Date: 2010-07-22 11:25:26
Hello,
I have modified a little an example doc_complex_map.cpp in order
to use vector of integers which is a member (int_vector_) of structure stored
as a shared map value (complex_data).
Program works as expected on x86 (32bits). I get core dump on x86-64:
(gdb) bt
#0 0x000000000041ecfe in boost::container::vector<int, boost::interprocess::allocator<int, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ul>, boost::interprocess::iset_index> > >::priv_push_back (this=0x7f3435ae9260,
x=@0x7fff77fe9eac) at /home/bma/opt/include/boost/interprocess/containers/container/vector.hpp:1239
#1 0x000000000041ed57 in boost::container::vector<int, boost::interprocess::allocator<int, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0ul>, boost::interprocess::iset_index> > >::push_back (this=0x7f3435ae9260, x=@0x7fff77fe9eac)
at /home/bma/opt/include/boost/interprocess/containers/container/vector.hpp:904
#2 0x0000000000401cf1 in operator() (this=0x7fff77fea0ee, x=@0x7f3435ae9218) at doc_complex_map.cpp:109
#3 0x0000000000401e8c in main () at doc_complex_map.cpp:146
Valgrind output is:
[bma_at_dev2 example]$ vg ./doc_complex_map
==18738== Memcheck, a memory error detector.
==18738== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==18738== Using LibVEX rev 1804, a library for dynamic binary translation.
==18738== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==18738== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==18738== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==18738== For more details, rerun with: -v
==18738==
==18738== Invalid write of size 4
==18738== at 0x41ECFE: boost::container::vector<int, boost::interprocess::allocator<int, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0l>, boost::interprocess::iset_index> > >::priv_push_back(int const&) (vector.hpp:1239)
==18738== by 0x41ED56: boost::container::vector<int, boost::interprocess::allocator<int, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0l>, boost::interprocess::iset_index> > >::push_back(int const&) (vector.hpp:904)
==18738== by 0x401CF0: main::test_struct::operator()(complex_data&) (doc_complex_map.cpp:109)
==18738== by 0x401E8B: main (doc_complex_map.cpp:146)
==18738== Address 0x104c0f989 is not stack'd, malloc'd or (recently) free'd
This is on boost 1.43.
I am attaching source code. Thanks for any hints.
-- Bartosz Marcinkiewicz e-mail: bma_at_[hidden], bartosz.marcinkiewicz_at_[hidden] EPCON Sp. z o.o. www.epcon.pl
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk