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

[SR-15672] Crash without reason #57951

Closed
fwgreen opened this issue Dec 30, 2021 · 1 comment
Closed

[SR-15672] Crash without reason #57951

fwgreen opened this issue Dec 30, 2021 · 1 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 run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella swift 5.5

Comments

@fwgreen
Copy link

fwgreen commented Dec 30, 2021

Previous ID SR-15672
Radar None
Original Reporter @fwgreen
Type Bug
Status Closed
Resolution Cannot Reproduce
Environment

Swift 5.5.2

macOS 12.1
Apple M1

Additional Detail from JIRA
Votes 0
Component/s swift
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 47fd72e4e2ab923ee53fd8d96b1c776d

Issue Description:

The following program causes a crash:

func canSum(_ targetSum: Int, _ numbers: [Int]) -> Bool {    
    var table = Array(repeating: false, count: targetSum * 2)    
    table[0] = true    
    for i in 0...targetSum {        
        if table[i] == true {            
            for num in numbers {                
                table[i + num] = true            
            }        
        }    
    }    
    return table[targetSum]
}
print(canSum(2, [2, 3])) 
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
 Stack dump:
 0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -interpret Tab.swift -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -color-diagnostics -O -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name Tab -target-sdk-version 12.1.0
 1. Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
 2.
 3. While running user code "Tab.swift"
 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):
 0 swift-frontend 0x0000000106ceb9c4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
 1 swift-frontend 0x0000000106ceaacc llvm::sys::RunSignalHandlers() + 128
 2 swift-frontend 0x0000000106cec004 SignalHandler(int) + 292
 3 libsystem_platform.dylib 0x000000019cf404e4 _sigtramp + 56
 4 libsystem_platform.dylib 0xffff80010bf9c1a0 _sigtramp + 18446603333788876020
 5 libsystem_platform.dylib 0x000000010bf9c064 _sigtramp + 18446744071277231032
 6 swift-frontend 0x0000000102b366d4 llvm::orc::runAsMain(int (int, char**), llvm::ArrayRef<std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> > >, llvm::Optional<llvm::StringRef>) + 1120
 7 swift-frontend 0x0000000102ab0b90 swift::RunImmediately(swift::CompilerInstance&, std::_1::vector<std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> >, std::1::allocator<std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > > > const&, swift::IRGenOptions const&, swift::SILOptions const&, std::1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >&&) + 9836
 8 swift-frontend 0x0000000102a6a0f4 performCompileStepsPostSILGen(swift::CompilerInstance&, std::_1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2384
 9 swift-frontend 0x0000000102a5d790 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7060
 10 swift-frontend 0x00000001029b6df8 main + 932
 11 dyld 0x00000001091f10f4 start + 520
 zsh: trace trap swift -O Tab.swift 
@fwgreen
Copy link
Author

fwgreen commented Mar 27, 2022

Consistently returns an index out range error as of Swift 5.6. So closing

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels Dec 12, 2022
@AnthonyLatsis AnthonyLatsis added standard library Area: Standard library umbrella run-time crash Bug → crash: Swift code crashed during execution swift 5.5 and removed swift compiler The Swift compiler in itself labels Jan 16, 2023
This issue was closed.
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 run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella swift 5.5
Projects
None yet
Development

No branches or pull requests

2 participants