Description of problem:
The regression was detected when compiling and running valgrind, as valgrind
reads its own debug information, and reports strange values found in the debug
info.
Valgrind reports then that line numbers > 1048575 are found in its own debug
info, when compiled with lto and gcc 9.
Version-Release number of selected component (if applicable):
devtoolset-9-gcc-9.1.1-2.6.el7.x86_64
How reproducible:
Always
Steps to Reproduce:
1. Dowload the valgrind code
$ wget https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2
2. Extract the source code
$ tar -xf valgrind-3.15.0.tar.bz2
3. Configure and build
$ source scl_source enable devtoolset-9
$ { ./autogen.sh; \
./configure --prefix=`pwd`/install --enable-only64bit --enable-lto; \
make -j2 install; \
} >& build.log
Actual results:
$ ./install/bin/valgrind -q date
==14497== warning: Can't handle line info entry with line number 177277754 greater than 1048575
==14497== (Nb: this message is only shown once)
==14497== warning: Can't handle inlined call info entry with line number 177277750 greater than 1048575
==14497== (Nb: this message is only shown once)
Fri Mar 20 09:53:41 -03 2020
Expected results:
$ valgrind -q date
Fri Mar 20 09:55:17 -03 2020
Additional info:
#### Double check that valgrind debug info reader is correct:
gdb ./.in_place/memcheck-amd64-linux
Reading symbols from ./.in_place/memcheck-amd64-linux...
(gdb) info line guest_amd64_toIR.c:177277754
Line number 177277754 is out of range for "priv/guest_amd64_toIR.c".
Line 177277754 of "priv/guest_amd64_toIR.c" starts at address 0x58069001 <dis_ESC_0F__SSE4+17> and ends at 0x58069005 <dis_ESC_0F__SSE4+21>.
(gdb)
You can also try:
(gdb) disass /s dis_ESC_0F__SSE4
and it shows lots of useless lines.
You can ask valgrind to show more info about what it is doing/reading by doing
./install/bin/valgrind -v -v -v -v -d -d -d -d --debug-dump=line date |& tee d.out
(In reply to Marek Polacek from comment #2)
> You mention this is a regression, what version of GCC handled this right,
> GCC 8 from DTS 8?
Right, it's a regression regarding devtoolset-8-gcc-8.3.1-3.1.el7.x86_64.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (devtoolset-10-gcc bug fix update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2021:2219