
Hi,
I guess practise makes perfect, stands.
It turned out that libSMI's internal error-handler is not just for fun. I was not catching errors reported by this nifty utility. The problem was, I was missing dependent MIB files, and forces libSMI to raise SIGSEGV, when I ignored reported messages earlier.
So: use internal error-handler... It will save you great deal of headaches and time.
Regards, Miroslav Beranič ml.
2009/2/21 Miroslav Beranič ml. miroslav.beranic@gmail.com:
Hi,
I am trying to load multiple MIB files (about 50 of them) in one process. I get a segment fault when calling method
extern SmiNode *smiGetFirstNode(SmiModule *smiModulePtr, SmiNodekind nodekind);
I managed to trace it to method
static Object *getNextChildObject(Node *startNodePtr, Module *modulePtr, SmiNodekind nodekind)
in smi.c:159 (in TRUNK)
There is an if statement:
if (((!modulePtr) || (objectPtr->modulePtr == modulePtr)) && ((nodekind == SMI_NODEKIND_ANY) || (nodekind & objectPtr->export.nodekind))) { break; }
Statement: objectPtr->export
seems to point to invalid memory address. As I debuged it looks like properties
- export
- flags
- line
point to invalid memory, as by accessing it, it signals SIGSEGV.
So my question: Is there any limit on loading MIBs or any other reason this can happen? And next: what would be good way to load multiple MIB-s -- lets say any MIB in specific directory... description of how to do this or some pointers would be great.
Best regards, Miroslav Beranič ml.