andrey@debian:~$ sudo valgrind --leak-check=full --undef-value-errors=no /usr/local/bin/netxmsd ==3879== Memcheck, a memory error detector ==3879== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==3879== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==3879== Command: /usr/local/bin/netxmsd ==3879== Using configuration file "/etc/netxmsd.conf" [18-Mar-2014 19:21:33.502] [INFO ] Platform subagent "/usr/local/lib/netxms/linux.nsm" successfully loaded [18-Mar-2014 19:21:33.673] [INFO ] Database driver "/usr/local/lib/libnxddr_mysql.so" loaded and initialized successfully [18-Mar-2014 19:21:34.484] [INFO ] Network device driver "AT" loaded successfully [18-Mar-2014 19:21:34.522] [INFO ] Network device driver "CISCO-ESW" loaded successfully [18-Mar-2014 19:21:34.562] [INFO ] Network device driver "NTWS" loaded successfully [18-Mar-2014 19:21:34.612] [INFO ] Network device driver "ERS8000" loaded successfully [18-Mar-2014 19:21:34.646] [INFO ] Network device driver "BAYSTACK" loaded successfully [18-Mar-2014 19:21:34.679] [INFO ] Network device driver "PROCURVE" loaded successfully [18-Mar-2014 19:21:34.712] [INFO ] Network device driver "PING3" loaded successfully [18-Mar-2014 19:21:34.752] [INFO ] Network device driver "SYMBOL-WS" loaded successfully [18-Mar-2014 19:21:34.788] [INFO ] Network device driver "NETSCREEN" loaded successfully [18-Mar-2014 19:21:34.820] [INFO ] Network device driver "CISCO-SB" loaded successfully [18-Mar-2014 19:21:34.861] [INFO ] Network device driver "DELL-PWC" loaded successfully [18-Mar-2014 19:21:34.910] [INFO ] Network device driver "CATALYST-2900XL" loaded successfully [18-Mar-2014 19:21:34.945] [INFO ] Network device driver "CATALYST-GENERIC" loaded successfully [18-Mar-2014 19:21:34.956] [INFO ] Network device driver "DLINK" loaded successfully [18-Mar-2014 19:21:37.011] [ERROR] Inconsistent database: interface 162 linked to non-existing node 157 [18-Mar-2014 19:21:37.013] [ERROR] Failed to load interface object with id 162 from database [18-Mar-2014 19:21:37.042] [ERROR] Inconsistent database: interface 197 linked to non-existing node 178 [18-Mar-2014 19:21:37.043] [ERROR] Failed to load interface object with id 197 from database [18-Mar-2014 19:21:37.049] [ERROR] Inconsistent database: interface 199 linked to non-existing node 178 [18-Mar-2014 19:21:37.050] [ERROR] Failed to load interface object with id 199 from database [18-Mar-2014 19:21:37.056] [ERROR] Inconsistent database: interface 207 linked to non-existing node 150 [18-Mar-2014 19:21:37.057] [ERROR] Failed to load interface object with id 207 from database [18-Mar-2014 19:21:37.556] [INFO ] Listening for SNMP traps on UDP socket 0.0.0.0:162 [18-Mar-2014 19:21:37.564] [INFO ] Listening for client connections on TCP socket 0.0.0.0:4701 [18-Mar-2014 19:21:37.576] [INFO ] Listening for mobile device connections on TCP socket 0.0.0.0:4747 [18-Mar-2014 19:21:37.596] [INFO ] NetXMS Server started NetXMS Server V1.2.13 Build 7863 Ready Enter "help" for command list or "down" for server shutdown System Console netxmsd: exit Cannot exit from local server console netxmsd: down Proceeding with server shutdown... [18-Mar-2014 19:58:50.077] [INFO ] NetXMS Server stopped Error in my_thread_global_end(): 4 threads didn't exit ==3879== ==3879== HEAP SUMMARY: ==3879== in use at exit: 1,831,054 bytes in 9,593 blocks ==3879== total heap usage: 439,812 allocs, 430,219 frees, 1,445,873,409 bytes allocated ==3879== ==3879== 8 bytes in 1 blocks are definitely lost in loss record 53 of 1,308 ==3879== at 0x4028308: malloc (vg_replace_malloc.c:263) ==3879== by 0x46B2F0F: strdup (strdup.c:43) ==3879== by 0x4200F0E: yylex(YYSTYPE*, void*) (parser.l:74) ==3879== by 0x42021A1: yyparse(void*, NXSL_Lexer*, NXSL_Compiler*, NXSL_Program*) (parser.tab.cpp:1924) ==3879== by 0xBC00BA: ??? ==3879== ==3879== 16 bytes in 1 blocks are definitely lost in loss record 626 of 1,308 ==3879== at 0x4028308: malloc (vg_replace_malloc.c:263) ==3879== by 0x46BCF43: wcsdup (wcsdup.c:31) ==3879== by 0x40EF5C0: ClientSession::ClientSession(int, sockaddr*) (session.cpp:271) ==3879== by 0x407FAC5: ClientListener(void*) (client.cpp:187) ==3879== by 0x4337C38: start_thread (pthread_create.c:304) ==3879== by 0x4710D4D: clone (clone.S:130) ==3879== ==3879== 16 bytes in 2 blocks are definitely lost in loss record 627 of 1,308 ==3879== at 0x4028308: malloc (vg_replace_malloc.c:263) ==3879== by 0x46B2F0F: strdup (strdup.c:43) ==3879== by 0x4200F0E: yylex(YYSTYPE*, void*) (parser.l:74) ==3879== by 0x42021A1: yyparse(void*, NXSL_Lexer*, NXSL_Compiler*, NXSL_Program*) (parser.tab.cpp:1924) ==3879== by 0x10100C8: ??? ==3879== ==3879== 128 bytes in 1 blocks are definitely lost in loss record 1,012 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x4CAEC13: ??? ==3879== by 0x4C889C4: ??? ==3879== by 0x4C8A0E8: ??? ==3879== by 0x4C5DDF1: ??? ==3879== by 0x4250CB4: DBConnect(db_driver_t*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t*) (session.cpp:63) ==3879== by 0x411DA51: Syncer(void*) (syncer.cpp:120) ==3879== by 0x4710D4D: clone (clone.S:130) ==3879== ==3879== 128 bytes in 1 blocks are definitely lost in loss record 1,013 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x4CAEC13: ??? ==3879== by 0x4C889C4: ??? ==3879== by 0x4C8A0E8: ??? ==3879== by 0x4C5DDF1: ??? ==3879== by 0x4250CB4: DBConnect(db_driver_t*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t*) (session.cpp:63) ==3879== by 0x408A149: DBWriteThread(void*) (dbwrite.cpp:127) ==3879== by 0x4710D4D: clone (clone.S:130) ==3879== ==3879== 128 bytes in 1 blocks are definitely lost in loss record 1,014 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x4CAEC13: ??? ==3879== by 0x4C889C4: ??? ==3879== by 0x4C8A0E8: ??? ==3879== by 0x4C5DDF1: ??? ==3879== by 0x4250CB4: DBConnect(db_driver_t*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t*) (session.cpp:63) ==3879== by 0x4089FA9: IDataWriteThread(void*) (dbwrite.cpp:182) ==3879== by 0x4710D4D: clone (clone.S:130) ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,040 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x40E2E7B: ObjectsInit() (nms_threads.h:639) ==3879== by 0x40B77D4: Initialize() (main.cpp:752) ==3879== by 0x8048F16: main (netxmsd.cpp:482) ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,041 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x40BA0C0: ThreadCreate(void* (*)(void*), int, void*) (nms_threads.h:639) ==3879== by 0x40B7A13: Initialize() (main.cpp:818) ==3879== by 0x8048F16: main (netxmsd.cpp:482) ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,042 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x40BA0C0: ThreadCreate(void* (*)(void*), int, void*) (nms_threads.h:639) ==3879== by 0x40B7AC6: Initialize() (main.cpp:833) ==3879== by 0x8048F16: main (netxmsd.cpp:482) ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,043 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x40BA0C0: ThreadCreate(void* (*)(void*), int, void*) (nms_threads.h:639) ==3879== by 0x40B7AE9: Initialize() (main.cpp:840) ==3879== by 0x8048F16: main (netxmsd.cpp:482) ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,044 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x427C63A: StartMainLoop(void* (*)(void*), void* (*)(void*)) (nms_threads.h:639) ==3879== by 0x2D342D2F: ??? ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,045 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x40EB5F4: PollManager(void*) (nms_threads.h:639) ==3879== by 0x4337C38: start_thread (pthread_create.c:304) ==3879== by 0x4710D4D: clone (clone.S:130) ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,046 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x4271B83: MsgWaitQueue::MsgWaitQueue() (nms_threads.h:639) ==3879== by 0x41CF7E9: AgentConnection::AgentConnection(unsigned int, unsigned short, int, wchar_t const*) (agent.cpp:93) ==3879== by 0x40CF5F8: Node::connectToAgent(unsigned int*, unsigned int*) (nms_core.h:289) ==3879== by 0x40D7513: _ZN4Node10statusPollEP13ClientSessionji.part.124 (node.cpp:1106) ==3879== by 0x40E9AB3: StatusPoller(void*) (poll.cpp:278) ==3879== by 0x6E: ??? ==3879== ==3879== 144 bytes in 1 blocks are possibly lost in loss record 1,047 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x41D27DF: AgentConnection::connect(rsa_st*, int, unsigned int*, unsigned int*) (nms_threads.h:639) ==3879== ==3879== 3,600 bytes in 25 blocks are possibly lost in loss record 1,271 of 1,308 ==3879== at 0x4026A68: calloc (vg_replace_malloc.c:566) ==3879== by 0x40111FB: _dl_allocate_tls (dl-tls.c:300) ==3879== by 0x43385A0: pthread_create@@GLIBC_2.1 (allocatestack.c:580) ==3879== by 0x4089863: InitDataCollector() (nms_threads.h:639) ==3879== ==3879== LEAK SUMMARY: ==3879== definitely lost: 424 bytes in 7 blocks ==3879== indirectly lost: 0 bytes in 0 blocks ==3879== possibly lost: 4,752 bytes in 33 blocks ==3879== still reachable: 1,825,878 bytes in 9,553 blocks ==3879== suppressed: 0 bytes in 0 blocks ==3879== Reachable blocks (those to which a pointer was found) are not shown. ==3879== To see them, rerun with: --leak-check=full --show-reachable=yes ==3879== ==3879== For counts of detected and suppressed errors, rerun with: -v ==3879== ERROR SUMMARY: 15 errors from 15 contexts (suppressed: 0 from 0)