Bug 463992 - Valgrind fails to run
Summary: Valgrind fails to run
Status: RESOLVED DUPLICATE of bug 381819
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.18.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-08 05:27 UTC by Igor
Modified: 2023-01-08 17:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor 2023-01-08 05:27:22 UTC
SUMMARY
Trying to run valgrind I get the following output:

[code]
igor@WaylandGnome ~/dbhandler/Debug/dbhandler $ valgrind --leak-check=full --verbose dbhandler
==6136== Memcheck, a memory error detector
==6136== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==6136== Using Valgrind-3.18.1-42b08ed5bd-20211015 and LibVEX; rerun with -h for copyright info
==6136== Command: dbhandler
==6136== 
--6136-- Valgrind options:
--6136--    --leak-check=full
--6136--    --verbose
--6136-- Contents of /proc/version:
--6136--   Linux version 5.10.52-gentoo (root@WaylandGnome) (gcc (Gentoo 10.3.0-r2 p3) 10.3.0, GNU ld (Gentoo 2.35.2 p1) 2.35.2) #19 SMP Tue Aug 31 09:20:30 CDT 2021
--6136-- 
--6136-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c
--6136-- Page sizes: currently 4096, max supported 4096
--6136-- Valgrind library directory: /usr/libexec/valgrind
--6136-- Reading syms from /usr/local/bin/dbhandler
--6136-- Reading syms from /lib64/ld-2.33.so
--6136--   Considering /usr/lib/debug/lib64/ld-2.33.so.debug ..
--6136--   .. CRC is valid
--6136-- Reading syms from /usr/libexec/valgrind/memcheck-amd64-linux
--6136--   Considering /usr/lib/debug/usr/libexec/valgrind/memcheck-amd64-linux.debug ..
--6136--   .. CRC is valid
--6136--    object doesn't have a dynamic symbol table
--6136-- Scheduler: using generic scheduler lock implementation.
--6136-- Reading suppressions file: /usr/libexec/valgrind/default.supp
==6136== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-6136-by-igor-on-???
==6136== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-6136-by-igor-on-???
==6136== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-6136-by-igor-on-???
==6136== 
==6136== TO CONTROL THIS PROCESS USING vgdb (which you probably
==6136== don't want to do, unless you know exactly what you're doing,
==6136== or are doing some strange experiment):
==6136==   /usr/libexec/valgrind/../../bin/vgdb --pid=6136 ...command...
==6136== 
==6136== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==6136==   /path/to/gdb dbhandler
==6136== and then give GDB the following command
==6136==   target remote | /usr/libexec/valgrind/../../bin/vgdb --pid=6136
==6136== --pid is optional if only one valgrind process is running
==6136== 
vex amd64->IR: unhandled instruction bytes: 0x8F 0xEA 0x78 0x10 0xD0 0x8 0x4 0x0 0x0 0x89
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==6136== valgrind: Unrecognised instruction at address 0x40197cf.
==6136==    at 0x40197CF: get_common_indices.constprop.0 (in /lib64/ld-2.33.so)
==6136==    by 0x401ACB6: init_cpu_features.constprop.0 (in /lib64/ld-2.33.so)
==6136==    by 0x401BE1D: _dl_sysdep_start (in /lib64/ld-2.33.so)
==6136==    by 0x4001FDB: _dl_start (in /lib64/ld-2.33.so)
==6136==    by 0x4001057: ??? (in /lib64/ld-2.33.so)
==6136== Your program just tried to execute an instruction that Valgrind
==6136== did not recognise.  There are two possible reasons for this.
==6136== 1. Your program has a bug and erroneously jumped to a non-code
==6136==    location.  If you are running Memcheck and you just saw a
==6136==    warning about a bad jump, it's probably your program's fault.
==6136== 2. The instruction is legitimate but Valgrind doesn't handle it,
==6136==    i.e. it's Valgrind's fault.  If you think this is the case or
==6136==    you are not sure, please let us know and we'll try to fix it.
==6136== Either way, Valgrind will now raise a SIGILL signal which will
==6136== probably kill your program.
==6136== 
==6136== Process terminating with default action of signal 4 (SIGILL)
==6136==  Illegal opcode at address 0x40197CF
==6136==    at 0x40197CF: get_common_indices.constprop.0 (in /lib64/ld-2.33.so)
==6136==    by 0x401ACB6: init_cpu_features.constprop.0 (in /lib64/ld-2.33.so)
==6136==    by 0x401BE1D: _dl_sysdep_start (in /lib64/ld-2.33.so)
==6136==    by 0x4001FDB: _dl_start (in /lib64/ld-2.33.so)
==6136==    by 0x4001057: ??? (in /lib64/ld-2.33.so)
==6136== 
==6136== HEAP SUMMARY:
==6136==     in use at exit: 0 bytes in 0 blocks
==6136==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==6136== 
==6136== All heap blocks were freed -- no leaks are possible
==6136== 
==6136== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction
igor@WaylandGnome ~/dbhandler/Debug/dbhandler $ 

[/code]

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT
Valgrind fails to start

EXPECTED RESULT
Valgrind runs and find the leaks

SOFTWARE/OS VERSIONS
Linux/GNOME/Wayland
(available in About System)

ADDITIONAL INFORMATION

I can provide any additional information about the system and the program.

I can also able to successfully start the program in the Terminal.
Comment 1 Mark Wielaard 2023-01-08 17:52:56 UTC
This is a duplicate bug #381819 which contains a possible fix.

*** This bug has been marked as a duplicate of bug 381819 ***