Bug 88703 - Stabs parser fails to handle ";"
Summary: Stabs parser fails to handle ";"
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: massif (show other bugs)
Version: 2.2.0
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 17:43 UTC by Steve Atkins
Modified: 2004-09-19 12:30 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 Steve Atkins 2004-09-02 17:43:48 UTC
While running massif it throws a few dozen errors at startup:

  ==21540== Massif, a space profiler for x86-linux.
  ==21540== Copyright (C) 2003, Nicholas Nethercote
  ==21540== Using valgrind-2.2.0, a program supervision framework for x86-linux.
  ==21540== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
  ==21540== For more details, rerun with: -v
  ==21540== 
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"
   @@ unlikely looking definition in unparsed remains ";"

It then appears to run correctly.

This is with a binary compiled using gcc 2.96 (stock RedHat 7.3) compiled with -g
and dynamically linked with the Qt libraries.
Comment 1 Harri Porten 2004-09-13 21:34:44 UTC
Same problem here with binaries compiled with gcc 2.95 on Debian Woody. Frontend was memcheck. Rather seems like a problem in the core.
Comment 2 Tom Hughes 2004-09-19 12:30:40 UTC
CVS commit by thughes: 

The fix for bug 85811 added decoding of many extra negative type
numbers in stabs and also removed the expectation of a trailing
semicolon after the type number as gcc didn't seem to be putting
one in. It seems that older gcc's do add one however, so we now
skip one if it is there.

CCMAIL: 88703-done@bugs.kde.org


  M +6 -0      vg_stabs.c   1.16


--- valgrind/coregrind/vg_stabs.c  #1.15:1.16
@@ -676,4 +676,10 @@ static SymType *stabtype_parser(SegInfo 
          break;
       }
+      /* Different versions of gcc seem to disagree about whether a
+         negative type is followed by a semicolon or not, and the stabs
+         spec (susch as it is) is not clear either so we will skip a
+         semicolon if there is one. */
+      if (*p == ';')
+         p++;
       break;
    }