From patchwork Wed Jan 10 10:10:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 1884904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JP2y+wjz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T93Tw5DHQz1yPp for ; Wed, 10 Jan 2024 21:11:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 740E5613DD; Wed, 10 Jan 2024 10:10:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 740E5613DD Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JP2y+wjz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tEBzv-pBXUIe; Wed, 10 Jan 2024 10:10:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 41A0F60F35; Wed, 10 Jan 2024 10:10:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 41A0F60F35 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 13438C0072; Wed, 10 Jan 2024 10:10:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 994E4C0037 for ; Wed, 10 Jan 2024 10:10:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 71D9F435E8 for ; Wed, 10 Jan 2024 10:10:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 71D9F435E8 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JP2y+wjz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AYHnojAY3VU5 for ; Wed, 10 Jan 2024 10:10:53 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0FD06435DB for ; Wed, 10 Jan 2024 10:10:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0FD06435DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704881451; 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; bh=OFOZ/Jaaduxd0ngSW7RFQdHVviB8eVjst3h26Fx3A7w=; b=JP2y+wjzyvuwthF2xERom/W9PzfYjGK6Q9MoDNGp03G0/s+IByuqLYUQOkJAQ9i7vR7ORP Xd2t1WUDAuKGv0mc6uUzdi299WgrX6DW7bTh5F57f0TBtn5f1OrKGqhhzY0vV+yy6R/a7g LApB04VYrHPf2Evnn6K3lICev5Zn5qQ= 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-673-Eg-XZZj2PNuJoopzlyVwWw-1; Wed, 10 Jan 2024 05:10:50 -0500 X-MC-Unique: Eg-XZZj2PNuJoopzlyVwWw-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 EFC75185A780; Wed, 10 Jan 2024 10:10:49 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.193.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 614232026D66; Wed, 10 Jan 2024 10:10:49 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Wed, 10 Jan 2024 11:10:38 +0100 Message-ID: <170488141483.2356299.17040818647820951043.stgit@ebuild> User-Agent: StGit/1.5 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH v2 1/3] tests: Set handle_segv fpr UBSAN to allow SIGSEGV tests. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Previously tests that were generating a SIGSEGV were excluded from UBSAN runs. With the correct environment variable, these tests can be run. This is working even with the clang version supplied by Ubuntu 20.04. Signed-off-by: Eelco Chaudron --- tests/atlocal.in | 10 ---------- tests/daemon.at | 28 ++++++++-------------------- tests/ovsdb-server.at | 28 ++++++++-------------------- 3 files changed, 16 insertions(+), 50 deletions(-) diff --git a/tests/atlocal.in b/tests/atlocal.in index 1013098a1..372576a91 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -194,16 +194,6 @@ else DIFF_SUPPORTS_NORMAL_FORMAT=no fi -# Check whether UB Sanitizer is being used. -case "$CFLAGS" in -*fsanitize=undefined*) - TESTS_WITH_UBSAN=yes - ;; -*) - TESTS_WITH_UBSAN=no - ;; -esac - # Turn off proxies. unset http_proxy unset https_proxy diff --git a/tests/daemon.at b/tests/daemon.at index 2c7fac57c..6cb8b9888 100644 --- a/tests/daemon.at +++ b/tests/daemon.at @@ -78,12 +78,9 @@ AT_CLEANUP AT_SETUP([daemon --monitor]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS # Start the daemon and wait for the pidfile to get created. on_exit 'kill $(cat *.pid)' @@ -150,12 +147,9 @@ AT_CLEANUP AT_SETUP([daemon --detach --monitor]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS on_exit 'kill $(cat *.pid)' @@ -239,12 +233,9 @@ AT_SETUP([backtrace without monitor]) AT_SKIP_IF([test "$HAVE_BACKTRACE" = "no" && test "$HAVE_UNWIND" = "no"]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --no-db \ --log-file --verbose=DBG], [0], [ignore], [ignore]) @@ -263,12 +254,9 @@ AT_SETUP([backtrace with monitor]) AT_SKIP_IF([test "$HAVE_BACKTRACE" = "no" && test "$HAVE_UNWIND" = "no"]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS on_exit 'kill $(cat *.pid)' diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index d36c3c117..6916c0742 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -302,12 +302,9 @@ AT_SETUP([ovsdb-server/add-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS # Start ovsdb-server, initially with one db. ordinal_schema > schema @@ -344,12 +341,9 @@ AT_SETUP([ovsdb-server/add-db and remove-db with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS # Start ovsdb-server, initially with one db. ordinal_schema > schema @@ -503,12 +497,9 @@ AT_SETUP([ovsdb-server/add-remote with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS # Start ovsdb-server, initially with no remotes. ordinal_schema > schema @@ -545,12 +536,9 @@ AT_SETUP([ovsdb-server/add-remote and remove-remote with --monitor]) AT_KEYWORDS([ovsdb server positive]) AT_SKIP_IF([test "$IS_WIN32" = "yes"]) -# This test intentionally causes SIGSEGV, so make Address Sanitizer ignore it. +# This test intentionally causes SIGSEGV, so make sanitizers ignore it. ASAN_OPTIONS=$ASAN_OPTIONS:handle_segv=0; export ASAN_OPTIONS - -# Skip it if UB Sanitizer is being used. There's no way to disable the -# SEGV check at runtime. -AT_SKIP_IF([test $TESTS_WITH_UBSAN = yes]) +UBSAN_OPTIONS=$UBSAN_OPTIONS:handle_segv=0; export UBSAN_OPTIONS # Start ovsdb-server, initially with no remotes. ordinal_schema > schema