Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webos: bootd: Logger.cpp: fix segfault with 64bit time_t
:Release Notes: It was already reported by gcc in log.do_compile: ../git/src/bootd/util/Logger.cpp:124:20: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__time64_t' {aka 'long long int'} [-Wformat=] ../git/src/bootd/event/DynamicEventDB.cpp:315:28: warning: format '%ld' expects argument of type 'long int', but argument 3 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:50 warning: Source file is more recent than executable. 50 cmpb %dh, (%eax) /* is byte NUL? */ (gdb) bt #0 __GI_strlen () at ../sysdeps/i386/i586/strlen.S:50 #1 0xb760fb49 in __printf_buffer (buf=0xbffff030, format=0x42b8cf "%s(%3ld.%09ld) : %s) %s\n", ap=0xbffff89c "\251\271B", mode_flags=2) at /usr/src/debug/glibc/2.40+git/stdio-common/vfprintf-process-arg.c:435 #2 0xb762f64f in __vdprintf_internal (d=870436166, format=0x42b8cf "%s(%3ld.%09ld) : %s) %s\n", arg=0xbffff88c "\350\270B", mode_flags=2) at iovdprintf.c:69 webosose#3 0xb76dd7d3 in __dprintf_chk (d=4, flag=1, format=0x42b8cf "%s(%3ld.%09ld) : %s) %s\n") at dprintf_chk.c:33 webosose#4 0x00429a95 in dprintf (__fd=<optimized out>, __fmt=0x42b8cf "%s(%3ld.%09ld) : %s) %s\n") at /usr/include/bits/stdio2.h:174 webosose#5 Logger::writeBootdLog (this=0x435440 <g_Logger>, type=0x42b8e8 "PERFORMANCE", msgid=0x42b9a9 "Boot", msg=0x43544c <g_Logger+12> "BOOTD_START") at /usr/src/debug/bootd/2.0.0-23/src/bootd/util/Logger.cpp:123 webosose#6 0x00429bdf in Logger::performanceLog (this=0x435440 <g_Logger>, msgid=0x42b9a9 "Boot", format=0x42b008 "BOOTD_START") at /usr/src/debug/bootd/2.0.0-23/src/bootd/util/Logger.cpp:143 webosose#7 0x0040fbf8 in main (argc=1, argv=0xbffffa54) at /usr/src/debug/bootd/2.0.0-23/src/bootd/Main.cpp:44 :Testing Performed: Local Test: OK :QA Notes: :Issues Addressed: [WRQ-32812] bootd segfaults with 64-bit time_t Change-Id: I45ed378ac1212a6ecbcdf84479d721c2960641c5
- Loading branch information