Thread: query related valgrind usage in arm board with i686 arch

  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    147

    query related valgrind usage in arm board with i686 arch

    Hi Team,

    We are using arm board of i686 arch .

    I got valgrind cross compiled using the arm toolchain of i386 ( vendor given).

    We observe for two of the packages could able to run with valgrind .

    where as with others I get below error .

    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-linux.so.3
    valgrind: was not found whilst processing
    valgrind: symbols from the object with soname: ld-linux.so.3
    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.


    In above I see like when I do readelf -S ./lib/libc.so.6

    [63] .debug_aranges PROGBITS 00000000 131558 000240 00 0 0 8
    [64] .debug_info PROGBITS 00000000 131798 001571 00 0 0 1
    [65] .debug_abbrev PROGBITS 00000000 132d09 0003dd 00 0 0 1
    [66] .debug_line PROGBITS 00000000 1330e6 000e17 00 0 0 1
    [67] .debug_frame PROGBITS 00000000 133f00 002608 00 0 0 4
    [68] .debug_str PROGBITS 00000000 136508 0012f8 01 MS 0 0 1
    [69] .debug_loc PROGBITS 00000000 137800 00039b 00 0 0 1

    I belive debug symbols are present


    In my target board we have busybox binary , this works very fine with valgrind.

    I mean if "ld-linux.so.3 needs to have symbols" ,does this mean busy box does not use this linker / loader?.

    Where as for others it gives error as shown before?.

    when I do readelf -S /lib/ld-linux.so.3 , it shows

    [21] .debug_aranges PROGBITS 00000000 0218f0 0000a0 00 0 0 8
    [22] .debug_info PROGBITS 00000000 021990 000a81 00 0 0 1
    [23] .debug_abbrev PROGBITS 00000000 022411 0001b2 00 0 0 1
    [24] .debug_line PROGBITS 00000000 0225c3 00037f 00 0 0 1
    [25] .debug_frame PROGBITS 00000000 022944 000608 00 0 0 4
    [26] .debug_str PROGBITS 00000000 022f4c 0011cf 01 MS 0 0 1
    [27] .debug_loc PROGBITS 00000000 02411b 0002fb 00 0 0 1

    Will this confirm like it has debugging symbols.

    Not sure enough , what exactly missing , Any inputs in this will be highly appreciated.

    Thanks
    vlrk

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Code:
    $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep index
    00000000000a82e0 i index@@GLIBC_2.2.5
    00000000000a89e0 i rindex@@GLIBC_2.2.5
    Use nm to list the dynamic symbols.

    Also, index is in libc, so I've no idea why it's complaining about not being able to find in ld-linux.so.3

    > We are using arm board of i686 arch .
    > I got valgrind cross compiled using the arm toolchain of i386 ( vendor given).
    Unless as the error message hints, it's a 32/64 bit mix-up.

    What does 'file' report for the program you're trying to valgrind?
    Code:
    $ file /bin/ls
    /bin/ls: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    147
    Thanks salem,

    Below is the nm and file related output.

    Code:
    [labuser@141179 lib]$ nm libc.so.6 | grep index
    000f0e30 t decrement_at_index.part.0
    000ea7c0 t __GI___if_freenameindex
    000ea7c0 t __GI_if_freenameindex
    000eaacc t __GI_if_indextoname
    000ea7fc t __GI_if_nameindex
    000ea6f0 t __GI___if_nametoindex
    000ea6f0 t __GI_if_nametoindex
    000ea7c0 t __if_freenameindex
    000ea7c0 W if_freenameindex
    000eaacc t __if_indextoname
    000eaacc W if_indextoname
    000ea7fc t __if_nameindex
    000ea7fc W if_nameindex
    000ea6f0 t __if_nametoindex
    000ea6f0 W if_nametoindex
    00075d20 W index
    00076c10 W rindex

    Code:
    file lighttpd
    lighttpd: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 4.19.0, not stripped
    may be as it shows , I should get libc6-dbg:i386 and provide this info to valgrind .
    Need to find a way , on getting this.

    Thanks
    vlrk

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 06-26-2015, 11:29 PM
  2. malloc related query
    By roaan in forum C Programming
    Replies: 1
    Last Post: 09-29-2009, 02:53 AM
  3. Structure related query
    By progue in forum C Programming
    Replies: 2
    Last Post: 10-24-2007, 05:37 AM
  4. Query related to DisconnectEx?
    By dp_76 in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-25-2005, 02:33 AM
  5. Query related to recv()?
    By dp_76 in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-16-2005, 07:25 AM

Tags for this Thread