-
Notifications
You must be signed in to change notification settings - Fork 149
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
gcc-14: map_shadow_stack incorrect syscall number #263
Comments
Might be fixed by PR 259 (#259). Could you test it? |
This is a separate issue. The syscall number appears to have changed since the implementation of shadow stacks in boost/context. The impact is that boost/context will fail to setup a shadow stack when SHSTK is enabled (which is unlikely currently), and will crash. In https://github.com/php/php-src/pull/14027/files we define |
Confirming that this still happens, and having read the source, I agree with @arnaud-lb on the diagnostics. I don't know the specifics on gcc-14 and why I'm encountering this without setting any flags, but this looks like a problem. |
__NR_map_shadow_stack is defined to 453 (not 451) on Ubuntu 24.04 with Linux kernel 6.8.0-44, gcc 13.2.0 and glibc 2.39. This causes warnings about macro redefinition when Boost.Fiber is compiled. Change the syscall number to 453 and only define the macro if it has not been defined already. Also include unistd.h for syscall() and __NR_* constants. Fixes boostorg#263. Fixes boostorg#269.
System: Ubuntu 24.04 (as per the
ubuntu:24.04
Docker image)Compiler: g++-14 (as per
apt install g++-14
in the aforementioned image)uname -a:
Linux 2b064e2a8785 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
glibc version: 2.39
Variant: release
Library version: Boost develop branch
I'm getting a warning about a redefinition of
__NR_map_shadow_stack
. It's not causing any issues, in part because I'm only indirectly including the file (via Asio'sspawn.hpp
). It looks like<boost/context/fiber.hpp>
is defining__NR_map_shadow_stack
to 451, but the actual syscall number seems to be 453. This only happens in C++23, where<memory>
includes all the syscall numbers.For me it's just an annoying warning, but it seems it may point to a real bug. I don't know enough to provide further diagnostics.
Please note that this doesn't happen in the Godbolt environment, which uses an older glibc version. The ubuntu 24.04 gcc-14 seems to have
__CET__
defined by default.Repro instructions:
The text was updated successfully, but these errors were encountered: