Hello Paola,
I installed valgrind and recompiled glibc and pmacct with debugging symbols.
This is the output.
rapna ~ # valgrind /usr/sbin/uacctd -d -f /etc/pmacctd/uacctd.conf
==3260== Memcheck, a memory error detector
==3260== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3260== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==3260== Command: /usr/sbin/uacctd -d -f /etc/pmacctd/uacctd.conf
==3260==
DEBUG: [/etc/pmacctd/uacctd.conf] plugin name/type: 'default'/'core'.
DEBUG: [/etc/pmacctd/uacctd.conf] plugin name/type: 'in'/'mysql'.
DEBUG: [/etc/pmacctd/uacctd.conf] plugin name/type: 'out'/'mysql'.
DEBUG: [/etc/pmacctd/uacctd.conf] plugin name/type: 'in1'/'memory'.
DEBUG: [/etc/pmacctd/uacctd.conf] plugin name/type: 'out1'/'memory'.
DEBUG: [/etc/pmacctd/uacctd.conf] plugin name/type: 'in2'/'memory'.
DEBUG: [/etc/pmacctd/uacctd.conf] daemonize:true
DEBUG: [/etc/pmacctd/uacctd.conf] syslog:daemon
DEBUG: [/etc/pmacctd/uacctd.conf] plugin_pipe_zmq:true
DEBUG: [/etc/pmacctd/uacctd.conf] plugin_pipe_zmq_profile:medium
DEBUG: [/etc/pmacctd/uacctd.conf] uacctd_group:5
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate[in]:dst_host
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate[out]:src_host
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate_filter[in]:( dst net
192.168.2.0/24 or dst net 192.168.222.0/24 or dst net 172.16.3.0/24 )
and not dst host 192.168.2.201
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate_filter[out]:( src net
192.168.2.0/24 or src net 192.168.222.0/24 or src net 172.16.3.0/24 )
and not src host 192.168.2.201
DEBUG: [/etc/pmacctd/uacctd.conf] sql_db:net_stats
DEBUG: [/etc/pmacctd/uacctd.conf] sql_table[in]:traffic_wan_in
DEBUG: [/etc/pmacctd/uacctd.conf] sql_table[out]:traffic_wan_out
DEBUG: [/etc/pmacctd/uacctd.conf] sql_optimize_clauses:true
DEBUG: [/etc/pmacctd/uacctd.conf] sql_passwd:max3ds
DEBUG: [/etc/pmacctd/uacctd.conf] sql_user:root
DEBUG: [/etc/pmacctd/uacctd.conf] sql_refresh_time:3600
DEBUG: [/etc/pmacctd/uacctd.conf] sql_history:1h
DEBUG: [/etc/pmacctd/uacctd.conf] sql_history_roundoff:h
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate[in1]:dst_host
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate[out1]:src_host
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate_filter[in1]:( dst net
192.168.2.0/24 or dst net 192.168.222.0/24 or dst net 172.16.3.0/24 )
and not dst host 192.168.2.201
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate_filter[out1]:( src net
192.168.2.0/24 or src net 192.168.222.0/24 or src net 172.16.3.0/24 )
and not src host 192.168.2.201
DEBUG: [/etc/pmacctd/uacctd.conf] imt_path[in1]:/var/run/pmacct_wan_in.pipe
DEBUG: [/etc/pmacctd/uacctd.conf]
imt_path[out1]:/var/run/pmacct_wan_out.pipe
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate[in2]:src_host
DEBUG: [/etc/pmacctd/uacctd.conf] aggregate_filter[in2]:dst host
192.168.2.27
DEBUG: [/etc/pmacctd/uacctd.conf]
imt_path[in2]:/var/run/pmacct_arvid_in.pipe
DEBUG: [/etc/pmacctd/uacctd.conf] debug:true
==3260==
==3260== HEAP SUMMARY:
==3260== in use at exit: 135,884 bytes in 105 blocks
==3260== total heap usage: 164 allocs, 59 frees, 229,203 bytes allocated
==3260==
==3260== LEAK SUMMARY:
==3260== definitely lost: 288 bytes in 1 blocks
==3260== indirectly lost: 3,452 bytes in 35 blocks
==3260== possibly lost: 0 bytes in 0 blocks
==3260== still reachable: 132,144 bytes in 69 blocks
==3260== suppressed: 0 bytes in 0 blocks
==3260== Rerun with --leak-check=full to see details of leaked memory
==3260==
==3260== For lists of detected and suppressed errors, rerun with: -s
==3260== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==3267== Syscall param socketcall.sendto(msg) points to uninitialised
byte(s)
==3267== at 0x54CACFC: sendto (in /lib64/libpthread-2.32.so)
==3267== by 0x621A7F2: nfnl_send (in /usr/lib64/libnfnetlink.so.0.2.0)
==3267== by 0x621C462: nfnl_query (in /usr/lib64/libnfnetlink.so.0.2.0)
==3267== by 0x50CB341: ??? (in /usr/lib64/libnetfilter_log.so.1.1.0)
==3267== by 0x113E50: main (in /usr/sbin/uacctd)
==3267== Address 0x1ffeff4239 is on thread 1's stack
==3267==
==3289==
==3289== HEAP SUMMARY:
==3289== in use at exit: 807,638 bytes in 405 blocks
==3289== total heap usage: 4,470 allocs, 4,065 frees, 12,736,275 bytes
allocated
==3289==
==3295==
==3295== HEAP SUMMARY:
==3295== in use at exit: 998,559 bytes in 493 blocks
==3295== total heap usage: 3,478 allocs, 2,985 frees, 9,554,499 bytes
allocated
==3295==
==3283==
==3283== HEAP SUMMARY:
==3283== in use at exit: 712,487 bytes in 342 blocks
==3283== total heap usage: 4,465 allocs, 4,123 frees, 12,893,134 bytes
allocated
==3283==
==3289== LEAK SUMMARY:
==3289== definitely lost: 936 bytes in 2 blocks
==3289== indirectly lost: 32,276 bytes in 71 blocks
==3289== possibly lost: 640 bytes in 2 blocks
==3289== still reachable: 773,786 bytes in 330 blocks
==3289== of which reachable via heuristic:
==3289== multipleinheritance: 3,008 bytes in 2
blocks
==3289== suppressed: 0 bytes in 0 blocks
==3289== Rerun with --leak-check=full to see details of leaked memory
==3289==
==3289== For lists of detected and suppressed errors, rerun with: -s
==3289== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==3295== LEAK SUMMARY:
==3295== definitely lost: 1,280 bytes in 10 blocks
==3295== indirectly lost: 32,276 bytes in 71 blocks
==3295== possibly lost: 640 bytes in 2 blocks
==3295== still reachable: 964,363 bytes in 410 blocks
==3295== of which reachable via heuristic:
==3295== multipleinheritance: 6,016 bytes in 4
blocks
==3295== suppressed: 0 bytes in 0 blocks
==3295== Rerun with --leak-check=full to see details of leaked memory
==3295==
==3295== For lists of detected and suppressed errors, rerun with: -s
==3295== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==3283== LEAK SUMMARY:
==3283== definitely lost: 288 bytes in 1 blocks
==3283== indirectly lost: 3,452 bytes in 35 blocks
==3283== possibly lost: 30,112 bytes in 39 blocks
==3283== still reachable: 678,635 bytes in 267 blocks
==3283== of which reachable via heuristic:
==3283== multipleinheritance: 3,480 bytes in 4
blocks
==3283== suppressed: 0 bytes in 0 blocks
==3283== Rerun with --leak-check=full to see details of leaked memory
==3283==
==3283== For lists of detected and suppressed errors, rerun with: -s
==3283== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==3267==
==3267== HEAP SUMMARY:
==3267== in use at exit: 894,768 bytes in 549 blocks
==3267== total heap usage: 3,610 allocs, 3,061 frees, 3,251,315 bytes
allocated
==3267==
==3271== Invalid read of size 1
==3271== at 0x48406AE: strstr (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3271== by 0x167775: MY_DB_Connect (in /usr/sbin/uacctd)
==3271== by 0x17B068: sql_exit_gracefully (in /usr/sbin/uacctd)
==3271== by 0x5511F1F: ??? (in /lib64/libc-2.32.so)
==3271== by 0x55C7D5E: poll (in /lib64/libc-2.32.so)
==3271== by 0x167F45: mysql_plugin (in /usr/sbin/uacctd)
==3271== by 0x11C3E7: load_plugins (in /usr/sbin/uacctd)
==3271== by 0x113C8D: main (in /usr/sbin/uacctd)
==3271== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3271==
==3271==
==3271== Process terminating with default action of signal 11 (SIGSEGV)
==3271== Access not within mapped region at address 0x0
==3271== at 0x48406AE: strstr (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3271== by 0x167775: MY_DB_Connect (in /usr/sbin/uacctd)
==3271== by 0x17B068: sql_exit_gracefully (in /usr/sbin/uacctd)
==3271== by 0x5511F1F: ??? (in /lib64/libc-2.32.so)
==3271== by 0x55C7D5E: poll (in /lib64/libc-2.32.so)
==3271== by 0x167F45: mysql_plugin (in /usr/sbin/uacctd)
==3271== by 0x11C3E7: load_plugins (in /usr/sbin/uacctd)
==3271== by 0x113C8D: main (in /usr/sbin/uacctd)
==3271== If you believe this happened as a result of a stack
==3271== overflow in your program's main thread (unlikely but
==3271== possible), you can try to increase the size of the
==3271== main thread stack using the --main-stacksize= flag.
==3271== The main thread stack size used in this run was 8388608.
==3277== Invalid read of size 1
==3277== at 0x48406AE: strstr (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3277== by 0x167775: MY_DB_Connect (in /usr/sbin/uacctd)
==3277== by 0x17B068: sql_exit_gracefully (in /usr/sbin/uacctd)
==3277== by 0x5511F1F: ??? (in /lib64/libc-2.32.so)
==3277== by 0x55C7D5E: poll (in /lib64/libc-2.32.so)
==3277== by 0x167F45: mysql_plugin (in /usr/sbin/uacctd)
==3277== by 0x11C3E7: load_plugins (in /usr/sbin/uacctd)
==3277== by 0x113C8D: main (in /usr/sbin/uacctd)
==3277== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3277==
==3277==
==3277== Process terminating with default action of signal 11 (SIGSEGV)
==3277== Access not within mapped region at address 0x0
==3277== at 0x48406AE: strstr (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3277== by 0x167775: MY_DB_Connect (in /usr/sbin/uacctd)
==3277== by 0x17B068: sql_exit_gracefully (in /usr/sbin/uacctd)
==3277== by 0x5511F1F: ??? (in /lib64/libc-2.32.so)
==3277== by 0x55C7D5E: poll (in /lib64/libc-2.32.so)
==3277== by 0x167F45: mysql_plugin (in /usr/sbin/uacctd)
==3277== by 0x11C3E7: load_plugins (in /usr/sbin/uacctd)
==3277== by 0x113C8D: main (in /usr/sbin/uacctd)
==3277== If you believe this happened as a result of a stack
==3277== overflow in your program's main thread (unlikely but
==3277== possible), you can try to increase the size of the
==3277== main thread stack using the --main-stacksize= flag.
==3277== The main thread stack size used in this run was 8388608.
==3271==
==3271== HEAP SUMMARY:
==3271== in use at exit: 17,759,425 bytes in 3,899 blocks
==3271== total heap usage: 4,945 allocs, 1,046 frees, 18,407,103 bytes
allocated
==3271==
==3277==
==3277== HEAP SUMMARY:
==3277== in use at exit: 17,789,001 bytes in 3,937 blocks
==3277== total heap usage: 5,007 allocs, 1,070 frees, 18,471,846 bytes
allocated
==3277==
==3271== LEAK SUMMARY:
==3271== definitely lost: 936 bytes in 2 blocks
==3271== indirectly lost: 32,276 bytes in 71 blocks
==3271== possibly lost: 640 bytes in 2 blocks
==3271== still reachable: 17,725,573 bytes in 3,824 blocks
==3271== suppressed: 0 bytes in 0 blocks
==3271== Rerun with --leak-check=full to see details of leaked memory
==3271==
==3271== For lists of detected and suppressed errors, rerun with: -s
==3271== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==3277== LEAK SUMMARY:
==3277== definitely lost: 936 bytes in 2 blocks
==3277== indirectly lost: 32,276 bytes in 71 blocks
==3277== possibly lost: 640 bytes in 2 blocks
==3277== still reachable: 17,755,149 bytes in 3,862 blocks
==3277== suppressed: 0 bytes in 0 blocks
==3277== Rerun with --leak-check=full to see details of leaked memory
==3277==
==3277== For lists of detected and suppressed errors, rerun with: -s
==3277== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==3267== LEAK SUMMARY:
==3267== definitely lost: 3,528 bytes in 6 blocks
==3267== indirectly lost: 3,452 bytes in 35 blocks
==3267== possibly lost: 4,800 bytes in 15 blocks
==3267== still reachable: 882,988 bytes in 493 blocks
==3267== of which reachable via heuristic:
==3267== multipleinheritance: 6,016 bytes in 4
blocks
==3267== suppressed: 0 bytes in 0 blocks
==3267== Rerun with --leak-check=full to see details of leaked memory
==3267==
==3267== Use --track-origins=yes to see where uninitialised values come from
==3267== For lists of detected and suppressed errors, rerun with: -s
==3267== ERROR SUMMARY: 3 errors from 1 contexts (suppressed: 0 from 0)
I just started up uacctd and then shout it down again to force a write
in mysql database.
Hope it helps to find the issue.
regards
Goeran
Am 14.04.2021 um 14:39 schrieb Paolo Lucente:
Hi Goran,
Can you please gather more information about the crash following these
instructions:
https://github.com/pmacct/pmacct/blob/master/QUICKSTART#L2876-#L2896
Output from either a gdb back trace or valgrind would be of help.
Paolo
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists