Skip to content

Instantly share code, notes, and snippets.

@mfournier
Last active December 19, 2015 22:39
Show Gist options
  • Save mfournier/6028636 to your computer and use it in GitHub Desktop.
Save mfournier/6028636 to your computer and use it in GitHub Desktop.
testing collectd libmnl patch to netlink plugin (3b44cc54), built with --enable-debug --disable-all-plugins --enable-netlink --enable-cpu --enable-logfile --enable-csv segfaults except if built with CFLAGS="-g -O0"
$ gdb collectd/sbin/collectd collectd/var/lib/collectd/core
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/collectd/sbin/collectd...done.
[New LWP 13897]
[New LWP 13898]
[New LWP 13890]
[New LWP 13896]
[New LWP 13899]
[New LWP 13900]
[New LWP 13894]
[New LWP 13893]
[New LWP 13892]
[New LWP 13895]
[New LWP 13891]
warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `collectd/sbin/collectd -f -C /home/vagrant/collectd.netlink.conf'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f39a93c28ef in ir_read () at netlink.c:672
672 if (iflist[ifindex] == NULL)
(gdb) bt full
#0 0x00007f39a93c28ef in ir_read () at netlink.c:672
tm = <optimized out>
ifindex = <optimized out>
type_index = <optimized out>
buf = 0x7f39a5fa6e60 "\024"
nlh = <optimized out>
rt = <optimized out>
ret = <optimized out>
seq = <optimized out>
portid = 13890
ifindex = <optimized out>
type_id = {38, 42, 46}
type_name = {0x7f39a93c3bf8 "qdisc", 0x7f39a93c3bfe "class", 0x7f39a93c3c04 "filter"}
#1 0x000000000040fa6c in plugin_read_thread (args=<optimized out>) at plugin.c:462
callback = <optimized out>
rf = 0x1042d50
old_ctx = <optimized out>
status = <optimized out>
rf_type = 0
now = <optimized out>
rc = <optimized out>
__PRETTY_FUNCTION__ = "plugin_read_thread"
#2 0x00007f39a9f65b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
__res = <optimized out>
pd = 0x7f39a5fa8700
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139885574522624, -4983657950690037128, 139885641400736, 139885574523328,
139885650530368, 3, 4946419738158936696, 4946410975189119608}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0,
0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
freesize = <optimized out>
__PRETTY_FUNCTION__ = "start_thread"
#3 0x00007f39a98a2a7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
#4 0x0000000000000000 in ?? ()
No symbol table info available.
LoadPlugin csv
LoadPlugin netlink
<Plugin netlink>
VerboseInterface All
QDisc All
Class All
Filter All
</Plugin>
==7150== HEAP SUMMARY:
==7150== in use at exit: 50,965 bytes in 309 blocks
==7150== total heap usage: 131,243 allocs, 130,934 frees, 31,279,623 bytes allocated
==7150==
==7150== Thread 1:
==7150== 8 bytes in 1 blocks are definitely lost in loss record 4 of 44
==7150== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7150== by 0x5962B41: strdup (strdup.c:43)
==7150== by 0x411584: plugin_register_read (plugin.c:1133)
==7150== by 0x6272468: module_register (netlink.c:736)
==7150== by 0x40FE98: plugin_load_file (plugin.c:365)
==7150== by 0x411163: plugin_load (plugin.c:978)
==7150== by 0x40ACBD: dispatch_loadplugin (configfile.c:304)
==7150== by 0x40AF10: dispatch_value (configfile.c:355)
==7150== by 0x40C7CF: cf_read (configfile.c:1078)
==7150== by 0x407255: main (collectd.c:466)
==7150==
==7150== 48 bytes in 1 blocks are definitely lost in loss record 25 of 44
==7150== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==7150== by 0x40BE80: cf_read_generic (configfile.c:787)
==7150== by 0x40C70D: cf_read (configfile.c:1062)
==7150== by 0x407255: main (collectd.c:466)
==7150==
==7150== LEAK SUMMARY:
==7150== definitely lost: 56 bytes in 2 blocks
==7150== indirectly lost: 0 bytes in 0 blocks
==7150== possibly lost: 0 bytes in 0 blocks
==7150== still reachable: 50,909 bytes in 307 blocks
==7150== suppressed: 0 bytes in 0 blocks
==7150== Reachable blocks (those to which a pointer was found) are not shown.
==7150== To see them, rerun with: --leak-check=full --show-reachable=yes
==7150==
==7150== For counts of detected and suppressed errors, rerun with: -v
==7150== Use --track-origins=yes to see where uninitialised values come from
==7150== ERROR SUMMARY: 2534 errors from 3 contexts (suppressed: 7 from 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment