[Crash-utility] Fix fill_mem_map_cache() to read page-size-or-less size correctly
Dave Anderson
anderson at redhat.com
Tue Sep 17 20:29:45 UTC 2019
----- Original Message -----
> Hi Dave,
>
> On 9/17/2019 2:40 PM, Dave Anderson wrote:
> >
> > Hi Kazu,
> >
> > This seems to be an extrememly rare condition, but in any case, your
> > patch is the correct thing to do.
> >
> > However, I do have two dumpfiles where the change causes the warning message
> > to be displayed unnecessarily, which was only meant to be displayed if the
> > mem_map cache is *not* virtually-mapped. But the single check for
> > !(vt->flags & V_MEM_MAP) is not always sufficient, so it should also
> > check for !(machdep->flags & VMEMMAP) like so:
> >
> > --- a/memory.c 2019-09-17 14:20:24.586069004 -0400
> > +++ b/memory.c 2019-09-17 14:36:36.765286602 -0400
> > @@ -6348,13 +6348,13 @@ fill_mem_map_cache(ulong pp, ulong ppend
> > if (cnt > size)
> > cnt = size;
> >
> > - if (!readmem(addr, KVADDR, bufptr, size,
> > + if (!readmem(addr, KVADDR, bufptr, cnt,
> > "virtual page struct cache", RETURN_ON_ERROR|QUIET)) {
> > - BZERO(bufptr, size);
> > - if (!(vt->flags & V_MEM_MAP) && ((addr+size) < ppend))
> > + BZERO(bufptr, cnt);
> > + if (!((vt->flags & V_MEM_MAP) || (machdep->flags & VMEMMAP)) && ((addr+cnt) < ppend))
> > error(WARNING,
> > "mem_map[] from %lx to %lx not accessible\n",
> > - addr, addr+size);
> > + addr, addr+cnt);
> > }
> >
> > addr += cnt;
> >
> > You OK with that?
>
> I'm OK, thanks!
>
> Kazu
OK good -- it's queued for crash-7.2.7:
https://github.com/crash-utility/crash/commit/5d43b10b6e12a931ad6e469fe7f0813067721747
I'm hoping to release 7.2.7 by the end of this week.
Thanks,
Dave
More information about the Crash-utility
mailing list