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-11979] swiftc Swift 5.1.3 Linux crash #54411

Open
swift-ci opened this issue Dec 29, 2019 · 1 comment
Open

[SR-11979] swiftc Swift 5.1.3 Linux crash #54411

swift-ci opened this issue Dec 29, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11979
Radar rdar://problem/58455056
Original Reporter helge (JIRA User)
Type Bug
Environment

Linux 5.1.3 Docker image (swift:5.1.3), but affects other Linux builds too (e.g. the Travis 14.04 Ubuntu).

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 9925ff3ff3288fc92f02d73d5ba86cc5

Issue Description:

The issue is old and happened with 5.1 branches already, not sure I filed it.

When trying to compile Noze.io w/ Swift 5.1, swiftc crashes:

1.  While emitting SIL for 'decodeIntegralValue(_:)' (at /src/Sources/Freddy/JSONParser.swift:466:22)
2.  While silgen emitFunction SIL function "@$s6Freddy10JSONParserV19decodeIntegralValue33_CA3C9A2D4E0127F7667B225FFBCE6A53LLyAA4JSONOAA12NumberParserAELLVKF".
 for 'decodeIntegralValue(_:)' (at /src/Sources/Freddy/JSONParser.swift:466:22)
3.  While silgen closureexpr SIL function "@$s6Freddy10JSONParserV19decodeIntegralValue33_CA3C9A2D4E0127F7667B225FFBCE6A53LLyAA4JSONOAA12NumberParserAELLVKFys5UInt8VKXEfU_".
 for expression at [/src/Sources/Freddy/JSONParser.swift:484:50 - line:504:17] RangeText="{ c in
                    #if swift(>=4.0)  // HH
                      guard case let (exponent, false) = value.multipliedReportingOverflow(by: 10) else {
                        throw InternalError.NumberOverflow(offset: errorStart)
                      }
                      
                      guard case let (newValue, false) = Int(c - Literal.zero).addingReportingOverflow(exponent) else {
                        throw InternalError.NumberOverflow(offset: errorStart)
                      }
                    #else
                      guard case let (exponent, false) = Int.multiplyWithOverflow(10, value) else {
                          throw InternalError.NumberOverflow(offset: errorStart)
                      }
                      
                      guard case let (newValue, false) = Int.addWithOverflow(exponent, Int(c - Literal.zero)) else {
                          throw InternalError.NumberOverflow(offset: errorStart)
                      }
                    #endif
                    
                    value = newValue
                "

Here is a Travis log: https://travis-ci.org/NozeIO/Noze.io/jobs/630599274

Trigger using Docker on the Mac:

git clone -b develop https://github.com/NozeIO/Noze.io.git && cd Noze.io
docker run --rm   -v "${PWD}:/src"   -v "${PWD}/.docker.build:/src/.build"   swift:5.1.3   bash -c 'cd /src && swift build'

(this crashes so hard, it even kills Docker)

P.S.: This is Linux only, building in Xcode 11 seems to work fine.

@beccadax
Copy link
Contributor

beccadax commented Jan 9, 2020

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants