Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-578

purify reports mismatched new/delete in facet implementation.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2.0
    • 4.2.1
    • 22. Localization
    • None
    • Patch Available
    • Incorrect Behavior

    Description

      ****  Purify instrumented ./stocks (pid 19642)  ****
      FMM: Freeing mismatched memory:
        * This is occurring while in thread 19642:
          operator delete(*) [rtlib.o]
          __rw::__rw_facet::~__rw_facet[not-in-charge]() [facet.cpp:139]
          std::time_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::~time_put[not-in-charge]() [_time_put.h:105]
          std::time_put_byname<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::~time_put_byname[in-charge deleting]() [ti_time_put.cpp:105]
          __rw::__rw_facet::_C_manage(__rw::__rw_facet*, __rw::__rw_facet::_C_facet_type, char const*, __rw::__rw_facet*  (*)(unsigned, char const*)) [facet.cpp:427]
          __rw::__rw_locale::~__rw_locale[in-charge]() [locale_body.cpp:692]
        * Attempting to free block at 0x80f3fe0 in the heap.
        * Address 0x80f3fe0 is at the beginning of a malloc'd block of 2452 bytes.
        * This block was allocated from thread -1207973632:
          malloc         [rtlib.o]
          operator new(unsigned) [libstd15d.so]
          operator new [](unsigned) [libstd15d.so]
          __rw::__rw_get_timepunct(__rw::__rw_facet const*, int, unsigned) [time_put.cpp:454]
          __rw::__rw_get_time_put_data(__rw::__rw_time_put_data&, __rw::__rw_facet const*, tm const*, char, char, bool) [time_put.cpp:2115]
          __rw::__rw_put_time(__rw::__rw_facet const*, char*, unsigned, std::ios_base&, char, tm const*, char, char, int, int) [time_put.cpp:2666]
        * This block of memory was obtained using an allocation routine which is
          not compatible with the routine by which it is being freed.
      

      Memory is allocated with array new, but deallocated with operator delete.

      Attachments

        1. stdcxx-578.patch
          1 kB
          Travis Vitek

        Activity

          People

            vitek Travis Vitek
            vitek Travis Vitek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: