My Net-SNMP version and configuration info is below.  I also attached
some information about my system.

$ net-snmp-config --version
5.4.2.1

$ net-snmp-config --configure-options
 '--prefix=/usr' '--build=x86_64-pc-linux-gnu'
'--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc'
'--localstatedir=/var/lib' '--libdir=/usr/lib64'
'--with-install-prefix=/home/tmp/portage/net-analyzer/net-snmp-5.4.2.1-r1/image/'
'--with-sys-location=Unknown' '--with-sys-contact=r...@unknown'
'--with-default-snmp-version=3' '--with-mib-modules=host
ucd-snmp/dlmod' '--with-logfile=/var/log/net-snmpd.log'
'--with-persistent-directory=/var/lib/net-snmp'
'--enable-ucd-snmp-compatibility' '--enable-shared'
'--enable-as-needed' '--disable-mfd-rewrites' '--enable-embedded-perl'
'--enable-ipv6' '--disable-internal-md5' '--with-openssl'
'--with-libwrap' '--without-rpm' '--without-bzip2' '--without-zlib'
'--without-elf' '--with-python-modules'
'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu'
'CFLAGS= -march=nocona -O2 -pipe -ggdb' 'LDFLAGS=-Wl,-O1'


---------------------------------------------------------
            Net-SNMP configuration summary:
---------------------------------------------------------

  SNMP Versions Supported:    1 2c 3
  UCD-SNMP compatability:     enabled
  Net-SNMP Version:           5.4.2.1
  Building for:               linux
  Network transport support:  Callback Unix TCP UDP TCPIPv6 UDPIPv6
  SNMPv3 Security Modules:     usm
  Agent MIB code:             host ucd-snmp/dlmod default_modules =>
host/hr_system host/hr_storage host/hr_device host/hr_other
host/hr_proc host/hr_network host/hr_print host/hr_disk
host/hr_partition host/hr_filesys host/hr_swrun host/hr_swinst
snmpv3mibs mibII ucd_snmp notification notification-log-mib target
agent_mibs agentx disman/event disman/schedule utilities host
  Embedded Perl support:      enabled
  SNMP Perl modules:          building -- embeddable
  SNMP Python modules:        building for /usr/bin/python
  Authentication support:     MD5 SHA1
  Encryption support:         DES AES

---------------------------------------------------------



On Fri, Jun 4, 2010 at 14:17, Bart Van Assche <[email protected]> wrote:
> On Fri, Jun 4, 2010 at 1:34 AM, Brendan Tauras <[email protected]> wrote:
>>
>> Thank you for the advice.  It helped me learn more about the Net-SNMP
>> library, but unfortunately it did not solve the issue with
>> uninitialized syscall data.
>>
>> I used memset() to initialize the "struct snmp_session" before passing
>> it to snmp_sess_init(), but I cannot memset() the "struct snmp_pdu"
>> because it is allocated and initialized by snmp_pdu_create() before I
>> can do any initialization.
>>
>> I also tried adding null byte padding to the end of the character
>> arrays pointed to in the "hosts" and "oids" arrays in the async app (
>> http://www.net-snmp.org/wiki/index.php/TUT:Simple_Async_Application ).
>>  The initialization did not stop the valgrind errors (see attached
>> files asyncapp.c and gdb.log).
>>
>> I think in the function header in snmpUDPDomain.c:184:
>>
>> static int netsnmp_udp_send(netsnmp_transport *t, void *buf, int size,
>> void **opaque, int *olength)
>>
>> "void *buf" is actually a "struct snmp_session *"/"netsnmp_session *",
>> but I do not know what type "void **opaque" is.  I noticed that the
>> "peername" pointer in "buf" is invalid when examining with gdb (see
>> attached file gdb.log) :
>>
>> peername = 0x114c10000 <Address 0x114c10000 out of bounds>
>>
>> Here's the valgrind error message again from the asynchronous context
>> in case you have any other thoughts:
>>
>> ==798== 8 errors in context 2 of 7:
>> ==798== Syscall param ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ
>> points to uninitialised byte(s)
>> ==798==    at 0x51C2A60: __sendmsg_nocancel (in /lib64/libc-2.10.1.so)
>> ==798==    by 0x4E8BB0F: netsnmp_udp_send (snmpUDPDomain.c:184)
>> ==798==    by 0x4E60AB2: snmp_sess_async_send (snmp_api.c:4862)
>> ==798==    by 0x401315: asynch_response (asyncapp.c:188)
>> ==798==    by 0x4E64BB0: _sess_process_packet (snmp_api.c:5239)
>> ==798==    by 0x4E669B3: _sess_read (snmp_api.c:5742)
>> ==798==    by 0x4E671B0: snmp_sess_read (snmp_api.c:5761)
>> ==798==    by 0x4E671F1: snmp_read (snmp_api.c:5378)
>> ==798==    by 0x401045: asynchronous (asyncapp.c:254)
>> ==798==    by 0x4014E4: main (asyncapp.c:276)
>> ==798==  Address 0x7fefff6c8 is on thread 1's stack
>> ==798==  Uninitialised value was created by a stack allocation
>> ==798==    at 0x4E8B9A2: netsnmp_udp_send (snmpUDPDomain.c:246)
>
> With which Net-SNMP version did this occur ?
>
> Bart.
>
Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.10.1-r1, 
2.6.32-gentoo-r7 x86_64)
=================================================================
System uname: 
linux-2.6.32-gentoo-r7-x86_64-intel-r-_core-tm-2_duo_cpu_t95...@_2.60ghz-with-gentoo-1.12.13
Timestamp of tree: Sat, 05 Jun 2010 16:15:01 +0000
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r2
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -...@eula dlj-1.1 PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ 
/etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d 
/etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d 
/etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=nocona -O2 -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch 
protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans 
userfetch"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo 
http://gentoo.cites.uiuc.edu/pub/gentoo/ http://gentoo.osuosl.org/ 
http://open-systems.ufl.edu/mirrors/gentoo/ 
http://gentoo.mirrors.tds.net/gentoo/";
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress 
--force --whole-file --delete --stats --timeout=180 --exclude=/distfiles 
--exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync21.us.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext acl acpi alsa amd64 berkdb bzip2 cli cracklib crypt cups 
custom-cflags custom-cpuopts custom-cxxflags custom-optimization cxx dbus dri 
fortran gdbm gpm hal hardened iconv ipv6 mmx mmxext modules mudflap multilib 
ncurses nls nptl nptlonly nvidia opengl openmp pam pcre perl pppd python 
qt3support readline reflection sdl session spl sse sse2 ssl ssse3 sysfs tcpd 
threads unicode vmx xinerama xorg zlib" ALSA_CARDS="hda-intel intel8x0 
intel8x0m usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop 
empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul 
mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions 
alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file 
authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user 
autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires 
ext_filter file_cache filter headers include info log_config logio mem_cache 
mime mime_magic negotiation rewrite setenvif speling status unique_id userdir 
usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse 
synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 
lb216 lcdm001 mtxorb ncurses text" QEMU_SOFTMMU_TARGETS="i386 x86_64" 
QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" 
VIDEO_CARDS="nvidia fbdev vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 
ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal 
rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, 
LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, 
PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to