-
Bug
-
Resolution: Fixed
-
P4
-
16
-
b11
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8258087 | 13.0.6 | Sergey Nazarkin | P4 | Resolved | Fixed | b03 |
JDK-8257900 | 11.0.11-oracle | Dukebot | P4 | Resolved | Fixed | b01 |
JDK-8257134 | 11.0.10 | Dmitry Cherepanov | P4 | Resolved | Fixed | b05 |
JDK-8257472 | openjdk8u282 | Sergey Nazarkin | P4 | Resolved | Fixed | b04 |
The problem is in the get_timezone function.
src/hotspot/share/runtime/os.cpp
static time_t get_timezone(const struct tm* time_struct) {
#if defined(_ALLBSD_SOURCE)
return time_struct->tm_gmtoff;
#elif defined(_WINDOWS)
long zone;
_get_timezone(&zone);
return static_cast<time_t>(zone);
#else
return timezone;
#endif
}
The call to get_timezone works fine on Mac but it returns undeclared "timezone" on Linux.
According to the doc for the tm_gmtoff member:
“The tm_gmtoff field is derived from BSD and is a GNU library extension; it is not visible in a strict ISO C environment.”
It might make sense to return time_struct->tm_gmtof if _GNU_SOURCE is defined. Attached a candidate patch.
src/hotspot/share/runtime/os.cpp
static time_t get_timezone(const struct tm* time_struct) {
#if defined(_ALLBSD_SOURCE)
return time_struct->tm_gmtoff;
#elif defined(_WINDOWS)
long zone;
_get_timezone(&zone);
return static_cast<time_t>(zone);
#else
return timezone;
#endif
}
The call to get_timezone works fine on Mac but it returns undeclared "timezone" on Linux.
According to the doc for the tm_gmtoff member:
“The tm_gmtoff field is derived from BSD and is a GNU library extension; it is not visible in a strict ISO C environment.”
It might make sense to return time_struct->tm_gmtof if _GNU_SOURCE is defined. Attached a candidate patch.
- backported by
-
JDK-8257134 iso8601_time returns incorrect offset part on MacOS
- Resolved
-
JDK-8257472 iso8601_time returns incorrect offset part on MacOS
- Resolved
-
JDK-8257900 iso8601_time returns incorrect offset part on MacOS
- Resolved
-
JDK-8258087 iso8601_time returns incorrect offset part on MacOS
- Resolved
- relates to
-
JDK-8251365 Build failure on AIX after 8250636
- Resolved
- links to
-
Commit openjdk/jdk13u-dev/cf0e9356
-
Review openjdk/jdk13u-dev/51
-
Review openjdk/jdk13u-dev/52
(3 links to)