Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2903716ybd; Mon, 24 Jun 2019 15:05:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTgzrTmxzidl7E/IzkXz0YOWL26tVriXZAp7uiHBalcHnWT0xUQUb/GEKlEJQvsRhu/WjW X-Received: by 2002:a17:90a:22c6:: with SMTP id s64mr27874454pjc.5.1561413901448; Mon, 24 Jun 2019 15:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561413901; cv=none; d=google.com; s=arc-20160816; b=W2LQs3Bkoi6Roml1aPxEGzxla0mpwDDYWhq+9p4+wxMJPYbiK0xisMgQC96BIEDb6C bjtVvplotg2QUlUPeYvPC/RcMpiHoePhHyZ3x7oR/xG2iDasbSi/JmK74ChgpTMJeP3Q RG3F3oU8fJxhxkKfr9qpEHKJz65Yl3NsmpPsKyv+8TJkFL5elAZyvNi070TOQSyFpRBL g0fYgm6XS29H9EfWnRDtpbma6LvMN5/Zz7Ywt0nHHnt5F0RYHPeVj4WpwdKUIji7VWEj NpeduziZ9MD7kaeUF777ooZfwbi4gFNFRWyqidTdQknyUHfb9yLtsVhIjPCIMPUEV846 dCwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lA2BtYvSKOorPxjN3wkABykmN5bMJyaABk+Tkrn5M9M=; b=j97u+5YSrn359iuGllIqXjkhWJevrneJPgUW8OCzhmPJORtyD9pBmjXKhtbw62vVVP Fo+teKa60HMEKkaiS5NPVp/UCh5PGFrykyOVfhVlZJhOsogUjQg0aLQhab+5fanXr7sB gt3swOVbLoI8kcLCMvsg4xIMFKyWt6j+jDEdQn8MHnKfjYWgCt0DJskLHgOCk9EaOWh5 x/Txs70yk9dBTmkTnnFkaCErgD51OWCGa6RqEFL2V5BIuQMLj9YGlgrYGu+/JNrr7ubw Br2Squ4PGrCxls5jA88z7j7dhx2Ohws0Zf+ttNIg3+Z5rKjtUA+R/szDtaOV0swSoUOf as6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fomichev-me.20150623.gappssmtp.com header.s=20150623 header.b=rn9KNk8S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si11243751pli.151.2019.06.24.15.04.45; Mon, 24 Jun 2019 15:05:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fomichev-me.20150623.gappssmtp.com header.s=20150623 header.b=rn9KNk8S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731765AbfFXVYZ (ORCPT + 99 others); Mon, 24 Jun 2019 17:24:25 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45157 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726331AbfFXVYY (ORCPT ); Mon, 24 Jun 2019 17:24:24 -0400 Received: by mail-pl1-f196.google.com with SMTP id bi6so7600421plb.12 for ; Mon, 24 Jun 2019 14:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lA2BtYvSKOorPxjN3wkABykmN5bMJyaABk+Tkrn5M9M=; b=rn9KNk8S20uH5r2M0vrVL/qWRrEMeYBZPku7L5/IqFGCZs4mh6FwgsNLSVQUJypPac 0cjTXdwcR4XMDDdVUDIenIOL+dg7QhS8OHaQTiWDQcdqN5rwPKRubK8MceXXXmGF1IR2 Tye+Z5QjtdsCRavVwiT9/gFVjkpCYDsR/d4ZSttg428YIqIlYitrQnux4SevvxpaTfbF fqrzwoeg7T44BuFSgJaS7pV4rjbAxAHVufqgb7sLCJ2mQQjeEB/CxOugRQ4OlXP5RkMi Ze9VXvTdfh7yK506oiIO04hTGDHDwC5/nQpdB1jj4oVNaOAEV0fhgxfPipiajrJzcpwL LdaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lA2BtYvSKOorPxjN3wkABykmN5bMJyaABk+Tkrn5M9M=; b=YJIW32r16pUkIK59PwE2M08fEt2GH33k/UYZBN01auZV/5Y4zIbrda9JaU2UkCyEn0 4e7A+CSfOo3ZnL7/Cr9d0wNYa5GnHOQ+hirOQ3j6U+e2MfdXEZVbwWX3FBJDd2TSf93Q /FIzII1H3maDDkvoAoBQQu8KCdcjxxSgcwm9xAjLUMBo2SynVDOU2o7zm8hjGE1UdB/S hj2pXIxxAtkIdZKGMbMD62Nal+vEcctjeeQBclHi8onXFzlK/5OS8XhhRwvgSY2ihvvk 5Nt1dN/AEfIjCcLxoSAUzvfU1MFhiswGiaV0xOAVAPvsIkavFxUs7uLmbyG6peK5N273 dEnw== X-Gm-Message-State: APjAAAVjg48NnNkP6PUYFnr9Vo6svbAOkVRzetrJ1qmwosBJKAIOHvU+ 1SmsxSBTYMkqfs4y8JcAitRW2LTufNg= X-Received: by 2002:a17:902:c83:: with SMTP id 3mr92076723plt.326.1561411464020; Mon, 24 Jun 2019 14:24:24 -0700 (PDT) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id n140sm14995682pfd.132.2019.06.24.14.24.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 14:24:23 -0700 (PDT) Date: Mon, 24 Jun 2019 14:24:22 -0700 From: Stanislav Fomichev To: Andrii Nakryiko Cc: Rong Chen , Stanislav Fomichev , Daniel Borkmann , Martin Lau , LKML , Stephen Rothwell , bpf , lkp@01.org Subject: Re: [selftests/bpf] 69d96519db: kernel_selftests.bpf.test_socket_cookie.fail Message-ID: <20190624212422.GA10487@mini-arch> References: <20190621084040.GU7221@shao2-debian> <20190621161039.GF1383@mini-arch> <20190621222745.GH1383@mini-arch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/24, Andrii Nakryiko wrote: > On Sun, Jun 23, 2019 at 5:59 PM Rong Chen wrote: > > > > On 6/22/19 6:27 AM, Stanislav Fomichev wrote: > > > On 06/21, Andrii Nakryiko wrote: > > >> ) > > >> > > >> On Fri, Jun 21, 2019 at 9:11 AM Stanislav Fomichev wrote: > > >>> On 06/21, kernel test robot wrote: > > >>>> FYI, we noticed the following commit (built with gcc-7): > > >>>> > > >>>> commit: 69d96519dbf0bfa1868dc8597d4b9b2cdeb009d7 ("selftests/bpf: convert socket_cookie test to sk storage") > > >>>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master > > >>>> > > >>>> in testcase: kernel_selftests > > >>>> with following parameters: > > >>>> > > >>>> group: kselftests-00 > > >>>> > > >>>> test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel. > > >>>> test-url: https://www.kernel.org/doc/Documentation/kselftest.txt > > >>>> > > >>>> > > >>>> on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 4G > > >>>> > > >>>> caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace): > > >>>> > > >>>> > > >>>> If you fix the issue, kindly add following tag > > >>>> Reported-by: kernel test robot > > >>>> > > >>>> # selftests: bpf: test_socket_cookie > > >>>> # libbpf: failed to create map (name: 'socket_cookies'): Invalid > > >>>> # argument > > >>> Another case of old clang trying to create a map that depends on BTF? > > >>> Should we maybe switch those BTF checks in the kernel to return > > >>> EOPNOTSUPP to make it easy to diagnose? > > >> For older compilers that don't generate DATASEC/VAR, you'll see a clear message: > > >> > > >> libbpf: DATASEC '.maps' not found. > > >> > > >> So this must be something else. I just confirmed with clang version > > >> 7.0.20180201 that for ./test_socket_cookie that's the first line > > >> that's emitted on failure. > > > Thanks for checking, I also took a look at the attached kernel_selftests.xz, > > > here is what it has: > > > 2019-06-21 11:58:35 ln -sf /usr/bin/clang-6.0 /usr/bin/clang > > > 2019-06-21 11:58:35 ln -sf /usr/bin/llc-6.0 /usr/bin/llc > > > ... > > > # BTF libbpf test[1] (test_btf_haskv.o): SKIP. No ELF .BTF found > > > # BTF libbpf test[2] (test_btf_nokv.o): SKIP. No ELF .BTF found > > > ... > > > # Test case #0 (btf_dump_test_case_syntax): test_btf_dump_case:71:FAIL > > > # failed to load test BTF: -2 > > > # Test case #1 (btf_dump_test_case_ordering): test_btf_dump_case:71:FAIL > > > # failed to load test BTF: -2 > > > ... > > > > > > And so on. So there is clearly an old clang that doesn't emit any > > > BTF. And I also don't see your recent abd29c931459 before 69d96519dbf0 in > > > linux-next, that's why it doesn't complain about missing/corrupt BTF. > > Ah, ok, that would explain it. But in any case, clang 6&7 is too old. > Clang 8 or better yet clang 9 (for global data, datasec/var-dependent > stuff) would be great. While we are it: I think I have resolved the BTF story internally, so if you want to go ahead and convert the rest of the tests to BTF format, I would not object anymore ;-) (I didn't expect it to be that easy initially, so sorry if I wasted everyones time arguing about it). > > > > > > We need to convince lkp people to upgrade clang, otherwise, I suppose, > > > we'll get more of these reportings after your recent df0b77925982 :-( > > > > Thanks for the clarification, we'll upgrade clang asap. > > Thanks Rong! > > > > > Best Regards, > > Rong Chen > > > > > > > > > >>>> # libbpf: failed to load object './socket_cookie_prog.o' > > >>>> # (test_socket_cookie.c:149: errno: Invalid argument) Failed to load > > >>>> # ./socket_cookie_prog.o > > >>>> # FAILED > > >>>> not ok 15 selftests: bpf: test_socket_cookie > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> To reproduce: > > >>>> > > >>>> # build kernel > > >>>> cd linux > > >>>> cp config-5.2.0-rc2-00598-g69d9651 .config > > >>>> make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 olddefconfig > > >>>> make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 prepare > > >>>> make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 modules_prepare > > >>>> make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 SHELL=/bin/bash > > >>>> make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 bzImage > > >>>> > > >>>> > > >>>> git clone https://github.com/intel/lkp-tests.git > > >>>> cd lkp-tests > > >>>> bin/lkp qemu -k job-script # job-script is attached in this email > > >>>> > > >>>> > > >>>> > > >>>> Thanks, > > >>>> Rong Chen > > >>>> > > >>