Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Bug report
Bug description:
As originally reported inastral-sh/python-build-standalone#463
LLVM 19.x has a hard error when handling PIC compiled functions containing computed gotos. It appears prior versions of LLVM could silently have buggy behavior in this scenario. We need to skip functions with computed gotos to allow LLVM 19.x to work with BOLT.
This results in an error like
BOLT-ERROR: unable to get new address corresponding to input address 0x1af0fa in function _PyEval_EvalFrameDefault.localalias/1(*3). Consider adding this function to --skip-funcs=...Reproduced with
./configure \ py_cv_module__openssl=n/a \ py_cv_module__hashlib=n/a \ py_cv_module__gdbm=n/a \ --without-ensurepip \ --enable-shared \ --enable-optimizations \ --enable-boltWithout--enable-shared, the failure doesn't occur.
There's an upstream fix in progress atllvm/llvm-project#120267 — I'm not sure when it will be available. In the meantime, we should skip the functions. The patch fixing this will extend the common flags proposed in#128455, e.g.,zanieb@5448cd9
See also, commentary at#124948 (comment)
Additional logs
BOLT-INFO: Target architecture: x86_64BOLT-INFO: BOLT version: 6a0964d75628b15bafd078342120888c0e6d126fBOLT-INFO: first alloc address is 0x400000BOLT-INFO: creating new program header table at address 0x600000, offset 0x200000BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.BOLT-INFO: enabling relocation modeBOLT-INFO: forcing -jump-tables=move for instrumentationBOLT-INFO: enabling lite modeBOLT-INFO: 0 out of 6 functions in the binary (0.0%) have non-empty execution profileBOLT-INSTRUMENTER: Number of indirect call site descriptors: 2BOLT-INSTRUMENTER: Number of indirect call target descriptors: 4BOLT-INSTRUMENTER: Number of function descriptors: 4BOLT-INSTRUMENTER: Number of branch counters: 1BOLT-INSTRUMENTER: Number of ST leaf node counters: 4BOLT-INSTRUMENTER: Number of direct call counters: 0BOLT-INSTRUMENTER: Total number of counters: 5BOLT-INSTRUMENTER: Total size of counters: 40 bytes (static alloc memory)BOLT-INSTRUMENTER: Total size of string table emitted: 47 bytes in fileBOLT-INSTRUMENTER: Total size of descriptors: 356 bytes in fileBOLT-INSTRUMENTER: Profile will be saved to file /fast/workspace/cpython/python.boltBOLT-INFO: padding code to 0xa00000 to accommodate hot textBOLT-INFO: output linked against instrumentation runtime library, lib entry point is 0xa06950BOLT-INFO: clear procedure is 0xa02390BOLT-INFO: patched build-id (flipped last bit)BOLT-INFO: setting _end to 0xa0a0bcBOLT-INFO: setting _end to 0xa0a0bcBOLT-INFO: setting __bolt_runtime_start to 0xa06900BOLT-INFO: setting __bolt_runtime_fini to 0xa06950BOLT-INFO: setting __hot_start to 0x800000BOLT-INFO: setting __hot_end to 0x80014cBOLT-INFO: shared object or position-independent executable detectedBOLT-INFO: Target architecture: x86_64BOLT-INFO: BOLT version: 6a0964d75628b15bafd078342120888c0e6d126fBOLT-INFO: first alloc address is 0x0BOLT-INFO: creating new program header table at address 0x600000, offset 0x600000BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.BOLT-INFO: enabling relocation modeBOLT-INFO: forcing -jump-tables=move for instrumentationBOLT-INFO: enabling lite modeBOLT-WARNING: Failed to analyze 1381 relocationsBOLT-INFO: 0 out of 7363 functions in the binary (0.0%) have non-empty execution profileBOLT-INSTRUMENTER: Number of indirect call site descriptors: 1508BOLT-INSTRUMENTER: Number of indirect call target descriptors: 7281BOLT-INSTRUMENTER: Number of function descriptors: 7281BOLT-INSTRUMENTER: Number of branch counters: 82352BOLT-INSTRUMENTER: Number of ST leaf node counters: 43921BOLT-INSTRUMENTER: Number of direct call counters: 0BOLT-INSTRUMENTER: Total number of counters: 126273BOLT-INSTRUMENTER: Total size of counters: 1010184 bytes (static alloc memory)BOLT-INSTRUMENTER: Total size of string table emitted: 186842 bytes in fileBOLT-INSTRUMENTER: Total size of descriptors: 8306748 bytes in fileBOLT-INSTRUMENTER: Profile will be saved to file /fast/workspace/cpython/libpython3.14.so.1.0.boltBOLT-INFO: 62323 instructions were shortenedBOLT-INFO: removed 156 empty blocksBOLT-INFO: UCE removed 1608 blocks and 99444 bytes of codeBOLT-INFO: padding code to 0x1000000 to accommodate hot textBOLT-INFO: output linked against instrumentation runtime library, lib entry point is 0x11be950BOLT-INFO: clear procedure is 0x11ba390BOLT-INFO: patched build-id (flipped last bit)BOLT-INFO: setting __bolt_runtime_start to 0x11be900BOLT-INFO: setting __bolt_runtime_fini to 0x11be950BOLT-INFO: setting __hot_start to 0x800000BOLT-INFO: setting __hot_end to 0xe1e116BOLT-ERROR: unable to get new address corresponding to input address 0x1af0fa in function _PyEval_EvalFrameDefault.localalias/1(*3). Consider adding this function to --skip-funcs=...
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux