Created attachment 96260 [details] a reproducer application If an application is compiled with Intel compiler, line numbers are displayed incorrectly if the line contains line break. A reproducer application (line_numbers.c) is attached. Steps to build and run the test: icc -O0 -g line_numbers.c -o line_numbers_icc valgrind -q ./line_numbers_icc Expected result (reported for gcc-compiled application): ==xxxx== Invalid write of size 4 ==xxxx== at 0xxxxxxx: main (line_numbers.c:8) ==xxxx== Address 0xxxxxxxx is 4 bytes inside a block of size 40 free'd ==xxxx== at 0xxxxxxxx: free (vg_replace_malloc.c:530) ==xxxx== by 0xxxxxxx: main (line_numbers.c:7) ==xxxx== Block was alloc'd at ==xxxx== at 0xxxxxxxx: malloc (vg_replace_malloc.c:299) ==xxxx== by 0xxxxxxx: main (line_numbers.c:5) ==xxxx== Actual result: ==xxxx== Invalid write of size 4 ==xxxx== at 0xxxxxxx: main (line_numbers.c:8) ==xxxx== Address 0xxxxxxxx is 4 bytes inside a block of size 40 free'd ==xxxx== at 0xxxxxxxx: free (vg_replace_malloc.c:530) ==xxxx== by 0xxxxxxx: main (line_numbers.c:7) ==xxxx== Block was alloc'd at ==xxxx== at 0xxxxxxxx: malloc (vg_replace_malloc.c:299) ==xxxx== by 0xxxxxxx: main (line_numbers.c:7) ==xxxx==
It would be good to analyse the debug info generated by icc e.g. using objdump and/or using gdb e.g. info line 5/6/7 and info line *0x...... and/or the valgrind gdbserver monitor command v.info location <addr> (where addr is an address that should be part of the line 5) Alternatively, it might be the unwind info that is not ok and/or the valgrind unwinder. You might investigate that by using gdb+vgdb, and put a break at vg_replace_malloc.c:299. You can then compare gdb unwinder (using the bt gdb command) with the valgrind unwinder (using monitor v.info scheduler) All the above might give some hints about what is going wrong.
(In reply to Philippe Waroquiers from comment #1) > It would be good to analyse the debug info generated by icc > e.g. using objdump > and/or using gdb e.g. info line 5/6/7 > and info line *0x...... > and/or the valgrind gdbserver monitor command v.info location <addr> > (where addr is an address that should be part of the line 5) Philippe Waroquiers, Thank you very much. The debug information is generated incorrectly by compiler.