https://bugs.kde.org/show_bug.cgi?id=454860
Bug ID: 454860
Summary: Massif allocation tree missing with gcc -Og flag
Product: valgrind
Version: 3.19.0
Platform: Fedora RPMs
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: massif
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
I was following the manual in <https://valgrind.org/docs/manual/ms-manual.html>
and I noticed that I did not obtain allocation trees in detailed snapshots. I
realized it's because I compiled with the -Og flag instead of the -O0 flag.
STEPS TO REPRODUCE
1. Use the source file in
<https://valgrind.org/docs/manual/ms-manual.html#ms-manual.anexample>
2. Compile with `gcc -Og`
3. Use valgrind as `valgrind --tool=massif --time-unit=B prog`
4. Look at `ms_print` output.
OBSERVED RESULT
The detailed snapshot bottom text was, for example,
98.43% (10,000B) (heap allocation functions) malloc/new/new[], --alloc-fns,
etc.
->98.43% (10,000B) 0x40114D: main (in /home/fox/code/c/custom/a)
EXPECTED RESULT
Without the -Og flag I obtain the following allocation tree:
99.09% (20,000B) (heap allocation functions) malloc/new/new[], --alloc-fns,
etc.
->49.54% (10,000B) 0x401178: main (massif_example.c:17)
|
->39.64% (8,000B) 0x401143: g (massif_example.c:4)
| ->19.82% (4,000B) 0x401159: f (massif_example.c:9)
| | ->19.82% (4,000B) 0x401195: main (massif_example.c:20)
| |
| ->19.82% (4,000B) 0x40119A: main (massif_example.c:22)
|
->09.91% (2,000B) 0x401154: f (massif_example.c:8)
->09.91% (2,000B) 0x401195: main (massif_example.c:20)
SOFTWARE/OS VERSIONS
Linux: Linux fedora 5.17.11-300.fc36.x86_64
ADDITIONAL INFORMATION
--
You are receiving this mail because:
You are watching all bug changes.