This is the mail archive of the
mailing list for the GDB project.
Re: Revert: [obv] Code cleanup: Move print_command_1 expr variable scope
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 27 Mar 2015 15:24:10 -0400
- Subject: Re: Revert: [obv] Code cleanup: Move print_command_1 expr variable scope
- Authentication-results: sourceware.org; auth=none
- References: <20150326174630 dot GA3349 at host1 dot jankratochvil dot net> <5515AC41 dot 1040907 at ericsson dot com> <20150327192231 dot GA21247 at host1 dot jankratochvil dot net>
On 15-03-27 03:22 PM, Jan Kratochvil wrote:
> Hi Simon,
> On Fri, 27 Mar 2015 20:15:13 +0100, Simon Marchi wrote:
>> I think this patch is wrong. Starting with that commit (f30d5c7),
>> some tests (e.g. mi-break.exp) started to fail for me, because
>> of gdb segfaulting. Backtrace here: http://paste.ubuntu.com/10690836/
>> The address of expr is passed to the cleanup. When the cleanup is ran,
>> expr is no longer in scope, so what is at that address is probably not
>> safe to use anymore. That's my guess.
> yes, you are sure right, I have reverted it now.
> Sorry I made that commit somehow automatically, not expecting it may have any
> side effects.
I would have done the same. I must say I was very surprised when git bisect
told me that was the culprit. Very very sneaky bug...