Hello,

First, I would like to thank all of the developers of valgrind for their 
excellent work on this most useful developer tool, and also for the recent 
addition of ARM support.

To that end, I have been working on valgrind 3.6.1 support for armv5 - 
specifically, the arm926ej-s core.

I have some patches (aka kludges) to get it to mostly run on this processor, 
using arm-unknown-linux-gnueabi-gcc which I am willing to share if anyone is 
interested, but they are not ready for prime time.

I am having an issue with the loading of the debug symbols.  The GCC version I 
am using is 4.4.6.

I start with a very simple hello.c program, with one unfreed 8K item for 
testing:

#include <stdlib.h>
#include <stdio.h>

int main()
{
        char *m = malloc(8192);
        (void)m;
        printf("Hello!\n");
        exit(0);
}

$ arm-linux-gcc -W -Wall -gdwarf-2 hello.c -o hello

I am not sure how to find out which dwarf version is being compiled into my 
shared objects, but a sample run with the reported WARNINGS follows.
Note that I needed to disable a call in readdwarf.c, read_unitinfo_dwarf2, to 
keep it from crashing.  Also, the version number being read in 
read_debuginfo_dwarf3 is wrong - 512 or 1024, as shown by the DWARF: lines in 
the log.

Any advice for valgrind dwarf support or compiler build options necessary to 
fix this would be appreciated.

Update: I used dwarfdump on the hello file and ld-2.12.2.so and it appears to 
find no problems with the files using the -ka option, so help using that tool 
and determining what is going on would be great.

Thanks.

Mark Wickham
Digi International
---

$ cat /proc/cpuinfo
Processor       : ARM926EJ-S rev 5 (v5l)
BogoMIPS        : 178.99
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 5

Machine ID      : 3419
Hardware        : Digi ConnectPort X2
Revision        : 28011
Serial          : 0000000000000000
$ valgrind -v --leak-check=full --show-reachable=yes ./hello
==844== Memcheck, a memory error detector
==844== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==844== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==844== Command: ./hello
==844==
--844-- Valgrind options:
--844--    -v
--844--    --leak-check=full
--844--    --show-reachable=yes
--844-- Contents of /proc/version:
--844--   Linux version 2.6.35-01661-g850ec9c (markw@markw4) (gcc version 4.4.6 
(crosstool-NG 1.12.1) ) #1 PREEMPT Fri Sep 16 17:46:21 CDT 2011
--844-- Arch and hwcaps: ARM, ARMv5
--844-- Page sizes: currently 4096, max supported 4096
--844-- Valgrind library directory: /usr/lib/valgrind
--844-- Reading syms from /hello (0x8000)
Reading UnitInfo at 0x0.....
   => LINES=0x0    NAME=(null)     DIR=(null)
debug_line_sz 56, ui.stmt_list 0  (null)
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from /hello:
--844-- Only DWARF version 2, 3 and 4 line info is currently supported.
--844-- Reading syms from /lib/ld-2.12.2.so (0x4000000)
Reading UnitInfo at 0x0.....
   => LINES=0x0    NAME=(null)     DIR=(null)
debug_line_sz 2593, ui.stmt_list 0  (null)
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from /lib/ld-2.12.2.so:
--844-- Last block truncated in .debug_info; ignoring
--844-- Reading suppressions file: /usr/lib/valgrind/default.supp
--844-- REDIR: 0x40172f0 (memcpy) redirected to 0x3803ffe4 (???)
--844-- REDIR: 0x4016860 (strlen) redirected to 0x3803ffb8 (???)
--844-- Reading syms from /usr/lib/valgrind/vgpreload_core-arm-linux.so 
(0x4826000)
DWARF: 512
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from 
/usr/lib/valgrind/vgpreload_core-arm-linux.so:
--844-- Ignoring non-Dwarf2/3/4 block in .debug_info
--844-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-arm-linux.so 
(0x4830000)
DWARF: 512
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from 
/usr/lib/valgrind/vgpreload_memcheck-arm-linux.so:
--844-- Ignoring non-Dwarf2/3/4 block in .debug_info
DWARF: 1024
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from 
/usr/lib/valgrind/vgpreload_memcheck-arm-linux.so:
--844-- Ignoring non-Dwarf2/3/4 block in .debug_info
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from 
/usr/lib/valgrind/vgpreload_memcheck-arm-linux.so:
--844-- Last block truncated in .debug_info; ignoring
--844-- Reading syms from /lib/libc-2.12.2.so (0x4841000)
DWARF: 512
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from /lib/libc-2.12.2.so:
--844-- Ignoring non-Dwarf2/3/4 block in .debug_info
--844-- WARNING: Serious error when reading debug info
--844-- When reading debug info from /lib/libc-2.12.2.so:
--844-- Last block truncated in .debug_info; ignoring
--844-- REDIR: 0x48b4cb8 (rindex) redirected to 0x4834414 (rindex)
--844-- REDIR: 0x48b0bc8 (malloc) redirected to 0x48333e4 (malloc)
--844-- REDIR: 0x48b48c0 (strlen) redirected to 0x4834ae0 (strlen)
Hello!
--844-- REDIR: 0x48b0a4c (free) redirected to 0x4832ecc (free)
--844-- REDIR: 0x48b6260 (memset) redirected to 0x4836594 (memset)
==844==
==844== HEAP SUMMARY:
==844==     in use at exit: 8,192 bytes in 1 blocks
==844==   total heap usage: 1 allocs, 0 frees, 8,192 bytes allocated
==844==
==844== Searching for pointers to 1 not-freed blocks
==844== Checked 45,680 bytes
==844==
==844== 8,192 bytes in 1 blocks are still reachable in loss record 1 of 1
==844==    at 0x4833480: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-arm-linux.so)
==844==    by 0x8433: main (in /hello)
==844==
==844== LEAK SUMMARY:
==844==    definitely lost: 0 bytes in 0 blocks
==844==    indirectly lost: 0 bytes in 0 blocks
==844==      possibly lost: 0 bytes in 0 blocks
==844==    still reachable: 8,192 bytes in 1 blocks
==844==         suppressed: 0 bytes in 0 blocks
==844==
==844== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from 5)
--844--
--844-- used_suppression:     11 U1004-ARM-_dl_relocate_object
==844==
==844== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from 5)
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to