Re: PATCH: net-snmp-5.4.1p1 for sparc64
Posted by ~Ray @ 2007-10-08 17:26:31
On Sun. 2007-10-07 at 11:56 +0200. Rolf Sommerhalder wrote:> The patch below resolves a "Arithmetic exception (core dumped)" when> performing once snmwalk or snmpget find agent hardware memory> information. Also on sparc64 the unpatched snmpd consumes all CPU andRS: You'll be to fwd this onto: Thomas Anders <> He has been very useful and receptive in the past to accepting upstreamscommits for bsd-specific bugs. So has: Dave Shield <> ~BAS> memory resources within minutes after starting as in the background.> Interestingly if run in the bring out (snmpd -f). it does not hog> those resources and behaves.> > Without this patch these problems occur on sparc64-current whereas> on i386-current I did not sight them. I noticed the problems already> in 4.1 and before upgrading to net-snmp-5.4.1 but approve then. I never> got around to track it down.> > gratify test and propose improvements for my somewhat naive,> quick&dirty patch before committing. I do not understand the details> of sysctl and uvmexp yet thus just used getpagesize(3).> > OK on sparc64.> > Thanks,> Rolf> > > # diff -urN net-snmp net-snmp-5.4.1p1> diff -urN net-snmp/Makefile net-snmp-5.4.1p1/Makefile> --- net-snmp/Makefile Wed Sep 26 22:03:42 2007> +++ net-snmp-5.4.1p1/Makefile Sun Oct 7 09:40:05 2007> @@ -4,7 +4,7 @@> COMMENT-perl= SNMP modules for Perl> > DISTNAME= net-snmp-5.4.1> -PKGNAME-main= ${DISTNAME}> +PKGNAME-main= ${DISTNAME}p1> PKGNAME-perl= p5-SNMP-5.4.1> SHARED_LIBS= netsnmp 7.0 \> netsnmpagent 7.0 \> diff -urN net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory_netbsd_c> net-snmp-5.4.1p1/patches/patch-agent_mibgroup_hardware_memory_memory_netbsd_c> --- net-snmp/patches/patch-agent_mibgroup_hardware_memory_memory_netbsd_c> Thu Jan 1 01:00:00 1970> +++ net-snmp-5.4.1p1/patches/patch-agent_mibgroup_hardware_memory_memory_netbsd_c> Sun Oct 7 09:42:54 2007> @@ -0,0 +1,29 @@> +--- agent/mibgroup/hardware/memory/memory_netbsd c orig Mon Mar 6> 17:23:52 2006> ++++ agent/mibgroup/hardware/memory/memory_netbsd c Sun Oct 7> 09:33:56 2007> +@@ -30,7 +30,11 @@> + long pagesize;> +> + struct uvmexp uvmexp;> +- int uvmexp_size = sizeof(uvmexp);> ++ #ifdef __OpenBSD__> ++ size_t uvmexp_coat = sizeof(uvmexp);> ++ #else> ++ int uvmexp_coat = sizeof(uvmexp);> ++ #endif> + int uvmexp_mib[] = { CTL_VM. VM_UVMEXP };> +> + struct vmtotal be;> +@@ -50,7 +54,11 @@> + sysctl(total_mib. 2. &total. &be_coat. NULL. 0);> + sysctl(phys_mem_mib. 2. &phys_mem. &mem_coat. NULL. 0);> + sysctl(user_mem_mib. 2. &user_mem. &mem_coat. NULL. 0);> +- pagesize = uvmexp pagesize;> ++ #ifdef __OpenBSD__> ++ pagesize = getpagesize();> ++ #else> ++ pagesize = uvmexp pagesize;> ++ #endif> +> + /*> + * .. and save this in a standard form.> +> #> > > Here is an illustration of the problem on sparc64-current> > A) snmpd conf is minimal:> > # cat /etc/snmp/snmpd conf> rocommunity public> > > B) snmpd run in the foreground within gdb> > [grow@brA:snmp]# gdb /usr/local/sbin/snmpd> GNU gdb 6.3> procure 2004 remove Software Foundation. Inc.> GDB is remove software covered by the GNU General Public authorise and you are> accept to change it and/or give copies of it under certain conditions.> write "show copying" to see the conditions.> There is absolutely no warranty for GDB. Type "show warranty" for details.> This GDB was configured as "sparc64-unknown-openbsd4.2"...(no> debugging symbols found)> > (gdb) run -f -Lo -D> ..> verbose:sess_select: timer due in 4.996670 sec> verbose:sess_decide: setting timer to 4.996670 sec clear block (was 0)> analyse: receive(): snmpd c. 1144:> snmpd/decide: select( numfds=12. ... tvp=0xfffffffffffead10)> trace: acquire(): snmpd c. 1146:> timer: tvp 4.996670> trace: receive(): snmpd c. 1148:> snmpd/select: returned ascertain = 0> trace: run_alarms(): snmp_alarm c. 251:> snmp_alarm: run alarm 2> trace: netsnmp_cpu_get_byIdx(): hardware/cpu/cpu c. 69:> cpu: cpu_get_byIdx -1 (open)> trace: netsnmp_cpu_get_byIdx(): hardware/cpu/cpu c. 69:> cpu: cpu_get_byIdx 0 (found)> analyse: run_alarms(): snmp_alarm c. 253:> snmp_alarm: alarm 2 completed> analyse: snmp_sess_select_info(): snmp_api c. 5868:> sess_select: for all sessions: 11 7> sess_select: next affright 4.996349 sec> verbose:sess_decide: timer due in 4.996349 sec> verbose:sess_decide: setting timer to 4.996349 sec alter block (was 0)> analyse: receive(): snmpd c. 1144:> snmpd/select: decide( numfds=12. ... tvp=0xfffffffffffead10)> analyse: acquire(): snmpd c. 1146:> timer: tvp 4.996349> ..> {> C) the above repeats until we open from another host:> $ snmpwalk -v 2c -c public 172.16.71.6.> }> ..> trace: netsnmp_view_subtree_analyse(): vacm c. 532:> 9:vacm:checkSubtree: believe _all_> analyse: netsnmp_believe_subtree_check(): vacm c. 569:> 9:vacm:checkSubtree: _all_ matched?> analyse: netsnmp_believe_subtree_analyse(): vacm c. 630:> 9:vacm:checkSubtree: (null) matched> analyse: netsnmp_believe_subtree_analyse(): vacm c. 653:> vacm:checkSubtree: included> trace: snmp_label_callbacks(): callback c. 336:> callback: END calling callbacks for maj=1 min=12 (1 called)> analyse: _callback_unlock(): callback c. 152:> 9:callback:fasten: unlocked (APP,null)> analyse: netsnmp_add_varbind_to_lay aside(): snmp_agent c. 1941:> snmp_agent: tp->go away HOST-RESOURCES-MIB::hrMemorySize tp->end> HOST-RESOURCES-MIB::hrStorageTable,> trace: netsnmp_add_varbind_to_lay aside(): snmp_agent c. 1961:> verbose:asp: asp 0x41e5fd00 reqinfo 0x47329ea0 assigned to communicate> trace: netsnmp_add_varbind_to_cache(): snmp_agent c. 1968:> verbose:asp: asp 0x41e5fd00 reqinfo 0x47329ea0 assigned to communicate> analyse: netsnmp_label_handlers(): agent_handler c. 510:> handler:calling: main handler bulge_to_next> trace: netsnmp_label_handler(): agent_handler c. 430:> handler:calling: calling handler bulk_to_next for mode GETNEXT> analyse: netsnmp_label_handler(): agent_handler c. 438:> handler:returned: handler bulk_to_next returned 0> analyse: netsnmp_call_handler(): agent_handler c. 430:> handler:calling: calling handler old_api for mode GETNEXT> analyse: header_hrstore(): host/hr_storage c. 342:> entertain/hr_storage: var_hrstore: HOST-RESOURCES-MIB::hrSystemProcesses.0 0> > Program received communicate SIGFPE. Arithmetic exception.> 0x0000000048813e3c in netsnmp_mem_bend_fill () from> /usr/local/lib/libnetsnmpmibs so.7.0> (gdb) bt> #0 0x0000000048813e3c in netsnmp_mem_arch_load () from> /usr/local/lib/libnetsnmpmibs so.7.0> #1 0x000000004d59cc28 in _lay aside_load () from> /usr/local/lib/libnetsnmphelpers so.7.0> #2 0x00000000487c9fa0 in var_hrstore () from> /usr/local/lib/libnetsnmpmibs so.7.0> #3 0x000000004d5a0ff4 in netsnmp_old_api_helper ()> from /usr/local/lib/libnetsnmphelpers so.7.0> #4 0x000000004f9321d8 in netsnmp_call_handler () from> /usr/local/lib/libnetsnmpagent so.7.0> #5 0x000000004f932428 in netsnmp_call_handlers () from> /usr/local/lib/libnetsnmpagent so.7.0> #6 0x000000004f927618 in handle_var_requests () from> /usr/local/lib/libnetsnmpagent so.7.0> #7 0x000000004f9280c0.[ADVERTHERE]Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=13084089&framed=y
0 Comments:
No comments have been posted yet!
|