Leakhelp at daemon_cl.cpp:216 No properties have been set. | edit properties Jump to warning location ↓ warning details... Show Events | Options main() .../linux/src/daemon_cl.cpp expand/collapse int main(int argc, char **argv) { PortInit_t portInit; sigset_t set; InterfaceName *ifname; int sig; bool syntonize = false; int i; bool pps = false; uint8_t priority1 = 248; uint64_t phase_error_threshold = PHASE_ERROR_THRESHOLD; int phase_error_max_count = PHASE_ERROR_MAX_COUNT; bool override_portstate = false; PortState port_state = PTP_SLAVE; char *restoredata = NULL; char *restoredataptr = NULL; off_t restoredatalength = 0; off_t restoredatacount = 0; bool restorefailed = false; LinuxIPCArg *ipc_arg = NULL; bool use_config_file = false; char config_file_path[512]; memset(config_file_path, 0, 512); GPTPPersist *pGPTPPersist = NULL; LinuxThreadFactory *thread_factory = new LinuxThreadFactory(); // Block SIGUSR1 { sigset_t block; sigemptyset( &block ); sigaddset( &block, SIGUSR1 ); if( pthread_sigmask( SIG_BLOCK, &block, NULL ) != 0 ) { Undefined function Event 1: pthread_sigmask() is an Undefined Function. Jump to next message hide Skipping "if" Event 2: Skipping "if". pthread_sigmask(...) != 0 evaluates to false. Jump to previous message Jump to next message hide GPTP_LOG_ERROR("Failed to block SIGUSR1"); return -1; } } GPTP_LOG_REGISTER(); GPTP_LOG_INFO("gPTP starting"); if (watchdog_setup(thread_factory) != 0) { Skipping "if" Event 3: Skipping "if". watchdog_setup(...) != 0 evaluates to false. Jump to previous message Jump to next message hide GPTP_LOG_ERROR("Watchdog handler setup error"); return -1; } phy_delay_map_t ether_phy_delay; bool input_delay=false; portInit.clock = NULL; portInit.index = 0; portInit.timestamper = NULL; portInit.net_label = NULL; portInit.automotive_profile = false; portInit.isGM = false; portInit.testMode = false; portInit.linkUp = false; portInit.initialLogSyncInterval = LOG2_INTERVAL_INVALID; portInit.initialLogPdelayReqInterval = LOG2_INTERVAL_INVALID; portInit.operLogPdelayReqInterval = LOG2_INTERVAL_INVALID; portInit.operLogSyncInterval = LOG2_INTERVAL_INVALID; portInit.condition_factory = NULL; portInit.thread_factory = NULL; portInit.timer_factory = NULL; portInit.lock_factory = NULL; portInit.syncReceiptThreshold = CommonPort::DEFAULT_SYNC_RECEIPT_THRESH; portInit.neighborPropDelayThreshold = CommonPort::NEIGHBOR_PROP_DELAY_THRESH; LinuxNetworkInterfaceFactory *default_factory = new LinuxNetworkInterfaceFactory; OSNetworkInterfaceFactory::registerFactory (factory_name_t("default"), default_factory); LinuxTimerQueueFactory *timerq_factory = new LinuxTimerQueueFactory(); LinuxLockFactory *lock_factory = new LinuxLockFactory(); LinuxTimerFactory *timer_factory = new LinuxTimerFactory(); LinuxConditionFactory *condition_factory = new LinuxConditionFactory(); LinuxSharedMemoryIPC *ipc = new LinuxSharedMemoryIPC(); event Event 4: operator new() allocates and returns the resource of interest. Jump to previous message Jump to next message hide event Event 5: LinuxSharedMemoryIPC::LinuxSharedMemoryIPC() will be invoked on the resource of interest. LinuxSharedMemoryIPC::LinuxSharedMemoryIPC() does not free it or save any references that are freed later. LinuxSharedMemoryIPC::LinuxSharedMemoryIPC() will be invoked on new (). See related event 4. Jump to previous message Jump to next message hide LinuxSharedMemoryIPC::LinuxSharedMemoryIPC() .../linux/src/linux_hal_common.hpp expand/collapse LinuxSharedMemoryIPC() { event Event 6: this now references the resource of interest. this is set to new ()daemon_cl.cpp:216 See related event 5. Jump to previous message Jump to next message hide event Event 7: OS_IPC::OS_IPC() will be invoked on the resource of interest. OS_IPC::OS_IPC() does not free it or save any references that are freed later. OS_IPC::OS_IPC() will be invoked on this, which evaluates to new ()daemon_cl.cpp:216. See related event 6. Jump to previous message Jump to next message hide event Event 9: this 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 event Event 8: this now references the resource of interest. this is set to new ()daemon_cl.cpp:216 See related event 7. Jump to previous message Jump to next message hide shm_fd = 0; err = 0; master_offset_buffer = NULL; }; event Event 10: this has gone out of scope and no longer references the resource of interest. See related event 6. Jump to previous message Jump to next message hide event Event 11: ipc now references the resource of interest. ipc is set to new () See related event 4. Jump to previous message Jump to next message hide /* Create Low level network interface object */ if( argc < 2 ) { Taking true branch Event 12: Taking true branch. argc < 2 evaluates to true. Jump to previous message Jump to next message hide printf( "Interface name required\n" ); print_usage( argv[0] ); return -1; event Event 13: ipc has gone out of scope and no longer references the resource of interest. See related event 11. Jump to previous message Jump to next message hide Leak help There are no remaining references to the resource new () from daemon_cl.cpp:216. The resource was allocated at daemon_cl.cpp:216. The last reference was lost at daemon_cl.cpp:221. The resource was not freed. The issue can occur if the highlighted code executes. See related events 4, 5, 6, 7, 8, 9, 10, 11, and 13. Show: All events | Only primary events