Results 1 to 2 of 2

Thread: Detecting first free for double free exception

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Lake Katrine, NY

    Detecting first free for double free exception

    If I enable the memory debugger, which eventually flags an exception when a double free occurs, how do I determine where the first (valid) free occurred?

    Kenneth Kahn
    Senior Member of Consulting Staff
    CVA R&D Hardware Emulation
    Cadence Design Systems
    Lake Katrine, NY

  2. #2

    Re: [kenkahn] Detecting first free for double free exception

    Hello Ken,

    I've answered this in the support email you sent in, but I'll copy the relevant portion here as well. Assuming you are using the TotalView or MemoryScape GUI, you should get a pop up window for an event notification. This window, in the tabs near the top, should show the event location, where the second free took place. The Allocation Location, where the original malloc occurred. The Deallocation Location, where the first free, the one you are looking for, took place, and the Block details. In both the event location, and the Deallocation Location, the lines tagged are the first line AFTER the actual free, as we are detecting it after the 'free' took place.

    If you are using the CLI, or memscript or tvscript to catch this error, things become a little harder to track down, and I think you have to work backwards from the current location. So the GUI is a clear win here.

    I hope that helps.

    Pete Thompson
    TotalView Customer Services

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts