random-sig randomly failing with gdbserver

Philippe Waroquiers <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <1377861628.2127.28.camel@soleil>
gdb.base/random-sig.exp (frequently) randomly fails when running with gdbserver,
when running multiple times
  make check RUNTESTFLAGS="--target_board native-gdbserver random-signal.exp"
It looks like it can fail for at least three reasons

A successful run gives:
  (gdb) PASS: gdb.base/random-signal.exp: watch v
  continue
  Continuing.
  PASS: gdb.base/random-signal.exp: continue
  ^C
  Program received signal SIGINT, Interrupt.
  main () at ./gdb.base/random-signal.c:28
  28	    ;
  (gdb) PASS: gdb.base/random-signal.exp: stop with control-c

A failing run gives:
  (gdb) PASS: gdb.base/random-signal.exp: watch v
  continue
  Continuing.
  PASS: gdb.base/random-signal.exp: continue
  ^Cmain () at ./gdb.base/random-signal.c:28
  28	    ;
  Quit
  (gdb) FAIL: gdb.base/random-signal.exp: stop with control-c
  testcase ./gdb.base/random-signal.exp completed in 1 seconds


It can also fail with:
  (gdb) PASS: gdb.base/random-signal.exp: watch v
  continue
  Continuing.
  PASS: gdb.base/random-signal.exp: continue
  ^CFAIL: gdb.base/random-signal.exp: stop with control-c (timeout)
  testcase ./gdb.base/random-signal.exp completed in 11 seconds

Or fail with
  (gdb) PASS: gdb.base/random-signal.exp: watch v
  continue
  Continuing.
  PASS: gdb.base/random-signal.exp: continue
  ^CError evaluating expression for watchpoint 2
  Quit
  Watchpoint 2 deleted.
  main () at ./gdb.base/random-signal.c:28
  28	    ;
  (gdb) FAIL: gdb.base/random-signal.exp: stop with control-c
  testcase ./gdb.base/random-signal.exp completed in 1 seconds


Unclear what exactly happens. I suspect a race condition between
gdbserver reporting that the inferior stopped (to examine the
software watchpoint) and gdb sending at the same time
the interrupt, and expecting a SIGINT, but instead receiving
the stopped condition from gdbserver.

Philippe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.