https://bugs.kde.org/show_bug.cgi?id=395682

            Bug ID: 395682
           Summary: Reading debug info
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: dilyan.palau...@aegee.org
  Target Milestone: ---

Created attachment 113482
  --> https://bugs.kde.org/attachment.cgi?id=113482&action=edit
The produced binary

I have this program:
  #include <stdio.h>
  int main() {
    printf("a\n");
    int i = 7 /0;
    printf("b\n");
  }
which I compile with "gcc -g t.c -o t"

Running `valgrind -v  --memcheck:track-origins=yes --read-var-info=yes
--memcheck:show-leak-kinds=all --vgdb=no t` I expect to see the line where
there are problems, but it prints:

==24781== Memcheck, a memory error detector
==24781== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==24781== Using Valgrind-3.14.0.GIT-90daa486e8-20180620X and LibVEX; rerun with
-h for copyright info
==24781== Command: t
==24781== 
--24781-- Valgrind options:
--24781--    -v
--24781--    --memcheck:track-origins=yes
--24781--    --read-var-info=yes
--24781--    --memcheck:show-leak-kinds=all
--24781--    --vgdb=no
--24781-- Contents of /proc/version:
--24781--   Linux version 3.16.0-4-amd64 (debian-ker...@lists.debian.org) (gcc
version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)
--24781-- 
--24781-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-sse3
--24781-- Page sizes: currently 4096, max supported 4096
--24781-- Valgrind library directory: /usr/local/lib/valgrind
--24781-- Reading syms from /home/me/t
--24781-- ELF section outside all mapped regions
--24781-- Reading syms from /lib/x86_64-linux-gnu/ld-2.19.so
--24781--   Considering /lib/x86_64-linux-gnu/ld-2.19.so ..
--24781--   .. CRC mismatch (computed c067370a wanted 8c45d3ea)
--24781--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.19.so ..
--24781--   .. CRC is valid
--24781-- warning: addVar: unknown size (buf)
--24781-- warning: addVar: unknown size (buf)
--24781-- warning: addVar: unknown size (buf)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- warning: addVar: unknown size (loadcmds)
--24781-- Reading syms from /usr/local/lib/valgrind/memcheck-amd64-linux
--24781--    object doesn't have a symbol table
--24781--    object doesn't have a dynamic symbol table
--24781-- Scheduler: using generic scheduler lock implementation.
--24781-- Reading suppressions file: /usr/local/lib/valgrind/default.supp
--24781-- REDIR: 0x4017b50 (ld-linux-x86-64.so.2:strlen) redirected to
0x581df42e (???)
--24781-- REDIR: 0x4017900 (ld-linux-x86-64.so.2:index) redirected to
0x581df448 (???)
--24781-- Reading syms from
/usr/local/lib/valgrind/vgpreload_core-amd64-linux.so
--24781--    object doesn't have a symbol table
--24781-- Reading syms from
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--24781--    object doesn't have a symbol table
==24781== WARNING: new redirection conflicts with existing -- ignoring it
--24781--     old: 0x04017b50 (strlen              ) R-> (0000.0) 0x581df42e
???
--24781--     new: 0x04017b50 (strlen              ) R-> (2007.0) 0x0402d490
strlen
--24781-- REDIR: 0x4017b20 (ld-linux-x86-64.so.2:strcmp) redirected to
0x402ed40 (strcmp)
--24781-- REDIR: 0x4018850 (ld-linux-x86-64.so.2:mempcpy) redirected to
0x4037390 (mempcpy)
--24781-- Reading syms from /lib/x86_64-linux-gnu/libc-2.19.so
--24781--   Considering /lib/x86_64-linux-gnu/libc-2.19.so ..
--24781--   .. CRC mismatch (computed 8b555f82 wanted cd9b3228)
--24781--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so ..
--24781--   .. CRC is valid
--24781-- REDIR: 0x4aa8dc0 (libc.so.6:strcasecmp) redirected to 0x4023720
(_vgnU_ifunc_wrapper)
--24781-- REDIR: 0x4aab0b0 (libc.so.6:strncasecmp) redirected to 0x4023720
(_vgnU_ifunc_wrapper)
--24781-- REDIR: 0x4aa8590 (libc.so.6:memcpy@GLIBC_2.2.5) redirected to
0x4023720 (_vgnU_ifunc_wrapper)
--24781-- REDIR: 0x4aa6910 (libc.so.6:rindex) redirected to 0x402ce10 (rindex)
--24781-- REDIR: 0x4aa4c10 (libc.so.6:strlen) redirected to 0x402d3d0 (strlen)
==24781== 
==24781== Process terminating with default action of signal 8 (SIGFPE)
==24781==  Integer divide by zero at address 0x10090584FE
==24781==    at 0x401149: ??? (in /home/me/t)
==24781==    by 0x4A44B44: (below main) (libc-start.c:287)
a
--24781-- REDIR: 0x4a9f600 (libc.so.6:free) redirected to 0x402afd0 (free)
==24781== 
==24781== HEAP SUMMARY:
==24781==     in use at exit: 0 bytes in 0 blocks
==24781==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==24781== 
==24781== All heap blocks were freed -- no leaks are possible
==24781== 
==24781== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==24781== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Why isn't the code line shown at
==24781==  Integer divide by zero at address 0x10090584FE
==24781==    at 0x401149: ??? (in /home/me/t)

How shall I compile in order to see the lines in valgrind's output?  It worked
in the past and I don't know when and why it stopped working.

I use gcc (GCC) 7.3.1 20180618 and valgrind-3.14.0.GIT-90daa486e8-20180620X.

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

Reply via email to