Re: [commit+7.5] [patchv2] Write bpt at the ON_STACK bpt address

Edjunior Barbosa Machado
2012-08-03T00:15:16Z

On 08/02/2012 08:09 PM, Sergio Durigan Junior wrote:
> On Thursday, August 02 2012, Edjunior Barbosa Machado wrote:
>
>> On 07/31/2012 04:36 AM, Jan Kratochvil wrote:
>>>> gdb/testsuite/
>>>> 2012-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
>>>>
>>>> * gdb.base/valgrind-infcall.c: New file.
>>>> * gdb.base/valgrind-infcall.exp: New file.
>>
>> I've faced this internal-error when running this testcase on Fedora17 (which has valgrind-3.7.0) on ppc64:
>>
>> ...
>> (gdb) PASS: gdb.base/valgrind-infcall.exp: continue #1 (false warning)
>> continue
>> Continuing.
>> ==7541== Invalid free() / delete / delete[] / realloc()
>> ==7541== at 0x40458BC: free (vg_replace_malloc.c:427)
>> ==7541== by 0x10000763: main (valgrind-infcall.c:38)
>> ==7541== Address 0x4070040 is 0 bytes inside a block of size 1 free'd
>> ==7541== at 0x40458BC: free (vg_replace_malloc.c:427)
>> ==7541== by 0x10000757: main (valgrind-infcall.c:37)
>> ==7541==
>> ==7541== (action on error) vgdb me ...
>>
>> Program received signal SIGTRAP, Trace/breakpoint trap.
>> ../../gdb.git/gdb/frame.c:2396: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.
>> A problem internal to GDB has been detected,
>> FAIL: gdb.base/valgrind-infcall.exp: continue (GDB internal error)
>> further debugging may prove unreliable.
>> Quit this debugging session? (y or n) n
>>
>> With this error, gdb connection is closed and the testsuite gets stuck
>> at this point.
>
> (Adding Tom to CC list).
>
> Thanks for the report.
>
> Just as an FYI (or For Our Information, rather),
> http://sourceware.org/ml/gdb-patches/2012-08/msg00075.html clearly fixes
> the bug. I will keep an eye on this since I am interested as well.
>
> Thanks,
>

I've run the full testsuite with this patch and it indeed eliminates the internal-error on gdb.base/valgrind-infcall.exp, but now there are new failures on gdb.threads/watchpoint-fork.exp (the first and the third were already failing with the same internal-error from valgrind-infcall.exp):

...
FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
...

Here's the detailed output:

...
continue
Continuing.
[New process 28316]
parent1: 28316
Error in re-setting breakpoint 1: reading register r31 (#31): No such process.
Error in re-setting breakpoint -1: reading register r31 (#31): No such process.
Error in re-setting breakpoint 2: reading register r31 (#31): No such process.
Error in re-setting breakpoint 3: reading register r31 (#31): No such process.
Error in re-setting breakpoint 4: reading register r31 (#31): No such process.
reading register r31 (#31): No such process.
(gdb) FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
continue
Continuing.
reading register r31 (#31): No such process.
(gdb) FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
continue
Continuing.
reading register r31 (#31): No such process.
(gdb) FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
continue
Continuing.
reading register r31 (#31): No such process.
(gdb) FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
continue
Continuing.
reading register r31 (#31): No such process.
(gdb) FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish

--
Edjunior