-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
BOLT optimizations fail on Linux aarch64 #128884
Comments
I suspect the BOLT segfault is a case of llvm/llvm-project#121554, but have not confirmed. |
Please give me more details such as BOLT version, thx! |
Hey @liusy58! This was reproduced with GitHub Actions and subsequently disabled — if you have access to aarch64 GitHub Actions runners you can reproduce that way. Otherwise, this was using llvm-19 on Ubuntu, installed with:
You can see the details in #128845 I can try to reproduce in Docker too, but I don't have a Linux aarch64 machine around. |
Here's a reproduction of the segfault on llvm-20 on Debian (presumes you're in the CPython source tree) ARG DEBIAN_VERSION=unstable
FROM debian:${DEBIAN_VERSION}
ARG LLVM_VERSION=20
ENV LLVM_VERSION=${LLVM_VERSION}
ARG DEBIAN_VERSION
ENV DEBIAN_VERSION=${DEBIAN_VERSION}
# Add LLVM GPG key
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget gnupg \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /etc/apt/keyrings \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /etc/apt/keyrings/llvm.gpg
# Add LLVM repositories
RUN if [ "${DEBIAN_VERSION}" = "unstable" ]; then \
# When using `unstable`, the suffix is omitted
DIST_SUFFIX=""; \
else \
DIST_SUFFIX="-${DEBIAN_VERSION}"; \
fi && \
if [ "${LLVM_VERSION}" = "20" ]; then \
# When using `20`, the suffix is omitted
LLVM_SUFFIX=""; \
else \
LLVM_SUFFIX="-${LLVM_VERSION}"; \
fi && \
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain${DIST_SUFFIX} main" >> /etc/apt/sources.list.d/llvm.list && \
echo "deb-src [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain${DIST_SUFFIX} main" >> /etc/apt/sources.list.d/llvm.list && \
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain${DIST_SUFFIX}${LLVM_SUFFIX} main" >> /etc/apt/sources.list.d/llvm.list && \
echo "deb-src [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain${DIST_SUFFIX}${LLVM_SUFFIX} main" >> /etc/apt/sources.list.d/llvm.list
# Install LLVM
RUN apt-get update -y && apt-get install -y \
libllvm-${LLVM_VERSION}-ocaml-dev \
libllvm${LLVM_VERSION} \
llvm-${LLVM_VERSION} \
llvm-${LLVM_VERSION}-dev \
llvm-${LLVM_VERSION}-doc \
llvm-${LLVM_VERSION}-examples \
llvm-${LLVM_VERSION}-runtime \
clang-${LLVM_VERSION} \
clang-tools-${LLVM_VERSION} \
clang-${LLVM_VERSION}-doc \
libclang-common-${LLVM_VERSION}-dev \
libclang-${LLVM_VERSION}-dev \
libclang1-${LLVM_VERSION} \
clang-format-${LLVM_VERSION} \
python3-clang-${LLVM_VERSION} \
clangd-${LLVM_VERSION} \
clang-tidy-${LLVM_VERSION} \
lldb-${LLVM_VERSION} \
lld-${LLVM_VERSION} \
libc++-${LLVM_VERSION}-dev \
libc++abi-${LLVM_VERSION}-dev \
libbolt-${LLVM_VERSION}-dev \
bolt-${LLVM_VERSION}
# Install Python build dependencies
RUN apt-get install -y \
make \
libc6 \
build-essential \
pkg-config \
ccache \
gdb \
lcov \
libb2-dev \
libbz2-dev \
libffi-dev \
libgdbm-dev \
libgdbm-compat-dev \
liblzma-dev \
libncurses5-dev \
libreadline6-dev \
libsqlite3-dev \
libssl-dev \
lzma \
strace \
tk-dev \
uuid-dev \
xvfb \
zlib1g-dev
ADD . /cpython
WORKDIR /cpython
ENV CC=clang
ENV CXX=clang++
ENV PATH="/usr/lib/llvm-${LLVM_VERSION}/bin/:$PATH"
# Build CPython
RUN ./configure \
--with-openssl="/usr/include/openssl" \
--enable-slower-safety \
--enable-safety \
--enable-bolt
RUN make clean
RUN make -j8 Unlike llvm/llvm-project#121554, this is not "fixed" by setting disabling
The stacktrace is
|
And here's a stack with LLVM 19.6.1 built from source so we get some symbols
|
Thank you~ |
Currently we can't skip functions for aarch64, and it's not trivial to fix. |
Oh good to know what's why those are being ignored! I'm tracking that computed goto feature. |
Bug report
Bug description:
When running the
--pgo
test suite with a BOLT instrumented binary, the interpreter crashes withI find this surprising since we include
_PyEval_EvalFrameDefault
in the BOLT skip functions — but am not familiar with the details.The following patch successfully worked around that error
Then, the profiling test run succeeded, but BOLT crashed during the apply step.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: