[RFA] Add FORCE_LOCAL_GDB_QUIT_WAIT testsuite parameter.

Philippe Waroquiers philippe.waroquiers@skynet.be
Fri Dec 28 14:13:00 GMT 2018


On Mon, 2018-12-03 at 12:39 +0000, Pedro Alves wrote:
> On 12/02/2018 11:46 PM, Philippe Waroquiers wrote:
> > This patch helps to run GDB testsuite under valgrind, by ensuring
> > that the valgrind output completely goes into the gdb.log file
> > (approach suggested by Pedro on irc).
> 
> I'd first prefer to see about making this unconditional.
> Does the explicit "quit" slow down native non-valgrind testing
> noticeably, for example?  Always doing the "quit" would help
> catch bugs around GDB crashing on termination -- IIRC, I've fixed
> at least a bug like that that I only noticed happened because
> I found some rogue gdb core dumps in the testsuite dir.
Find attached the current state of implementing a 'clean quit' of GDB
at the end of a test.

As it is now, it is not suitable to be activated unconditionally;
but maybe the patch can be further improved.
The difference in timing is significant:
  time make check RUNTESTFLAGS="GDB=$PWD/gdb" FORCE_PARALLEL="1" -j1
  real	24m59.404s
  user	14m1.620s
  sys	2m30.536s
  time make check RUNTESTFLAGS="GDB=$PWD/gdb FORCE_LOCAL_GDB_QUIT_WAIT=1" FORCE_PARALLEL="1" -j1
  real	47m3.698s
  user	10m39.088s
  sys	1m49.892s

A few observations:
  * unclear why, but the FORCE uses less user and less sys cpu.
  * a very significant part of the real time diff is because
    the FORCE QUIT WAIT encounters times out for some tests,
    instead of doing a clean quit.
    I have not found a proper way to have both a clean quit
    without timeout, and not lose the valgrind output.
    The tests that have some timeouts are:
      gdb.base/dprintf-detach.exp
      gdb.base/jit.exp
      gdb.base/pie-fork.exp
      gdb.base/watchpoint-hw-attach.exp
      gdb.mi/mi-break.exp
      gdb.mi/mi-exec-run.exp
      gdb.mi/mi-watch.exp
      gdb.mi/new-ui-mi-sync.exp
      gdb.mi/user-selected-context-sync.exp
      gdb.server/abspath.exp
      gdb.server/connect-stopped-target.exp
      gdb.server/connect-without-multi-process.exp
      gdb.server/file-transfer.exp
      gdb.server/no-thread-db.exp
      gdb.server/run-without-local-binary.exp
      gdb.server/server-exec-info.exp
      gdb.server/server-mon.exp
      gdb.server/server-run.exp
      gdb.server/solib-list.exp
      gdb.server/stop-reply-no-thread.exp
      gdb.server/wrapper.exp
      gdb.threads/process-dies-while-handling-bp.exp
   The worst test is dprintf-detach, which adds 6 minutes of timeout.
  * even with the below patch, the valgrind output is incomplete
    for a few tests.  As far as I can see, the lost output is
    mostly due to time outs.

I have to admit that I am a little bit lost in the mysteries
of dejagnu/expect.
Whatever I am trying to change in the 'clean quit' logic,
it either increases the nr of timeouts, or loses some
valgrind output, or causes 'channel exp9 not open' errors.

So, some advice about how to improve the logic (for both
the normal and the mi 'clean quit' logic) would be welcome.

Thanks
Philippe.



 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-FORCE_LOCAL_GDB_QUIT_WAIT-testsuite-parameter.patch
Type: text/x-patch
Size: 4198 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20181228/1916d720/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Implement-FORCE_LOCAL_GDB_QUIT_WAIT-in-mi-mode.patch
Type: text/x-patch
Size: 2858 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20181228/1916d720/attachment-0001.bin>


More information about the Gdb-patches mailing list