mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: linux-kbuild@vger.kernel.org, masahiroy@kernel.org,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Miguel Ojeda <ojeda@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	Nicolas Schier <n.schier@avm.de>
Subject: Re: [PATCH] scripts/kallsyms: Fix build failure by setting errno before calling getline()
Date: Tue, 25 Jul 2023 12:00:32 +0100	[thread overview]
Message-ID: <09ce295f-f8c9-8663-4a7c-cf4a0c43a3ec@arm.com> (raw)
In-Reply-To: <CANiq72nPxb8p5YCTohGg5e3c4gPTYsfh8fB182D_SwO-rQm9pg@mail.gmail.com>



On 25/07/2023 11:33, Miguel Ojeda wrote:
> On Tue, Jul 25, 2023 at 10:55 AM James Clark <james.clark@arm.com> wrote:
>>
>> But I just checked now and it's just bear [1] that causes the issue.
>> Maybe it sets errno before forking and that persists in the child
>> processes? Not 100% sure how it works. I did debug scripts/kallsyms and
>> errno was already set on the first line of main(), so it's not some
>> other library call in kallsyms that is setting it but not being checked.
> 
> I think this is https://github.com/rizsotto/Bear/issues/469: bear
> preloads a library which was setting it to non-zero.
> 
> Now, even if bear was breaking a guarantee C programs have (`errno`
> for the initial thread at program startup is meant to be 0 according
> to the C standard), it is still a good idea to set `errno` to zero
> here in case something else happens to change `errno` within
> `kallsyms` in the future.
> 
> With the repro and the `bear` link issue added:
> 
>     Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
> 
> Cheers,
> Miguel

Oh yeah nice find, that's the issue. I added it and sent a v2.

Thanks
James


      reply	other threads:[~2023-07-25 11:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 13:17 James Clark
2023-07-25  0:41 ` Miguel Ojeda
2023-07-25  8:54   ` James Clark
2023-07-25 10:33     ` Miguel Ojeda
2023-07-25 11:00       ` James Clark [this message]

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=09ce295f-f8c9-8663-4a7c-cf4a0c43a3ec@arm.com \
    --to=james.clark@arm.com \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=n.schier@avm.de \
    --cc=ojeda@kernel.org \
    --cc=thunder.leizhen@huawei.com \
    /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

all inboxes | Powered by JetHome®