|
From: Carl L. <ce...@us...> - 2023-04-28 17:42:13
|
Paul:
On Thu, 2023-04-27 at 22:01 +0200, Paul Floyd wrote:
> On 24/04/2023 23:29, Carl Love via Valgrind-developers wrote:
> > == 714 tests, 2 stderr failures, 0 stdout failures, 0 stderrB
> > failures,
> > 0 stdoutB failures, 2 post failures ==
> > massif/tests/new-cpp (post)
> > massif/tests/overloaded-new (post)
> >
> And these two might be easy to fix if you run the testcase normally
> and
> see if you can identify the extra allocating functions and add them
> to
> the vgtest files in the --ignore-fn list.
So, just playing around with this to try and understand what causes the
post failures.
Looking at the new-cpp.vgtest file and the output from running regtes,
It looks like the test is run with the command (edited a little to make
it readable):
valgrind --tool=massif --stacks=no --time-unit=B --massif-out-file=massif.out
--ignore-fn=__part_load_locale --ignore-fn=__time_load_locale
--ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element
--ignore-fn=_GLOBAL__sub_I_eh_alloc.cc --ignore-fn=call_init.part.0
--ignore-fn=call_init ./new-cpp
The command line output is:
==789558== Massif, a heap profiler
==789558== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==789558== Using Valgrind-3.21.0.RC2 and LibVEX; rerun with -h for copyright info
==789558== Command: ./new-cpp
==789558==
==789558==
The contents of the output file massif.out is:
time_unit: B
#-----------
snapshot=0
#-----------
time=0
mem_heap_B=0
mem_heap_extra_B=0
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=1
#-----------
time=4008
mem_heap_B=4000
mem_heap_extra_B=8
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=2
#-----------
time=8016
mem_heap_B=8000
mem_heap_extra_B=16
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=3
#-----------
time=10024
mem_heap_B=10000
mem_heap_extra_B=24
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=4
#-----------
time=12032
mem_heap_B=12000
mem_heap_extra_B=32
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=5
#-----------
time=12032
mem_heap_B=12000
mem_heap_extra_B=32
mem_stacks_B=0
heap_tree=peak
n4: 12000 (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
n0: 4000 0x10000973: main (new-cpp.cpp:19)
n0: 4000 0x1000098F: main (new-cpp.cpp:20)
n0: 2000 0x100009A3: main (new-cpp.cpp:21)
n0: 2000 0x100009BB: main (new-cpp.cpp:22)
#-----------
snapshot=6
#-----------
time=16040
mem_heap_B=8000
mem_heap_extra_B=24
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=7
#-----------
time=20048
mem_heap_B=4000
mem_heap_extra_B=16
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=8
#-----------
time=22056
mem_heap_B=2000
mem_heap_extra_B=8
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=9
#-----------
time=24064
mem_heap_B=0
mem_heap_extra_B=0
mem_stacks_B=0
heap_tree=empty
I then ran the perl script:
perl ../../massif/ms_print massif.out | sed 's/gcc[0-9]*/gcc/' | ../../tests/filter_addresses
KB
11.75^ ###########
| #
| #
| #
| :::::::#
| : #
| : #
| ::::::: # ::::::::::::
| : : # :
| : : # :
| : : # :
| : : # :
| : : # :
| : : # :
| ::::::::::::: : # : ::::::
| : : : # : :
| : : : # : :
| : : : # : : ::::::
| : : : # : : :
| : : : # : : :
0 +----------------------------------------------------------------------->KB
0 23.50
Number of snapshots: 10
Detailed snapshots: [5 (peak)]
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B)
--------------------------------------------------------------------------------
0 0 0 0 0 0
1 4,008 4,008 4,000 8 0
2 8,016 8,016 8,000 16 0
3 10,024 10,024 10,000 24 0
4 12,032 12,032 12,000 32 0
5 12,032 12,032 12,000 32 0
99.73% (12,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->33.24% (4,000B) 0x........: main (new-cpp.cpp:19)
|
->33.24% (4,000B) 0x........: main (new-cpp.cpp:20)
|
->16.62% (2,000B) 0x........: main (new-cpp.cpp:21)
|
->16.62% (2,000B) 0x........: main (new-cpp.cpp:22)
--------------------------------------------------------------------------------
n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B)
--------------------------------------------------------------------------------
6 16,040 8,024 8,000 24 0
7 20,048 4,016 4,000 16 0
8 22,056 2,008 2,000 8 0
9 24,064 0 0 0 0
I don't see any explicit "post" errors printed? So I am clearly
missing something. :-)
I am hoping you can give me a hint here as I am not seeing where the
issue with the test is. Thanks.
Carl
|