Menu

#1944 FreeBSD / AMD64 HUP Signal 5.3.2 Crash in log_handler_file()

open
nobody
agent (1105)
5
2014-12-15
2008-04-14
Anonymous
No

This crash happens at the top of the hour when newsyslog(8) SIGHUP's the agent.

Oddly, the agent is configured to log via syslog. There really isn't any reason why log_handler_file() should get called.

[seklecki@bdb00 /foo]$ sudo gdb /usr/local/sbin/snmpd /foo/snmpd.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `snmpd'.
Program terminated with signal 3, Quit.
Reading symbols from /usr/local/lib/libnetsnmpmibs.so.10...done.
Loaded symbols for /usr/local/lib/libnetsnmpmibs.so.10
Reading symbols from /usr/local/lib/libnetsnmpagent.so.10...done.
Loaded symbols for /usr/local/lib/libnetsnmpagent.so.10
Reading symbols from /usr/local/lib/libnetsnmphelpers.so.10...done.
Loaded symbols for /usr/local/lib/libnetsnmphelpers.so.10
Reading symbols from /usr/lib/libwrap.so.4...done.
Loaded symbols for /usr/lib/libwrap.so.4
Reading symbols from /usr/local/lib/libnetsnmp.so.10...done.
Loaded symbols for /usr/local/lib/libnetsnmp.so.10
Reading symbols from /lib/libcrypto.so.4...done.
Loaded symbols for /lib/libcrypto.so.4
Reading symbols from /lib/libkvm.so.3...done.
Loaded symbols for /lib/libkvm.so.3
Reading symbols from /lib/libdevstat.so.5...done.
Loaded symbols for /lib/libdevstat.so.5
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
Reading symbols from /lib/libm.so.4...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /lib/libcrypt.so.3...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libutil.so.5...done.
Loaded symbols for /lib/libutil.so.5
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x000000007e7f8a2c in write () from /lib/libc.so.6
(gdb) bt
#0 0x000000007e7f8a2c in write () from /lib/libc.so.6
#1 0x000000007e7f8350 in __swrite () from /lib/libc.so.6
#2 0x000000007e7f8464 in _swrite () from /lib/libc.so.6
#3 0x000000007e7f78ad in __sflush () from /lib/libc.so.6
#4 0x000000007e7f77c8 in fflush () from /lib/libc.so.6
#5 0x000000007dbe68f2 in log_handler_file (logh=0x509080, pri=7, str=0x7fffffffb250 "compare:index: ") at snmp_logging.c:1081
#6 0x000000007dbe6a37 in snmp_log_string (priority=7, str=0x7fffffffb250 "compare:index: ") at snmp_logging.c:1143
#7 0x000000007dbe6b10 in snmp_vlog (priority=7, format=0x7dc1b828 "%s: ", ap=0x7fffffffb690) at snmp_logging.c:1209
#8 0x000000007dbe3605 in debugmsg (token=0x7dc20d35 "compare:index", format=0x7dc1b828 "%s: ") at snmp_debug.c:334
#9 0x000000007dbe3dbc in debugmsgtoken (token=0x7dc20d35 "compare:index", format=0x7dc20d43 "compare ") at snmp_debug.c:529
#10 0x000000007dc0d7e3 in netsnmp_compare_netsnmp_index (lhs=0x6ed540, rhs=0x6ed5a0) at container.c:422
#11 0x000000007dc0dcdc in array_qsort (data=0x6ff000, first=0, last=3, f=0x7dc0d750 <netsnmp\_compare\_netsnmp\_index>) at container_binary_array.c:69
#12 0x000000007dc0ddd3 in array_qsort (data=0x6ff000, first=0, last=6, f=0x7dc0d750 <netsnmp\_compare\_netsnmp\_index>) at container_binary_array.c:89
#13 0x000000007dc0ded0 in Sort_Array (c=0x64b600) at container_binary_array.c:110
#14 0x000000007dc0e5bd in netsnmp_binary_array_get (c=0x64b600, key=0x7fffffffb9d0, exact=1) at container_binary_array.c:241
#15 0x000000007dc0e562 in _ba_find (container=0x64b600, data=0x7fffffffb9d0) at container_binary_array.c:513
#16 0x000000007d9756fe in netsnmp_tdata_row_get_byoid (table=0x63c500, searchfor=0x0, searchfor_len=0) at table_tdata.c:469
#17 0x000000007d6b80d3 in mteObjects_createEntry (owner=0x7d6cf8f3 "snmpd.conf", oname=0x7fffffffcda0 "_BdskTable", index=2, flags=20) at disman/event/mteObjects.c:154
#18 0x000000007d6b8210 in mteObjects_addOID (owner=0x7d6cf8f3 "snmpd.conf", oname=0x7fffffffcda0 "_BdskTable", index=2, oid_name_buf=0x7fffffffcdd0 "dskErrorMsg", wild=1)
at disman/event/mteObjects.c:207
#19 0x000000007d6af255 in parse_mteMonitor (token=0x7d6cf78b "monitor", line=0x7d6cfec8 "-o dskPath -o dskErrorMsg \"dskTable\" dskErrorFlag != 0") at disman/event/mteTriggerConf.c:378
#20 0x000000007d6b071e in parse_default_mteMonitors (token=0x7fffffffe090 "defaultMonitors", line=0x7fffffffe4a0 "yes") at disman/event/mteTriggerConf.c:761
#21 0x000000007dbdf2ea in run_config_handler (lptr=0x632d00, token=0x7fffffffe090 "defaultMonitors", cptr=0x7fffffffe4a0 "yes", when=0) at read_config.c:506
#22 0x000000007dbe014a in read_config (filename=0x7fffffffe960 "/usr/local/etc/snmp/snmpd.conf", line_handler=0x509100, when=0) at read_config.c:796
#23 0x000000007dbe0f0e in read_config_files_in_path (path=0x64cb80 "/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:/home/smcafee/.snmp", ctmp=0x50b100, when=0,
perspath=0x652410 "/var/net-snmp", persfile=0x0) at read_config.c:1118
#24 0x000000007dbe1057 in read_config_files (when=0) at read_config.c:1199
#25 0x000000007dbe0567 in read_configs () at read_config.c:864
#26 0x000000007dbbb7cb in init_snmp (type=0x406418 "snmpd") at snmp_api.c:839
#27 0x0000000000404886 in main (argc=4, argv=0x7fffffffecb0) at snmpd.c:905

Command line:

root 83067 0.0 0.8 46440 31528 ?? S Fri01PM 3:10.14 /usr/local/sbin/snmpd -p /var/run/snmpd.pid -a -Ls 3

Conf file:

$ more /usr/local/etc/snmp/snmpd.conf
rocommunity [string]
trapsink snmp-traps.admin [string]

sysname bdb00.bdb
engineId bdb00.bdb

syslocation "Pittsburgh Data Center"
syscontact "BOFH bofh@gtld.tld"

agentAddress udp:1.2.3.4:161
AgentXSocket udp:localhost:705
smuxsocket tcp:127.0.0.1:199

proc usbd 1 1
proc devd 1 1
proc cron 3 1
proc sshd 20 1
proc ntpd 2 2
proc syslog-ng 2 1
proc sendmail 5 1
proc snmpd 5 1
proc nrpe2 4 1

proc postgres 1000 1

disk / 10%
disk /var 10%
disk /var/log 10%
disk /usr 10%
disk /opt 10%
disk /tmp 10%
disk /var/db/pgsql 20%

load 12 14 14

agentSecName internal
rouser internal

defaultMonitors yes

Discussion


Log in to post a comment.