
Hello, this is to anybody who works with smilib on Windows.
I am trying to use libsmi-0.4.0 on WindowsNT. I am using VC6.0. The lib and my testing code compile with no problem but at run-time I see this assertion:
----------------------------------------------------- Debug Assertion Failed!
Pogram: D:\projects\libsmitest\Debug\libsmitest.exe File: dbgheap.c Line: 1084
Expression: pHead->nBlockUse == nBlockUse -----------------------------------------------------
The code in question is: smiInit(NULL); smiSetPath("d:\projects\smi\mibs\ietf"); smiLoadModule("SNMPv2-SMI"); smiLoadModule("SNMPv2-TC"); smiLoadModule("SNMPv2-CONF"); smiLoadModule("SNMPv2-MIB");
The assertion gets fired on the last call to LoadModule. If I leave that call out, the program runs cleanly but doesn't do anything useful, of course. I saw a problem like this on this list in June but the answer was simply to call smiInit first which is the case with my code. Running the debugger shows that the error occurs when smiparse() gets called but this is what the call stack contains:
_free_dbg(void * 0x00309630, int 2) line 1084 + 43 bytes __crtsetenv(const char * 0x0030aa90, const int 1) line 174 + 17 bytes LIBSMITEST! putenv + 54 bytes timegm(tm * 0x00000002) line 165 + 10 bytes mainCRTStartup() line 206 + 25 bytes KERNEL32! 77f1b9ea()
Unfortunately I cannot trace into smiparse() because the debugger does not seem to be able to handle the flex/bison-code or it is simply not there.
The whole thing does not happen on Linux (gcc)!
Any help is appreciated!
Henning