Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3908726pxu; Tue, 20 Oct 2020 03:52:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymZwZNBXQwSKiNV4b7uhBvKeOW/suxDa+zxg2LADXaLkUBwqJQxTtWoGWO1Koiv6GXgi28 X-Received: by 2002:a05:6402:1bcc:: with SMTP id ch12mr2093381edb.339.1603191159980; Tue, 20 Oct 2020 03:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603191159; cv=none; d=google.com; s=arc-20160816; b=DqzwTXCK2wEhCIyP014gL5NgGfzpGuC3s1MpIlbMdSYIz2CPhaDJyyJblWHV+QccR+ vw2DtzGZ7uJpQMTrgGj8WGcWLKFRNE7MNNjfbtk0rgD0DDwtFtOqcwSc1ImLrq3oQ0SW UY+CAN/CzDwA+5IIIoZd1LaXYiNPuNadTjCru+RM3lLtZbzBPOar90QACnuJUNa6EV12 dUBeFhiAN0jtntIiMOYyVgcLU73qTJLJK6OReZZ/qgshi7QKXDXfVDY4WaBG7TfOEAz6 7F1G0zA8LMfTqcJxhZ2/H7XUUEWLdYE9937GmwcuXi8Wt8yBhVMagz4sbP3yjKjvVpnq sW/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=I21QrYRSiNW5Fssisck9nCnQyQHsM9KlA2IytBaQecs=; b=OeWCI6BkhJ5865XAKKhpoO9ZXDBxZX5heY20Jwj4hVL6sLLRjtyS4duB2l3ktl9qbA P3Ze5c3jeidy3AknOizctr3EOoI+LiTBUqOJA7+idCiVoAZTfo4zAo2XYzHbF1xbrZAk FLZUfEjls+jknf6/HzQDuJlUcmHtE0pKEzZMlrSvJ0VPnfwJi1qES43rW2IZnmL7Uwgv kKWt52MoaOwra++W+AR0zM73YWdI9wrAwvthJgj6M8WrW0wi8Ga/uTb3a9lbYWj9ZOV9 UkvVL/ozXFEgz2X4oZ6lPjL2PvTk/Tf6yVuy1OSSbmbP+AB/qZZZrZTM2Ai0gebxgBUF bEmw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si986238ejz.233.2020.10.20.03.52.17; Tue, 20 Oct 2020 03:52:39 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392298AbgJTJBr (ORCPT + 99 others); Tue, 20 Oct 2020 05:01:47 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:35978 "EHLO mail-ej1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392287AbgJTJBo (ORCPT ); Tue, 20 Oct 2020 05:01:44 -0400 Received: by mail-ej1-f67.google.com with SMTP id qp15so1560997ejb.3; Tue, 20 Oct 2020 02:01:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I21QrYRSiNW5Fssisck9nCnQyQHsM9KlA2IytBaQecs=; b=V/UYjcanYovhp88wg3EA2rZigT5o8Ee8c4liLQ9keUAo6LDAzEscl/u6n8AlDcobsw cmEzHe74MALPJ3pcY7RJY/eS1NeQTX0XiAV0EyUM08DPzd0fDyxqlWtvG5CWjWmJzMpw s8ASBiH8jVzev5fG+6LySj7f65Pf6minXBNoDgB2DgPnfp97FaD03nm7U9Vq9/vbMz4u qzip/pGzyf0a49tnRXffTzuooKqdf+iK6IWpjLXUc8KhzQtCl+KqbTt5KVFfu/mIY0cv 8f0t7Q7YvRY13xQ3hn6fmeVzobl90o99ofQvnv/nD1hnivGLJA7ISq2sxBTcc0yfXRm7 cSiw== X-Gm-Message-State: AOAM531G5/YilYgCjzwhd6K9zbqROX8CTsuS1whb2yIyeQnDooSlWJVD AFBbwX8LoFrcWcUUKIenFDQ= X-Received: by 2002:a17:906:d8a3:: with SMTP id qc3mr2127262ejb.183.1603184501961; Tue, 20 Oct 2020 02:01:41 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id e11sm1630465edq.5.2020.10.20.02.01.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2020 02:01:40 -0700 (PDT) Subject: Re: Segfault in pahole 1.18 when building kernel 5.9.1 for arm64 To: =?UTF-8?Q?=c3=89rico_Rolim?= , dwarves@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Hao Luo References: From: Jiri Slaby Message-ID: <82b757bb-1f49-ab02-2f4b-89577d56fec9@kernel.org> Date: Tue, 20 Oct 2020 11:01:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19. 10. 20, 1:18, Érico Rolim wrote: > I'm trying to build kernel 5.9.1 for arm64, and my dotconfig has > `CONFIG_DEBUG_INFO_BTF=y`, which requires pahole for building. However, 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 = arm64_ssbd_callback_required;; > 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=${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=${OBJCOPY} ${PAHOLE} -J ${1} > > in scripts/link-vmlinux.sh is changed to > > LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J --btf_encode_force ${1} > > The suggested `-j` or `--force` flags don't exist, since they were removed 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, works > 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=1177921 The backtrace: > (gdb) where > #0 __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:300 > #1 0x00007ffff7f78346 in memcpy (__len=, __src=, __dest=, __dest=, __src=, __len=) at /usr/include/bits/string_fortified.h:34 > #2 gobuffer__add (gb=0x555555569aa0, s=0x7fffffffb50c, len=12) at /usr/src/debug/dwarves-1.18-1.1.x86_64/gobuffer.c:87 > #3 0x00007ffff7f8671f in btf_elf__add_datasec_type (btfe=btfe@entry=0x555555569a40, section_name=section_name@entry=0x7ffff7fa43ad ".data..percpu", var_secinfo_buf=var_secinfo_buf@entry=0x555555569ac0) at /usr/src/debug/dwarves-1.18-1.1.x86_64/libbtf.c:721 > #4 0x00007ffff7f8d766 in btf_elf__encode (flags=0 '\000', btfe=0x555555569a40) at /usr/src/debug/dwarves-1.18-1.1.x86_64/libbtf.c:857 > #5 btf_elf__encode (btfe=0x555555569a40, flags=) at /usr/src/debug/dwarves-1.18-1.1.x86_64/libbtf.h:71 > #6 0x00007ffff7f7fc70 in btf_encoder__encode () at /usr/src/debug/dwarves-1.18-1.1.x86_64/btf_encoder.c:213 > #7 0x00007ffff7f80d17 in cu__encode_btf (cu=0x55555638d9b0, verbose=0, force=false, skip_encoding_vars=false) at /usr/src/debug/dwarves-1.18-1.1.x86_64/btf_encoder.c:255 > #8 0x000055555555ac4d in pahole_stealer (cu=0x55555638d9b0, conf_load=) at /usr/src/debug/dwarves-1.18-1.1.x86_64/pahole.c:2366 > #9 0x00007ffff7f89dab in finalize_cu (cus=0x5555555622d0, dcu=0x7fffffffd080, conf=0x5555555610e0 , cu=0x55555638d9b0) at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarf_loader.c:2473 > #10 finalize_cu_immediately (conf=0x5555555610e0 , dcu=0x7fffffffd080, cu=0x55555638d9b0, cus=0x5555555622d0) at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarf_loader.c:2317 > #11 cus__load_module (cus=cus@entry=0x5555555622d0, conf=0x5555555610e0 , mod=mod@entry=0x555555564760, dw=0x555555565960, elf=elf@entry=0x555555562360, filename=0x7fffffffe846 "ss") at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarf_loader.c:2473 > #12 0x00007ffff7f8a0f1 in cus__process_dwflmod (dwflmod=0x555555564760, userdata=, name=, base=, arg=0x7fffffffe1b0) at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarf_loader.c:2518 > #13 0x00007ffff7d4f571 in dwfl_getmodules () from /usr/lib64/libdw.so.1 > #14 0x00007ffff7f823ed in cus__process_file (filename=0x7fffffffe846 "ss", fd=3, conf=, cus=0x5555555622d0) at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarf_loader.c:2571 > #15 dwarf__load_file (cus=0x5555555622d0, conf=, filename=0x7fffffffe846 "ss") at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarf_loader.c:2588 > #16 0x00007ffff7f76771 in cus__load_file (cus=cus@entry=0x5555555622d0, conf=conf@entry=0x5555555610e0 , filename=0x7fffffffe846 "ss") at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarves.c:1958 > #17 0x00007ffff7f798a8 in cus__load_files (cus=0x5555555622d0, conf=0x5555555610e0 , filenames=0x7fffffffe518) at /usr/src/debug/dwarves-1.18-1.1.x86_64/dwarves.c:2316 > #18 0x00005555555576fc in main (argc=3, argv=0x7fffffffe508) at /usr/src/debug/dwarves-1.18-1.1.x86_64/pahole.c:2687 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/pahole.c?h=v1.18&id=1abc001417b579b86a9b27ff88c9095d8f498a46 > > Thanks, > Érico > -- js suse labs