Re: Net-SNMP 5.6.rc1 available for testing

Mishustin Kirill <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
22.12.2010 15:26, Bart Van Assche wrote:

> That's interesting. Can you please run the entire snmpd (open source
> code + your MIB) through Valgrind (first through memcheck, next through
> Helgrind and/or DRD) ? The output of these tools should allow to find
> out what is causing threads to stop unexpectedly.

Done it. I can't see anything suspicious in logs from valgrind, but I've 
never used this tool before, so, maybe someone more expirienced will 
make something out of it.

I attached logs from memcheck and helgrind, and also source for my agent 
module.
In 5.6.rc1, I see only one string in that file I open in module, but it 
should write that string every second (And it does that in 5.4.2.1).

Thanks in advance for any help.

Kirill.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
helgrind.log (text/x-log, 5.2 KB)
==11962== Helgrind, a thread error detector
==11962== Copyright (C) 2007-2010, and GNU GPL'd, by OpenWorks LLP et al.
==11962== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==11962== Command: ./snmpd -c /home/kovarny/home/Work/4/net-snmp-5.6.1.rc1/agent/snmpd.conf
==11962== Parent PID: 11961
==11962== 
--11962-- 
--11962-- Valgrind options:
--11962--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--11962--    --tool=helgrind
--11962--    -v
--11962--    --log-file=/home/kovarny/home/Work/4/%p-log
--11962-- Contents of /proc/version:
--11962--   Linux version 2.6.32-3-686 (Debian 2.6.32-9) ([email protected]) (gcc version 4.3.4 (Debian 4.3.4-8) ) #1 SMP Thu Feb 25 06:14:20 UTC 2010
--11962-- Arch and hwcaps: X86, x86-sse1-sse2
--11962-- Page sizes: currently 4096, max supported 4096
--11962-- Valgrind library directory: /usr/lib/valgrind
--11962-- Reading syms from /lib/ld-2.11.2.so (0x4000000)
--11962--   Considering /lib/ld-2.11.2.so ..
--11962--   .. CRC mismatch (computed a4915861 wanted 0462c1f5)
--11962--   Considering /usr/lib/debug/lib/ld-2.11.2.so ..
--11962--   .. CRC is valid
--11962-- Reading syms from /home/kovarny/home/Work/4/net-snmp-5.6.1.rc1/agent/snmpd (0x8048000)
--11962-- Reading syms from /usr/lib/valgrind/helgrind-x86-linux (0x38000000)
--11962--    object doesn't have a dynamic symbol table
--11962-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--11962-- Reading suppressions file: /usr/lib/valgrind/default.supp
--11962-- Reading syms from /usr/lib/valgrind/vgpreload_core-x86-linux.so (0x401f000)
--11962-- Reading syms from /usr/lib/valgrind/vgpreload_helgrind-x86-linux.so (0x4021000)
--11962-- REDIR: 0x40160c0 (index) redirected to 0x40270cd (index)
--11962-- REDIR: 0x40162a0 (strlen) redirected to 0x4027178 (strlen)
--11962-- Reading syms from /lib/i686/cmov/libdl-2.11.2.so (0x4041000)
--11962--   Considering /lib/i686/cmov/libdl-2.11.2.so ..
--11962--   .. CRC mismatch (computed f1b62628 wanted 22ba0eb5)
--11962--   Considering /usr/lib/debug/lib/i686/cmov/libdl-2.11.2.so ..
--11962--   .. CRC is valid
--11962-- Reading syms from /lib/i686/cmov/libc-2.11.2.so (0x4046000)
--11962--   Considering /lib/i686/cmov/libc-2.11.2.so ..
--11962--   .. CRC mismatch (computed fc60a6e3 wanted 7f6d3e93)
--11962--   Considering /usr/lib/debug/lib/i686/cmov/libc-2.11.2.so ..
--11962--   .. CRC is valid
--11962-- Reading syms from /lib/i686/cmov/libpthread-2.11.2.so (0x418c000)
--11962--   Considering /lib/i686/cmov/libpthread-2.11.2.so ..
--11962--   .. CRC mismatch (computed 73226651 wanted 1f7e233b)
--11962--   Considering /usr/lib/debug/lib/i686/cmov/libpthread-2.11.2.so ..
--11962--   .. CRC is valid
--11962-- REDIR: 0x40b8cc0 (index) redirected to 0x402706d (index)
--11962-- REDIR: 0x40b5c30 (malloc) redirected to 0x402440b (malloc)
--11962-- REDIR: 0x40baad0 (memcpy) redirected to 0x40272c0 (memcpy)
--11962-- REDIR: 0x40b5350 (calloc) redirected to 0x40236ef (calloc)
--11962-- REDIR: 0x40b93d0 (strlen) redirected to 0x401f42c (_vgnU_ifunc_wrapper)
--11962-- REDIR: 0x40b9410 (__strlen_sse2) redirected to 0x402715d (strlen)
--11962-- REDIR: 0x40b8ea0 (strcpy) redirected to 0x40271ae (strcpy)
--11962-- REDIR: 0x40b8e30 (strcmp) redirected to 0x40271d6 (strcmp)
--11962-- REDIR: 0x40b5b50 (free) redirected to 0x4024025 (free)
==11962== Warning: noted but unhandled ioctl 0x8946 with no size/direction hints
==11962==    This could cause spurious value errors to appear.
==11962==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==11962== Warning: noted but unhandled ioctl 0x8946 with no size/direction hints
==11962==    This could cause spurious value errors to appear.
==11962==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==11962== Warning: noted but unhandled ioctl 0x8946 with no size/direction hints
==11962==    This could cause spurious value errors to appear.
==11962==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
--11962-- REDIR: 0x4191d00 (pthread_create@@GLIBC_2.1) redirected to 0x4028698 (pthread_create@*)
--11962-- REDIR: 0x40b6bb0 (realloc) redirected to 0x40244ba (realloc)
--11962-- REDIR: 0x41956f0 (pthread_rwlock_wrlock) redirected to 0x4026544 (pthread_rwlock_wrlock)
--11962-- REDIR: 0x4195a40 (pthread_rwlock_unlock) redirected to 0x4026a46 (pthread_rwlock_unlock)
--11962-- REDIR: 0x4193e10 (pthread_mutex_lock) redirected to 0x402533f (pthread_mutex_lock)
--11962-- REDIR: 0x4195300 (pthread_mutex_unlock) redirected to 0x402570f (pthread_mutex_unlock)
--11975-- REDIR: 0x4193e10 (pthread_mutex_lock) redirected to 0x402533f (pthread_mutex_lock)
--11975-- REDIR: 0x4195300 (pthread_mutex_unlock) redirected to 0x402570f (pthread_mutex_unlock)
==11962== 
==11962== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 5)
--11962-- 
--11962-- used_suppression:      6 helgrind-glibc2X-004
==11962== 
==11962== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 5)
==11975== 
==11975== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 9 from 8)
--11975-- 
--11975-- used_suppression:      9 helgrind-glibc2X-004
==11975== 
==11975== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 9 from 8)
memcheck.log (text/x-log, 7.7 KB)
==12025== Memcheck, a memory error detector
==12025== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==12025== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==12025== Command: ./snmpd -c /home/kovarny/home/Work/4/net-snmp-5.6.1.rc1/agent/snmpd.conf
==12025== Parent PID: 12024
==12025== 
--12025-- 
--12025-- Valgrind options:
--12025--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--12025--    -v
--12025--    --log-file=/home/kovarny/home/Work/4/%p-log
--12025-- Contents of /proc/version:
--12025--   Linux version 2.6.32-3-686 (Debian 2.6.32-9) ([email protected]) (gcc version 4.3.4 (Debian 4.3.4-8) ) #1 SMP Thu Feb 25 06:14:20 UTC 2010
--12025-- Arch and hwcaps: X86, x86-sse1-sse2
--12025-- Page sizes: currently 4096, max supported 4096
--12025-- Valgrind library directory: /usr/lib/valgrind
--12025-- Reading syms from /lib/ld-2.11.2.so (0x4000000)
--12025--   Considering /lib/ld-2.11.2.so ..
--12025--   .. CRC mismatch (computed a4915861 wanted 0462c1f5)
--12025--   Considering /usr/lib/debug/lib/ld-2.11.2.so ..
--12025--   .. CRC is valid
--12025-- Reading syms from /home/kovarny/home/Work/4/net-snmp-5.6.1.rc1/agent/snmpd (0x8048000)
--12025-- Reading syms from /usr/lib/valgrind/memcheck-x86-linux (0x38000000)
--12025--    object doesn't have a dynamic symbol table
--12025-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--12025-- Reading suppressions file: /usr/lib/valgrind/default.supp
--12025-- REDIR: 0x40160c0 (index) redirected to 0x3803eda3 (vgPlain_x86_linux_REDIR_FOR_index)
--12025-- Reading syms from /usr/lib/valgrind/vgpreload_core-x86-linux.so (0x401f000)
--12025-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so (0x4021000)
==12025== WARNING: new redirection conflicts with existing -- ignoring it
--12025--     new: 0x040160c0 (index               ) R-> 0x04024cb0 index
--12025-- REDIR: 0x40162a0 (strlen) redirected to 0x40250f0 (strlen)
--12025-- Reading syms from /lib/i686/cmov/libdl-2.11.2.so (0x403e000)
--12025--   Considering /lib/i686/cmov/libdl-2.11.2.so ..
--12025--   .. CRC mismatch (computed f1b62628 wanted 22ba0eb5)
--12025--   Considering /usr/lib/debug/lib/i686/cmov/libdl-2.11.2.so ..
--12025--   .. CRC is valid
--12025-- Reading syms from /lib/i686/cmov/libc-2.11.2.so (0x4043000)
--12025--   Considering /lib/i686/cmov/libc-2.11.2.so ..
--12025--   .. CRC mismatch (computed fc60a6e3 wanted 7f6d3e93)
--12025--   Considering /usr/lib/debug/lib/i686/cmov/libc-2.11.2.so ..
--12025--   .. CRC is valid
--12025-- Reading syms from /lib/i686/cmov/libpthread-2.11.2.so (0x4189000)
--12025--   Considering /lib/i686/cmov/libpthread-2.11.2.so ..
--12025--   .. CRC mismatch (computed 73226651 wanted 1f7e233b)
--12025--   Considering /usr/lib/debug/lib/i686/cmov/libpthread-2.11.2.so ..
--12025--   .. CRC is valid
--12025-- REDIR: 0x40b5cc0 (index) redirected to 0x4024c20 (index)
--12025-- REDIR: 0x40b70d0 (memchr) redirected to 0x4025830 (memchr)
--12025-- REDIR: 0x40b6840 (rindex) redirected to 0x4024b60 (rindex)
--12025-- REDIR: 0x40b6760 (strncpy) redirected to 0x40252f0 (strncpy)
--12025-- REDIR: 0x40b6490 (__GI_strlen) redirected to 0x40250d0 (__GI_strlen)
--12025-- REDIR: 0x40b2c30 (malloc) redirected to 0x4023ecb (malloc)
--12025-- REDIR: 0x40b7ad0 (memcpy) redirected to 0x4025870 (memcpy)
--12025-- REDIR: 0x40b2350 (calloc) redirected to 0x40231af (calloc)
--12025-- REDIR: 0x40b63d0 (strlen) redirected to 0x401f42c (_vgnU_ifunc_wrapper)
--12025-- REDIR: 0x40b6410 (__strlen_sse2) redirected to 0x40250b0 (strlen)
--12025-- REDIR: 0x40b5ea0 (strcpy) redirected to 0x4025130 (strcpy)
--12025-- REDIR: 0x40b5e30 (strcmp) redirected to 0x40256b0 (strcmp)
--12025-- REDIR: 0x40b2b50 (free) redirected to 0x4023ae5 (free)
--12025-- REDIR: 0x40b7560 (memmove) redirected to 0x4026510 (memmove)
--12025-- REDIR: 0x40b8e00 (strchrnul) redirected to 0x4026590 (strchrnul)
--12025-- REDIR: 0x40b7630 (mempcpy) redirected to 0x4026600 (mempcpy)
--12025-- REDIR: 0x40b6680 (strncmp) redirected to 0x40255d0 (strncmp)
--12025-- REDIR: 0x40b8d30 (rawmemchr) redirected to 0x40265c0 (rawmemchr)
==12025== Warning: noted but unhandled ioctl 0x8946 with no size/direction hints
==12025==    This could cause spurious value errors to appear.
==12025==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==12025== Warning: noted but unhandled ioctl 0x8946 with no size/direction hints
==12025==    This could cause spurious value errors to appear.
==12025==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==12025== Warning: noted but unhandled ioctl 0x8946 with no size/direction hints
==12025==    This could cause spurious value errors to appear.
==12025==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
--12025-- REDIR: 0x40b3bb0 (realloc) redirected to 0x4023f7a (realloc)
--12025-- REDIR: 0x40b5b10 (strcat) redirected to 0x4024d40 (strcat)
--12025-- REDIR: 0x40b77c0 (stpcpy) redirected to 0x4026120 (stpcpy)
--12025-- REDIR: 0x40b6550 (strnlen) redirected to 0x4025030 (strnlen)
--12025-- REDIR: 0x40b75d0 (memset) redirected to 0x40264a0 (memset)
==12025== 
==12025== HEAP SUMMARY:
==12025==     in use at exit: 466,468 bytes in 11,639 blocks
==12025==   total heap usage: 12,906 allocs, 1,267 frees, 541,210 bytes allocated
==12025== 
==12025== Searching for pointers to 11,639 not-freed blocks
==12032== 
==12032== HEAP SUMMARY:
==12032==     in use at exit: 466,332 bytes in 11,638 blocks
==12032==   total heap usage: 12,906 allocs, 1,268 frees, 541,210 bytes allocated
==12032== 
==12032== Searching for pointers to 11,638 not-freed blocks
==12025== Checked 9,299,428 bytes
==12025== 
==12025== LEAK SUMMARY:
==12025==    definitely lost: 0 bytes in 0 blocks
==12025==    indirectly lost: 0 bytes in 0 blocks
==12025==      possibly lost: 136 bytes in 1 blocks
==12025==    still reachable: 466,332 bytes in 11,638 blocks
==12025==         suppressed: 0 bytes in 0 blocks
==12025== Rerun with --leak-check=full to see details of leaked memory
==12025== 
==12025== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 7)
--12025-- 
--12025-- used_suppression:     16 dl-hack3-cond-1
==12025== 
==12025== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 7)
==12032== Checked 911,512 bytes
==12032== 
==12032== LEAK SUMMARY:
==12032==    definitely lost: 0 bytes in 0 blocks
==12032==    indirectly lost: 0 bytes in 0 blocks
==12032==      possibly lost: 0 bytes in 0 blocks
==12032==    still reachable: 466,332 bytes in 11,638 blocks
==12032==         suppressed: 0 bytes in 0 blocks
==12032== Rerun with --leak-check=full to see details of leaked memory
==12032== 
==12032== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 7)
--12032-- 
--12032-- used_suppression:     16 dl-hack3-cond-1
==12032== 
==12032== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 7)
==12033== 
==12033== HEAP SUMMARY:
==12033==     in use at exit: 144,711 bytes in 699 blocks
==12033==   total heap usage: 13,435 allocs, 12,736 frees, 641,759 bytes allocated
==12033== 
==12033== Searching for pointers to 699 not-freed blocks
==12033== Checked 538,388 bytes
==12033== 
==12033== LEAK SUMMARY:
==12033==    definitely lost: 5,702 bytes in 283 blocks
==12033==    indirectly lost: 47,079 bytes in 107 blocks
==12033==      possibly lost: 0 bytes in 0 blocks
==12033==    still reachable: 91,930 bytes in 309 blocks
==12033==         suppressed: 0 bytes in 0 blocks
==12033== Rerun with --leak-check=full to see details of leaked memory
==12033== 
==12033== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 7)
--12033-- 
--12033-- used_suppression:     16 dl-hack3-cond-1
==12033== 
==12033== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 7)
thread_test.c (text/x-csrc, 673 B)
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>

#include "thread_test.h"

int already_done = 0;

pthread_t test_thread;
FILE *fl = NULL;

void init_thread_test(void)
{
	snmp_log(LOG_INFO, "%s started\n", __FUNCTION__);
	fl = fopen("/home/kovarny/logs/threadtest.log", "w");
	setvbuf(fl, NULL, _IONBF, BUFSIZ);
	if (!already_done)
	{
		already_done = 1;
		pthread_create(&test_thread, NULL, &mf_proc, NULL);
	}
}

void mf_proc(void)
{
	struct timeval to;
	while (1)
	{
		fprintf(fl, "Test thread in progress\n");
		to.tv_sec = 1;
		to.tv_usec = 0;
		select(0, NULL, NULL, NULL, &to);
	}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.