-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
when emitting the symbol graph for the snippet below, swift symbolgraph-extract
will crash on toolchains with assertions enabled.
without assertions, it generates an invalid symbol graph with multiple conflicting conformances to the underscored protocol.
arguments: swift symbolgraph-extract -target x86_64-unknown-linux-gnu -minimum-access-level internal -output-dir $SYMBOLGRAPHS -skip-inherited-docs -emit-extension-block-symbols -include-spi-symbols -pretty-print
Reproduction
public
enum E<T>
{
}
public
protocol _P
{
}
public
protocol Q1:_P
{
}
public
protocol Q2:_P
{
}
extension E:_P
{
}
extension E:Q1 where T == Int
{
}
extension E:Q2 where T == Bool
{
}
Stack dump
swift-symbolgraph-extract: /home/build-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: /home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract -target x86_64-unknown-linux-gnu -minimum-access-level internal -output-dir TestModules/SymbolGraphs -skip-inherited-docs -emit-extension-block-symbols -include-spi-symbols -pretty-print -module-name _Concurrency
1. Swift version 5.10.1 (swift-5.10.1-RELEASE)
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):
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x72effe4)[0x56eedf837fe4]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x72edd4e)[0x56eedf835d4e]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x72f0358)[0x56eedf838358]
/lib/x86_64-linux-gnu/libc.so.6(+0x45320)[0x748b9ea45320]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11c)[0x748b9ea9eb1c]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x1e)[0x748b9ea4526e]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xdf)[0x748b9ea288ff]
/lib/x86_64-linux-gnu/libc.so.6(+0x2881b)[0x748b9ea2881b]
/lib/x86_64-linux-gnu/libc.so.6(+0x3b507)[0x748b9ea3b507]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c3c6aa)[0x56eeda1846aa]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c439f2)[0x56eeda18b9f2]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c38e7d)[0x56eeda180e7d]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c3adc9)[0x56eeda182dc9]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c4319a)[0x56eeda18b19a]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c36350)[0x56eeda17e350]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0xceba3b)[0x56eed9233a3b]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c35c4a)[0x56eeda17dc4a]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0x1c358c7)[0x56eeda17d8c7]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0xd1ec20)[0x56eed9266c20]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0xcc14f0)[0x56eed92094f0]
/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca)[0x748b9ea2a1ca]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b)[0x748b9ea2a28b]
/home/ubuntu/5.10/x86_64/usr/bin/swift-symbolgraph-extract(+0xcbf855)[0x56eed9207855]
./generate-test-symbolgraphs: line 17: 130883 Aborted (core dumped) swift symbolgraph-extract -target x86_64-unknown-linux-gnu -minimum-access-level internal -output-dir TestModules/SymbolGraphs -skip-inherited-docs -emit-extension-block-symbols -include-spi-symbols -pretty-print -module-name $TARGET
Expected behavior
it should omit the implied conformances according to the rules of SE-0143
Environment
Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labelsThis issue needs more specific labels