bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segmentation violation using recent CVS version of gprof -l onMinGW32 +


From: K Schutte
Subject: Segmentation violation using recent CVS version of gprof -l onMinGW32 + fix
Date: Wed, 12 Feb 2003 09:42:15 +0100

Using the MinGW32 version of binutils (version 
binutils-2.13.90-20030111-1-src.tar.gz )
I get a segmentation violation using gprof -l <executable-name>.

This used to work with earlier gprof versions.

The problem seems to have to do with the call to sym_lookup with
address -1, which apparently on other platforms returns something 
like "<hicore>". However, on MiNGW32 this returns sentinel = 0,
which leads to a segmentation violation.

The patch: check for sentinel == 0, and if it is zero do not perform
the sentinel->addr correction. With this patch gprof seems to work
again. 

Attached is a fix. I do not read this list on a regular basis.

Klamer
-- 
Klamer Schutte, E-mail: address@hidden
Electro-Optical Systems, TNO Physics and Electronics Laboratory
Tel: +31-70-3740469 -- Fax: +31-70-3740654 -- Mobile: +31-6-51316671
--- gprof/corefile.c.org        Tue Feb 11 15:42:02 2003
+++ gprof/corefile.c    Tue Feb 11 15:43:04 2003
@@ -742,8 +742,9 @@
 
   sentinel = sym_lookup (&symtab, ~(bfd_vma) 0);
 
-  if (strcmp (sentinel->name, "<hicore>") == 0 && max_vma >= sentinel->addr)
-    sentinel->addr = max_vma + 1;
+  if (sentinel != 0) 
+    if (strcmp (sentinel->name, "<hicore>") == 0 && max_vma >= sentinel->addr)
+      sentinel->addr = max_vma + 1;
 
   /* Copy in function symbols.  */
   memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]