Skip to content

Instantly share code, notes, and snippets.

@whizz
Created May 2, 2012 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whizz/2576023 to your computer and use it in GitHub Desktop.
Save whizz/2576023 to your computer and use it in GitHub Desktop.
Reproduce leak in noitd
cd /usr/local/src
git clone git://github.com/omniti-labs/reconnoiter.git
cd reconnoiter
yum -y install zlib-devel protobuf-c-devel libuuid-devel ncurses-devel pcre-devel libssh2-devel openssl-devel postgresql-devel libxml2-devel libxslt-devel apr-devel net-snmp-devel java-devel telnet
autoconf
./configure
make
make install
<?xml version="1.0" encoding="utf8" standalone="yes"?>
<noit xmlns:ip_acl="noit://module/ip_acl" lockfile="/var/run/noitd.lock">
<!-- <watchdog glider="/opt/gimli/bin/glider" tracedir="/var/log/noitd.crash"/> -->
<eventer>
<config>
<default_queue_threads>10</default_queue_threads>
<default_ca_chain>/usr/local/etc/default-ca-chain.crt</default_ca_chain>
</config>
</eventer>
<logs>
<console_output>
<outlet name="stderr"/>
<log name="error"/>
<log name="debug" disabled="true"/>
</console_output>
<feeds>
<log name="feed" type="jlog" path="/var/log/noitd.feed(stratcon)"/>
</feeds>
<components>
<error>
<outlet name="error"/>
<log name="error/collectd"/>
<log name="error/dns"/>
<log name="error/eventer"/>
<log name="error/external"/>
<log name="error/lua"/>
<log name="error/mysql"/>
<log name="error/ping_icmp"/>
<log name="error/postgres"/>
<log name="error/selfcheck"/>
<log name="error/snmp"/>
<log name="error/ssh2"/>
</error>
<debug>
<outlet name="debug"/>
<log name="debug/collectd" disabled="true"/>
<log name="debug/dns" disabled="true"/>
<log name="debug/eventer" disabled="true"/>
<log name="debug/external" disabled="true"/>
<log name="debug/lua" disabled="true"/>
<log name="debug/mysql" disabled="true"/>
<log name="debug/ping_icmp" disabled="true"/>
<log name="debug/postgres" disabled="true"/>
<log name="debug/selfcheck" disabled="true"/>
<log name="debug/snmp" disabled="true"/>
<log name="debug/ssh2" disabled="true"/>
</debug>
</components>
<feeds>
<config>
<extended_id>off</extended_id>
</config>
<outlet name="feed"/>
<log name="check"/>
<log name="delete"/>
<log name="status"/>
<log name="metrics"/>
<log name="bundle"/>
<log name="config"/>
</feeds>
</logs>
<modules directory="/usr/local/libexec/noit">
<loader image="lua" name="lua">
<config>
<directory>/usr/local/libexec/noit/?.lua</directory>
</config>
</loader>
<module image="selfcheck" name="selfcheck"/>
<module image="ping_icmp" name="ping_icmp"/>
<module image="dns" name="dns"/>
<module image="snmp" name="snmp"/>
<module image="ssh2" name="ssh2"/>
<module image="httptrap" name="httptrap"/>
<module loader="lua" name="varnish" object="noit.module.varnish"/>
<module loader="lua" name="http" object="noit.module.http"/>
<module loader="lua" name="resmon" object="noit.module.resmon"/>
<module loader="lua" name="smtp" object="noit.module.smtp"/>
<jezebel>
<config>
<url>http://127.0.0.1:8083/dispatch</url>
</config>
<module loader="lua" name="jmx" object="noit.module.jezebel"/>
</jezebel>
<generic image="check_test" name="check_test"/>
<generic image="ip_acl" name="ip_acl"/>
</modules>
<listeners>
<sslconfig>
<optional_no_ca>false</optional_no_ca>
<certificate_file>/usr/local/etc/noit.crt</certificate_file>
<key_file>/usr/local/etc/noit.key</key_file>
<ca_chain>/usr/local/etc/ca.crt</ca_chain>
</sslconfig>
<consoles type="noit_console">
<listener address="/tmp/noit">
<config>
<line_protocol>telnet</line_protocol>
</config>
</listener>
<listener address="*" port="32322">
<config>
<line_protocol>telnet</line_protocol>
</config>
</listener>
<listener address="*" port="32323" ssl="on"/>
</consoles>
<listener type="control_dispatch" address="*" port="43191" ssl="on">
<config>
<log_transit_feed_name>feed</log_transit_feed_name>
</config>
</listener>
</listeners>
<rest>
<acl>
<rule type="allow"/>
</acl>
</rest>
<checks filterset="default" resolve_rtype="prefer-ipv4" transient_min_period="1000" transient_period_granularity="500" period="60000" timeout="30000">
<config xmlns:ip_acl="noit://module/ip_acl">
<ip_acl:global/>
</config>
<switches module="snmp">
<dc1>
<FGT310 target="92.43.56.151">
<check uuid="acbc755a-9e0e-42d4-af56-d1c21bf61c29" name="1"/>
<config inherit="SwitchPortX">
<community>public</community>
</config>
<check uuid="32a30274-b1ac-42c2-9963-f94dbbb55953" name="2"/>
<check uuid="d2fe3c4c-445c-454b-a39a-1720e5ecab8d" name="3"/>
<check uuid="2e1f6ffc-7cbf-451d-946c-be3fe3c397c9" name="4"/>
<check uuid="d1d6b60a-ae58-498e-9f63-dd76df76235c" name="5"/>
<check uuid="1fcd0580-f535-46e4-b680-74cf2ab0a38d" name="6"/>
<check uuid="b2144ea9-eae8-4e69-9f4f-70bf5d8f98ba" name="7"/>
<check uuid="5b6e05f9-b425-465e-809c-cc837ca93b77" name="8"/>
<check uuid="319d4597-f047-439c-b4d7-35bbf07e6d07" name="9"/>
<check uuid="9431843e-eeda-49b4-9991-475a43811c5f" name="10"/>
</FGT310>
</dc1>
</switches>
</checks>
<filtersets>
<filterset name="default">
<rule type="deny" module="^ping_icmp$" metric="^(?:minimum|maximum|count)$"/>
<rule type="allow"/>
</filterset>
</filtersets>
<config_templates>
<include file="config_templates.conf"/>
</config_templates>
<acls>
<acl name="global">
<rule type="deny">8.8.38.0/24</rule>
</acl>
<acl name="sample">
<rule type="deny">66.225.209.0/24</rule>
</acl>
</acls>
</noit>
==19030== Memcheck, a memory error detector
==19030== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==19030== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==19030== Command: noitd -D
==19030== Parent PID: 15881
==19030==
==19030==
==19030== HEAP SUMMARY:
==19030== in use at exit: 1,702,122 bytes in 22,452 blocks
==19030== total heap usage: 217,074 allocs, 194,622 frees, 58,485,231 bytes allocated
==19030==
==19030== 66 bytes in 33 blocks are definitely lost in loss record 1,767 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CAA695D: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x334CA82518: xmlXPathCastNodeToString (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x42A934: _noit_conf_get_string (noit_conf.c:995)
==19030== by 0x42F647: noit_console_show_check (noit_conf_checks.c:465)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030==
==19030== 74 bytes in 2 blocks are definitely lost in loss record 1,803 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CAA695D: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x430065: noit_console_check (noit_conf_checks.c:294)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 92 bytes in 10 blocks are definitely lost in loss record 1,842 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CAA695D: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x334CA82518: xmlXPathCastNodeToString (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x42EFBE: noit_console_config_show (noit_conf_checks.c:702)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 320 bytes in 1 blocks are possibly lost in loss record 2,195 of 2,573
==19030== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==19030== by 0x33442117F2: _dl_allocate_tls (in /lib64/ld-2.12.so)
==19030== by 0x3344E0701F: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==19030== by 0x44C2B9: jlog_logio_open (noit_log.c:545)
==19030== by 0x44AF07: noit_log_stream_new (noit_log.c:730)
==19030== by 0x42B456: noit_conf_log_init (noit_conf.c:1503)
==19030== by 0x41645A: noit_main (noit_main.c:151)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 320 bytes in 1 blocks are possibly lost in loss record 2,196 of 2,573
==19030== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==19030== by 0x33442117F2: _dl_allocate_tls (in /lib64/ld-2.12.so)
==19030== by 0x3344E0701F: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==19030== by 0x44C029: jlog_logio_reopen (noit_log.c:436)
==19030== by 0x44C2C9: jlog_logio_open (noit_log.c:549)
==19030== by 0x44AF07: noit_log_stream_new (noit_log.c:730)
==19030== by 0x42B456: noit_conf_log_init (noit_conf.c:1503)
==19030== by 0x41645A: noit_main (noit_main.c:151)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 320 bytes in 1 blocks are possibly lost in loss record 2,197 of 2,573
==19030== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==19030== by 0x33442117F2: _dl_allocate_tls (in /lib64/ld-2.12.so)
==19030== by 0x3344E0701F: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==19030== by 0x44C029: jlog_logio_reopen (noit_log.c:436)
==19030== by 0x44A38A: noit_log_reopen_all (noit_log.c:1025)
==19030== by 0x415BC0: child_main (noitd.c:162)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 740 bytes in 20 blocks are definitely lost in loss record 2,291 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CAA695D: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x334CA82518: xmlXPathCastNodeToString (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x42EDC1: noit_console_config_show (noit_conf_checks.c:781)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 1,000 bytes in 2 blocks are definitely lost in loss record 2,325 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CA50C51: xmlGetNodePath (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x4300B3: noit_console_check (noit_conf_checks.c:306)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 4,000 bytes in 8 blocks are definitely lost in loss record 2,497 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CA50C51: xmlGetNodePath (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x428BAE: noit_console_config_cd (noit_conf.c:1838)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 4,000 bytes in 8 blocks are definitely lost in loss record 2,498 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CA50C51: xmlGetNodePath (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x428CE7: noit_console_config_cd (noit_conf.c:1850)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 5,000 bytes in 10 blocks are definitely lost in loss record 2,510 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CA50C51: xmlGetNodePath (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x42EFD0: noit_console_config_show (noit_conf_checks.c:702)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 6,000 bytes in 12 blocks are definitely lost in loss record 2,518 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CA50C51: xmlGetNodePath (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x42EC00: noit_console_config_show (noit_conf_checks.c:752)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== 7,500 bytes in 15 blocks are definitely lost in loss record 2,528 of 2,573
==19030== at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==19030== by 0x334CA50C51: xmlGetNodePath (in /usr/lib64/libxml2.so.2.7.6)
==19030== by 0x42EB94: noit_console_config_show (noit_conf_checks.c:748)
==19030== by 0x419FBE: _noit_console_state_do (noit_console_state.c:438)
==19030== by 0x418D95: noit_console_dispatch (noit_console.c:308)
==19030== by 0x419243: noit_console_handler (noit_console.c:484)
==19030== by 0x442D4B: eventer_epoll_impl_trigger (eventer_epoll_impl.c:202)
==19030== by 0x442F7A: eventer_epoll_impl_loop (eventer_epoll_impl.c:268)
==19030== by 0x415CDE: child_main (noitd.c:219)
==19030== by 0x41695E: noit_main (noit_main.c:217)
==19030== by 0x416157: main (noitd.c:225)
==19030==
==19030== LEAK SUMMARY:
==19030== definitely lost: 28,472 bytes in 120 blocks
==19030== indirectly lost: 0 bytes in 0 blocks
==19030== possibly lost: 960 bytes in 3 blocks
==19030== still reachable: 1,672,690 bytes in 22,329 blocks
==19030== suppressed: 0 bytes in 0 blocks
==19030== Reachable blocks (those to which a pointer was found) are not shown.
==19030== To see them, rerun with: --leak-check=full --show-reachable=yes
==19030==
==19030== For counts of detected and suppressed errors, rerun with: -v
==19030== ERROR SUMMARY: 13 errors from 13 contexts (suppressed: 19 from 10)
==16676== Memcheck, a memory error detector
==16676== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==16676== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==16676== Command: noitd -D
==16676== Parent PID: 8754
==16676==
==16676==
==16676== HEAP SUMMARY:
==16676== in use at exit: 1,675,219 bytes in 22,254 blocks
==16676== total heap usage: 121,582 allocs, 99,328 frees, 26,725,518 bytes allocated
==16676==
==16676== 320 bytes in 1 blocks are possibly lost in loss record 2,186 of 2,555
==16676== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==16676== by 0x33442117F2: _dl_allocate_tls (in /lib64/ld-2.12.so)
==16676== by 0x3344E0701F: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==16676== by 0x44C2B9: jlog_logio_open (noit_log.c:545)
==16676== by 0x44AF07: noit_log_stream_new (noit_log.c:730)
==16676== by 0x42B456: noit_conf_log_init (noit_conf.c:1503)
==16676== by 0x41645A: noit_main (noit_main.c:151)
==16676== by 0x416157: main (noitd.c:225)
==16676==
==16676== 320 bytes in 1 blocks are possibly lost in loss record 2,187 of 2,555
==16676== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==16676== by 0x33442117F2: _dl_allocate_tls (in /lib64/ld-2.12.so)
==16676== by 0x3344E0701F: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==16676== by 0x44C029: jlog_logio_reopen (noit_log.c:436)
==16676== by 0x44C2C9: jlog_logio_open (noit_log.c:549)
==16676== by 0x44AF07: noit_log_stream_new (noit_log.c:730)
==16676== by 0x42B456: noit_conf_log_init (noit_conf.c:1503)
==16676== by 0x41645A: noit_main (noit_main.c:151)
==16676== by 0x416157: main (noitd.c:225)
==16676==
==16676== 320 bytes in 1 blocks are possibly lost in loss record 2,188 of 2,555
==16676== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==16676== by 0x33442117F2: _dl_allocate_tls (in /lib64/ld-2.12.so)
==16676== by 0x3344E0701F: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==16676== by 0x44C029: jlog_logio_reopen (noit_log.c:436)
==16676== by 0x44A38A: noit_log_reopen_all (noit_log.c:1025)
==16676== by 0x415BC0: child_main (noitd.c:162)
==16676== by 0x41695E: noit_main (noit_main.c:217)
==16676== by 0x416157: main (noitd.c:225)
==16676==
==16676== LEAK SUMMARY:
==16676== definitely lost: 0 bytes in 0 blocks
==16676== indirectly lost: 0 bytes in 0 blocks
==16676== possibly lost: 960 bytes in 3 blocks
==16676== still reachable: 1,674,259 bytes in 22,251 blocks
==16676== suppressed: 0 bytes in 0 blocks
==16676== Reachable blocks (those to which a pointer was found) are not shown.
==16676== To see them, rerun with: --leak-check=full --show-reachable=yes
==16676==
==16676== For counts of detected and suppressed errors, rerun with: -v
==16676== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 19 from 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment