nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

libc/localtime: fix ats over time_t range

Open Donny9 opened this issue 3 years ago • 3 comments

Summary

libc/localtime: fix ats over time_t range

Fix time error for "set TZ :Pacific/Honolulu".

Signed-off-by: Jiuzhu Dong [email protected]

Impact

tzset correct

Testing

Local test

Donny9 avatar Aug 04 '22 12:08 Donny9

I hope to find some time end of week to get more precise look into this. Maybe you can describe some sample values that are failing currently, so I can focus on that.

@pkarashchenko Based on the modification of pr, i found it maybe caused busyloop at line 2320.

[01/00 00:00:00.000000] [ 0] [ap] clock_basetime, line 89
[01/00 00:00:00.000000] [ 0] [ap] clock_basetime, line 97
[01/00 00:00:00.000000] [ 0] [ap] timegm, line 2679
[01/00 00:00:00.000000] [ 0] [ap] time1, line 2479
[01/00 00:00:00.000000] [ 0] [ap] time1, line 2486
[01/00 00:00:00.000000] [ 0] [ap] time1, line 2492
[01/00 00:00:00.000000] [ 0] [ap] time2, line 2456
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2150
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2161
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2172
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2179
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2189
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2200
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2211
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2231
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2237
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2245
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2273
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2293
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320
[01/00 00:00:00.000000] [ 0] [ap] time2sub, line 2320

image

Donny9 avatar Aug 11 '22 07:08 Donny9

@Donny9 can this is somehow related to an issue that I asked in https://lists.apache.org/thread/h4pnnv1b9hfoglwg6hp6jz12xpytff7r ?

pkarashchenko avatar Aug 11 '22 07:08 pkarashchenko

@Donny9 can this is somehow related to an issue that I asked in https://lists.apache.org/thread/h4pnnv1b9hfoglwg6hp6jz12xpytff7r ?

I‘m not sure if busyloop is related to "struct tm", i feel like which condition is always satisfied, causing busyloop. Maybe realted to "sinse TYPE_SIGNED(int_fast64_t) is always true"

Donny9 avatar Aug 11 '22 07:08 Donny9