Version: unspecified (using Devel) OS: Linux We were hacking with kcachegrind, and found a bug regarding long lines which result in an offset when displaying the line numbers (and picking the right lines to display). This gives a highly confusing code-review :-) We have packaged a small example from Ubuntu Lucid 10.04, where we compile goat.c $ gcc -g -o goat goat.c We run callgrind under valgrind $ valgrind --tool=callgrind ./goat We display the result $ kcachegrind callgrind.out.* As you see the "hola" line-numbers are displaced relative to the original source. The problem originates from the long lines - which confuse the display-unit of kcachegrind. As you see, when we exceed 256 characters, we have an offset of one line for the remaining part of the code, and if we exceed 512, we get an offset of +2 lines. I.e. it seems that a counter is wrapping or alike. The root of the bug is kcachegrind-0.4.6/kcachegrind/sourceview.cpp line 631, where you define buf[256] Since Josef and I have discussed this offline, we have (thanx Josef) found this patch, which we have verfied already. Since the bug is highly annoying for any C/C++ code with long lines, we would like to see this patched asap. Reproducible: Always Steps to Reproduce: We have packaged a small example from Ubuntu Lucid 10.04, where we compile goat.c $ wget http://petertoft.dk/kcachegrind/goat.c $ gcc -g -o goat goat.c We run callgrind under valgrind $ valgrind --tool=callgrind ./goat We display the result $ kcachegrind callgrind.out.* As you see the "hola" line-numbers are displaced relative to the original source. The problem originates from the long lines - which confuse the display-unit of kcachegrind. As you see at http://petertoft.dk/kcachegrind/Screenshot.png, when we exceed 256 characters, we have an offset of one line for the remaining part of the code, and if we exceed 512, we get an offset of +2 lines. I.e. it seems that a counter is wrapping or alike. Actual Results: See http://petertoft.dk/kcachegrind/Screenshot.png Expected Results: The print lines should be shown as lines 7,9, and 11 Josef is aware of the bug :)
Fixed in trunk r1167564 (KDE 4.6) and backported to 4.5 branch r1167576 (KDE 4.5.1).