Boost logo

Boost Users :

From: Markus Bernhardt (Markus.Bernhardt_at_[hidden])
Date: 2007-07-06 06:34:26


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm using purify to check my app.
Using serialization, I see the following FMR:

#################

FMR: Free memory read
  This is occurring while in thread 3:
  std::locale::~locale() [libstlport.so.1]
  boost::scoped_ptr<std::locale>::~scoped_ptr()
  boost::archive::basic_binary_iprimitive<boost::archive::
    binary_iarchive,std::basic_istream
    <char,std::char_traits<char> > >::~basic_binary_iprimitive()
  boost::archive::binary_iarchive_impl
    <boost::archive::binary_iarchive>::~binary_iarchive_impl()

  boost::archive::binary_iarchive::~binary_iarchive()
  void de::scmb::bm::seri::Serializer::serialize
    (std::basic_ifstream<char,std::char_traits<char> >&,
    de::scmb::bm::core::Instance&)

Reading 8 bytes from 0x100312228 in the heap.
Address 0x100312228 is at the beginning of a freed block of 80 bytes.

This block was allocated from thread 3:
  malloc [rtlib.o]
  c2n6Fl_Pv___1 [libCrun.so.1]
  void*operator new(unsigned long) [rtlib.o]
  std::locale::locale(std::_Locale_impl*,bool) [libstlport.so.1]
  std::locale::locale<boost::archive::codecvt_null<char> >
    (const std::locale&,__type_0*) [libboost_serialization-sw-d.a]
  std::locale*boost::archive::add_facet
    <boost::archive::codecvt_null<char> >(const std::locale&,__type_0*)
    [libboost_serialization-sw-d.a]

There have been 0 frees since this block was freed from thread 3:
  free [rtlib.o]
  c2k6FPv_v___1 [libCrun.so.1]
  void operator delete(void*) [rtlib.o]
  boost::io::basic_ios_locale_saver
    <char,std::char_traits<char> >::~basic_ios_locale_saver()
    [libboost_serialization-sw-d.a]
  boost::archive::basic_binary_iprimitive
    <boost::archive::binary_iarchive,std::basic_istream
      <char,std::char_traits<char> > >::~basic_binary_iprimitive()
    [libboost_serialization-sw-d.a]
  boost::archive::binary_iarchive_impl
    <boost::archive::binary_iarchive>::~binary_iarchive_impl()
    [Serializer.cpp]

#################

Has anyone seen this before.

Looks like std::locale is using a buffer with 80 bytes size, which is
shared between std::locale objetcs and get deleted by the destruction of
a basic_ios_locale_saver object, which has a std::locale object.

Is this guess correct ??

Can this become a problem ??

Kind regards,
Markus

- --
Software Consulting
Markus Bernhardt GmbH
Spieljochstr. 34
81825 München

Fon: +49-89-420903-14
Fax: +49-89-420903-20
www: http://www.scmb.de

Geschäftsführung Markus Bernhardt
Handelsregister AG München HRB 125966
USt-Id DE201885231

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGjhqydnooMonJSYkRAuNnAJ47I+Q2/xagCxw5H/pzDLl50ragJACbBQyx
vDtVBQkEe407mIYX1Y6dvzg=
=GgUq
-----END PGP SIGNATURE-----


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