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-10147] Segfault in Calendar.dataComponents(in:from) #3509

Closed
swift-ci opened this issue Mar 21, 2019 · 5 comments
Closed

[SR-10147] Segfault in Calendar.dataComponents(in:from) #3509

swift-ci opened this issue Mar 21, 2019 · 5 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-10147
Radar None
Original Reporter tannernelson (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10-a-ubuntu18.04

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, 5.0Regression, RunTimeCrash
Assignee @spevans
Priority Medium

md5: 63514f0def85cd99b86ca38fa700a9e7

Issue Description:

This line is causing a segfault on Linux:

https://github.com/vapor/nio-mysql/blob/9f968d8d2e912f73b027c3985360d409e3adc94e/Sources/NIOMySQL/MySQLTime.swift#L51

Process 13 stopped
* thread #​3, name = 'NIO-ELT-#0', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
    frame #​0: 0x00007ffff75cec30 libFoundation.so`CFLocaleGetIdentifier
libFoundation.so`CFLocaleGetIdentifier:
->  0x7ffff75cec30 <+0>: movq   0x18(%rdi), %rax
    0x7ffff75cec34 <+4>: retq   
    0x7ffff75cec35:      nopw   %cs:(%rax,%rax)
    0x7ffff75cec3f:      nop    
Target 0: (fluent-mysql-driverPackageTests.xctest) stopped.
(lldb) bt
* thread #&#8203;3, name = 'NIO-ELT-#0', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
  * frame #&#8203;0: 0x00007ffff75cec30 libFoundation.so`CFLocaleGetIdentifier
    frame #&#8203;1: 0x00007ffff75b89c4 libFoundation.so`__CFCalendarSetupCal + 20
    frame #&#8203;2: 0x00007ffff75bace0 libFoundation.so`_CFCalendarDecomposeAbsoluteTimeV + 48
    frame #&#8203;3: 0x00007ffff73875e7 libFoundation.so`Foundation.NSCalendar.components(_: Foundation.NSCalendar.Unit, from: Foundation.Date) -> Foundation.DateComponents + 935
    frame #&#8203;4: 0x00007ffff7389038 libFoundation.so`Foundation.NSCalendar.components(in: Foundation.TimeZone, from: Foundation.Date) -> Foundation.DateComponents + 1016
    frame #&#8203;5: 0x00007ffff725e3a4 libFoundation.so`partial apply forwarder for closure #&#8203;1 (Foundation.NSCalendar) -> Foundation.DateComponents in Foundation.Calendar.dateComponents(in: Foundation.TimeZone, from: Foundation.Date) -> Foundation.DateComponents + 36
    frame #&#8203;6: 0x00007ffff725e344 libFoundation.so`partial apply forwarder for reabstraction thunk helper from @callee_guaranteed (@guaranteed Foundation.NSCalendar) -> (@owned Foundation.DateComponents, @error @owned Swift.Error) to @escaping @callee_guaranteed (@guaranteed Foundation.NSCalendar) -> (@out Foundation.DateComponents, @error @owned Swift.Error) + 20
    frame #&#8203;7: 0x00007ffff72614f9 libFoundation.so`reabstraction thunk helper from @callee_guaranteed (@guaranteed Foundation.NSCalendar) -> (@owned Foundation.DateComponents, @error @owned Swift.Error) to @escaping @callee_guaranteed (@guaranteed Foundation.NSCalendar) -> (@out Foundation.DateComponents, @error @owned Swift.Error)partial apply forwarder with unmangled suffix ".158" + 9
    frame #&#8203;8: 0x00007ffff7246fea libFoundation.so`Foundation._MutableHandle.map<A>((A) throws -> A1) throws -> A1 + 74
    frame #&#8203;9: 0x00007ffff7258143 libFoundation.so`Foundation.Calendar.dateComponents(in: Foundation.TimeZone, from: Foundation.Date) -> Foundation.DateComponents + 163
@belkadan
Copy link

Looks very similar to SR-9101. @millenomi?

@LucianoPAlmeida
Copy link
Contributor

tannernelson (JIRA User), @belkadan

I'm facing something similar too

Segmentation fault with the following code

Swift version 5.0 (swift-5.0-RELEASE)

Target: x86_64-unknown-linux-gnu

Ubuntu 18.04.2 LTS (Bionic Beaver)

Swift Official Image running on a Docker container

@belkadan
Copy link

belkadan commented Apr 8, 2019

@weissi, is this related to the one you just filed?

@weissi
Copy link
Member

weissi commented Apr 8, 2019

thanks @belkadan, indeed! That is also a NULL CFLocale which looks like SR-10333.

CC @millenomi/@spevans

@spevans
Copy link
Collaborator

spevans commented Apr 24, 2019

This is a dupe of SR-10333 and was fixed in #2067

@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

5 participants