Skip to content

Completely empty DistributedActorSystem implementation crashes compiler 5.9 rather than emit diagnostic #66548

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

Closed
TeamPuzel opened this issue Jun 12, 2023 · 7 comments · Fixed by #66695
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software distributed Feature → concurrency: distributed actor type checker Area → compiler: Semantic analysis

Comments

@TeamPuzel
Copy link

Output

Swift version 5.9-dev (LLVM 677d82daa6d87d2, Swift 291fe21d5020234)
Target: x86_64-unknown-linux-gnu
Log
Building for debugging...
error: emit-module command failed due to signal 11 (use -v to see invocation)
error: compile command failed due to signal 11 (use -v to see invocation)
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /home/teampuzel/Projects/Swift/Nodes/src/channel.swift /home/teampuzel/Projects/Swift/Nodes/src/start.swift /home/teampuzel/Projects/Swift/Nodes/src/utility/main.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/teampuzel/Projects/Swift/Nodes/.build/x86_64-unknown-linux-gnu/debug -color-diagnostics -enable-testing -g -module-cache-path /home/teampuzel/Projects/Swift/Nodes/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /home/teampuzel/Toolchains/Swift/usr/bin/swift-driver -entry-point-function-name Nodes_main -empty-abi-descriptor -plugin-path /home/teampuzel/Toolchains/Swift/usr/lib/swift/host/plugins -plugin-path /home/teampuzel/Toolchains/Swift/usr/local/lib/swift/host/plugins -resource-dir /home/teampuzel/Toolchains/Swift/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -fPIC -module-name Nodes -package-name nodes -emit-module-doc-path /home/teampuzel/Projects/Swift/Nodes/.build/x86_64-unknown-linux-gnu/debug/Nodes.swiftdoc -emit-module-source-info-path /home/teampuzel/Projects/Swift/Nodes/.build/x86_64-unknown-linux-gnu/debug/Nodes.swiftsourceinfo -emit-dependencies-path /home/teampuzel/Projects/Swift/Nodes/.build/x86_64-unknown-linux-gnu/debug/Nodes.build/Nodes.emit-module.d -o /home/teampuzel/Projects/Swift/Nodes/.build/x86_64-unknown-linux-gnu/debug/Nodes.swiftmodule
1.      Swift version 5.9-dev (LLVM 677d82daa6d87d2, Swift 291fe21d5020234)
2.      Compiling with the current language version
3.      While evaluating request TypeCheckSourceFileRequest(source_file "/home/teampuzel/Projects/Swift/Nodes/src/channel.swift")
4.      While type-checking 'ChannelSystem' (at /home/teampuzel/Projects/Swift/Nodes/src/channel.swift:6:1)
5.      While evaluating request TypeWitnessRequest(ChannelSystem: DistributedActorSystem module Nodes, Distributed.(file).DistributedActorSystem.SerializationRequirement)
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/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x7048513)[0x562c8f808513]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x704623e)[0x562c8f80623e]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x704887a)[0x562c8f80887a]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7fba12642520]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x252c9a8)[0x562c8acec9a8]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x234d08f)[0x562c8ab0d08f]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x225ac9f)[0x562c8aa1ac9f]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x226127c)[0x562c8aa2127c]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x22627e8)[0x562c8aa227e8]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x2262a46)[0x562c8aa22a46]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x223f0f0)[0x562c8a9ff0f0]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x2849249)[0x562c8b009249]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x2849055)[0x562c8b009055]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x284248d)[0x562c8b00248d]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x2840557)[0x562c8b000557]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28400cb)[0x562c8b0000cb]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28ded2b)[0x562c8b09ed2b]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28e2dab)[0x562c8b0a2dab]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28be6ca)[0x562c8b07e6ca]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28c0fc4)[0x562c8b080fc4]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28dfd73)[0x562c8b09fd73]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x28dfb61)[0x562c8b09fb61]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x2850ce7)[0x562c8b010ce7]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x274b3d8)[0x562c8af0b3d8]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x217b78e)[0x562c8a93b78e]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x223a887)[0x562c8a9fa887]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x21cd91f)[0x562c8a98d91f]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x21ccb42)[0x562c8a98cb42]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x22c1847)[0x562c8aa81847]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x22c3ff7)[0x562c8aa83ff7]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x22c3e12)[0x562c8aa83e12]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x22c16b4)[0x562c8aa816b4]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x22c1694)[0x562c8aa81694]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x107b579)[0x562c8983b579]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x107053e)[0x562c8983053e]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0x1070487)[0x562c89830487]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0xdeebc2)[0x562c895aebc2]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0xddc79f)[0x562c8959c79f]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0xddaee7)[0x562c8959aee7]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0xbf8b08)[0x562c893b8b08]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7fba12629d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7fba12629e40]
/home/teampuzel/Toolchains/Swift/usr/bin/swift-frontend(+0xbf7b25)[0x562c893b7b25]

Steps to reproduce

  • import Distributed
  • Try to use the DistributedActorSystem protocol

Environment

  • OS: elementary OS 7 Horus x86_64
  • Host: MacBookPro12,1 1.0
  • Kernel: 5.19.0-43-generic
  • CPU: Intel i5-5257U (4) @ 3.100GHz
  • GPU: Intel Iris Graphics 6100
@TeamPuzel TeamPuzel added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Jun 12, 2023
@xedin
Copy link
Contributor

xedin commented Jun 12, 2023

cc @ktoso

@xedin xedin added type checker Area → compiler: Semantic analysis crash Bug: A crash, i.e., an abnormal termination of software distributed Feature → concurrency: distributed actor and removed triage needed This issue needs more specific labels labels Jun 12, 2023
@ktoso
Copy link
Contributor

ktoso commented Jun 12, 2023

Could you please provide more details about the code that is "using" the protocol? Pasting the file contents would be most helpful.

Is it perhaps an entirely empty implementation?

@ktoso ktoso self-assigned this Jun 12, 2023
@TeamPuzel
Copy link
Author

TeamPuzel commented Jun 12, 2023

@ktoso It is empty, I didn't think an example would help much. I didn't start implementing anything because as soon as DistributedActorSystem appears after the : the LSP would start crashing repeatedly.

I wasn't sure if this was a bug in sourcekit-lsp so I tried to build the package, and unfortunately it resulted in the segfault from which I provided the log.

It is enough to have this:

struct Test: DistributedActorSystem {}

The only other code in the package is:

func main() async throws {

}

which is called from main.swift as try await main()

edit:
Using distributed actors works fine though, I tested a hello world with the LocalTestingDistributedActorSystem and didn't run into issues.

@ktoso
Copy link
Contributor

ktoso commented Jun 13, 2023

We did fix some issues surrounding that in #66020 -- when no methods are present the diagnostics went bust but perhaps we missed something still?

The workaround here is to at least attempt to include some implementations in the type. You can copy paste the protocol definitions and make sure to include the ad-hoc ones:

  • remoteCall
  • remoteCallVoid

@TeamPuzel
Copy link
Author

Okay, I will just start on macOS and move my code over to Linux once it's enough to avoid this crash.

It looks like the fix is from over a month ago. I think I should have a newer toolchain - currently it's swift-DEVELOPMENT-SNAPSHOT-2023-06-07-a-ubuntu22.04

@ktoso ktoso changed the title Using the DistributedActorSystem protocol on Ubuntu 22 LTS crashes the dev 5.9 compiler Completely empty DistributedActorSystem implementation crashes compiler 5.9 rather than emit diagnostic Jun 16, 2023
@ktoso
Copy link
Contributor

ktoso commented Jun 16, 2023

Yeah I mean the fix seems to have been incomplete, here's a follow up that also handles the "completely empty" implementation case: #66695

@ktoso
Copy link
Contributor

ktoso commented Jun 16, 2023

rdar://110708278

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. crash Bug: A crash, i.e., an abnormal termination of software distributed Feature → concurrency: distributed actor type checker Area → compiler: Semantic analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants