drmemory nudge command output

57 views
Skip to first unread message

Brian Hire

unread,
Mar 23, 2020, 2:07:53 PM3/23/20
to Dr. Memory Users
I need to look for a memory leak in a large server process.
I plan on using the drmemory nudge command to help do this
Before I tried it on the server, i thought I'd test it with a smaller test driver program.
I created a loop in this program (a while(true) with a usleep and a small memory leak).
I start up the test driver using drmemory, find its pid, and then do a nudge on the running process.
However, when I look at the logs folder created for that pid, i never see any updates to the results.txt.
The nudge command appears to work just fine (no errors reported).
Has anyone sucessfully used the nudge command and can give me some advice?

Brian Hire

unread,
Mar 23, 2020, 2:09:45 PM3/23/20
to Dr. Memory Users
sorry, i should have noted, this is on Linux platform

Derek Bruening

unread,
Mar 24, 2020, 10:58:50 AM3/24/20
to drmemor...@googlegroups.com
It works for me, printing to stderr in the nudged program, and printing to results.txt, on the tests/infloop program.  Maybe try that from a drmemory build directory as a sanity check?

In another shell when the command below printed "starting" and is looping:

$ bin64/drmemory -nudge 118045

Target program:

$ bin64/drmemory -- tests/infloop
~~Dr.M~~ Dr. Memory version 2.3.18344
starting
<received nudge mask=0x40000 id=0x00000000 arg=0x0000000000000000>
~~Dr.M~~
~~Dr.M~~ Error #1: LEAK 42 direct bytes 0x00007f47e3320fb0-0x00007f47e3320fda + 17 indirect bytes
~~Dr.M~~ # 0 replace_malloc               [/home/bruening/drmemory/git/src/common/alloc_replace.c:2577]
~~Dr.M~~ # 1 foo                          [/home/bruening/drmemory/git/src/tests/infloop.c:85]
~~Dr.M~~ # 2 main                         [/home/bruening/drmemory/git/src/tests/infloop.c:112]
~~Dr.M~~
~~Dr.M~~ Error #2: LEAK 8 direct bytes 0x00007f47e3321040-0x00007f47e3321048 + 19 indirect bytes
~~Dr.M~~ # 0 replace_malloc               [/home/bruening/drmemory/git/src/common/alloc_replace.c:2577]
~~Dr.M~~ # 1 foo                          [/home/bruening/drmemory/git/src/tests/infloop.c:89]
~~Dr.M~~ # 2 main                         [/home/bruening/drmemory/git/src/tests/infloop.c:112]
~~Dr.M~~
~~Dr.M~~ Error #3: LEAK 160 direct bytes 0x00007f47e33210b0-0x00007f47e3321150 + 0 indirect bytes
~~Dr.M~~ # 0 replace_malloc               [/home/bruening/drmemory/git/src/common/alloc_replace.c:2577]
~~Dr.M~~ # 1 foo                          [/home/bruening/drmemory/git/src/tests/infloop.c:96]
~~Dr.M~~ # 2 main                         [/home/bruening/drmemory/git/src/tests/infloop.c:112]
~~Dr.M~~
~~Dr.M~~ ERRORS FOUND:
~~Dr.M~~       0 unique,     0 total unaddressable access(es)
~~Dr.M~~       0 unique,     0 total uninitialized access(es)
~~Dr.M~~       0 unique,     0 total invalid heap argument(s)
~~Dr.M~~       0 unique,     0 total warning(s)
~~Dr.M~~       3 unique,    22 total,   3286 byte(s) of leak(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of possible leak(s)
~~Dr.M~~ ERRORS IGNORED:
~~Dr.M~~      13 unique,    16 total,   6634 byte(s) of still-reachable allocation(s)
~~Dr.M~~          (re-run with "-show_reachable" for details)
~~Dr.M~~ Details: /home/bruening/drmemory/git/build_x64_dbg/logs/DrMemory-infloop.118045.000/results.txt

Results.txt has:

===========================================================================
SUMMARY AFTER NUDGE #1:

Error #1: LEAK 42 direct bytes 0x00007f47e3320fb0-0x00007f47e3320fda + 17 indirect bytes
# 0 replace_malloc               [/home/bruening/drmemory/git/src/common/alloc_replace.c:2577]
# 1 foo                          [/home/bruening/drmemory/git/src/tests/infloop.c:85]
# 2 main                         [/home/bruening/drmemory/git/src/tests/infloop.c:112]


--

---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drmemory-users/c3a0f449-232f-4545-991e-61f9c5da1a39%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages