snmpd is segfaulting when -DALL is specified. After searching through
the mail archives, I found Dave Shield's patch at
http://www.mail-archive.com/[email protected]/msg08966.html
I applied this patch and snmpd continued past register_mib() but then
segfaulted on _callback_lock().
Any assistance would be appreciated.
System Information
==================
OS: Solaris 9 (sparc)
NetSNMP: 5.3.1pre2
gcc: 3.4.2
Original Backtrace (no patch)
=============================
bash-2.05# gdb /usr/local/sbin/snmpd
GNU gdb 6.0
Copyright 2003 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 "sparc-sun-solaris2.9"...
(gdb) run -f -Le -C -c /etc/snmpd.conf -DALL
Starting program: /usr/local/sbin/snmpd -f -Le -C -c /etc/snmpd.conf -DALL
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting APP:1 = 0/False
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting LIB:11 = 1/True
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting APP:1 = 0/False
trace: netsnmp_register_handler(): agent_handler.c, 212:
handler::register: Registering (::null) at .0
trace: netsnmp_inject_handler_before(): agent_handler.c, 342:
handler:inject: injecting bulk_to_next before null
trace: netsnmp_register_mib(): agent_registry.c, 606:
register_mib: registering "" at .0
Program received signal SIGSEGV, Segmentation fault.
0xfecb44d8 in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0 0xfecb44d8 in strlen () from /usr/lib/libc.so.1
#1 0xfed06ab4 in _doprnt () from /usr/lib/libc.so.1
#2 0xfed08af8 in vsnprintf () from /usr/lib/libc.so.1
#3 0xff154314 in snmp_vlog (priority=7,
format=0x400 <Address 0x400 out of bounds>, ap=0xff263e10)
at snmp_logging.c:1171
(gdb) list
1171 length = vsnprintf(buffer, LOGLENGTH, format, ap);
1172
1173 if (length == 0)
1174 return (0); /* Empty string */
1175
1176 if (length == -1) {
1177 snmp_log_string(LOG_ERR, "Could not format log-string\n");
1178 return (-1);
1179 }
1180
Backtrace with Dave Shield's patch
==================================
bash-2.05# gdb /usr/local/sbin/snmpd
GNU gdb 6.0
Copyright 2003 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 "sparc-sun-solaris2.9"...
(gdb) run -f -Le -DALL -C c /etc/snmpd.conf
Starting program: /usr/local/sbin/snmpd -f -Le -DALL -C c /etc/snmpd.conf
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting LIB:6 = 1/True
trace: main(): snmpd.c, 815:
snmpd/main: optind 5, argc 7
trace: netsnmp_ds_set_string(): default_store.c, 283:
netsnmp_ds_set_string: Setting APP:2 = "c"
trace: netsnmp_ds_set_string(): default_store.c, 283:
netsnmp_ds_set_string: Setting APP:2 = "c,/etc/snmpd.conf"
trace: main(): snmpd.c, 836:
snmpd/main: port spec: c,/etc/snmpd.conf
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting APP:1 = 0/False
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting LIB:11 = 1/True
trace: netsnmp_ds_set_boolean(): default_store.c, 205:
netsnmp_ds_set_boolean: Setting APP:1 = 0/False
trace: netsnmp_register_handler(): agent_handler.c, 212:
handler::register: Registering (::null) at .0
trace: netsnmp_inject_handler_before(): agent_handler.c, 342:
handler:inject: injecting bulk_to_next before null
trace: netsnmp_register_mib(): agent_registry.c, 606:
register_mib: registering "" at .0 with context "(null)"
trace: netsnmp_subtree_find_first(): agent_registry.c, 152:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 161:
subtree: didn't find a subtree for context: ""
trace: netsnmp_register_handler(): agent_handler.c, 212:
handler::register: Registering (::null) at .0
trace: netsnmp_inject_handler_before(): agent_handler.c, 342:
handler:inject: injecting bulk_to_next before null
trace: netsnmp_register_mib(): agent_registry.c, 606:
register_mib: registering "" at .0 with context "(null)"
trace: netsnmp_subtree_find_first(): agent_registry.c, 152:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 161:
subtree: didn't find a subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 152:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 161:
subtree: didn't find a subtree for context: ""
trace: netsnmp_subtree_find_prev(): agent_registry.c, 1488:
wtest: oid in: .0
trace: netsnmp_subtree_find_first(): agent_registry.c, 152:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 161:
subtree: didn't find a subtree for context: ""
trace: netsnmp_subtree_find_prev(): agent_registry.c, 1488:
wtest: oid in: .0
trace: netsnmp_subtree_find_first(): agent_registry.c, 152:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 161:
subtree: didn't find a subtree for context: ""
trace: netsnmp_subtree_find_prev(): agent_registry.c, 1488:
wtest: oid in: .0
trace: add_subtree(): agent_registry.c, 179:
subtree: adding subtree for context: ""
trace: init_callbacks(): callback.c, 174:
callback: initialized
trace: _callback_lock(): callback.c, 118:
9:callback:lock:
Program received signal SIGSEGV, Segmentation fault.
0xfecb44d8 in strlen () from /usr/lib/libc.so.1
(gdb) where
#0 0xfecb44d8 in strlen () from /usr/lib/libc.so.1
#1 0xfed06ab4 in _doprnt () from /usr/lib/libc.so.1
#2 0xfed08af8 in vsnprintf () from /usr/lib/libc.so.1
#3 0xff154314 in snmp_vlog (priority=7,
format=0x400 <Address 0x400 out of bounds>, ap=0xff181150)
at snmp_logging.c:1171
(gdb) list
1171 length = vsnprintf(buffer, LOGLENGTH, format, ap);
1172
1173 if (length == 0)
1174 return (0); /* Empty string */
1175
1176 if (length == -1) {
1177 snmp_log_string(LOG_ERR, "Could not format log-string\n");
1178 return (-1);
1179 }
1180
Thanks,
John Clinton
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders