Repository navigation
Jit stencils on Windows contain debug data in 3.15 #142050
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Nov 28, 2025 - changed the title
[-]Jit stencils on Windows contain debug data on Windows[/-][+]Jit stencils on Windows contain debug data[/+]on Nov 28, 2025 Don't know when it happened
I've done some further investigation. Just changing back to
_LLVM_VERSION = "20" _EXTERNALS_LLVM_TAG = "llvm-20.1.8.0"in
Lines 14 to 15 in cd4d0ae
_LLVM_VERSION = "21" _EXTERNALS_LLVM_TAG = "llvm-21.1.4.0" fixes this. So it must be related to the update of clang to 21.1.4.0 (#140973).
Looking closer at the data
// _NOP.o: file format coff-x86-64 // 0: '\x00\x00\x00\x00\x04\x00\x00\x00\xf1\x00\x00\x00<\x00\x00\x00\n\x00\x01\x11\x00\x00\x00\x00\x00\x00\x00\x00.\x00<\x11\x00\x00\x00\x00\xd0\x00\x15\x00\x01\x00\x04\x00\x00\x00\x16R\x00\x00\x00\x00\x00\x00clang version 21.1.4\x00\x00' // 4c: 00 00 00 00reveals
clang version 21.1.4. Thus, I had high hopes that using -fno-ident might fix it. But unfortunately, this is not enough, still more metadata is written. So searching in the clang command line reference formetadataI found -fno-stack-size-section which doesn't change anything.Thus, I think just ignoring
.debug$SCOFF sections is the easiest way to go and I have verified usingpy Tools\jit\build.py -p PC -o jit-files aarch64-pc-windows-msvc x86_64-pc-windows-msvc i686-pc-windows-msvcthat with this fix for all three configurations this metadata is no longer contained in the stencils (and was present in all of them before).
I've checked again in WSL Ubuntu 24.04.3 LTS for clang 21.1.3 and on native Ubuntu 24.04.3 LTS for clang 21.1.7 that this does not happen for
x86_64-pc-linux-gnu. I don't have a setup for cross builds, so unfortunately I cannot comment onaarch64-unknown-linux-gnufor Linux and I have no Mac.I have no idea why clang changed that only for Windows.
As written in #142052 (comment), I am unsure about a backport, because
- 3.14 uses clang 19.1.7 and is not affected. I've verified for
aarch64-pc-windows-msvcx86_64-pc-windows-msvci686-pc-windows-msvc. - no clang update is planned there anymore (I assume?)
- the clang version used for the jit cannot (easily without touching
_llmv.py) be changed. Make LLVM_VERSION configurable with env variable #138497 supports that only for configure based builds. And it is discouraged to use a different clang version, anyway. And the jit is experimental in 3.14 ... - but better safe than sorry? The fix is small and simple ...
- 3.14 uses clang 19.1.7 and is not affected. I've verified for
- changed the title
[-]Jit stencils on Windows contain debug data[/-][+]Jit stencils on Windows contain debug data in 3.15[/+]on Nov 30, 2025 - added3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixes
on Nov 30, 2025 I have no idea why clang changed that only for Windows.
Ha, I found it, even though it is not part of the 21.1.0 release notes:
llvm/llvm-project#142970: [CodeGen][COFF] Always emit CodeView compiler info on Windows targetsMSVC always emits minimal CodeView metadata with compiler information, even when debug info is otherwise disabled. Other tools may rely on this metadata being present. For example, linkers use it to determine whether hotpatching is enabled for the object file.
It is contained in clang since 21.1.0-rc1.
Unfortunately, this is done unconditionally (at first it was planned to do it only when hotpatching is enabled) and there seems to be no switch to disable it.PR is merged, I think this can be closed.
Reacted by Savannah Ostrowski and Sergey Miryanov
Bug report
Bug description:
E.g.
which is in fact empty on main for Linux (at least for me on WSL) or Windows on 3.14.
The above block is contained in every stencil :(
Clang now generates debug info into the object files. Don't know when it happened, maybe one of the clang updates. Doesn't matter anyway, the fix is easy, just ignore
.debug$SCOFF sections, which brings us back toCPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs