Re: [PATCH] Fix memory leaks in dump_mem_map when SPARSEMEM is enabled

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

 



> Date: Tue, 16 Jun 2015 11:14:51 -0400
> From: anderson@xxxxxxxxxx
> To: crash-utility@xxxxxxxxxx
> Subject: Re: [Crash-utility] [PATCH] Fix memory leaks in dump_mem_map when SPARSEMEM is enabled
>
>
> Hi Oliver,
>
> Since it's a GETBUF() call, it's not really a memory leak (by design). 

Dave,

Sorry, I'm not familiar the code. 

If the  dump_mem_map get called in a thousand loop, the crash could reported memory allocation errors and exit the loop.
After I fixed with this patch, the issue got disappeared.

I'm not sure you know the reason, if not, I can show you the error messages.
 
> But it's certainly unnecessary for CONFIG_SPARSEMEM kernels. Queued
> for crash-7.1.2:
>
> https://github.com/crash-utility/crash/commit/005eb9e502056a09196f6507162648c796e36f95
>
> Thanks,
> Dave
>
>
> ----- Original Message -----
> > Signed-off-by: Yong Yang <yangoliver@xxxxxxxxx>
> > ---
> > memory.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/memory.c b/memory.c
> > index 32427ea..765732b 100644
> > --- a/memory.c
> > +++ b/memory.c
> > @@ -5734,10 +5734,6 @@ dump_mem_map(struct meminfo *mi)
> > long buffersize;
> > char *outputbuffer;
> > int bufferindex;
> > -
> > - buffersize = 1024 * 1024;
> > - outputbuffer = GETBUF(buffersize + 512);
> > -
> > char style1[100];
> > char style2[100];
> > char style3[100];
> > @@ -5748,6 +5744,9 @@ dump_mem_map(struct meminfo *mi)
> > return;
> > }
> >
> > + buffersize = 1024 * 1024;
> > + outputbuffer = GETBUF(buffersize + 512);
> > +
> > sprintf((char *)&style1, "%%lx%s%%%dllx%s%%%dlx%s%%8lx %%2d%s",
> > space(MINSPACE),
> > (int)MAX(PADDR_PRLEN, strlen("PHYSICAL")),
> > --
> > 1.9.1
> >
> > --
> > Crash-utility mailing list
> > Crash-utility@xxxxxxxxxx
> > https://www.redhat.com/mailman/listinfo/crash-utility
> >
>
> --
> Crash-utility mailing list
> Crash-utility@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/crash-utility
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux