Re: [RFA/commit] Memory leak in on reading frame register

Pedro Alves
2015-05-19T10:04:56Z

On 05/15/2015 04:58 PM, Joel Brobecker wrote:

>> > Thanks. I wonder whether the leaks come from constructing the
>> > current frame at each stop, instead of from evaluating
>> > breakpoint conditions. E.g.., if we do a "step" over:
>> >
>> > while (1);
>> >
>> > ... are we constantly leaking values until the user does
>> > ctrl-c?
>> >
>> > That would suggest to me to that we should be doing
>> > value_mark/value_free_to_mark around each
>> > handle_inferior_event.
> A very accurate guess, as it turns out. Condition evaluation
> is not the problem, here, but indeed, we a couple of calls to
> handle_inferior in addition to each call to
> bpstat_check_breakpoint_conditions. The former are responsible
> for the leak.
>
> How about the attached patch?

Looks good to me.

Thanks,
Pedro Alves