
Hi!
Dave> I've been looking at trying to use libSMI in the Net-SNMP library, Dave> (replacing our current parser) and have run into a problem whereby Dave> libSMI crashes out in the middle of parsing HOST-RESOURCES-MIB.
Dave, I appreciate to hear about this, at least the first part of the sentence. ;-)
Dave> [...detailed problem description...] Dave> Is this a bug in the library, or my code ?
Dave> If it's a problem with the library, why doesn't the noddy program Dave> tickle it? (I can post the code of this if that would be helpful).
It's a bug in the library, that is hopefully fixed by the attached patch, which is also in the CVS repository.
Your second program probably just did not fail on it, because of a less determistic and more fortunate memory allocation layout. ;-)
Maybe, I should play with dmalloc again...
Dave> Is there any advice as to how I can avoid invoking Dave> 'checkObjects'? Or is that just applying a sticking plaster and Dave> leaving the real problem?
checkObjects() is called unconditionally at the `END' of each parsed module. I cannot explain why you did not see it called from your simple test program.
-frank
diff -u -r1.144 parser-smi.y --- parser-smi.y 2001/06/06 07:36:37 1.144 +++ parser-smi.y 2001/06/06 11:59:46 @@ -509,6 +509,10 @@ if (!modulePtr->prefixNodePtr) { modulePtr->prefixNodePtr = objectPtr->nodePtr; } else { + if (objectPtr->nodePtr->oidlen < modulePtr->prefixNodePtr->oidlen) + modulePtr->prefixNodePtr = + findNodeByOid(objectPtr->nodePtr->oidlen, + modulePtr->prefixNodePtr->oid); for (i = 0; i < modulePtr->prefixNodePtr->oidlen; i++) { if (modulePtr->prefixNodePtr->oid[i] != objectPtr->nodePtr->oid[i]) { -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.