From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 044035A026A for ; Mon, 13 Feb 2023 02:22:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676251333; h=from:from: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=mNqmdIXw0NIapHKHdyeB2av53YIRYtetB/aztufm/No=; b=M0EihTd17DPs/+aewEk3Y7sRzRsptUh2kwhzrA2EgvYcX/zO2tzCLu1jJYwDnrU1uhogEy nMHdyf157+UzDEQCxYHwV5+fKsGrRCSrCZu2RXjG1PSgxWoRjyO+ZfEWizVgXgY+uRqCuk +olDbJe5YysGda/jaK1tw84sRaFvRII= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-501-aqMYTuDWOl2pm4LDSyNwAA-1; Sun, 12 Feb 2023 20:22:12 -0500 X-MC-Unique: aqMYTuDWOl2pm4LDSyNwAA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 017D31871CC6; Mon, 13 Feb 2023 01:22:12 +0000 (UTC) Received: from maya.cloud.tilaa.com (unknown [10.33.32.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C440140CF8ED; Mon, 13 Feb 2023 01:22:11 +0000 (UTC) Date: Mon, 13 Feb 2023 02:14:49 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] Make assertions actually useful Message-ID: <20230213021449.4a8aab61@elisabeth> In-Reply-To: <20230116041527.129406-1-david@gibson.dropbear.id.au> References: <20230116041527.129406-1-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: ZJ76FRKKGNXMILZJUO4OKJFJ547LTWI2 X-Message-ID-Hash: ZJ76FRKKGNXMILZJUO4OKJFJ547LTWI2 X-MailFrom: sbrivio@redhat.com 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.3 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: On Mon, 16 Jan 2023 14:15:27 +1000 David Gibson wrote: > There are some places in passt/pasta which #include and make > various assertions. If we hit these something has already gone wrong, but > they're there so that we a useful message instead of cryptic misbehaviour > if assumptions we thought were correct turn out not to be. > > Except.. the glibc implementation of assert() uses syscalls that aren't in > our seccomp filter, so we'll get a SIGSYS before it actually prints the > message. Work around this by adding our own ASSERT() implementation using > our existing err() function to log the message, and an abort(). The > abort() probably also won't work exactly right with seccomp, but once we've > printed the message, dying with a SIGSYS works just as well as dying with > a SIGABRT. > > Signed-off-by: David Gibson Applied. -- Stefano