Repository navigation
libc/localtime: fix some issues and update to consistent with mainline - #6783
Conversation
pkarashchenko
left a comment
There was a problem hiding this comment.
Seems like current code for localtime is hardly depending on presence of 64 bit types.
962ae37 to
f5cfe74
Compare
pkarashchenko
left a comment
There was a problem hiding this comment.
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. |
|
@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" |
Signed-off-by: dongjiuzhu1 <[email protected]>
Enable CONFIG_LIBC_LOCALTIME,CONFIG_RTC and CONFIG_SCHED_TICKLESS In os clock init process, clock_initialize() --> ... --> sim_rtc_rdtime() --> gmtime_r() --> gmtsub() --> return NULL get the error rtctime. Signed-off-by: wangbowen6 <[email protected]>
when enable LIBC_LOCALTIME and SYSLOG_TIMESTAMP_LOCALTIME and zoneinfo/posixrulesi isn't exist [ EMERG] [ap] backtrace: [ EMERG] [ap] [20] [<0xc1cc3c4>] arm_switchcontext+0xc/0x10 [ EMERG] [ap] [20] [<0xc1ac67a>] sem_wait+0x5a/0xc0 [ EMERG] [ap] [20] [<0xc1c4588>] tzset.part.0+0x8/0x160 [ EMERG] [ap] [20] [<0xc1c58de>] localtime_r+0xc6/0x114 [ EMERG] [ap] [20] [<0xc1a910a>] clock_gettime+0x16/0xa8 [ EMERG] [ap] [20] [<0xc1b7622>] nx_vsyslog+0x9e/0xc0 [ EMERG] [ap] [20] [<0xc4ba7e0>] romfs_stat+0xa4/0xf4 [ EMERG] [ap] [20] [<0xc4b47bc>] inode_semtake+0x24/0x5c [ EMERG] [ap] [20] [<0xc1c0102>] bsearch+0x26/0x6c [ EMERG] [ap] [20] [<0xc1c265a>] vsyslog+0x16/0x24 [ EMERG] [ap] [20] [<0xc1c2676>] syslog+0xe/0x1c [ EMERG] [ap] [20] [<0xc4bae12>] romfs_open+0xee/0x178 <--- err log [ EMERG] [ap] [20] [<0xc4b68ae>] file_vopen+0x116/0x144 [ EMERG] [ap] [20] [<0xc4b6ac8>] open+0x20/0x60 [ EMERG] [ap] [20] [<0xc1c3df4>] tzload+0x84/0x810 [ EMERG] [ap] [20] [<0xc1c6ef4>] mm_zalloc+0x10/0x18 [ EMERG] [ap] [20] [<0xc4bb426>] romfs_checkmount+0x22/0x58 [ EMERG] [ap] [20] [<0xc4bad74>] romfs_open+0x50/0x178 [ EMERG] [ap] [20] [<0xc1c392c>] tzparse+0x2c/0x470 [ EMERG] [ap] [20] [<0xc1ac5da>] nxsem_wait_uninterruptible+0x8a/0xd0 [ EMERG] [ap] [20] [<0xc1ac690>] sem_wait+0x70/0xc0 [ EMERG] [ap] [20] [<0xc4b47bc>] inode_semtake+0x24/0x5c [ EMERG] [ap] [20] [<0xc4b481c>] inode_semgive+0x28/0x58 [ EMERG] [ap] [20] [<0xc4b58b4>] file_close+0x18/0x44 [ EMERG] [ap] [20] [<0xc4b4690>] close+0x80/0xb4 [ EMERG] [ap] [20] [<0xc1c43f4>] tzload+0x684/0x810 [ EMERG] [ap] [20] [<0xc1c4616>] tzset.part.0+0x96/0x160 [ EMERG] [ap] [20] [<0xc1c58de>] localtime_r+0xc6/0x114 [ EMERG] [ap] [20] [<0xc1a910a>] clock_gettime+0x16/0xa8 [ EMERG] [ap] [20] [<0xc1ea692>] cmd_date+0x276/0x37c Signed-off-by: dongjiuzhu1 <[email protected]>
testcase: set TZ CEST time_t t = time(NULL); struct tm *ts = localtime(&t); t = timegm(ts); t will return (time_t)-1; Signed-off-by: dongjiuzhu1 <[email protected]>
pkarashchenko
left a comment
There was a problem hiding this comment.
Few optional style changes

Summary
Impact
Testing
timedatectl
set TZ Asia/Shanghai
timedatectl
timedatectl set-timezone Asia/Tokyo
timedatectl
timedatectl set-timezone Pacific/Honolulu
timedatectl
timedatectl set-timezone Asia/Shanghai
timedatectl
timedatectl set-timezone xxxaaa
timedatectl