Bug 389470 - Redirection of index function in ld.so.1 breaks compatibility on old environments
Summary: Redirection of index function in ld.so.1 breaks compatibility on old environm...
Status: RESOLVED INTENTIONAL
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (other bugs)
Version First Reported In: 3.13.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-26 16:47 UTC by Baris Demiray
Modified: 2018-01-26 16:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Baris Demiray 2018-01-26 16:47:37 UTC
Hello all,

I am trying to run a MIPS application on an AXIS camera through Valgrind that I compiled using the toolchain provided by Axis, but it's failing at redirecting a method. Here is the info bug_report page suggests to add. Please note that, I can do the exact thing with Valgrind 3.12.0 without this error (there is hovewer a crash in that case, please feel free to suggest in your response if this should be reported as well, as I'm not sure due to pretty ancient toolchain/environment).

root@axis-accc8f034f14:/usr/local/packages/app# uname -a
Linux axis-accc8e02cf14 4.9.53-axis5 #1 SMP PREEMPT Tue Nov 14 17:47:07 CET 2017 mips GNU/Linux

And the output of Valgrind ran with -v flag.

root@axis-accc8e02cf14:/usr/local/packages/app# VALGRIND_LIB=/var/spool/storage/NetworkShare/bdemiray/valgrind/3.13.0-mips/lib/valgrind /var/spool/storage/NetworkShare/bdemiray/valgrind/
3.13.0-mips/bin/valgrind -v --tool=memcheck ./app
==22414== Memcheck, a memory error detector
==22414== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==22414== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==22414== Command: ./app
==22414== 
--22414-- Valgrind options:
--22414--    -v
--22414--    --tool=memcheck
--22414-- Contents of /proc/version:
--22414--   Linux version 4.9.53-axis5 (svcj@build-srv44) (gcc version 4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527] (GCC 4.7.2 Axis release R28/1.28) ) #1 SMP PREEMPT Tue Nov 14 17:47:07 CET 2017
--22414-- 
--22414-- Arch and hwcaps: MIPS32, LittleEndian, MIPS-baseline-dsp
--22414-- Page sizes: currently 4096, max supported 65536
--22414-- Valgrind library directory: /var/spool/storage/NetworkShare/bdemiray/valgrind/3.13.0-mips/lib/valgrind
--22414-- Reading syms from /usr/local/packages/app/app
--22414-- Reading syms from /lib/ld-2.19.so
--22414--   Considering /lib/ld-2.19.so ..
--22414--   .. CRC mismatch (computed eb25f40e wanted d3f1593a)
--22414--    object doesn't have a symbol table

valgrind:  Fatal error at startup: a function redirection
valgrind:  which is mandatory for this platform-tool combination
valgrind:  cannot be set up.  Details of the redirection are:
valgrind:  
valgrind:  A must-be-redirected function
valgrind:  whose name matches the pattern:      index
valgrind:  in an object with soname matching:   ld.so.1
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld.so.1
valgrind:  
valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
valgrind:  package on this machine.  (2, longer term): ask the packagers
valgrind:  for your Linux distribution to please in future ship a non-
valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:  that exports the above-named function using the standard
valgrind:  calling conventions for this platform.  The package you need
valgrind:  to install for fix (1) is called
valgrind:  
valgrind:    On Debian, Ubuntu:                 libc6-dbg
valgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo
valgrind:  
valgrind:  Note that if you are debugging a 32 bit process on a
valgrind:  64 bit system, you will need a corresponding 32 bit debuginfo
valgrind:  package (e.g. libc6-dbg:i386).
valgrind:  
valgrind:  Cannot continue -- exiting now.  Sorry.

And the commit that I have found that is probably related to this issue,

https://sourceware.org/git/?p=valgrind.git;a=commitdiff;h=464c1720419b8021f87e11ee3bbf8d1aebd1eb62

Thanks in advance.
Comment 1 Tom Hughes 2018-01-26 16:58:33 UTC
The commit is entirely deliberate - we need to be able to intercept that function in order to avoid issuing spurious warnings.

This is working as designed, and the message tells you what you need to do to fix your environment so that valgrind can work there.