Skip to content

🍒 [lldb][Windows] Require exact match in LLDBMemoryReader::resolvePointerAsSymbol#12916

Open
speednoisemovement wants to merge 2 commits intoswiftlang:swift/release/6.4.xfrom
speednoisemovement:cp_mem_reader_64
Open

🍒 [lldb][Windows] Require exact match in LLDBMemoryReader::resolvePointerAsSymbol#12916
speednoisemovement wants to merge 2 commits intoswiftlang:swift/release/6.4.xfrom
speednoisemovement:cp_mem_reader_64

Conversation

@speednoisemovement
Copy link
Copy Markdown

LLDBMemoryReader::resolvePointerAsSymbol will return a symbol if its argument points anywhere inside it. When we have sparse symbols for an image (for example, just COFF exports), we assume that the size of a given symbol is the distance between it and the next known symbol. However, this extent can actually include any number of private symbols.

Because of this, multiple symbols resolve to the name of the preceding public symbol, and the last one read can overwrite the others in the TypeRefBuilder's cache.

This change adds a requirement on Windows that the pointer match the start of a symbol to keep the cache from being stomped.

See #12891 for details.

(original: #12894)

…erAsSymbol

LLDBMemoryReader::resolvePointerAsSymbol will return a symbol if its
argument points anywhere inside it. When we have sparse symbols for an
image (for example, just COFF exports), we assume that the size of a
given symbol is the distance between it and the next known symbol.
However, this extent can actually include any number of private symbols.

Because of this, multiple symbols resolve to the name of the preceding
public symbol, and the last one read can overwrite the others in the
`TypeRefBuilder`'s cache.

This change adds a requirement on Windows that the pointer match the
*start* of a symbol to keep the cache from being stomped.

See swiftlang#12891 for details.

(cherry picked from commit 565e24f)
(cherry picked from commit 08f4dd4)
(cherry picked from commit cccc417)
@speednoisemovement speednoisemovement requested a review from a team as a code owner May 7, 2026 16:44
@speednoisemovement
Copy link
Copy Markdown
Author

@swift-ci Please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant