Closed JDevlieghere closed 1 week ago
@swift-ci test
C:\Users\swift-ci\jenkins\workspace\apple-llvm-project-pull-request-windows\swift-llvm-bindings failed (ret=1): ['git', 'checkout', 'swift/release/6.0']
b"error: pathspec 'swift/release/6.0' did not match any file(s) known to git\n"
@shahmishal Is this a bug in the bot config, or should this patch go to a different 6.x branch? (It's a backport for rdar://139654755)
@swift-ci test windows
The
relative_list_list_entry_t
offset field in the Objective-C runtime is of typeint64_t
. There are cases where these offsets are negative values. For negative offsets, LLDB would currently incorrectly zero-extend the offset (dropping the fact that the offset was negative), instead producing large offsets that, when added to them_baseMethods_ptr
result in addresses that had their upper bits set (e.g.,0x00017ff81b3241b0
). We then would try toGetMethodList
from such an address but fail to read it (because it's an invalid address). This would manifest in Objective-C decls not getting completed correctly (and formatters not working). We noticed this in CI failures on our Intel bots. This happened to work fine on arm64 because we strip the upper bits when callingClassDescriptorV2::method_list_t::Read
using theFixCodeAddress
ABI plugin API (which doesn't do that on Intel).The fix is to sign-extend the offset calculation.
Example failure before this patch: