Sporadic failures of selftest tests

Ulrich Weigand uweigand@de.ibm.com
Tue Oct 17 15:48:00 GMT 2017


Pedro Alves wrote:
> On 10/17/2017 03:40 PM, Pedro Alves wrote:
> > On 10/17/2017 03:34 PM, Pedro Alves wrote:
> > 
> >> Wait, is your build of GDB an optimized build?  Maybe the compiler
> >> managed to inline captured_command_loop for you?  Currnetly, when
> >> GDB stops for an inline breakpoint, it stops at the stack caller,
> >> which would explain this.
> > 
> > Yup, I can reproduce this with:
> > 
> > $ rm -f main.o && make CXXFLAGS="-g3 -O2"
> > $ make check TESTS="*/complaints.exp"
> > [...]
> > Running src/gdb/testsuite/gdb.gdb/complaints.exp ...
> > FAIL: gdb.gdb/complaints.exp: run until breakpoint at captured_command_loop
> > WARNING: Couldn't test self
> 
> Ah, and in addition to the wrong function hit, I do also see
> the prompt issue then.

Yes, this looks like what I'm seeing.  Note that the wrong function hit
is just an XFAIL, so I didn't notice it (but this is actually what I
get in the "good" case too).

> So indeed, that inferior gdb prompt can confuse gdb_test_multiple.
> That prompt is only output in optimized builds, because in that
> case, due to inlining, the breakpoint happens to trigger _after_
> captured_command_loop prints the prompt...  In non-optimized builds,
> the prompt is _not_ output.

But what confuses me is that in a normal build, GDB by default gets
built with -O2 for me, so I'm wondering why you had to use special
CXXFLAGS above.  Also, I'm wondering why I'm only seeing this now,
when this has apparently been broken all the time.  Just some random
timing issues that are now different for some reason?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list