Skip to content
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

(lib/SymbolGraphGen) DeclarationFragmentPrinter.h: Assertion `NumFragments' failed #71635

Open
tayloraswift opened this issue Feb 15, 2024 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software swift 5.10 SymbolGraphGen The swiftSymbolGraphGen library, responsible for gathering and emitting symbol graphs.

Comments

@tayloraswift
Copy link
Member

Description

we have again lost the ability to dump the symbol graph for the standard library

Reproduction

$ swift symbolgraph-extract -module-name _Concurrency -target x86_64-unknown-linux-gnu -minimum-access-level internal -output-dir .testing/swift/artifacts -emit-extension-block-symbols -skip-inherited-docs -pretty-print

Stack dump

swift-symbolgraph-extract: /home/ec2-user/swift/lib/SymbolGraphGen/DeclarationFragmentPrinter.h:140: virtual swift::symbolgraphgen::DeclarationFragmentPrinter::~DeclarationFragmentPrinter(): Assertion `NumFragments' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /usr/bin/swift-symbolgraph-extract -module-name _Concurrency -target x86_64-unknown-linux-gnu -minimum-access-level internal -output-dir .testing/swift/artifacts -emit-extension-block-symbols -skip-inherited-docs -pretty-print
1.      Swift version 5.10-dev (LLVM dbfaba0078e9380, Swift 63c8b551eb2f613)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/bin/swift-symbolgraph-extract(+0x72e33f4)[0x55b3dbcba3f4]
/usr/bin/swift-symbolgraph-extract(+0x72e10ce)[0x55b3dbcb80ce]
/usr/bin/swift-symbolgraph-extract(+0x72e3768)[0x55b3dbcba768]
/lib64/libc.so.6(+0x54dd0)[0x7f0f30297dd0]
/lib64/libc.so.6(+0xa153c)[0x7f0f302e453c]
/lib64/libc.so.6(raise+0x16)[0x7f0f30297d26]
/lib64/libc.so.6(abort+0xd3)[0x7f0f3026b7f3]
/lib64/libc.so.6(+0x2871b)[0x7f0f3026b71b]
/lib64/libc.so.6(+0x4dcc6)[0x7f0f30290cc6]
/usr/bin/swift-symbolgraph-extract(+0x1c3914a)[0x55b3d661014a]
/usr/bin/swift-symbolgraph-extract(+0x1c40612)[0x55b3d6617612]
/usr/bin/swift-symbolgraph-extract(+0x1c3595d)[0x55b3d660c95d]
/usr/bin/swift-symbolgraph-extract(+0x1c378c9)[0x55b3d660e8c9]
/usr/bin/swift-symbolgraph-extract(+0x1c3fc7e)[0x55b3d6616c7e]
/usr/bin/swift-symbolgraph-extract(+0x1c32e30)[0x55b3d6609e30]
/usr/bin/swift-symbolgraph-extract(+0xceda1b)[0x55b3d56c4a1b]
/usr/bin/swift-symbolgraph-extract(+0x1c3272a)[0x55b3d660972a]
/usr/bin/swift-symbolgraph-extract(+0x1c323a7)[0x55b3d66093a7]
/usr/bin/swift-symbolgraph-extract(+0xd2030f)[0x55b3d56f730f]
/usr/bin/swift-symbolgraph-extract(+0xcc3a20)[0x55b3d569aa20]
/lib64/libc.so.6(+0x3feb0)[0x7f0f30282eb0]
/lib64/libc.so.6(__libc_start_main+0x80)[0x7f0f30282f60]
/usr/bin/swift-symbolgraph-extract(+0xcc1d85)[0x55b3d5698d85]
Aborted (core dumped)

Expected behavior

it worked in 5.9

Environment

Swift version 5.10-dev (LLVM dbfaba0078e9380, Swift 63c8b55)
Target: x86_64-unknown-linux-gnu

Additional information

the crash only occurs when using -minimum-access-level internal. this mode is required, even when the end goal is to only dump public symbols because of a separate issue where lib/SymbolGraphGen over-aggresively deletes nodes resulting in broken symbol graphs.

@tayloraswift tayloraswift added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels labels Feb 15, 2024
tayloraswift added a commit to tayloraswift/swift-unidoc that referenced this issue Feb 15, 2024
… things but it is better than having no symbol graph at all
@tayloraswift
Copy link
Member Author

tayloraswift commented Feb 15, 2024

_StringProcessing and Foundation are broken even on the public ACL:

$ swift symbolgraph-extract -module-name _StringProcessing -target x86_64-unknown-linux-gnu -minimum-access-level public -output-dir .testing/swift/artifacts -emit-extension-block-symbols -skip-inherited-docs

the crash seems to be related to -emit-extension-block-symbols rather than -minimum-access-level internal, as omitting that option also allows dumping the _Concurrency symbol graph.

@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler itself SymbolGraphGen The swiftSymbolGraphGen library, responsible for gathering and emitting symbol graphs. swift 5.10 labels Feb 15, 2024
@MaxDesiatov MaxDesiatov removed the triage needed This issue needs more specific labels label Feb 19, 2024
@tayloraswift
Copy link
Member Author

this crash is still taking place as of swift-6.0-DEVELOPMENT-SNAPSHOT-2024-07-24-a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software swift 5.10 SymbolGraphGen The swiftSymbolGraphGen library, responsible for gathering and emitting symbol graphs.
Projects
None yet
Development

No branches or pull requests

3 participants