swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.3k stars 10.34k forks source link

Compiler crash with amd64 but not aarch64 #75978

Open lhoward opened 3 weeks ago

lhoward commented 3 weeks ago

Description

Crash (see dump) on Intel builds

Reproduction

Building SwiftMRP. Don't have a smaller repro.

Stack dump

Stack dump:
0.  Program arguments: /opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend -frontend -c /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MMRP/MMRPApplication.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MMRP/MMRPAttributes.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MSRP/CBSParams.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MSRP/MSRPApplication.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MSRP/MSRPAttributes.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MSRP/MSRPTypes.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MVRP/MVRPApplication.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Applications/MVRP/MVRPAttributes.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/Error.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/IEEE802Packet.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/MRPController.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/PDU.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/Protocol.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/SerDes.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/StateMachine.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/Timer.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/Types.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/Utility.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/VLAN.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Base/Value.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Applicant.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Application.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/BaseApplication.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Bridge.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/LeaveAll.swift -primary-file /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Participant.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Port.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Registrar.swift /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Platform/LinuxPlatform.swift -emit-dependencies-path /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/x86_64-unknown-linux-gnu/debug/MRP.build/Participant.d -emit-reference-dependencies-path /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/x86_64-unknown-linux-gnu/debug/MRP.build/Participant.swiftdeps -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/x86_64-unknown-linux-gnu/debug -color-diagnostics -enable-testing -g -module-cache-path /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-driver -enable-experimental-feature StrictConcurrency -empty-abi-descriptor -resource-dir /opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/IORingSwift/Sources/CIORingShims/include/module.modulemap -Xcc -I -Xcc /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/IORingSwift/Sources/CIORingShims/include -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/IORingSwift/Sources/CIOURing/module.modulemap -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/swift-numerics/Sources/_NumericsShims/include/module.modulemap -Xcc -I -Xcc /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/swift-numerics/Sources/_NumericsShims/include -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/swift-system/Sources/CSystem/include/module.modulemap -Xcc -I -Xcc /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/swift-system/Sources/CSystem/include -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/checkouts/SocketAddress/Sources/CLinuxSockAddr/module.modulemap -Xcc -fmodule-map-file=/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/CNetLink/module.modulemap -Xcc -I -Xcc /usr/include/libnl3 -Xcc -fPIC -Xcc -g -Xcc -fno-omit-frame-pointer -module-name MRP -package-name swiftmrp -plugin-path /opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/host/plugins -plugin-path /opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/local/lib/swift/host/plugins -parse-as-library -o /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/x86_64-unknown-linux-gnu/debug/MRP.build/Participant.swift.o -index-store-path /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules
1.  Swift version 5.10.1 (swift-5.10.1-RELEASE)
2.  Compiling with the current language version
3.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Participant.swift")
4.  While silgen constructor initializer SIL function "@$s3MRP11ParticipantC10controller11application4port17contextIdentifier4typeACyxGAA13MRPControllerCy1PQzG_xAmA010MAPContextG0VAA0B4TypeOSgtYacfc".
 for 'init(controller:application:port:contextIdentifier:type:)' (at /home/lukeh/CVSRoot/padl/inferno/control/SwiftMRP/Sources/MRP/Model/Participant.swift:192:3)
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):
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x72effe4)[0x62ae0be41fe4]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x72edd4e)[0x62ae0be3fd4e]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x72f0358)[0x62ae0be42358]
/lib/x86_64-linux-gnu/libc.so.6(+0x45320)[0x75578c891320]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11c)[0x75578c8eab1c]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x1e)[0x75578c89126e]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xdf)[0x75578c8748ff]
/lib/x86_64-linux-gnu/libc.so.6(+0x2881b)[0x75578c87481b]
/lib/x86_64-linux-gnu/libc.so.6(+0x3b507)[0x75578c887507]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15d6065)[0x62ae06128065]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1613fcc)[0x62ae06165fcc]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x161aae6)[0x62ae0616cae6]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x162258e)[0x62ae0617458e]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x159b176)[0x62ae060ed176]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1589160)[0x62ae060db160]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1556b38)[0x62ae060a8b38]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1551fef)[0x62ae060a3fef]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15465ec)[0x62ae060985ec]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1629d38)[0x62ae0617bd38]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1615f89)[0x62ae06167f89]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1628558)[0x62ae0617a558]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x16368ff)[0x62ae061888ff]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1635e4d)[0x62ae06187e4d]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x161a93b)[0x62ae0616c93b]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1617ba7)[0x62ae06169ba7]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1551f04)[0x62ae060a3f04]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15465ec)[0x62ae060985ec]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15241a0)[0x62ae060761a0]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x155f8f6)[0x62ae060b18f6]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1552243)[0x62ae060a4243]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1543716)[0x62ae06095716]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15f4cf7)[0x62ae06146cf7]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1591a5d)[0x62ae060e3a5d]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x156299e)[0x62ae060b499e]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1552353)[0x62ae060a4353]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x1546d70)[0x62ae06098d70]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15ddcce)[0x62ae0612fcce]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15dc59d)[0x62ae0612e59d]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x151e852)[0x62ae06070852]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x14f7833)[0x62ae06049833]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x14f990f)[0x62ae0604b90f]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x14faa4e)[0x62ae0604ca4e]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15ee450)[0x62ae06140450]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15ee118)[0x62ae06140118]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x14fcba7)[0x62ae0604eba7]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x15dbebb)[0x62ae0612debb]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x14ffd33)[0x62ae06051d33]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0x14fd9c8)[0x62ae0604f9c8]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0xe18b8d)[0x62ae0596ab8d]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0xe2ed7a)[0x62ae05980d7a]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0xe1c51b)[0x62ae0596e51b]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0xe1af2f)[0x62ae0596cf2f]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0xcc0872)[0x62ae05812872]
/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca)[0x75578c8761ca]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b)[0x75578c87628b]
/opt/swift-5.10.1-RELEASE-ubuntu24.04/usr/bin/swift-frontend(+0xcbf855)[0x62ae05811855]

Expected behavior

Doesn't crash

Environment

Works:

Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: aarch64-unknown-linux-gnu

Fails:

Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional information

No response

lhoward commented 3 weeks ago

It appears the offending code is this in the initialiser:

    _leaveAll = await LeaveAll(
      interval: controller.leaveAllTime,
      onLeaveAllTimerExpired: _onLeaveAllTimerExpired
    )

investigating further.

lhoward commented 3 weeks ago

OK, if I move the initialisation of _leaveAll into a separate async function which is called from the initialiser, the compile no longer crashes.