
Hi Frank,
I've tracked down the crash to the point where the loadModule() function calls to yyparse.
When running my test program outside Microsoft Visual C++, I don't see any warning or error messages at all, the program just terminates But when running in Visual C++ debugger, I am getting messages like these (a snippet) at the time of a crash:
Detected memory leaks! Dumping objects -> {6846} normal block at 0x026C1948, 1258 bytes long. Data: <The CounterBased> 54 68 65 20 43 6F 75 6E 74 65 72 42 61 73 65 64 {6844} normal block at 0x01C2FFE0, 20 bytes long. Data: <CounterBasedGaug> 43 6F 75 6E 74 65 72 42 61 73 65 64 47 61 75 67 {6843} normal block at 0x01C2E050, 44 bytes long. Data: <N > 4E 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 ... ...
Actually, as you will see, there is memory leak after each call to smiLoadModule()! There are several articles at MSDN describing how to detect memory leaks in Visual C++ runtime system. One way to do this is to dump memory leak information at the points of interest in the code using the _CrtDumpMemoryLeaks() function.
So, calling _CrtDumpMemoryLeaks() after smiLoadModule() will produce memory leak warning (similar to that above). The same happens in smidump (which I've built in a separate Visual C++ project). However, it's only my DLL that would crash, not smidump :(
Any hints how one could better trace the parsing process (debug the Bison parser and the relevant components within the libsmi itself). Any other suggestions?
Thank you. Arie.
-----Original Message----- From: Frank Strauss [mailto:strauss@ibr.cs.tu-bs.de] Sent: Wednesday, January 09, 2002 11:28 PM To: Arie Trost Cc: libsmi@ibr.cs.tu-bs.de Subject: Re: [libsmi] memory leak; program terminates
Hi Arie!
What you have done so far (smiInit() and several calls to smiLoadModule()) is correct. I don't know how C++ runtime systems behave with respect to memory leaks. I cannot guarantee that there are no more leaks in the libsmi code (in fact, I'm quite sure that there are still some minor leaks not yet fixed). But I wonder why your runtime system terminates the program for this reason.
-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.