From: Alan Maguire <alan.maguire@oracle.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: acme@kernel.org, yonghong.song@linux.dev,
dwarves@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
bpf@vger.kernel.org, daniel@iogearbox.net, song@kernel.org,
eddyz87@gmail.com, olsajiri@gmail.com,
stephen.s.brennan@oracle.com, laura.nao@collabora.com,
ubizjak@gmail.com
Subject: Re: [PATCH dwarves] btf_encoder: verify 0 address DWARF variables are really in ELF section
Date: Mon, 27 Jan 2025 11:17:31 +0000 [thread overview]
Message-ID: <54ff082d-5409-4fe6-b711-b80fdedd751e@oracle.com> (raw)
In-Reply-To: <CAM_iQpU8jQ9yEs_rAf2gdyt5yie7BwkiU4vpa-efF6ccVo5ADg@mail.gmail.com>
On 26/01/2025 20:04, Cong Wang wrote:
> On Sat, Jan 25, 2025 at 8:55 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>>
>> Hi Alan,
>>
>> On Tue, Dec 17, 2024 at 2:36 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>>>
>>> We use the DWARF location information to match a variable with its
>>> associated ELF section. In the case of per-CPU variables their
>>> ELF section address range starts at 0, so any 0 address variables will
>>> appear to belong in that ELF section. However, for "discard" sections
>>> DWARF encodes the associated variables with address location 0 so
>>> we need to double-check that address 0 variables really are in the
>>> associated section by checking the ELF symbol table.
>>>
>>> This resolves an issue exposed by CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
>>> kernel builds where __pcpu_* dummary variables in a .discard section
>>> get misclassified as belonging in the per-CPU variable section since
>>> they specify location address 0.
>>
>> It is _not_ your patch's fault, but I got this segfault which prevents me from
>> testing this patch. (It also happens after reverting your patch.)
>
> Never mind, I managed to workaround this issue by a clean build.
>
> And I tested your patch, it works for me with CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y.
>
> Tested-by: Cong Wang <cong.wang@bytedance.com>
>
> Thanks a lot!
Thanks for verifying the fix! You didn't happen to get a coredump or
backtrace for the earlier segmentation fault by any chance? Just want to
make sure there aren't other issues lurking here. Thanks again!
Alan
next prev parent reply other threads:[~2025-01-27 11:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 10:36 [PATCH dwarves] btf_encoder: verify 0 address DWARF variables are really in ELF section Alan Maguire
2024-12-17 14:28 ` Jiri Olsa
2024-12-17 21:35 ` Stephen Brennan
2025-01-26 4:55 ` Cong Wang
2025-01-26 20:04 ` Cong Wang
2025-01-27 11:17 ` Alan Maguire [this message]
2025-01-31 20:18 ` Cong Wang
2025-03-12 16:53 ` Alan Maguire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54ff082d-5409-4fe6-b711-b80fdedd751e@oracle.com \
--to=alan.maguire@oracle.com \
--cc=acme@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=laura.nao@collabora.com \
--cc=olsajiri@gmail.com \
--cc=song@kernel.org \
--cc=stephen.s.brennan@oracle.com \
--cc=ubizjak@gmail.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox