Summary: | ppc: Valgrind crashes while reading stabs information | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Bart Van Assche <bart.vanassche+kde> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED INTENTIONAL | ||
Severity: | crash | CC: | florian, njn |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Bart Van Assche
2008-05-22 18:57:09 UTC
Exactly the same results with trunk r8880, Fedora Core release 6 and gcc 4.1.1. I can't reproduce with trunk r10378 on Linux or Mac. Do you still see this? I can't reproduce this issue either with r10378. (In reply to comment #3) > I can't reproduce this issue either with r10378. Can reproduce this with trunk r10857 on openSUSE 10.3 PPC. After having applied the patch below the crash does no longer occur but the stabs reader complains about a bad stabstr size: $ ./vg-in-place --tool=none memcheck/tests/deep_templates ==5370== Nulgrind, the minimal Valgrind tool ==5370== Copyright (C) 2002-2009, and GNU GPL'd, by Nicholas Nethercote. ==5370== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info ==5370== Command: memcheck/tests/deep_templates ==5370== @@ bad stabstr size -268215147 It's not NULL. How DULL. ==5370== $ svn diff coregrind/m_debuginfo/readstabs.c Index: coregrind/m_debuginfo/readstabs.c =================================================================== --- coregrind/m_debuginfo/readstabs.c (revision 10857) +++ coregrind/m_debuginfo/readstabs.c (working copy) @@ -143,12 +143,15 @@ Char *string; if (di->trace_symtab) { + vg_assert(st); + VG_(printf) ( "st->n_un.n_strx = %ld\n", st->n_un.n_strx ); + vg_assert(0 <= st->n_un.n_strx && (st->n_un.n_strx & 0xffffff) < stabstr_sz); VG_(printf) ( "%2d type=%d othr=%d desc=%d " "value=0x%x strx=%d %s\n", i, st->n_type, st->n_other, st->n_desc, (Int)st->n_value, (Int)st->n_un.n_strx, - stabstr + st->n_un.n_strx ); + stabstr + (st->n_un.n_strx & 0xffffff) ); } /* handle continued string stabs */ @@ -160,7 +163,7 @@ Bool qcontinuing = False; UInt qstringidx; - qstringidx = st->n_un.n_strx; + qstringidx = (st->n_un.n_strx & 0xffffff); string = stabstr + qstringidx; qlen = VG_(strlen)(string); @@ -211,8 +214,8 @@ if (i >= n_stab_entries) break; - if (stab[i].n_un.n_strx) { - string = stabstr + stab[i].n_un.n_strx; + if ((stab[i].n_un.n_strx & 0xffffff)) { + string = stabstr + (stab[i].n_un.n_strx & 0xffffff); qlen = VG_(strlen)(string); } else { string = NULL; Support for reading stabs debug info has been removed from the valgrind source |