You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-8917 FileHandle warning: 'let' properties are implicitly 'final'; use 'public' instead of 'open'
Issue Description:
When the underlying system call – pipe(2) – fails, Pipe() crashes on Ubuntu calling fatalError. It is my understanding that `fatalError` should only be called in response to programmer error and not because of a resource allocation failure.
An initialized NSPipe object. Returns nil if the method encounters errors while attempting to create the pipe or the NSFileHandle objects that serve as endpoints of the pipe.
An initialized NSPipe object. Returns nil if the method encounters errors while attempting to create the pipe or the NSFileHandle objects that serve as endpoints of the pipe.
But there are no nullable annotations in the NSFileHandle.h header file for pipe...
Ive opened a PR #1697 that sets the .fileDescriptor to -1 rather than calling fatalError. Its probably the only thing than can be done given that the initialiser is not failable.
Attachment: Download
Environment
Linux fido 3.13.0-46-generic #75-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Swift version 4.1.1 (swift-4.1.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
md5: 0d4ecd3a68dec42245053d252ead6b83
relates to:
Issue Description:
When the underlying system call –
pipe(2)
– fails,Pipe()
crashes on Ubuntu callingfatalError
. It is my understanding that `fatalError` should only be called in response to programmer error and not because of a resource allocation failure.The offending code is in FileHandle.swift, line 380
This is also reported as Radar 39998419, as the behavior on macOS is different.
The attached (very simple) program demonstrates the problem.
The text was updated successfully, but these errors were encountered: