]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
Fix inferior deadlock with "target remote | CMD"
authorPedro Alves <palves@redhat.com>
Thu, 19 Oct 2017 15:00:21 +0000 (16:00 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 19 Oct 2017 15:00:21 +0000 (16:00 +0100)
commita75868f50ba72e9aa906702ae038fa29feda7743
tree456ad7756d5a0b466165ec440956f8516e777345
parent2edf834e298b15c882678db22e86745f701807fa
Fix inferior deadlock with "target remote | CMD"

Comparing test results between

  --target_board=native-gdbserver
  --target_board=native-stdio-gdbserver

I noticed that gdb.base/bigcore.exp is failing with native-stdio-gdbserver:

  Running src/gdb/testsuite/gdb.base/bigcore.exp ...
  FAIL: gdb.base/bigcore.exp: continue (timeout)
  ...

The problem is that:

  1. When debugging with "target remote | CMD", the inferior's
     stdout/stderr streams are connected to a pipe.

  2. The bigcore.c program prints a lot to the screen before it
     reaches the breakpoint location that the "continue" shown above
     wants to reach.

  3. GDB is not flushing the inferior's output pipe while the inferior
     is running.

  4. The pipe becomes full.

  5. The inferior thus deadlocks.

The bug is #3 above, which is what this commit fixes.  A new test is
added, that specifically exercises this scenario.  The test fails
before the fix, and passes after, and gdb.base/bigcore.exp also starts
passing.

gdb/ChangeLog:
2017-10-19  Pedro Alves  <palves@redhat.com>

* ser-base.c (ser_base_read_error_fd): Delete the file handler if
async.
(handle_error_fd): New function.
(ser_base_async): Add/delete an event loop file handler for
error_fd.

gdb/testsuite/ChangeLog:
2017-10-19  Pedro Alves  <palves@redhat.com>

* gdb.base/long-inferior-output.c: New file.
* gdb.base/long-inferior-output.exp: New file.
gdb/ChangeLog
gdb/ser-base.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/long-inferior-output.c [new file with mode: 0644]
gdb/testsuite/gdb.base/long-inferior-output.exp [new file with mode: 0644]