This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix leak in displaced step.


On 2018-11-10 06:52, Philippe Waroquiers wrote:
On Fri, 2018-11-09 at 22:19 +0000, Simon Marchi wrote:
> 2018-11-04  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
>
> 	* infrun.c (displaced_step_clear): Fix leak by xfree-ing
> 	displaced->step_saved_copy.

I assume you have regtested this?  If so, LGTM.
Yes, before submitting a patch, I run the gdb tests (including gdb.ada)
and (try to) detect regressions by comparing with an untouched master build.
I also re-run all tests once more before pushing,
with which I now see  one more 'unresolved testcase' in
step-over-syscall.exp, which is clearly a regression I did not
detect initially :(.

So, I will further investigate, and submit another patch once I
understand how to properly fix this leak.

Thanks for looking at the patch, sorry for this wrong fix ...

Philippe

FYI, I am intending to run the full gdb testsuite under valgrind,
and analyse the reported problems.
Currently, there are only 2 remaining definite leaks seen when
running a few small tests:
  * this leak (which is triggered for each step/next I think)
  * a 'one shot initialization' leak of 2 small blocks 
         'ui::ui(_IO_FILE*, _IO_FILE*, _IO_FILE*)'

There are many 'possibly lost' leaks in Python, which I guess are normal. There is also a bunch of possibly lost blocks created by the arch init code
(seems to be 'one shot initialization' leaks also, unclear to me
if these are normal).
In summary, GDB seems reasonably 'leak free'.

Then there were a bunch of uninitialized memory usage (conditional
jumps, or used in syscalls) in various tests, but the whole testsuite
came to a halt due to the 'lingering processes' problem, see other patch.

So, no risk of having nothing to do during the week-end :)


Thank you very much for doing this!

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]