Leakhelp at daemon_cl.cpp:121 No properties have been set. | edit properties Jump to warning location ↓ warning details... Show Events | Options watchdog_setup() .../linux/src/daemon_cl.cpp expand/collapse int watchdog_setup(OSThreadFactory *thread_factory) { #ifdef SYSTEMD_WATCHDOG SystemdWatchdogHandler *watchdog = new SystemdWatchdogHandler(); OSThread *watchdog_thread = thread_factory->createThread(); event Event 1: LinuxThreadFactory::createThread() returns the address of a new object. Jump to next message hide event Event 2: watchdog_thread is set to thread_factory->createThread(), which evaluates to LinuxThreadFactory::createThread(). See related event 1. Jump to previous message Jump to next message hide int watchdog_result; long unsigned int watchdog_interval; watchdog_interval = watchdog->getSystemdWatchdogInterval(&watchdog_result); if (watchdog_result) { Taking true branch Event 3: Taking true branch. watchdog_result evaluates to true. Jump to previous message Jump to next message hide GPTP_LOG_INFO("Watchtog interval read from service file: %lu us", watchdog_interval); watchdog->update_interval = watchdog_interval / 2; GPTP_LOG_STATUS("Starting watchdog handler (Update every: %lu us)", watchdog->update_interval); watchdog_thread->start(watchdogUpdateThreadFunction, watchdog); event Event 4: LinuxThread::start() is invoked on watchdog_thread, which evaluates to LinuxThreadFactory::createThread()daemon_cl.cpp:113. See related event 2. Jump to previous message Jump to next message hide event Event 5: The resource of interest is allocated inside LinuxThread::start(). Jump to previous message Jump to next message hide LinuxThread::start() .../linux/src/linux_hal_common.cpp expand/collapse bool LinuxThread::start(OSThreadFunction function, void *arg) { event Event 6: this is set to LinuxThreadFactory::createThread()daemon_cl.cpp:113. See related event 4. Jump to previous message Jump to next message hide sigset_t set; sigset_t oset; int err; _private = new LinuxThreadPrivate; event Event 7: operator new() allocates and returns the resource of interest. Jump to previous message Jump to next message hide event Event 8: _private now references the resource of interest, where this is LinuxThreadFactory::createThread()daemon_cl.cpp:113. _private is set to new () See related events 6 and 7. Jump to previous message Jump to next message hide if( _private == NULL ) return false; Skipping "if" Event 9: Skipping "if". _private == __null evaluates to false. Jump to previous message Jump to next message hide arg_inner = new OSThreadArg(); arg_inner->func = function; arg_inner->arg = arg; sigemptyset(&set); sigaddset(&set, SIGALRM); err = pthread_sigmask(SIG_BLOCK, &set, &oset); Undefined function Event 10: pthread_sigmask() is an Undefined Function. Jump to previous message Jump to next message hide if (err != 0) { Taking true branch Event 11: Taking true branch. err != 0 evaluates to true. Jump to previous message Jump to next message hide GPTP_LOG_ERROR ("Add timer pthread_sigmask( SIG_BLOCK ... )"); gptpLog() .../common/gptp_log.cpp expand/collapse void gptpLog(GPTP_LOG_LEVEL level, const char *tag, const char *path, int line, const char *fmt, ...) { char msg[1024]; va_list args; va_start(args, fmt); vsprintf(msg, fmt, args); #ifndef GENIVI_DLT std::chrono::system_clock::time_point cNow = std::chrono::system_clock::now(); time_t tNow = std::chrono::system_clock::to_time_t(cNow); struct tm tmNow; PLAT_localtime(&tNow, &tmNow); std::chrono::system_clock::duration roundNow = cNow - std::chrono::system_clock::from_time_t(tNow); long int millis = (long int) std::chrono::duration_cast(roundNow).count(); if (path) { fprintf(stderr, "%s: GPTP [%2.2d:%2.2d:%2.2d:%3.3ld] [%s:%u] %s\n", tag, tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec, millis, path, line, msg); } else { fprintf(stderr, "%s: GPTP [%2.2d:%2.2d:%2.2d:%3.3ld] %s\n", tag, tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec, millis, msg); } #else DltLogLevelType dlt_level; switch (level) { Event 12: level evaluates to 1. Jump to previous message Jump to next message hide case GPTP_LOG_LVL_CRITICAL: dlt_level = DLT_LOG_FATAL; break; case GPTP_LOG_LVL_ERROR: dlt_level = DLT_LOG_ERROR; break; case GPTP_LOG_LVL_EXCEPTION: case GPTP_LOG_LVL_WARNING: dlt_level = DLT_LOG_WARN; break; case GPTP_LOG_LVL_INFO: case GPTP_LOG_LVL_STATUS: dlt_level = DLT_LOG_INFO; break; case GPTP_LOG_LVL_DEBUG: dlt_level = DLT_LOG_DEBUG; break; case GPTP_LOG_LVL_VERBOSE: dlt_level = DLT_LOG_VERBOSE; break; default: dlt_level = DLT_LOG_INFO; break; } DLT_LOG(dlt_con_gptp, dlt_level, DLT_STRING(msg)); Skipping "if" Event 13: Skipping "if". dlt_con_gptp.log_level_ptr evaluates to false. Jump to previous message Jump to next message hide Leaving loop Event 14: Leaving loop. false evaluates to false. Jump to previous message Jump to next message hide #endif } return false; return 0; event Event 15: _private has gone out of scope and no longer references the resource of interest. See related event 8. Jump to previous message Jump to next message hide Leak help There are no remaining references to the resource new () from linux_hal_common.cpp:802. The resource was allocated at linux_hal_common.cpp:802. The last reference was lost at daemon_cl.cpp:122. The resource was not freed. The issue can occur if the highlighted code executes. See related events 5, 7, 8, and 15. Show: All events | Only primary events