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-1547] NSData causes segmentation fault #4351
Comments
Comment by Sergej Jaskiewicz (JIRA) Still observe this issue in the release — even for existing files. |
Comment by Mark Woollard (JIRA) I've done a bit of debugging on this, the crash is occurring in * thread #​1: tid = 6673, 0x00007ffff7c2298c libswiftCore.so`swift::ValueWitnessFlags::getAlignmentMask(this=0x0000000000000090) const + 12 at Metadata.h:229, name = 'TestFoundation', stop reason = signal SIGSEGV: invalid address (fault address: 0x90)
frame #​0: 0x00007ffff7c2298c libswiftCore.so`swift::ValueWitnessFlags::getAlignmentMask(this=0x0000000000000090) const + 12 at Metadata.h:229
226 /// For example, if the type needs to be 8-byte aligned, the
227 /// appropriate alignment mask should be 0x7.
228 size_t getAlignmentMask() const {
-> 229 return (Data & AlignmentMask);
230 }
231 constexpr ValueWitnessFlags withAlignmentMask(size_t alignMask) const {
232 return ValueWitnessFlags((Data & ~AlignmentMask) | alignMask);
(lldb) bt
* thread #​1: tid = 6673, 0x00007ffff7c2298c libswiftCore.so`swift::ValueWitnessFlags::getAlignmentMask(this=0x0000000000000090) const + 12 at Metadata.h:229, name = 'TestFoundation', stop reason = signal SIGSEGV: invalid address (fault address: 0x90)
* frame #​0: 0x00007ffff7c2298c libswiftCore.so`swift::ValueWitnessFlags::getAlignmentMask(this=0x0000000000000090) const + 12 at Metadata.h:229
frame #​1: 0x00007ffff7c2296c libswiftCore.so`swift::ValueWitnessTable::getAlignmentMask(this=0x0000000000000000) const + 28 at Metadata.h:731
frame #​2: 0x00007ffff7c228e6 libswiftCore.so`swift::SwiftError::getValue(this=0x0000000000aefa60) const + 102 at ErrorObject.h:119
frame #​3: 0x00007ffff7c4c56d libswiftCore.so`swift_getErrorValue(errorObject=0x0000000000aefa60, scratch=0x00007fffffffcf18, out=0x00007fffffffcf00) + 29 at ErrorObjectNative.cpp:106
frame #​4: 0x00000000004954bd TestFoundation`TestNSData.test_sr1547(self=0x0000000000a65720) -> () + 301 at TestNSData.swift:101 Am happy to take a further look at this to try and get to the bottom but am new to the Swift project so may need a bit of guidance ! |
Comment by Mark Woollard (JIRA) Some further info - this seems to be nothing specifically to do with NSData but with throw/catching of NSError. The following code fails at the same point: do {
throw NSError(domain: NSPOSIXErrorDomain, code: Int(123), userInfo: nil)
} catch {
print(error)
} |
Comment by Matt Rajca (JIRA) Fixed, +test: #999 |
Environment
Ubuntu 14.04
Swift version 3.0-dev (LLVM dffa09ffd8, Clang 1e6cba3ce3, Swift d2aee43220)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
md5: bf2015ec5d9255dbcda105e2324bcc6f
is duplicated by:
relates to:
Issue Description:
I discovered a bug probably related to SR-936.
I can include further info if necessary. But since I am new to swift I did not quite now how to add stacktrace, etc.
The text was updated successfully, but these errors were encountered: