From nobody Sat May 4 02:59:02 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 154334381260882.86837725180499; Tue, 27 Nov 2018 10:36:52 -0800 (PST) Received: from localhost ([::1]:43963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRiDr-0005qQ-Ov for importer@patchew.org; Tue, 27 Nov 2018 13:36:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRiCt-0005Zd-W5 for qemu-devel@nongnu.org; Tue, 27 Nov 2018 13:35:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRiCq-0006ly-6T for qemu-devel@nongnu.org; Tue, 27 Nov 2018 13:35:35 -0500 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:43779) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRiCp-0006do-Nh for qemu-devel@nongnu.org; Tue, 27 Nov 2018 13:35:32 -0500 Received: by mail-lj1-x242.google.com with SMTP id 83-v6so21003402ljf.10 for ; Tue, 27 Nov 2018 10:35:31 -0800 (PST) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id z7-v6sm704595lji.42.2018.11.27.10.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 10:35:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=qWyj9KcR8VX4xrlc0qoRdaH6njjqsh76aKUvMrN0Gow=; b=OdoyvkbfkID7x9tlg6kbSjFwYksbpSbRH68Pl/wn6vinXpMl7amwLlG73sGHAI6V4J qp4eDAoz0gyTAXLIKYxImNuRB8nbvJpPNMwPy8easFQLT6BEhiEpRyo1VkfWzjYgf4zH mz9OwBEVpK5N2gbv2N5VqC67cvA3+jHekSms/WREa/TmAvhuw7OViaXzCnBXqgYpfKkf 2uO8b5RSdBysmuFZPPe0Np/vxmD5PBjp66h+cGCEv1F648jXwEldebSOHTG15WWmpsJx 6MBmTbpuK5aZ6mKskT7uNB4nz2lpLJP3b+3Kr7XJ5fGxzVHuiYd2jZSHmf35afFAZ6v1 9fpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=qWyj9KcR8VX4xrlc0qoRdaH6njjqsh76aKUvMrN0Gow=; b=CuYfJ4LBl3zSt9zP8P0oqbACCJGq3fPVSRZmo5KEfhzIR/m6PVjmilWEU9yP2HsDip HRSpqtN8Eh6Rl0WIsyDyVY03xVvFSv6/72vpBNW/GmVXYzYAZax9iu2o92qiJT/OIP5k fSCviZwZaR6ByLugmeni5kq2KsZUZhgbylLKkVLvSfQjDeFA4Ck8Uu8leLtj4LfSWUg6 36k2+xtdiRwQP4WXNvZrNyiboOG8DHpS9L5qxBC/lW2nzvsMmEWEpiiDXqilfOPvVaIs YObI5Oppwn7OuPxDMPb2SIN0W77wzT+5Ywbs5bUtC4L4bLjcq7odTuka+ZJnOZaavndO 1qMg== X-Gm-Message-State: AA+aEWY3xzP4hOJIZ3vKkQCFr5BQjRIfNEifCNl/figwceuYyrlUJzDa w++jzVmUnjryKFrKQK3W3kCTHLiF X-Google-Smtp-Source: AFSGD/Xo3jFfDdyzCKAO6yyp9XyaUGyhy29tt3zk2TbDDEpyrKIPPtlFthXkkVuEepilPJaZACZhYQ== X-Received: by 2002:a2e:6594:: with SMTP id e20-v6mr22365190ljf.123.1543343729251; Tue, 27 Nov 2018 10:35:29 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 27 Nov 2018 19:35:26 +0100 Message-Id: <1543343726-53531-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::242 Subject: [Qemu-devel] [PATCH] glib-compat: work around g_test_message bug with subprocess tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Subprocesses are created by glib without leaving the file descriptors open. Therefore, g_test_message (and assertion failures, but those trigger when things are going bad anyway) will think that it is writing to the log file descriptor, but while actually stomping on the QMP file descriptor or similar. This causes spurious failures, which are as nice to debug as the reader can imagine. While I have opened a pull request on GLib, this will probably take a while to propagate to distros. I found this while working on qgraph, but the fix is generic. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/glib-compat.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index fdf95a2..989b9ef 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -113,4 +113,10 @@ gint g_poll_fixed(GPollFD *fds, guint nfds, gint timeo= ut); =20 #pragma GCC diagnostic pop =20 +/* See https://gitlab.gnome.org/GNOME/glib/merge_requests/501 */ +#define g_test_message(...) \ + do { \ + if (!g_test_subprocess()) g_test_message(__VA_ARGS__); \ + } while (0) + #endif --=20 1.8.3.1