RE: snmpd 5.4.1 is crashing where 5.4 didn't

Zack Little <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Sorry about not reporting this in a pre-release.  I'll do that from now on.
 
Unfortunately I am not able to run this with a debugger.  I'm running in an embedded Linux environment and can't because of space/availability issues.
 
I've been adding trace messages trying to figure out what is happening and I've got a better understanding of the problem.
 
The code doesn't always blow up in the same spot (or function), but the place it blows up almost always seems to be related to a compare.  Out of nowhere when the crash happens I am seeing very large values for the OID and the LEN of the data being compared for a sort.
 
Here is an example (with my trace messages).  In this case the code blew up when it hit the DEBUGIF("compare:index") trace statements in netsnmp_compare_netsnmp_index().  The statements in [] are comments I added to this email.
 
>From my limited understanding of this code it would appear that the sorting routines are being called with an array element that is one element outside of the bounds of the array.
 
snmp_oid_compare-->enterfrom [netsnmp_compare_netsnmp_index]../../snmplib/snmp_api.c 6323oid in_name1=2044320 len=1 1oid in_name2=2044320 len=1 1hello world../../snmplib/snmp_api.c 6364oid in_name1=2044320 len=1 1oid in_name2=2044320 len=1 1snmp_oid_compare<--exitmessed up by now? array_qsort ../../snmplib/container_binary_array.c 127 f=0xfdff0
[printing first through last......]        data[0] oid=2202536 len=1 len=1        data[1] oid=2044320 len=1 len=1        data[2] oid=2046888 len=1 len=1
[last is 3 and printing data[3] to see if those are the huge values]prob start array_qsort ../../snmplib/container_binary_array.c 137. i=1 j=3 last=3. calling with j        data[3] oid=1075172316 len=2035496 len=2035496 j= 3[they are]
netsnmp_compare_netsnmp_index ../../snmplib/container.c 482lhs 0x1f3198, rhs 0x1f36a8lhs oid=2044320 len=1 len=1rhs oid=1075172316 len=2035496 len=2035496MAX_SUBID 0xffffffff../../snmplib/container.c 507lhs 0x1f3198, rhs 0x1f36a8lhs oid=2044320 len=1 len=1rhs oid=1075172316 len=2035496 len=2035496> Date: Tue, 31 Jul 2007 17:02:00 +0100> From: [email protected]> To: [email protected]> Subject: Re: snmpd 5.4.1 is crashing where 5.4 didn't> CC: [email protected]> > On 31/07/07, Zack Little <[email protected]> wrote:> > Version 5.4 works fine> > for me but I can easily make 5.4.1 crash. I encountered the same thing in> > the pre-releases and was hoping it would be cleared up in the final 5.4.1> > build.> > As a general rule, if yoiu encounter a problem in the pre-releases,> it's definitely worth reporting it. There are hundreds of different> configurations out there, and the core developers only have access> to a tiny fraction of these. If we don't know about a problem, then it's> fairly unlikely that it'll be fixed!> > > > The crash doesn't happen in the same spot. One way to cause it is> > to simply do a "snmpwalk" of the whole tree. That almost always produces a> > crash the first time. I can also do an "snmpwalk" on just "IF". That will> > cause a crash after two or three times usually.> > Can you try running the agent under a debugger, and trying to> force the crash The backtrace from that would be more useful in> trying to determine what's going wrong.> > Dave> > -------------------------------------------------------------------------> This SF.net email is sponsored by: Splunk Inc.> Still grepping through log files to find problems? Stop.> Now Search log events and configuration files using AJAX and a browser.> Download your FREE copy of Splunk now >> http://get.splunk.com/> _______________________________________________> 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> 
_________________________________________________________________
Local listings, incredible imagery, and driving directions - all in one place! Find it!
http://maps.live.com/?wip=69&FORM=MGAC01

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
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
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.