From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 9CE465A004E for ; Wed, 07 Aug 2024 03:04:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1722992659; bh=7MQtdsQFqVqNMrP5HbTXWCD/Xx3EmYv73xOvlFyaGmM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jnwOtXyGTgDb987dEM0JvgyArFt9nhC3W4u+61IQD8eSKh2STftaoBoLHFiXRqvTT nUnm27erpgromCoUjb9daU2/NcOnQKKJwwSdEKCa/RByicDV6gLPJ2eorjYItosXUA kxq7SRjpB3L0SvFJnBQ9csHNjY8TmCO92s1QkAOZnQQ6MeXg2xwr1TJL4gOaXGrXkW Uo7tvXQqbj1dMHWBds/xBKGHk9R+Gq5E0BWxZZ1ezJX0RoD5DZbzZCV4k6aqauB7xJ sYgZQGx6KLAJcwDtAUhrol02gD1ua5FmuWDdmK5d9svwtLorf6GLc52JklTPzvSUxO aTHmOfowGASmg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WdsQC3pPsz4wcl; Wed, 7 Aug 2024 11:04:19 +1000 (AEST) Date: Tue, 6 Aug 2024 22:28:02 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] util: In ASSERT(), use "fprintf(stderr, ...)" rather than err(...) Message-ID: References: <20240805141027.1502569-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cSbkODaT/mlpH/Ma" Content-Disposition: inline In-Reply-To: Message-ID-Hash: RVHTACIZOHX5ITNA6TXULSWWJL4IGEZB X-Message-ID-Hash: RVHTACIZOHX5ITNA6TXULSWWJL4IGEZB X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --cSbkODaT/mlpH/Ma Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 06, 2024 at 11:27:40AM +0200, Laurent Vivier wrote: > On 06/08/2024 02:27, David Gibson wrote: > > On Mon, Aug 05, 2024 at 04:10:27PM +0200, Laurent Vivier wrote: > > > We use our own implementation of assert() because the glic implementa= tion > > > uses syscalls that aren't in our seccomp filter, see 7a8ed9459dfe > > > ("Make assertions actually useful"). And we replaced it by an err(), > > > followed by an abort() (that is also catched by seccomp). > >=20 > > I think Stefano's said everything I would on the change itself, but.. > >=20 > > > We don't have a coredump or a backtrace but we have at least the > > > error message... only if logging is enabled. > >=20 > > Whether we get a coredump shouldn't be affected by our weird ASSERT() > > here. If coredumps are enabled (which they're not by default on > > current distros, AFAICT), we should still get a coredump with the > > SIGSYS here, just as we would for a SIGABRT. > >=20 >=20 > I don't know what, but there is something that prevent passts to generate= a core dump > (I tried abort(), (char *)0 =3D 0, it works with a simple program, not wi= th passt). >=20 > Moreover, if we use gdb it doesn't stop on the syscall but exit and we > cannot locate the exit point. And as strace doesn't report the syscall th= at > generates the SIGSYS, it makes hard to find which one it is. Oh... that'll be the PR_SET_DUMPABLE. That'll stop strace, gdb, core dumps, .. I routinely comment that out when debugging. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --cSbkODaT/mlpH/Ma Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmayFrAACgkQzQJF27ox 2Gejqw//Wl2cqoERbSILxpXW0VOWFrXBBjPUVhXN3GkowkiLKxNo7fokgvlbZ9TQ gqXbRVcKqAJNyiAvR7ItMsH4ENzZY9ntPrz4wEwgHOICXsu1smO8Kelz/rCs/sWN d2WJ6loqUb8jbrCd+2UoqqZ2pyRotUM1APApHgH78nCQx2S4ushIB8rkAeBtCnE0 ZoFlEb3EwIUDkjju/biOVaF4WZp6IdAINfLnZLcOIl9OP6R2/0B0SLXnYZyhQWAV nhrp/IzQlfqbOOme+6NhXIfFbqkcVh1RBkidqdlcd7YBXu7S9qwroPaIVqvZCSm3 B1voySfYErT3nV7M6wH8lBh1z0Xijjt3G919SZArYfQAtCqNIi0ggv8N0BtkHPZ4 uoRa93Kl8VkaU1FFqv1Mm16SMmxm5aHxzHpwQHoeH5gk6uERdTMFVj+hj3rxIuE8 htj8tGI+5sYQSVtTn//5yZfUZZa1rUbdL5ag4Q+lMNUyHM5GPmFrBu9mMsxtlA/y +j88Tx6OZesNa2Fkez+ciySAOCdJQG/JV/yyPi9L6j/CqNQa2zzjfzSCqGMkQqOz EZ/ndvmdvSxcRit6BPONmyre9hBcYxgY+jhIMks/aHnBlPjQnVEvffK4C1hyV//P FWzUw5m8hftdDudwM76c5uMuAv4fVmdIvGMozH+s6DJrAY81sck= =jUKp -----END PGP SIGNATURE----- --cSbkODaT/mlpH/Ma--