[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
_GLIBCXX_DEBUG and std::list
From: |
mathieu |
Subject: |
_GLIBCXX_DEBUG and std::list |
Date: |
Fri, 01 Jun 2007 08:01:31 -0000 |
User-agent: |
G2/1.0 |
Hello,
I was recently suggested to use -D_GLIBCXX_DEBUG to compile my
project to detect any misuse of the STL (Thanks Paul P.). That's what
I did and now running the code through valgrind I am getting:
==20939== Invalid write of size 4
==20939== at 0x40D557C:
__gnu_debug::_Safe_sequence_base::_Safe_sequence_base() (safe_base.h:
179)
==20939== by 0x40D5724:
__gnu_debug::_Safe_sequence<std::__debug::list<gdcm::Element,
std::allocator<gdcm::Element> > >::_Safe_sequence() (safe_sequence.h:
103)
==20939== by 0x40D84B5: std::__debug::list<gdcm::Element,
std::allocator<gdcm::Element> >::list(std::allocator<gdcm::Element>
const&) (list:103)
==20939== by 0x411C563: gdcm::Document::Document()
(gdcmDocument.cxx:58)
and
==20939== Invalid write of size 4
==20939== at 0x40D70F7: std::__norm::_List_base<gdcm::Element,
std::allocator<gdcm::Element>
>::_List_impl::_List_impl(std::allocator<std::__norm::_List_node<gdcm::Element>
> const&) (stl_list.h:309)
==20939== by 0x40D83EB: std::__norm::_List_base<gdcm::Element,
std::allocator<gdcm::Element>
>::_List_base(std::allocator<gdcm::Element> const&) (stl_list.h:343)
==20939== by 0x40D842B: std::__norm::list<gdcm::Element,
std::allocator<gdcm::Element> >::list(std::allocator<gdcm::Element>
const&) (stl_list.h:473)
==20939== by 0x40D84A7: std::__debug::list<gdcm::Element,
std::allocator<gdcm::Element> >::list(std::allocator<gdcm::Element>
const&) (list:103)
==20939== by 0x411C58E: gdcm::Document::Document()
(gdcmDocument.cxx:58)
or
==20939== Invalid write of size 4
==20939== at 0x40D5CAD: std::__norm::_List_base<gdcm::Element,
std::allocator<gdcm::Element> >::_M_init() (stl_list.h:356)
==20939== by 0x40D8401: std::__norm::_List_base<gdcm::Element,
std::allocator<gdcm::Element>
>::_List_base(std::allocator<gdcm::Element> const&) (stl_list.h:344)
==20939== by 0x40D842B: std::__norm::list<gdcm::Element,
std::allocator<gdcm::Element> >::list(std::allocator<gdcm::Element>
const&) (stl_list.h:473)
==20939== by 0x40D84A7: std::__debug::list<gdcm::Element,
std::allocator<gdcm::Element> >::list(std::allocator<gdcm::Element>
const&) (list:103)
==20939== by 0x411C58E: gdcm::Document::Document()
(gdcmDocument.cxx:58)
Is there a document somewhere describing what this means and/or how
to fix my code.
Thanks,
-Mathieu
Ref: Linux/Debian oldstable. g++ (4.2.1 Debian) and valgrind (3.2
Debian)
- _GLIBCXX_DEBUG and std::list,
mathieu <=