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

Integer overflow with timer function on specifying seconds interval greater than 21474.836471 #506

Closed
stephanecopin opened this issue Aug 29, 2017 · 2 comments

Comments

@stephanecopin
Copy link

Hey guys,

I think this is just a documentation mistake at https://github.com/ReactiveCocoa/ReactiveSwift/blob/master/Sources/FoundationExtensions.swift#L155-L157 and https://github.com/ReactiveCocoa/ReactiveSwift/blob/master/Sources/SignalProducer.swift#L2478-L2480.
The documentation specifies 200,000 as the maximum interval, however 10% of 200,000 is 20,000 (rather than 2,000), so the Int conversion will overflow with any [micro/milli]seconds values greater than 21474.836471.
Not sure if just the documentation should be updated, or a more in depth change should be made. I feel like an interval like 21,600 seconds (6h00) is more likely to be set by someone than 200,000, for applications that are allowed to run in the background for example.

Thoughts?

@andersio
Copy link
Member

andersio commented Sep 24, 2017

cc @liscio

soxjke added a commit to soxjke/ReactiveSwift that referenced this issue Oct 22, 2017
- Added overflow test case
- Removed note on value limits for DispatchTimeInterval `*` operator
soxjke added a commit to soxjke/ReactiveSwift that referenced this issue Oct 23, 2017
- Added overflow test case
- Removed note on value limits for DispatchTimeInterval `*` operator
- Updated CHANGELOG.md
andersio pushed a commit that referenced this issue Oct 26, 2017
* - Fixed integer overflows for Foundation extensions (#506)
- Added overflow test case
- Removed note on value limits for DispatchTimeInterval `*` operator
- Updated CHANGELOG.md

* - Fixed linux build https://travis-ci.org/ReactiveCocoa/ReactiveSwift/jobs/291102863
- Update CHANGELOG.md

* Bringing back `==` syntax for equality matchers in FoundationExtensionsSpec.swift
@RuiAAPeres
Copy link
Member

Hello. 👋 Thanks for opening this issue. Due to inactivity, we will soft close the issue. If you feel that it should remain open, please let us know. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants