Comments (3)
It looks like the expectation you are referring to is ...
EXPECT_EQ("-2147481748-01-01T00:00:00+00:00", format(RFC3339, tp, cut));
around line 1025. If so, my first concern is that the test has been changed because that line uses the timezone cut
, whereas your output says utc
.
That said, that part of the test is about conversions in the libc:UTC timezone, which means it mostly concerns the behavior of gmtime_r(3)
from your C library.
It is difficult to say more without being able to run the code, but my first question would be "how does gmtime_r()
behave on a time_t
value of -67768040609740800?" My guess is that it fails. It should return {0, 0, 0, 1, 0, -2147483648}
.
from cctz.
Did you discover anything about the behavior of your gmtime_r()
, or is this no longer an issue?
from cctz.
I apologize for not getting back to this earlier.
Fuchsia uses musl for its libc implementation:
gmtime_r()
for -67768040609740800
does indeed fail; it yields a tm
with all fields set to 0.
These are the two underflow conditions in __secs_to_tm
:
if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
return -1;
if (years + 100 > INT_MAX || years + 100 < INT_MIN)
return -1;
The second is the one that's triggered, with an off-by-one error. (years + 100
ends up being -2147483649
.)
It appears there's a patch attempting to fix this that was never merged: https://www.openwall.com/lists/musl/2016/11/02/1
However, the patch is incomplete, because with it, the month ends up off by 2:
{0, 0, 0, 1, 2, -2147483648}
from cctz.
Related Issues (20)
- why the include file in the same directory with "cctz/xxx.h"
- Feature Request: Support parsing 'T' and 'Z' case insensitively
- Installation with lubridate package on AIX7.2 failed due to mutex error HOT 10
- MSVC compiler warnings (level 4) cosmetic
- Linker errors on FreeBSD (-lm missing) HOT 1
- Lone test `MakeTime.SysSecondsLimits` fails on FreeBSD/Clang HOT 9
- Build failure on arm64-uwp HOT 8
- cctz fails to build on AIX
- hash support for cctz::time_point<cctz::seconds> ? HOT 2
- %E produces different results in OS X vs Linux HOT 4
- Detect if include/cctz/time_zone.h:join_seconds() would overflow the output time_point HOT 2
- [Docs] Possible outdated documentation HOT 1
- Add fraction of seconds support HOT 3
- loadtimezone and n_sec impl is slow in starrocks HOT 4
- [Bug]: time_zone_format.cc causes compilation issues under QNX HOT 1
- Commit 6355d60 broke FreeBSD builds HOT 4
- Help!!! How to get specific current timezone name? HOT 7
- TimeZones.LoadZonesConcurrently test failure on Debian Sid/Trixie HOT 7
- Please, release a new version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cctz.