-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Windows missing pdata for $ss22_ContiguousArrayBufferV19firstElementAddressSpyxGvgyp_Tg5 #69315
Comments
What's the Swift version? |
I had just downloaded the current binaries within a day. Sorry that isn’t precise, yet, more later. |
Is this x86-64 or ARM Windows? |
This isn't a runtime bug; it's to do with whether the compiler generated Windows unwind information for a given function. It looks like it might actually be an LLVM issue, but to confirm I think we should hand this to IRGen folks so they can check. |
Hmmm. Checking the Microsoft documentation, it says:
(emphasis mine). It seems to me that |
@al45tair Thanks for helping out with the triage! This area isn’t my forte. |
If you so much as push, then you change rsp, then you are not a leaf. Things are specified, such that, stackwalk works from any instruction. It doesn't work here. This function is not a leaf, and lacks pdata/xdata.
|
This is definitely a bug. Maybe it is LLVM and not Swift, but it is a bug. |
Some versions of the Microsoft documentation have confused leaf and non-leaf. I have tried to get it corrected and clarified, but it is possible things only got more confusing. |
C:\s\sw1>swiftc --version |
ps: I have seen esp. assembly programmers get this wrong repeatedly. |
Microsoft does say
and they clearly give the example of It's a bit unhelpful of them to define leaf function this way, because that isn't the usual definition (normally it's a function that doesn't call anything). I can well imagine that someone might also argue that since the function doesn't call anything and doesn't itself throw any exceptions, there's no reason to provide unwind data for it — but of course that will affect debugging, which is what you're complaining about here. |
Stepping through hello world on Windows with cdb I see missing pdata.
I build codeview and have a pdb, but that isn't relevant. pdata is a runtime non-optional feature for stackwalk, independent of symbols.
C:\s\sw1>more sw1.swift
print("hello")
The problem is not universal by far. Many other functions I stepped through do have pdata and xdata.
The text was updated successfully, but these errors were encountered: