From patchwork Wed Mar 8 23:11:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1754368 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=MqkIAU4l; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=GWcxfZOi; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PX7T82fMZz1yWp for ; Thu, 9 Mar 2023 10:15:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=yL8F68YI3P+kNLY/Uoa+i8iBdLOMDKWPiDgkAmKNkLg=; b=MqkIAU4l75Wb9x zCXzImhwwE2s7F+43peMMuK5d0tjsejegk8jb1BecMyYTQvYSe9c2gxsF5m518eoLbaS8HSyc7vEu jWts4/F1hnupqMrjvxSHj4YwVpOOIhMfSIeVIrdF6LhbbCtjwETpxLHOyGBhWv8zqQUbReD2tE4Ja iL8PhzlciC5iA583TEcUNt1fS9Ph8KLJ4OUi8GZjXCNwKB7yspSFscPsevOgsVK4qQ7+Rls7S9uJB VnTwCF8iaaQScCyXrbLbRN1mQHE9mnr9LhkyVb95v+CkT9xxMtICBYwySw+CfeZUCusPOkmDuf9V2 GV+RPkZX04IYlnyp/xfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa2xL-0073XB-ST; Wed, 08 Mar 2023 23:12:24 +0000 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa2xG-0073Tu-PP for openwrt-devel@lists.openwrt.org; Wed, 08 Mar 2023 23:12:20 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4PX7PR72YQz9sR7; Thu, 9 Mar 2023 00:12:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1678317132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ghBXRPlFV8f3ZWC3rBQ7T1MLsXbbAp+zlAF0c4JA9Eo=; b=GWcxfZOil9v9p88jC6NaQBdUGrJwgB0zOWKYCpf54vHprEXu+11IUU0jFoF2vyOSq5kXOK /f+8DSEYY2QU2XHpsAFtUmomgeMFFqgcDBmUsDoQAGe1BzPoOFeZ1BDtqKxG1RYPTC9gvu oPg914H0hJO0HtBTfhJMNYBX+XNTEqYhLKNsnpi8kYIVIoXesTgHorjF/KKJWU+Jjl6rPd 8ReB7J9/1FjdddYZwbMWKGivsSvudbqrfaPNm9osNqvlnDo6GnSRPwpMB++gpXVOYkx5rb tl2KQX7CrqL3OjIW3jl8PygKHRrPiH7zzRMUHUle2BVLpKeCBRj20OhET60pWg== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Subject: [PATCH libubox 1/2] fuzz: Compile using libstd++ Date: Thu, 9 Mar 2023 00:11:51 +0100 Message-Id: <20230308231152.2142824-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PX7PR72YQz9sR7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230308_151219_036401_22922CE8 X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: It looks like libfuzzer is compiled using libstd++ on Debian Bookworm and not libc++. Using libc++ causes linking errors, use libstd++ instead. Signed-off-by: Hauke Mehrtens --- tests/fuzz/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , ynezz@true.cz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org It looks like libfuzzer is compiled using libstd++ on Debian Bookworm and not libc++. Using libc++ causes linking errors, use libstd++ instead. Signed-off-by: Hauke Mehrtens --- tests/fuzz/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt index cca74fd..6114a7c 100644 --- a/tests/fuzz/CMakeLists.txt +++ b/tests/fuzz/CMakeLists.txt @@ -4,7 +4,7 @@ MACRO(ADD_FUZZER_TEST name) ADD_EXECUTABLE(${name} ${name}.c) TARGET_COMPILE_OPTIONS(${name} PRIVATE -g -O1 -fno-omit-frame-pointer -fsanitize=fuzzer,address,leak,undefined) TARGET_INCLUDE_DIRECTORIES(${name} PRIVATE ${PROJECT_SOURCE_DIR}) - TARGET_LINK_OPTIONS(${name} PRIVATE -stdlib=libc++ -fsanitize=fuzzer,address,leak,undefined) + TARGET_LINK_OPTIONS(${name} PRIVATE -fsanitize=fuzzer,address,leak,undefined) TARGET_LINK_LIBRARIES(${name} ubox blobmsg_json json_script ${json}) ADD_TEST( NAME ${name} From patchwork Wed Mar 8 23:11:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1754367 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=p4IfMYpG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=e5dDdwQI; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PX7T83b9Cz246y for ; Thu, 9 Mar 2023 10:15:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uhJr/HDdvUOh7SkLw3W44kyg9hm5b7xpL3Ku32sh8vQ=; b=p4IfMYpGW3CNNB 2uEqblVnrYAVTYJgrSFrJ3fyq10zUnThrP90pSgEPurJEcPKi33O7r+RLteBqfpCT+QEuxcCjY6Ze j95OnU0l6g351wXj1GVSwxFcMv0OOOwtK9zRtmPX7zmUTd6YzLTWKdCugVL/zPy7LLjF2Gw6/dyPw K0e0CXnzHXDYmUYTae7veceyxCgOqy9Jm2TozZtj3TEU3B9j/pYPON7gZAw7TxhH5IM0iGpWYKGV0 0c0idqL3OQk67+mirU/4bjz1wqkboF2UtfcES08znxP91Z+VzWnQA7KUzsac7LXtJX7aXFMoA99ya LHQ4I4Wze/kHxDVuPlaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa2xo-0073kW-M5; Wed, 08 Mar 2023 23:12:52 +0000 Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa2xG-0073Tv-Q9 for openwrt-devel@lists.openwrt.org; Wed, 08 Mar 2023 23:12:21 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4PX7PS5HMrz9sQq; Thu, 9 Mar 2023 00:12:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1678317132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6/UHIR8IFDsbdT4GblX963O2iG7KT/uR9E0H2P5qjj0=; b=e5dDdwQIGJhHUHvIHiDlFVyV4whDoz05tzLs4yw8w7Ih9h1vmIxwML1a0D1nHUmeZK4NCc o6g8DP8usIKKTVwQmR0QdAF7lsJc0d4dRRFsayhfda8bYTihPTXJni3sJONloWByEbKiGs 5ATl/T5Z7LEk25LnltJdY52xmL31YKB24hLeXhJNs+ArZNPdRLJOnDTYc+2bW8pVOMSATz GXtMoiaZRZ4CgOzkNjE1mfP4xbiEwx/NDaqiOVuQz3/OGUKa2qraYinLhBcT38hIdRsr8k TimGiMu2ONiS1A/M1CR9rYCWGpVAPdmjzKUZBkePFMO7esMEbA3uA0RNOnTAsQ== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Subject: [PATCH libubox 2/2] CI: Add github action Date: Thu, 9 Mar 2023 00:11:52 +0100 Message-Id: <20230308231152.2142824-2-hauke@hauke-m.de> In-Reply-To: <20230308231152.2142824-1-hauke@hauke-m.de> References: <20230308231152.2142824-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PX7PS5HMrz9sQq X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230308_151219_040966_F42B4ADA X-CRM114-Status: GOOD ( 10.48 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add a github action to build libubox and then execute the tests. clang 14 generates debug informations in DWARF 5 format, but valgrind 19.0 does not support that. Install valgrind 20.0 from experimental which supports it. Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:67c:2050:0:465:0:0:102 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , ynezz@true.cz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add a github action to build libubox and then execute the tests. clang 14 generates debug informations in DWARF 5 format, but valgrind 19.0 does not support that. Install valgrind 20.0 from experimental which supports it. Signed-off-by: Hauke Mehrtens --- I created a github pull request with these changes too: https://github.com/openwrt/libubox/pull/2 .github/workflows/test.yml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c6cdf0d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,61 @@ +name: 'Run tests' + +on: + push: + +jobs: + build_test: + strategy: + matrix: + include: + - compiler: "-DCMAKE_C_COMPILER=clang" + - compiler: "-DCMAKE_C_COMPILER=gcc" + + name: Build and run tests + runs-on: ubuntu-latest + container: + image: debian:bookworm + + steps: + + - name: Add Debian experimental + run: | + echo "deb http://deb.debian.org/debian/ experimental main" >> /etc/apt/sources.list + + - name: Install compiler + run: | + apt update + apt install -y cmake build-essential lua5.1 pkgconf libjson-c-dev liblua5.1-0-dev python3.11-venv clang + apt -t experimental install -y valgrind + useradd -ms /bin/bash buildbot + + - name: Checkout libubox + uses: actions/checkout@v3 + with: + path: libubox + + - name: Create build directory + run: mkdir build + + - name: Fix permission + run: chown -R buildbot:buildbot build libubox + + - name: Run cmake + shell: su buildbot -c "sh -e {0}" + working-directory: build + run: cmake ../libubox -DUNIT_TESTING=true ${{ matrix.compiler }} + + - name: build + shell: su buildbot -c "sh -e {0}" + working-directory: build + run: make + + - name: Run tests + shell: su buildbot -c "sh -e {0}" + working-directory: build + run: make test + + - name: Show logs + shell: su buildbot -c "sh -e {0}" + working-directory: build + run: cat Testing/Temporary/LastTest.log