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

purify reports memory leak from __rw_vfmtwhat in 18.exception test

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.2.0
    • 4.2.1
    • Tests
    • None
    • Patch Available
    • Incorrect Behavior

    Description

      The library uses a system of functions for platforms that don't support exceptions. The _rw_throw function calls __rw_vfmtwhat() to get a string describing the exception that has occured. Under some conditions the string is allocated from the heap as an array of characters. Eventually __rw_throw invokes a function via pointer (_rw_throw_proc) that is supposed to process the exception (possibly by throwing a real exception object). Unfortunately the test does not deallocate the string that was allocated by __rw_vfmtwhat().

      Purify: Searching for all memory leaks...

      Memory leaked: 3072 bytes (25.6%); potentially leaked: 0 bytes (0%)

      wLK: 3072 bytes leaked in 12 blocks

      • This memory was allocated from:
        malloc [rtlib.o]
        operator new(unsigned) [libstd15d.so]
        operator new [](unsigned) [libstd15d.so]
        _rw::_rw_vfmtwhat(char*, unsigned, char const*, char*) [exception.cpp:479]
        _rw::_rw_throw(int, ...) [exception.cpp:825]
        test_rw_throw() [18.exception.cpp:527]
      • Block of 256 bytes (12 times); last block at 0x8118de0

      Attachments

        1. stdcxx-584.patch
          0.5 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: