Re: [libsmi] memory leak; program terminates

Hi Arie,
I looked into your code and libsmi code.
Your mib file "HCNUM-TC.txt" required SNMPv2-SMI and SNMPv2-TC. Libsmi lookup nothing because of illegal mib path, so parser occured internal error. exit(-1) was called at printError() in error.c. To call smiExit() was omitted.
The memory leak problem of your program owed to omitting smiExit() more than libsmi.
Add smiSetPath(). Then No Error.
STDMETHODIMP CGMIBAccessor::Initialize() { ... smiSetPath(your_mib_file_path); // addition requred ... return S_OK; }
Best regards, Jeongwon.
----- Original Message ----- From: "Arie Trost" ariet@genesyslab.com To: "'Frank Strauss'" strauss@ibr.cs.tu-bs.de; "Kang, Jeongwon" hanule@3ic.co.kr Cc: libsmi@ibr.cs.tu-bs.de Sent: Saturday, January 12, 2002 11:44 AM Subject: RE: [libsmi] memory leak; program terminates
Hi,
Although I could think of some workarounds for my specific problem, I believe it would be nice to have libsmi working flawlessly in those long-term-process scenarios (e.g., a COM/ActiveX object, a regular DLL, etc).
Having the capability of launching parsing tools from, for example, an HTML page, will give some new perspective to libsmi..
My humble contribution to that: Attached please find a zip file containing a sample Visual C++ project that demonstrates the crash I had been experiencing with my COM object. Once you've unzipped the files and built the project, you can instantly start using it for debugging libsmi while it's used from within a COM component.
Instructions:
Unzip the file, for example, onto a folder c:\libsmi-com Three sub-folders will be created under c:\libsmi-com:
Mibcom - contains the COM server dll project client - a simple COM client application project libsmi-win32 - libsmi built as a static win32 multithreaded library (used by Mibcom)
Open Visual project c:\libsmi-com\Mibcom\MIBCOM.dsw (workspace will contain both projects, that one for COM server and COM client.)
Build the both projects and run the test.
Once you've run the test, the client will start consequently loading MIB files (from c:\libsmi-com\client\mibs). You will see that after fourth ot fifth call to LoadMIB() or so, the
client will crash.
- You can debug the program by setting up break-points in test.cpp (in
order to trace the client) and setting DebugBreak() in GMIBAccessor.cpp in order to trace the server (including to break into the libsmi's code.). See the CGMIBAccessor::LoadMIB() function.
- Project can be used under Windows NT 4.0, Windows 2000 and Windows XP.
Hope this will help to resolve the issue (hopefully someone out there among the libsm maintainers will take a shot at it).
Best regards, Arie.
-- !! 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.
participants (1)
-
Kang, Jeongwon