RE: [libsmi] memory leak; program terminates

Hi Kang,
Thanks for the tip, this did the trick.
I've noticed that exit(-1) statement in printError(). I would like my application to skip a MIB module that caused a failure and continue loading other MIBs. How can I handle this situation in my application (do some cleanup for a falty MIB and prepare for loading the next one)?
Thank you, Arie.
-----Original Message----- From: Kang, Jeongwon [mailto:hanule@3ic.co.kr] Sent: Friday, January 11, 2002 11:25 PM To: Arie Trost Cc: libsmi@ibr.cs.tu-bs.de Subject: 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.
-- !! 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.

Hi Arie,
I recommand the following. First, lookup the smilint source code and refer to error handling code, then you can exclude the illegal MIB error. Next, use C++ exception or MFC exception, then you can handle unstable libsmi. Last, modify the source of libsmi. There would be nothing for it but to modify the source for meeting the personal need.
I wish your success!
----- Original Message ----- From: "Arie Trost" ariet@genesyslab.com To: "'Kang, Jeongwon'" hanule@3ic.co.kr Cc: libsmi@ibr.cs.tu-bs.de Sent: Tuesday, January 15, 2002 5:10 AM Subject: RE: [libsmi] memory leak; program terminates
Hi Kang,
Thanks for the tip, this did the trick.
I've noticed that exit(-1) statement in printError(). I would like my application to skip a MIB module that caused a failure and continue loading other MIBs. How can I handle this situation in my application (do some cleanup for a falty MIB and prepare for loading the next one)?
Thank you, 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.

Hi!
Arie> I would like my application to skip a MIB module that caused a Arie> failure and continue loading other MIBs. How can I handle this Arie> situation in my application (do some cleanup for a falty MIB and Arie> prepare for loading the next one)?
There are good reasons for the parser to terminate in case of severe errors. If it would continue, you would end up with dangling pointers and consequences you would not like! ;-)
You must use correct SMI code. In case of a programming language like C you would also not expect your compiler to accept illegal code.
So: First fix the first module before running your application with the next one.
-frank -- !! 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 (3)
-
Arie Trost
-
Frank Strauss
-
Kang, Jeongwon