|
From: <sv...@va...> - 2005-05-03 15:23:05
|
Author: sewardj
Date: 2005-05-03 16:23:00 +0100 (Tue, 03 May 2005)
New Revision: 3603
Modified:
trunk/coregrind/vg_symtab2.c
Log:
VG_(addCfiSI): ignore CfiSIs which state an address range outside of
the segment itself. This may well be hiding bugs in the CFI reader,
but I can't figure out why some .so-s generate very low address
ranges -- sometimes eg 0x0 .. 0x1.
Modified: trunk/coregrind/vg_symtab2.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_symtab2.c 2005-05-03 15:20:01 UTC (rev 3602)
+++ trunk/coregrind/vg_symtab2.c 2005-05-03 15:23:00 UTC (rev 3603)
@@ -386,6 +386,18 @@
UInt new_sz, i;
CfiSI* new_tab;
=20
+ /* Rule out ones which are completely outside the segment. These
+ probably indicate some kind of bug, but for the meantime ignore
+ them. */
+ if ( cfisi->base + cfisi->len - 1 < si->start
+ || si->start + si->size - 1 < cfisi->base ) {
+ if (VG_(clo_trace_cfi)) {
+ VG_(printf)("CfiSI outside segment: ");
+ VG_(ppCfiSI)(cfisi);
+ }
+ return;
+ }
+
if (si->cfisi_used =3D=3D si->cfisi_size) {
new_sz =3D 2 * si->cfisi_size;
if (new_sz =3D=3D 0) new_sz =3D 20;
@@ -863,6 +875,13 @@
<=3D si->cfisi_maxaddr);
=20
if (i < si->cfisi_used - 1) {
+ /*
+ if (!(si->cfisi[i].base < si->cfisi[i+1].base)) {
+ VG_(printf)("\nOOO cfisis:\n");
+ VG_(ppCfiSI)(&si->cfisi[i]);
+ VG_(ppCfiSI)(&si->cfisi[i+1]);
+ }
+ */
/* In order. */
vg_assert(si->cfisi[i].base < si->cfisi[i+1].base);
/* No overlaps. */
|