Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webos: configd=r22 (Logger: fix segfaults with 64bit time_t)
:Release Notes: It was already reported by gcc in log.do_compile: configd/1.2.0-24/git $ grep Wformat= ../temp/log.do_compile | sort -u ../git/src/common/util/Logger.hpp:238:21: warning: format '%ld' expects argument of type 'long int', but argument 2 has type '__time64_t' {aka 'long long int'} [-Wformat=] ../git/src/common/util/Logger.hpp:278:46: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__time64_t' {aka 'long long int'} [-Wformat=] but it wasn't fatal for the build, "only" causes segfault in runtime. :Detailed Notes: Fixes: Program received signal SIGSEGV, Segmentation fault. __GI_strlen () at ../sysdeps/i386/i586/strlen.S:93 warning: Source file is more recent than executable. 93 movl (%eax), %ecx /* get word (= 4 bytes) in question */ (gdb) bt #0 __GI_strlen () at ../sysdeps/i386/i586/strlen.S:93 #1 0xb78e6b49 in __printf_buffer (buf=0xbffff788, format=0x4710a0 "[%5ld.%09ld] [%-7s] %-15s ", ap=0xbffff880 "\251\031G", mode_flags=2) at /usr/src/debug/glibc/2.40+git/stdio-common/vfprintf-process-arg.c:435 #2 0xb790684a in __vsnprintf_internal (string=0x48b828 <Logger::getInstance()::s_logger+520> "[ 136.000000000] [", maxlen=1024, format=0x4710a0 "[%5ld.%09ld] [%-7s] %-15s ", args=0xbffff874 "\210", mode_flags=2) at vsnprintf.c:96 #3 0xb79b5aa0 in ___snprintf_chk (s=0x48b828 <Logger::getInstance()::s_logger+520> "[ 136.000000000] [", maxlen=1024, flag=1, slen=4294967295, format=0x4710a0 "[%5ld.%09ld] [%-7s] %-15s ") at snprintf_chk.c:38 #4 0x0046f81b in snprintf (__s=0x48b828 <Logger::getInstance()::s_logger+520> "[ 136.000000000] [", __n=1024, __fmt=0x4710a0 "[%5ld.%09ld] [%-7s] %-15s ") at /usr/include/bits/stdio2.h:68 #5 Logger::writeFile<char const*, int, char const*, LogLevel, LogType, char const*, char const*> (this=<optimized out>, logLevel=0x4719a9 "info", msgid=0x47177d "MAIN", format=0x474b9c "(%s, %d) %s : LogLevel(%d) / LogType(%d) / LogPath(%s) / BootStatus(%s)") at /usr/src/debug/configd/1.2.0-24/src/common/util/Logger.hpp:278 #6 Logger::write<char const*, int, char const*, LogLevel, LogType, char const*, char const*> (this=<optimized out>, level=0x4719a9 "info", msgid=0x47177d "MAIN", format=0x474b9c "(%s, %d) %s : LogLevel(%d) / LogType(%d) / LogPath(%s) / BootStatus(%s)") at /usr/src/debug/configd/1.2.0-24/src/common/util/Logger.hpp:212 #7 Logger::info<char const*, int, char const*, LogLevel, LogType, char const*, char const*> (msgid=0x47177d "MAIN", format=0x474b9c "(%s, %d) %s : LogLevel(%d) / LogType(%d) / LogPath(%s) / BootStatus(%s)") at /usr/src/debug/configd/1.2.0-24/src/common/util/Logger.hpp:174 #8 Logger::info<char const*, int, char const*, LogLevel, LogType, char const*, char const*> (msgid=0x47177d "MAIN", format=0x474b9c "(%s, %d) %s : LogLevel(%d) / LogType(%d) / LogPath(%s) / BootStatus(%s)") at /usr/src/debug/configd/1.2.0-24/src/common/util/Logger.hpp:171 #9 Setting::printSetting (warning: could not convert 'pbnjson::JValue' from the host encoding (ANSI_X3.4-1968) to UTF-32. This normally should not happen, please file a bug report. this=0x48bea0 <Setting::getInstance()::_instance>) at /usr/src/debug/configd/1.2.0-24/src/configd/setting/Setting.cpp:204 #10 0x0041e84e in main (argc=1, argv=0xbffffa54) at /usr/src/debug/configd/1.2.0-24/src/configd/setting/Setting.h:42 :Testing Performed: Build Successful :QA Notes: N/A :Issues Addressed: [WRQ-33135] CCC: configd=r22 (Logger: fix segfaults with 64bit time_t) [WRQ-32810] configd segfaults with 64-bit time_t Cherry-picked-from-commit: af552b6f66a93164284528295b1f622497d872e9 Cherry-picked-from-branch:
- Loading branch information