lkml.org 
[lkml]   [2023]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] scripts/kallsyms: Fix build failure by setting errno before calling getline()
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

\
 
 \ /
  Last update: 2023-07-25 12:34    [W:0.057 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site