From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74DB7C47071 for ; Thu, 16 Nov 2023 09:00:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3YEc-0001FC-2b; Thu, 16 Nov 2023 04:00:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3YEa-0001Ex-Ro for qemu-devel@nongnu.org; Thu, 16 Nov 2023 04:00:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3YET-0002XI-Nn for qemu-devel@nongnu.org; Thu, 16 Nov 2023 04:00:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700125216; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iTwgxD8MGIOc3VLAYiYE2OeHdjjGj6HyKXzHHg65YgI=; b=ITVTyyQwWg1Orw2Jv8QgLNmszcsevoKaChIsYq018Qt3jDuEpBF6i3B5rnsnZy5LIPsamg Wi5W7+6uKVxEhiEC3Q+b3uNxmLk3Te1QXc96SMqvFqOq3jn6CtxO2SBnh+8Qzs6UKNYDjR 7ob0jCqeiQZwsQqDB6gZu61j35vNX3s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-398-LIiSLHL5N7O6JLQuZz6r2g-1; Thu, 16 Nov 2023 04:00:13 -0500 X-MC-Unique: LIiSLHL5N7O6JLQuZz6r2g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC9E5811E8F; Thu, 16 Nov 2023 09:00:12 +0000 (UTC) Received: from redhat.com (unknown [10.42.28.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CCA72026D4C; Thu, 16 Nov 2023 09:00:09 +0000 (UTC) Date: Thu, 16 Nov 2023 09:00:07 +0000 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Nicholas Piggin Cc: Thomas Huth , John Snow , Ani Sinha , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alex =?utf-8?Q?Benn=C3=A9e?= , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: Re: [PATCH] tests/avocado/reverse_debugging: Disable the ppc64 tests by default Message-ID: References: <20231114163115.298041-1-thuth@redhat.com> <12b4420e-1440-4516-8276-e0e907003c16@linaro.org> <9f6247e4-7e81-44f8-a63b-8ee11f722710@redhat.com> <6877d6d6-bfbf-4475-8c61-dd537265b278@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.10 (2023-03-25) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.099, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Thu, Nov 16, 2023 at 11:15:25AM +1000, Nicholas Piggin wrote: > On Thu Nov 16, 2023 at 3:22 AM AEST, Daniel P. Berrangé wrote: > > On Wed, Nov 15, 2023 at 01:14:53PM +0000, Daniel P. Berrangé wrote: > > > On Wed, Nov 15, 2023 at 07:23:01AM +0100, Thomas Huth wrote: > > > > On 15/11/2023 02.15, Nicholas Piggin wrote: > > > > > On Wed Nov 15, 2023 at 4:29 AM AEST, Thomas Huth wrote: > > > > > > On 14/11/2023 17.37, Philippe Mathieu-Daudé wrote: > > > > > > > On 14/11/23 17:31, Thomas Huth wrote: > > > > > > > > The tests seem currently to be broken. Disable them by default > > > > > > > > until someone fixes them. > > > > > > > > > > > > > > > > Signed-off-by: Thomas Huth > > > > > > > > --- > > > > > > > >   tests/avocado/reverse_debugging.py | 7 ++++--- > > > > > > > >   1 file changed, 4 insertions(+), 3 deletions(-) > > > > > > > > > > > > > > Similarly, I suspect https://gitlab.com/qemu-project/qemu/-/issues/1961 > > > > > > > which has a fix ready: > > > > > > > https://lore.kernel.org/qemu-devel/20231110170831.185001-1-richard.henderson@linaro.org/ > > > > > > > > > > > > > > Maybe wait the fix gets in first? > > > > > > > > > > > > No, I applied Richard's patch, but the problem persists. Does this test > > > > > > still work for you? > > > > > > > > > > I bisected it to 1d4796cd008373 ("python/machine: use socketpair() for > > > > > console connections"), > > > > > > > > Maybe John (who wrote that commit) can help? > > > > > > I find it hard to believe this commit is a direct root cause of the > > > problem since all it does is change the QEMU startup sequence so that > > > instead of QEMU listening for a monitor connection, it is given a > > > pre-opened monitor connection. > > > > > > At the very most that should affect the startup timing a little. > > > > > > I notice all the reverse debugging tests have a skip on gitlab > > > with a comment: > > > > > > # unidentified gitlab timeout problem > > > > > > this makes be suspicious that John's patch has merely made this > > > (henceforth undiagnosed) timeout more likely to ocurr. > > > > After an absolutely horrendous hours long debugging session I think > > I figured out the problem. The QEMU process is blocking in > > > > qemu_chr_write_buffer > > > > spinning in the loop on EAGAIN. > > Great work. > > Why does this make the gdb socket give an empty response? Something > just times out? There's no empty response - avocado is sending SIGTERM to the test because no response ever arrived after 10 seconds > > @@ -357,6 +360,10 @@ def _pre_launch(self) -> None: > > > > if self._console_set: > > self._cons_sock_pair = socket.socketpair() > > + self._cons_sock_pair[0].setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024*1024); > > + self._cons_sock_pair[0].setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1024*1024); > > + self._cons_sock_pair[1].setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024*1024); > > + self._cons_sock_pair[1].setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1024*1024); > > os.set_inheritable(self._cons_sock_pair[0].fileno(), True) > > > > # NOTE: Make sure any opened resources are *definitely* freed in > > So perhaps ppc64 fails just because it prints more to the console in early > boot than other targets? Yes, that's exactly it - the ppc firmware is very verbose, so is enough to tip it over the limit. > > The Machine class doesn't know if anything will ever use the console, > > so as is the change is unsafe. > > > > The original goal of John's change was to guarantee we capture early > > boot messages as some test need that. > > > > I think we need to be able to have a flag to say whether the caller needs > > an "early console" facility, and only use the pre-opened FD passing for > > that case. Tests we need early console will have to ask for that guarantee > > explicitly. > > The below patch makes this test work. Maybe as a quick fix it is > better than disabling the test. > > I guess we still have a problem if a test invokes vm.launch() > directly without subsequently waiting for a console pattern or > doing something with the console as you say. Your suggesstion is > add something like vm.launch(console=True) ? > > Thanks, > Nick > --- > > 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 Yes, thus should do the trick. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|