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-8808] SwiftPM crashes with RxSwift 4.3.0 on swift build #51316

Closed
norio-nomura opened this issue Sep 20, 2018 · 3 comments
Closed

[SR-8808] SwiftPM crashes with RxSwift 4.3.0 on swift build #51316

norio-nomura opened this issue Sep 20, 2018 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@norio-nomura
Copy link
Contributor

Previous ID SR-8808
Radar rdar://problem/44643065
Original Reporter @norio-nomura
Type Bug
Environment

swift-DEVELOPMENT-SNAPSHOT-2018-09-18-a or later on Linux

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

md5: 2d542f2753ac504110d867a5bcc41610

Issue Description:

Reproducing steps

  1. docker run -it --rm norionomura/swift:20180918a

  2. git clone -b 4.3.0 https://github.com/ReactiveX/RxSwift

  3. cd RxSwift

  4. swift build

crash log:

root@eb947d0832ab:/RxSwift# swift build
/RxSwift: error: manifest parse error(s):
/RxSwift/Package.swift:8:16: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
  return array.flatMap { $0 }
               ^
/RxSwift/Package.swift:8:16: note: use 'compactMap(_:)' instead
  return array.flatMap { $0 }
               ^~~~~~~
               compactMap
Stack dump:
0.  Program arguments: /usr/bin/swift -frontend -interpret /RxSwift/Package.swift -disable-objc-interop -sdk / -I /usr/lib/swift/pm/4 -swift-version 4 -module-name Package -lPackageDescription -- -fileno 9 
#​0 0x0000000004587bc4 PrintStackTraceSignalHandler(void*) (/usr/bin/swift+0x4587bc4)
#​1 0x0000000004585990 llvm::sys::RunSignalHandlers() (/usr/bin/swift+0x4585990)
#​2 0x0000000004587d72 SignalHandler(int) (/usr/bin/swift+0x4587d72)
#​3 0x00007ffb800b6390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#​4 0x00007ffb804e6598
#​5 0x00007ffb804e5ba1
#​6 0x00007ffb804e6543
#​7 0x00007ffb7c8cbbda $SSTsE10compactMapySayqd__Gqd__Sg7ElementQzKXEKlF (/usr/lib/swift/linux/libswiftCore.so+0x2adbda)
#​8 0x00007ffb7c9faaa9 $SSTsE7flatMapySayqd__Gqd__Sg7ElementQzKXEKlF (/usr/lib/swift/linux/libswiftCore.so+0x3dcaa9)
#​9 0x00007ffb804e5af9
#​10 0x00007ffb804e589d
#&#8203;11 0x0000000001109cce llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) (/usr/bin/swift+0x1109cce)
#&#8203;12 0x000000000110dee2 llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, char const* const*) (/usr/bin/swift+0x110dee2)
#&#8203;13 0x00000000005168c3 swift::RunImmediately(swift::CompilerInstance&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, swift::IRGenOptions&, swift::SILOptions const&) (/usr/bin/swift+0x5168c3)
#&#8203;14 0x00000000004eab51 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) (/usr/bin/swift+0x4eab51)
#&#8203;15 0x00000000004e5dd7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/usr/bin/swift+0x4e5dd7)
#&#8203;16 0x000000000048d17e main (/usr/bin/swift+0x48d17e)
#&#8203;17 0x00007ffb7e7e0830 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#&#8203;18 0x000000000048afb9 _start (/usr/bin/swift+0x48afb9)
@ankitspd
Copy link
Member

Looks like the compiler is crashing on Linux. Here is a minimal reproducer:

extension String {
  static func foo() -> String? {
      return nil
  }
}

func filterNil<T>(_ array: [T?]) -> [T] {
  return array.flatMap { $0 }
}

let targets: [String] = filterNil([
    .foo(),
])

@ankitspd
Copy link
Member

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
@tbkka
Copy link
Contributor

tbkka commented Apr 7, 2023

It no longer seems to be crashing with the 2023-04-06a Development snapshot running on Ubuntu 22.04 aarch64.

@tbkka tbkka closed this as completed Apr 7, 2023
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 crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants