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

swift-driver segfaults whenever it can’t find one of its input files #70572

Open
tayloraswift opened this issue Dec 20, 2023 · 0 comments
Open
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 driver

Comments

@tayloraswift
Copy link
Member

Description

swift-driver segfaults whenever it can’t find one of its input files, and the path does not end in a .swift extension.

Reproduction

$ swiftc this-file-doesnt-exist

Stack dump

💣 Program crashed: Signal 11: Backtracing...

💣 Program crashed: Bad pointer dereference at 0x0000000000000000

Thread 0 "swift-driver" crashed:

 0 0x0000000000000000
 1 (anonymous namespace)::BuildEngineImpl::executeTasks(llbuild::core::KeyType const&) + 11575 in swift-driver at /home/build-user/llbuild/lib/Core/BuildEngine.cpp:1090:14
 2 llbuild::core::BuildEngine::build(llbuild::core::KeyType const&) + 654 in swift-driver at /home/build-user/llbuild/lib/Core/BuildEngine.cpp:1593:20
 3 llb_buildengine_build + 140 in swift-driver at /home/build-user/llbuild/products/libllbuild/Core-C-API.cpp:216:26
 4 specialized Array.withUnsafeBufferPointer<A>(_:) in swift-driver at /home/build-user/llbuild/products/llbuildSwift/CoreBindings.swift:407:39
 5 specialized Key.withInternalDataPtr<A>(closure:) in swift-driver at /home/build-user/llbuild/products/llbuildSwift/CoreBindings.swift:61:21
 6 specialized withUnsafeMutablePointer<A, B>(to:_:) in swift-driver at /home/build-user/llbuild/products/llbuildSwift/CoreBindings.swift:407:17
 7 specialized withUnsafePointer<A, B>(to:_:) in swift-driver at /home/build-user/llbuild/products/llbuildSwift/CoreBindings.swift:105:9
 8 BuildEngine.build(key:) + 60 in swift-driver at /home/build-user/llbuild/products/llbuildSwift/CoreBindings.swift:63:20
 9 specialized LLBuildEngine.build<A>(key:) + 626 in swift-driver at Sources/SwiftDriverExecution/llbuild.swift:97:24
10 MultiJobExecutor.execute(env:fileSystem:) + 215 in swift-driver at /home/build-user/swift-driver/Sources/SwiftDriverExecution/MultiJobExecutor.swift:305:29
11 SwiftDriverExecutor.execute(workload:delegate:numParallelJobs:forceResponseFiles:recordedInputModificationDates:) + 322 in swift-driver at /home/build-user/swift-driver/Sources/SwiftDriverExecution/SwiftDriverExecutor.swift:88:25
12 Driver.performTheBuild(allJobs:jobExecutionDelegate:forceResponseFiles:) + 476 in swift-driver at /home/build-user/swift-driver/Sources/SwiftDriver/Driver/Driver.swift:1495:18
13 Driver.run(jobs:) + 7109 in swift-driver at /home/build-user/swift-driver/Sources/SwiftDriver/Driver/Driver.swift:1434:13
14 swift_driver_main + 2576 in swift-driver at /home/build-user/swift-driver/Sources/swift-driver/main.swift:107:14

Backtrace took 3.36s

Segmentation fault (core dumped)

Expected behavior

swift-driver should not segfault

Environment

$ swiftc --version
Swift version 5.9.2 (swift-5.9.2-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional information

No response

@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 Dec 20, 2023
@MaxDesiatov MaxDesiatov added driver and removed triage needed This issue needs more specific labels labels Feb 19, 2024
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 driver
Projects
None yet
Development

No branches or pull requests

2 participants