Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4599618pxu; Tue, 20 Oct 2020 23:53:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAGiAUkqF4ChTsv6UW9+QEx87Ja6RkBlPk/MvRKVqQZhFmt6dtvsUXCi+Oq59nLKAlXg6D X-Received: by 2002:a50:fe09:: with SMTP id f9mr1614721edt.239.1603263209702; Tue, 20 Oct 2020 23:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603263209; cv=none; d=google.com; s=arc-20160816; b=agM83GG7E/1fqxt14r9OSVuqQMaRJOLy+V7J5yH0iJrMkinzqe33I10/UYsFv9L2zB 4FteaMFCyB38/qdb3S18yr611kU4M8LmSlGV3h9okIXFxY/R8p1IP69ItUHrR+PRpLrY A+eXkbthe6hLlC9oQ5sYn4+HUdioHoPWuQOqFpg5zZz1TEX5Hu4Kn8DzzC0BTPi+Y936 RJUGIxJyOjL5rn9SZa2320hsVbed1+BhXDxixLZWG2rcrSczMIO4CKz1/kOkNRUvGqwL 11FwSPR+TSk6n3hoSr+rpStMGeIncIrZaxOmXXmpge7hMB2n80uZKF3nZjGIUl89ixIW a0WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=IMAkat+pr5AcmRrqVNZdhPbCE53YYvyE9XEgmZQh4KQ=; b=U7dYSucPLGfwDOaSCvt74RqUIx/cMKPNbePWbx4IsIePtszVxtgswl9Ffgcn1ipFw4 ++B/KuusuHsvBHgHVxfP08NVyEEQexTZZGqO6mafdfqazHWpHKOe5gVGIu/k8VtWvc2w XTgqOIKPMAgz3O5ziGcToZlYv4CzO9JWdOkQN2vUNcH8RtoVqGcD3btpKnjWcHzT0IHd gPtdOhNMeJx7C0tV/A3QI4Y7bPFGeDKVUFBhDNn3CYOC9PJ7ljZW2Ql9HEcBpdgbIGCO RMOs1h+xcW9eZWyz/GY3ptgLopMBrozXocRtpXbfPL2wwxK5KuhXYCEl17j/33pdau9/ taGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Spbm/aKU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca20si740447edb.402.2020.10.20.23.53.07; Tue, 20 Oct 2020 23:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Spbm/aKU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395340AbgJTRPN (ORCPT + 99 others); Tue, 20 Oct 2020 13:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730018AbgJTRPN (ORCPT ); Tue, 20 Oct 2020 13:15:13 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9885C0613CE; Tue, 20 Oct 2020 10:15:12 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id b138so2563510yba.5; Tue, 20 Oct 2020 10:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=IMAkat+pr5AcmRrqVNZdhPbCE53YYvyE9XEgmZQh4KQ=; b=Spbm/aKU6Nigo9+i+NndMi/GW83wFIUo938iEB5K/8GZR/P7SQnT7TmcxWb/W/l7+M 6v4Snd7hw6TnRROtOp4w8vTbM7GwCBuwzl+CnjmU8pDuM0ziq5fYH/9iI+JlXk6dbLBe BhrlnatlDFlvnycknRLSMAxZyzXjfYzplXGpMERyC+Qeu7/kbCMFyNTi2UrZnbyN29E0 kHrHUkxljeM+WQENLvmBa2gpsj3RQpZQ+bRJLHV58g2cBF3j6f7cKYYbf+hXhwPk6xSp B9V4kNgoDv0KMo5BcDFtmMCrzWJCMDcxtszjgPDLQHs5CwBmavcuah24LAA6BrOVTJyq negw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=IMAkat+pr5AcmRrqVNZdhPbCE53YYvyE9XEgmZQh4KQ=; b=t5dVbEiLmQaFG4M97glY4ByuGVhekWOAAffbgeNK3uONRCdzcwaLZ+3/OxES5gQ2ID hKwogZTgwLMogJ7ZAdUpiTofopFNS6emUp9zvO0SJIvtd6hJGsLtXgRnn/SQat5xhFkG RuQUjAu5YcV1lqvJ+lI6aJwHsUrtFeTOm26XSUwF/KelAfltJyVlWYIAVErMFbMbhNHc 3jPe1xB9JgP7OzEv0b4KGPw/y67/4cLvVmM9auKqTQY9FoyrsEzQHDpAf5Bv3rTnDLgs PjFrIvqYt/x13SU1tk550XrUqnZCQ5JuIrx/Mhv96ym6H9sfanNeTqC1PdCUv27cYytS d/8w== X-Gm-Message-State: AOAM530vu5mEjZxs409vT+0ZUq4ez23klIaLBPfMXMhulx+K3U0Wp2Vk /TiqRkPuu/3v5qaM4aqe9+OnueqJ/2A2TJ8i6lg= X-Received: by 2002:a25:c7c6:: with SMTP id w189mr5538938ybe.403.1603214112091; Tue, 20 Oct 2020 10:15:12 -0700 (PDT) MIME-Version: 1.0 References: <82b757bb-1f49-ab02-2f4b-89577d56fec9@kernel.org> In-Reply-To: <82b757bb-1f49-ab02-2f4b-89577d56fec9@kernel.org> From: Andrii Nakryiko Date: Tue, 20 Oct 2020 10:15:01 -0700 Message-ID: Subject: Re: Segfault in pahole 1.18 when building kernel 5.9.1 for arm64 To: Jiri Slaby Cc: =?UTF-8?B?w4lyaWNvIFJvbGlt?= , dwarves@vger.kernel.org, open list , Arnaldo Carvalho de Melo , Hao Luo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 3:51 AM Jiri Slaby wrote: > > Hi, > > On 19. 10. 20, 1:18, =C3=89rico Rolim wrote: > > I'm trying to build kernel 5.9.1 for arm64, and my dotconfig has > > `CONFIG_DEBUG_INFO_BTF=3Dy`, which requires pahole for building. Howeve= r, pahole > > version 1.18 segfaults during the build, as can be seen below: > > > > PAHOLE: Error: Found symbol of zero size when encoding btf (sym: > > '__kvm_nvhe_arm64_ssbd_callback_required', cu: > > 'arch/arm64/kernel/cpu_errata.c'). > > The symbol is an alias coming from arch/arm64/kernel/vmlinux.lds: > __kvm_nvhe_arm64_ssbd_callback_required =3D arm64_ssbd_callback_required;= ; What's readelf's output for that symbol? If it's legal for SST_OBJECT to have size zero, then we should just skip those in pahole. But it shouldn't crash in either case, of course. But as Arnaldo mentioned, that code changed significantly recently, so please check with latest pahole from tmp.libbtf_encoder branch. > > > PAHOLE: Error: Use '-j' or '--force' to ignore such symbols and force > > emit the btf. > > scripts/link-vmlinux.sh: line 141: 43837 Segmentation fault > > LLVM_OBJCOPY=3D${OBJCOPY} ${PAHOLE} -J ${1} > > LD .tmp_vmlinux.kallsyms1 > > KSYM .tmp_vmlinux.kallsyms1.o > > LD .tmp_vmlinux.kallsyms2 > > KSYM .tmp_vmlinux.kallsyms2.o > > LD vmlinux > > BTFIDS vmlinux > > FAILED: load BTF from vmlinux: Unknown error -2make: *** > > [Makefile:1162: vmlinux] Error 255 > > > > It is possible to force the build to continue if > > > > LLVM_OBJCOPY=3D${OBJCOPY} ${PAHOLE} -J ${1} > > > > in scripts/link-vmlinux.sh is changed to > > > > LLVM_OBJCOPY=3D${OBJCOPY} ${PAHOLE} -J --btf_encode_force ${1} > > > > The suggested `-j` or `--force` flags don't exist, since they were remo= ved in > > [1]. I believe `--btf_encode_force` should be suggested instead. > > Agreed, '--btf_encode_force' makes pahole to proceed without crashes. > > > It should be noted that the same build, but with pahole version 1.17, w= orks > > without issue, so I think this is either a regression in pahole or the = script > > will need to be changed for newer versions of pahole. > > Yeah, I observe the very same. I reported it at: > https://bugzilla.suse.com/show_bug.cgi?id=3D1177921 > > The backtrace: [...] > > > I suspect: > commit f3d9054ba8ff1df0fc44e507e3a01c0964cabd42 > Author: Hao Luo > AuthorDate: Wed Jul 8 13:44:10 2020 -0700 > > btf_encoder: Teach pahole to store percpu variables in vmlinux BTF. > > > Which added this machinery (btf_elf__add_datasec_type in particular). > > > - [1] https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/pah= ole.c?h=3Dv1.18&id=3D1abc001417b579b86a9b27ff88c9095d8f498a46 > > > > Thanks, > > =C3=89rico > > > > > -- > js > suse labs