Open anarthal opened 4 months ago
Might be fixed by PR 259 (https://github.com/boostorg/context/pull/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 SYS_map_shadow_stack
to 453, and only when it's not already defined.
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.
System: Ubuntu 24.04 (as per the
ubuntu:24.04
Docker image) Compiler: g++-14 (as perapt 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 branchI'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: