DynamoRIO / DynamoRIO/drmemory

Incorrect "INVALID HEAP" error

Open
#2,068 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

What steps will reproduce the problem?
1. `DrMemory-Windows-1.11.0-2\bin\drmemory.exe -debug -dr_debug -pause_at_assert -symcache_dir fresh_dir -leaks_only -no_count_leaks -- c:\Users\Administrator\Documents\GME\GME\Release\GME.exe /l`

What is the expected output? What do you see instead?

```
Potential Error #1: INVALID HEAP ARGUMENT to free 0x03ce01a8
# 0 replace_free [d:\drmemory_package\common\alloc_replace.c:2706] (0x029ed850 ) modid:2
# 1 mfc140u.dll!CMapPtrToPtr::RemoveAll [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\map_pp.cpp:80] (0x5554d9b4 ) modid:5
```

This error report is incorrect. The source is available at `"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\src\mfc\map_pp.cpp"`

What version of the product are you using? On what operating system?

DrMemory-Windows-1.11.0-2
Windows 2008R2

Does the problem go away when running in light mode (pass "-light" to Dr.
Memory)? What about when running with the options "-leaks_only
-no_count_leaks -no_track_allocs"?

The bug is present under `-leaks_only -no_count_leaks` but absent under `-leaks_only -no_count_leaks -no_track_allocs`

Does the problem go away when using the most recent build from
https://github.com/DynamoRIO/drmemory/wiki/Latest-Build?

That page points to a 404

Try the debug version of Dr. Memory and of its underlying engine DynamoRIO
by passing "-debug -dr_debug -pause_at_assert" to drmemory.exe. Are any
messages reported?

No asserts are reported

Please provide any additional information below. Please also see the
"Narrowing Down the Source of the Problem" section
of https://github.com/DynamoRIO/drmemory/wiki/Debugging.

Here's the [verbose log](https://drive.google.com/file/d/1jO_AlEy1k-HV3CA9iKIf7AQZvhYISNuL/view?usp=sharing)

Looks like DrMemory is looking for the pointer in the wrong arena(?)

```
replace_operator_new size=68 abort_on_oom=1 type=8
carving out new chunk @0x03ce0188 => head=0x03ce0190, res=0x03ce01a8
replace_alloc_common arena=0x03ce0000 flags=0x8 request=68, align=8 alloc=72 => 0x03ce01a8
```

```
replace_free 0x03ce01a8
ptr_is_in_arena: 0x03ce01a8 not found in arena 0x034e0000
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.