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-9154] ISO8601DateFormatter init causes Segmentation Fault on Linux #3597

Closed
swift-ci opened this issue Nov 1, 2018 · 1 comment
Closed

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 1, 2018

Previous ID SR-9154
Radar None
Original Reporter alph0n5e (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment
Swift version 4.2.1-dev (LLVM 4ba03d9389, Clang 78aa734eee, Swift f4134ebef6)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 0f45abf02d2d7647fc5a06c230b3ff53

Issue Description:

ISO8601DateFormatter() causes segmentation fault in Linux environment.

Swift-Linux Docker image based on https://github.com/swiftdocker/docker-swift/blob/master/4.2/Dockerfile,
with:

  • SWIFT_PLATFORM=ubuntu16.04

  • SWIFT_BRANCH=swift-4.2-branch

  • SWIFT_VERSION=swift-4.2-DEVELOPMENT-SNAPSHOT-2018-10-30-a

$ docker run --rm -it --privileged swift:master
root@dfea816d9cfa:/# swift --version
Swift version 4.2.1-dev (LLVM 4ba03d9389, Clang 78aa734eee, Swift f4134ebef6)
Target: x86_64-unknown-linux-gnu
root@dfea816d9cfa:/# swift
Welcome to Swift version 4.2.1-dev (LLVM 4ba03d9389, Clang 78aa734eee, Swift f4134ebef6). Type :help for assistance.
 1> import Foundation
 2> let formatter = ISO8601DateFormatter()
formatter: Foundation.ISO8601DateFormatter = {
 Foundation.Formatter = {
 Foundation.NSObject = {}
 }
 __cfObject =Segmentation fault

same result obtained with the swift:4.2 image directly:

$ docker run --rm -it --privileged swift:4.2
root@d3b9dfa3304e:/# swift --version
Swift version 4.2 (swift-4.2-RELEASE)
Target: x86_64-unknown-linux-gnu
root@d3b9dfa3304e:/# swift
Welcome to Swift version 4.2 (swift-4.2-RELEASE). Type :help for assistance.
  1> import Foundation
  2> let formatter = ISO8601DateFormatter()
formatter: Foundation.ISO8601DateFormatter = {
  Foundation.Formatter = {
    Foundation.NSObject = {}
  }
  __cfObject =Segmentation fault
@spevans
Copy link
Collaborator

spevans commented Jan 16, 2019

This looks to be fixed in both the swift-5.0-branch and master

$ ~/swift-DEVELOPMENT-SNAPSHOT-2019-01-15-a-ubuntu18.04/usr/bin/swift
error: ld-2.27.so 0xffffffff0005c564: adding range [0x1464a-0x146ba) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0xffffffff0005c564: adding range [0x146d0-0x146d6) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0xffffffff0005c5c5: adding range [0x1464a-0x146ba) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0xffffffff0005c5c5: adding range [0x146d0-0x146d6) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
Welcome to Swift version 5.0-dev (LLVM f63b283c71, Clang 41ac4c4262, Swift f348fb133e).
Type :help for assistance.
  1> import Foundation
  2> let formatter = ISO8601DateFormatter()
formatter: Foundation.ISO8601DateFormatter = {
  Foundation.Formatter = {
    Foundation.NSObject = {}
  }
  __cfObject = nil
  timeZone = some {
    _wrapped = {
      Foundation.NSObject = {}
      _base = {
        info = 12416
        pad = 0
      }
      _name = (_rawValue = 0x000000000064fc90 -> 0x00007ffff407f318 full type metadata for Foundation._NSCFString + 16)
      _data = (_rawValue = 0x000000000064c8a0 -> 0x00007ffff40806b0 full type metadata for Foundation.NSData + 16)
      _periods = (_rawValue = 0x0000000000632470)
      _periodCnt = 1
    }
    _autoupdating = false
  }
  formatOptions = {
    rawValue = 1907
  }
}
  3> ^D
$ ~/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-01-15-a-ubuntu18.04/usr/bin/swift
ierror: ld-2.27.so 0xffffffff0005c564: adding range [0x1464a-0x146ba) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0xffffffff0005c564: adding range [0x146d0-0x146d6) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0xffffffff0005c5c5: adding range [0x1464a-0x146ba) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0xffffffff0005c5c5: adding range [0x146d0-0x146d6) which has a base that is less than the function's low PC 0x14dc0. Please file a bug and attach the file at the start of this error message
mWelcome to Swift version 5.0-dev (LLVM ed64f75263, Clang e5012f3421, Swift a466ecea12).
Type :help for assistance.
  1> import Foundation
  2> let formatter = ISO8601DateFormatter()
formatter: Foundation.ISO8601DateFormatter = {
  Foundation.Formatter = {
    Foundation.NSObject = {}
  }
  __cfObject = nil
  timeZone = some {
    _wrapped = {
      Foundation.NSObject = {}
      _base = {
        info = 12416
        pad = 0
      }
      _name = (_rawValue = 0x0000000000650850 -> 0x00007ffff4082310 full type metadata for Foundation._NSCFString + 16)
      _data = (_rawValue = 0x000000000064d3c0 -> 0x00007ffff40836a8 full type metadata for Foundation.NSData + 16)
      _periods = (_rawValue = 0x0000000000633070)
      _periodCnt = 1
    }
    _autoupdating = false
  }
  formatOptions = {
    rawValue = 1907
  }
}
  3> ^D

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants