From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: [PULL 09/10] tests/avocado: reverse_debugging drain console to prevent hang
Date: Thu, 16 Nov 2023 19:05:33 +0100 [thread overview]
Message-ID: <20231116180534.566469-10-thuth@redhat.com> (raw)
In-Reply-To: <20231116180534.566469-1-thuth@redhat.com>
From: Nicholas Piggin <npiggin@gmail.com>
Like replay_linux.py, reverse_debugging.py starts the vm with console
set but does not interact with it (e.g., with wait_for_console_pattern).
In this situation, the console should have a drainer attached so the
socket does not fill. replay_linux.py has a drainer, but it is missing
from reverse_debugging.py.
Per analysis in Link: this can cause the console socket/pipe to fill and
QEMU get stuck in qemu_chr_write_buffer, leading to strange test case
failures (ppc64 fails because it prints a lot to console in early bios).
Attaching a drainer prevents this.
Note, this commit does not fix bugs introduced by the commits referenced
in the first two Fixes: tags, but together those commits conspire to
irritate the problem and cause test case failure, which this commit
fixes.
Link: https://lore.kernel.org/qemu-devel/ZVT-bY9YOr69QTPX@redhat.com/
Fixes: 1d4796cd0083 ("python/machine: use socketpair() for console connections")
Fixes: 761a13b23946 ("tests/avocado: ppc64 reverse debugging tests for pseries and powernv")
Fixes: be52eca30978 ("tests/acceptance: add reverse debugging test")
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20231116115354.228678-1-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/avocado/reverse_debugging.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_debugging.py
index fc47874eda..128d85bc0e 100644
--- a/tests/avocado/reverse_debugging.py
+++ b/tests/avocado/reverse_debugging.py
@@ -12,6 +12,7 @@
from avocado import skipIf
from avocado_qemu import BUILD_DIR
+from avocado.utils import datadrainer
from avocado.utils import gdb
from avocado.utils import process
from avocado.utils.network.ports import find_free_port
@@ -52,6 +53,10 @@ def run_vm(self, record, shift, args, replay_path, image_path, port):
if args:
vm.add_args(*args)
vm.launch()
+ console_drainer = datadrainer.LineLogger(vm.console_socket.fileno(),
+ logger=self.log.getChild('console'),
+ stop_check=(lambda : not vm.is_running()))
+ console_drainer.start()
return vm
@staticmethod
--
2.41.0
next prev parent reply other threads:[~2023-11-16 18:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 18:05 [PULL 00/10] Avocado test fixes Thomas Huth
2023-11-16 18:05 ` [PULL 01/10] tests/avocado: Replace assertEquals() for Python 3.12 compatibility Thomas Huth
2023-11-16 18:05 ` [PULL 02/10] tests/avocado: Replace assertRegexpMatches() " Thomas Huth
2023-11-16 18:05 ` [PULL 03/10] tests/avocado/virtio-gpu: Fix test_vhost_user_vga_virgl for edid support Thomas Huth
2023-11-16 18:05 ` [PULL 04/10] tests/avocado/intel_iommu: Add asset hashes to avoid warnings Thomas Huth
2023-11-16 18:05 ` [PULL 05/10] tests/avocado/multiprocess: Add asset hashes to silence warnings Thomas Huth
2023-11-16 18:05 ` [PULL 06/10] tests/avocado: Make fetch_asset() unconditionally require a crypto hash Thomas Huth
2023-11-16 18:05 ` [PULL 07/10] tests/avocado/replay_kernel: Mark the test_x86_64_pc as flaky Thomas Huth
2023-11-16 18:05 ` [PULL 08/10] tests/avocado/mem-addr-space-check: Replace assertEquals() for Python 3.12 Thomas Huth
2023-11-16 18:05 ` Thomas Huth [this message]
2023-11-16 18:05 ` [PULL 10/10] tests/avocado: Enable reverse_debugging.py tests in gitlab CI Thomas Huth
2023-11-20 14:39 ` [PULL 00/10] Avocado test fixes Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231116180534.566469-10-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).