Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1565097rwe; Sat, 15 Apr 2023 01:37:06 -0700 (PDT) X-Google-Smtp-Source: AKy350a9KG6kxE4SwpdZayBK8RrA4sUMCW+XjuIC5Dc0rdMHq1Lq4CY/5wsIRaKm64hp/u/cgcrf X-Received: by 2002:a05:6a20:cf49:b0:de:526b:f292 with SMTP id hz9-20020a056a20cf4900b000de526bf292mr8078567pzb.19.1681547825879; Sat, 15 Apr 2023 01:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681547825; cv=none; d=google.com; s=arc-20160816; b=v2DHfdS798NAngGCessSV7wQRdprH6c5u330bCBpLvV5EZKZGmiSIwfldRNyiKnSd4 0UBAWSBktBKeRkpDvQ7mPBP+ZdpDmJblNq34gZc3bGAd++KbnayqhQyWfGKPn7uJzhCG die5iD4uarM1G2BUNc/uDNZwYdT1liyqzFH2qDPVA//6T417ofPRQzhyroNYzdmbHPTb Akf3Yt8DcN5Nz9jkRkrcz8q/Iw2NM8vpfwtqUWN7oJvZQR42BmiXKoNH/G8aaB+n7eXB bX2X2B0B2CJB8F1VW4ts9OPkxiGauA2J5nyHWOBnwESauetQuOAxO5fibOzm45YbYeQY 9b4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Wx0/JegDs5ydht80NXH/UwxmxbYUu5hxKxJx5a7E6kw=; b=QVOF0D0AbjXWKrheGnoC5QikiwbcsukyANfERsoVtlbKFmr8+nzSK7yNasJCHVGSc9 dnWEARTE7zRYikVX8TQDPURjqhO2mcDJn3moKq3URT1pSIP+PgHry+viqrrPDOprtLvs kgJpkfcocfnb6aCEWuh8FQlg/DnPRcJ5OevpzPmB60IXZ7yGSlocp5X6IEv7ZgkDBJbC GaIfHynF/qe1FuvUyQ2/ptcwu7RtKvMjawJrsuWEl2kzgqdayRd35E50k9XEJLpX108G smZ2djbZS9CNe2RcZvSKTINQWyWJ7xvRJUP2tQayEZb86queQ/O652NPW/Ic0xXSZlSU MDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=eS2Jyuw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h71-20020a63834a000000b00518c256b38asi3410032pge.785.2023.04.15.01.36.53; Sat, 15 Apr 2023 01:37:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=eS2Jyuw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229752AbjDOIb0 (ORCPT + 99 others); Sat, 15 Apr 2023 04:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjDOIbY (ORCPT ); Sat, 15 Apr 2023 04:31:24 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E5A2112 for ; Sat, 15 Apr 2023 01:31:19 -0700 (PDT) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (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 smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 98DD53F452 for ; Sat, 15 Apr 2023 08:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1681547476; bh=Wx0/JegDs5ydht80NXH/UwxmxbYUu5hxKxJx5a7E6kw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=eS2Jyuw91vl0UWu3RmVp5S2AwVLtp88BAmL7/iQGH6uN6L/8n8A87/JsQvvLLmSR1 gGrMrpGamQGqBUguf1CkVaegjZL5a+3hT8ymFkkllVXUvcBcTJsStRNs9zZLf2gcGb gJOuzDrOvV6qDJV+WohEuYviBYFG7QB6Lgu5WAq3Bp3Z0DgWnhQ8PB08EZQJCRFJEG vAC1OhCVmrDbAjEusHuPbbMmAoY1TJn4wGJ2skro/NWkJeSadByZ3/sDkXY8kRwGtA COT3/GqlaJ+FfB5U0LkhkOncR6C37OB4+VgnB8DSEDaZCoknOjAvdwy9hf0OF+cMNL PlbPkaUVaW+5Q== Received: by mail-ej1-f71.google.com with SMTP id ud12-20020a170907c60c00b0093c44a07ad1so7389545ejc.2 for ; Sat, 15 Apr 2023 01:31:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681547475; x=1684139475; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wx0/JegDs5ydht80NXH/UwxmxbYUu5hxKxJx5a7E6kw=; b=OcQSGMsEUNI3qmyanLd19pkVhL/KdSm+JGUca2AdaSbV67FEpcu9dMPL76O9No9Jwa rzScUnSu/9GgZpytlUCE9D20iReFuAb16ZaJzoVIZA4W2yUACvhG7R67YrSGEbvDohr8 Bml0xQxdw0xaVOm/FVnVGVAYlp4+scVn4q+n1xYym/8TrYhiedGiHaX8bnxYLid9UnxL 9EkGoUZ2++0Z+yw/1eY46CZOZCDfzSKqxgOugKlvS3P/GDoZb2nyC6ckQn+E8GIZXARH GgGqJ4Rjez99XdXUn4sHxBNeafLd1AdIJnJY2raKO4t+9SErMutgvU66vHIVRoLGUe0R HIEA== X-Gm-Message-State: AAQBX9c8Cm8osRHYHvEPGTds5OfgJvh0geRsPB4x2y9ykBYnpdduyrG8 ngDjOOR1fHuqE7U/XroveL4KPmBtC6Tcjv3665AWUt7tPkY9bAAilSdHHc6R6o30d6NgB4UUCd7 nI+PIrvz8RZNajO05unUDV/0+xnUUjjxbSDEe+SZu2w== X-Received: by 2002:a17:907:2d1f:b0:94f:322d:909d with SMTP id gs31-20020a1709072d1f00b0094f322d909dmr9549ejc.63.1681547474682; Sat, 15 Apr 2023 01:31:14 -0700 (PDT) X-Received: by 2002:a17:907:2d1f:b0:94f:322d:909d with SMTP id gs31-20020a1709072d1f00b0094f322d909dmr9518ejc.63.1681547474284; Sat, 15 Apr 2023 01:31:14 -0700 (PDT) Received: from localhost (host-87-18-123-182.retail.telecomitalia.it. [87.18.123.182]) by smtp.gmail.com with ESMTPSA id a10-20020a1709064a4a00b0094a4e970508sm3491554ejv.57.2023.04.15.01.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Apr 2023 01:31:13 -0700 (PDT) Date: Sat, 15 Apr 2023 10:31:13 +0200 From: Andrea Righi To: Alexei Starovoitov Cc: Ilya Leoshkevich , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix , Paolo Pisati , bpf , "open list:KERNEL SELFTEST FRAMEWORK" , clang-built-linux , LKML Subject: Re: [PATCH] selftests/bpf: ignore pointer types check with clang Message-ID: References: <20230412095912.188453-1-andrea.righi@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 14, 2023 at 06:15:41PM -0700, Alexei Starovoitov wrote: > On Fri, Apr 14, 2023 at 9:28 AM Andrea Righi wrote: > > > > On Fri, Apr 14, 2023 at 06:15:38PM +0200, Ilya Leoshkevich wrote: > > > On Fri, Apr 14, 2023 at 08:15:03AM +0200, Andrea Righi wrote: > > > > On Thu, Apr 13, 2023 at 09:56:00PM -0700, Alexei Starovoitov wrote: > > > > > On Wed, Apr 12, 2023 at 2:59 AM Andrea Righi wrote: > > > > > > > > > > > > Building bpf selftests with clang can trigger errors like the following: > > > > > > > > > > > > CLNG-BPF [test_maps] bpf_iter_netlink.bpf.o > > > > > > progs/bpf_iter_netlink.c:32:4: error: incompatible pointer types assigning to 'struct sock *' from 'struct sock___17 *' [-Werror,-Wincompatible-pointer-types] > > > > > > s = &nlk->sk; > > > > > > ^ ~~~~~~~~ > > > > > > 1 error generated. > > > > > > > > > > I cannot reproduce this and BPF CI doesn't complain about it either. > > > > > What kind of clang do you use? > > > > > Some special version and build flags? > > > > > > > > I'm using Ubuntu clang version 15.0.7 (Ubuntu 23.04), no special build > > > > flag (unless Ubuntu enables some different default flags, but it > > > > shouldn't be the case... I'll double check). > > > > > > > > -Andrea > > > > > > Hi, > > > > > > FWIW, I see similar errors when I don't use recent pahole. > > > > I'm using pahole v1.24. > > I believe Ilya is correct. > > struct sock___17 is likely coming from vmlinux.h > Which means that there were errors due vmlinux build which > caused multiple structs to be present in BTF > and therefore bpftool generated such broken vmlinux.h > > The BTF section in such vmlinux is likely much larger than normal. > Let's get to the bottom of it instead of masking build error. > > Please try pahole 1.25. Yay! Success. Everything is working fine with pahole 1.25. Please ignore my patch, the fix is to simply upgrade pahole. Thanks! -Andrea