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
convert
and preview
commands crash on certain Markdown pages
#678
convert
and preview
commands crash on certain Markdown pages
#678
Comments
The code that crashes is in the new diagnostics formatter (#535). cc @arthurcro if you have any ideas 🙂 |
Thank you for the heads up, I’ll take a look asap! 🙂 |
Hi! 🙂I have identified the issue and I have found a proper fix. Thanks again for reporting this! @MaxDesiatov cc @franklinsch |
@arthurcro this is still reproducible on |
Thank you for reopening the issue and apologies for the inconvenience. |
I didn't, potentially more docs were published in the |
Hi! 😄 I'm unfortunately unable to reproduce the issue on |
Reproduced again with |
Great! I can reproduce with this commit, thank you! 🙇🏻 |
Hi! 👋 After some investigation, I've identified what seems to be the underlying cause of the problem. Interestingly, the issue doesn't seem to be directly caused by the improved default diagnostic formatter, even though the formatter does highlight it. While I might not have captured all the details accurately, here's my understanding so far: When using:
DocC will see this as a symbol link. For this specific crash, when using:
DocC will try to resolve this symbol link as a
To resolve the symbol link and eventually emit a diagnostic for this resolution error, DocC uses the symbol link This source range is used as the diagnostic's source range in case of resolution error. It's then used by the default diagnostic formatter to highlight the unresolved reference. If the source range does not match the actual content of the source file, it crashes. If we look at your crash, we get a I hope that made sense. |
Thanks for pointing it out. Maybe you can help file up a issue with some minimum reproducible input to Swift-Markdown so that I can help to look at it on the Markdown module side. QuietMisdreavus should have some better insights on such problem. But it looks like she is busy now and will back September 18. Also to know that there are several other issues about SourceRange parsing like apple/swift-markdown#71. I have tried to fix it, but the CodeReview process is pending for some unknown reason. |
I'm also frequently encountered this locally. This should definitely be a block issue for release/5.10 since it may crash a lot of downstream user.
Maybe we can discuss it in next DocC workgroup. cc @franklinsch @QuietMisdreavus IMO, We should either fix it before 5.10 release or revert relevant PR until we fix the issue. |
For the problem you found, I've open a PR to fix it. apple/swift-markdown#151 cc @arthurcro And there is another crash cause, I've opened a new issue on swift-docc to track it. #729 |
Both bugfix PR is merged into main. The cherry-pick to release/5.10 is still in progress.
If you are still encountering such crash on the latest toolchain, feel free to reopen the issue. @MaxDesiatov |
Description
When rendering Swift compiler documentation the diagnostics formatting code crashes on certain Markdown pages.
Checklist
main
branch of this package.Expected Behavior
No crashes.
Actual behavior
Swift/StringCharacterView.swift:158: Fatal error: String index is out of bounds
Steps To Reproduce
swift-DEVELOPMENT-SNAPSHOT-2023-07-23-a
.swift
is the clone from step 1):Swift-DocC Version Information
swift-DEVELOPMENT-SNAPSHOT-2023-07-23-a
Swift Compiler Version Information
The text was updated successfully, but these errors were encountered: