[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2021-02-21 Thread Ulya Trofimovich
https://bugs.kde.org/show_bug.cgi?id=427510

--- Comment #8 from Ulya Trofimovich  ---
(In reply to Mark Wielaard from comment #7)
> I cannot replicate this issue, not even with the attachment 132259 [details]:
> 
> $ callgrind_annotate callgrind.out.9703 > /dev/null
> 
> Produces no warnings or errors.

It could be because some of the source files needed for annotation are missing
(if you drop redirection to /dev/null, there is a message "The following files
chosen for auto-annotation could not be found" in the output). Now that I no
longer have those files on my system I cannot reproduce the warnings (neither
with HEAD, nor with the commit on which I based the patch).

But the code hasn't changed and the issue is still there: at
callgrind_annotate.in:1199 "pairs[0]" could not exist if "n" is 0.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2021-02-21 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=427510

Mark Wielaard  changed:

   What|Removed |Added

 CC||m...@klomp.org

--- Comment #7 from Mark Wielaard  ---
I cannot replicate this issue, not even with the attachment 132259:

$ callgrind_annotate callgrind.out.9703 > /dev/null

Produces no warnings or errors.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2020-10-13 Thread Ulya Trofimovich
https://bugs.kde.org/show_bug.cgi?id=427510

--- Comment #6 from Ulya Trofimovich  ---
(In reply to Ulya Trofimovich from comment #2)
> See here instructions for building from the official Valgrind git repo.
> 
> https://www.valgrind.org/downloads/repository.html

Oh, sorry, I used the wrong git repo in comment #3. Following the above build
instructions, I still get the same errors. They are trivial to fix, I attach a
patch in comment #4.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2020-10-13 Thread Ulya Trofimovich
https://bugs.kde.org/show_bug.cgi?id=427510

--- Comment #5 from Ulya Trofimovich  ---
Created attachment 132336
  --> https://bugs.kde.org/attachment.cgi?id=132336=edit
Patch that fixes the bug.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2020-10-13 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=427510

Paul Floyd  changed:

   What|Removed |Added

 CC||pa...@free.fr

--- Comment #4 from Paul Floyd  ---
(In reply to Ulya Trofimovich from comment #2)
> (In reply to Philippe Waroquiers from comment #1)
> > Seems fixed in recent git version.
> > Can you try with the last 3.16 version (or the last GIT version), 
> > instead of a 3.16 GIT version ?
> 
> Tried with HEAD (cloned from https://github.com/rantoniello/valgrind and

See here instructions for building from the official Valgrind git repo.

https://www.valgrind.org/downloads/repository.html

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2020-10-10 Thread Ulya Trofimovich
https://bugs.kde.org/show_bug.cgi?id=427510

--- Comment #3 from Ulya Trofimovich  ---
The "uninitilized" error is simple: the code assumes nonempty array and sets
its first element (in the case of a zero-sized array it adds one element, which
causes the second error because the assumption that there is an even number of
elements in the array is broken). The following simple patch fixes the error:

diff --git a/callgrind/callgrind_annotate.in b/callgrind/callgrind_annotate.in
index 4f28129..42a8cd1 100644
--- a/callgrind/callgrind_annotate.in
+++ b/callgrind/callgrind_annotate.in
@@ -1136,7 +1136,9 @@ sub annotate_ann_files($)
 }

 # Annotate chosen lines, tracking total counts of lines printed
-$pairs[0] = 1 if ($pairs[0] < 1);
+if ($n > 0 && $pairs[0] < 1) {
+$pairs[0] = 1
+}
 while (@pairs) {
 my $low  = shift @pairs;
 my $high = shift @pairs;

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2020-10-10 Thread Ulya Trofimovich
https://bugs.kde.org/show_bug.cgi?id=427510

--- Comment #2 from Ulya Trofimovich  ---
(In reply to Philippe Waroquiers from comment #1)
> Seems fixed in recent git version.
> Can you try with the last 3.16 version (or the last GIT version), 
> instead of a 3.16 GIT version ?

Tried with HEAD (cloned from https://github.com/rantoniello/valgrind and built
as `autogen.sh && mkdir build && cd build && ../configure && make`), the error
is gone, but on a closer look it's only because the default settings have been
changed. I can still see the bug with `--auto-yes`, along with some more
errors:

$ callgrind_annotate --auto=yes callgrind.out.9703 >/dev/null
Negative repeat count does nothing at callgrind_annotate line 828, 
line 58.
Negative repeat count does nothing at callgrind_annotate line 828, 
line 68.
Negative repeat count does nothing at callgrind_annotate line 828, 
line 14.
Negative repeat count does nothing at callgrind_annotate line 828, 
line 20.
Negative repeat count does nothing at callgrind_annotate line 828, 
line 34.
Negative repeat count does nothing at callgrind_annotate line 828, 
line 44.
Negative repeat count does nothing at callgrind_annotate line 828, 
line 51.
Use of uninitialized value $pairs[0] in numeric lt (<) at callgrind_annotate
line 1139.
Use of uninitialized value $high in numeric lt (<) at callgrind_annotate line
1150.

On a side note, why are annotations are off by default now? They are so useful.
And the percent count is gone, I miss that one too and don't know how to get it
back. :)

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 427510] Use of uninitialized value in callgrind_annotate.

2020-10-10 Thread Philippe Waroquiers
https://bugs.kde.org/show_bug.cgi?id=427510

Philippe Waroquiers  changed:

   What|Removed |Added

 CC||philippe.waroquiers@skynet.
   ||be

--- Comment #1 from Philippe Waroquiers  ---
Seems fixed in recent git version.
Can you try with the last 3.16 version (or the last GIT version), 
instead of a 3.16 GIT version ?

-- 
You are receiving this mail because:
You are watching all bug changes.