-
-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preload sets errno #469
Comments
thanks @Absolucy ! |
intel-lab-lkp
pushed a commit
to intel-lab-lkp/linux
that referenced
this issue
Jul 25, 2023
…etline() getline() returns -1 at EOF as well as on error. It also doesn't set errno to 0 on success, so initialize it to 0 before using errno to check for an error condition. See the paragraph here [1]: For some system calls and library functions (e.g., getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value. Bear has a bug [2] that launches processes with errno set and causes the following build failure: $ bear -- make LLVM=1 ... LD .tmp_vmlinux.kallsyms1 NM .tmp_vmlinux.kallsyms1.syms KSYMS .tmp_vmlinux.kallsyms1.S read_symbol: Invalid argument [1]: https://linux.die.net/man/3/errno [2]: rizsotto/Bear#469 Fixes: 1c975da ("scripts/kallsyms: remove KSYM_NAME_LEN_BUFFER") Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: James Clark <james.clark@arm.com>
akiyks
pushed a commit
to akiyks/linux
that referenced
this issue
Jul 31, 2023
…etline() getline() returns -1 at EOF as well as on error. It also doesn't set errno to 0 on success, so initialize it to 0 before using errno to check for an error condition. See the paragraph here [1]: For some system calls and library functions (e.g., getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value. Bear has a bug [2] that launches processes with errno set and causes the following build failure: $ bear -- make LLVM=1 ... LD .tmp_vmlinux.kallsyms1 NM .tmp_vmlinux.kallsyms1.syms KSYMS .tmp_vmlinux.kallsyms1.S read_symbol: Invalid argument [1]: https://linux.die.net/man/3/errno [2]: rizsotto/Bear#469 Fixes: 1c975da ("scripts/kallsyms: remove KSYM_NAME_LEN_BUFFER") Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: James Clark <james.clark@arm.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The library preloaded by bear sets
errno
toEINVAL
, which causes strange errors in software that checks for errno in functions.To Reproduce
Expected behavior
Environment:
Additional context
N/A, bug is completely unrelated to build systems, and can be reliably reproduced on a basic 5-line executable.
Before you send...
README.md
file orman bear
?: YesThe text was updated successfully, but these errors were encountered: