FW: Win32Lib memory problems
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> May 11, 2001
- 378 views
This didn't seem to get through the first time... -----Original Message----- From: Matthew Lewis I think I've finally figured out what's wrong in EuCOM. I've found several bugs in EuCOM (again, improperly declared structures), and fixed them. I *think* that's what the problem has been--BoundsChecker says no more memory problems (well, there are a few leaks, but that's a different issue). However, I also found a bug in Win32Lib, that looks like it goes back to v.41. The MSG structure is defined incorrectly. The second member, msg, was declared as an Integer, which to Win32Lib is the same as a Word, or 16-bits. In fact, msg should be a UINT, a 32-bit number. This could account for some crashes occuring when a Win32Lib app closes. It seems that dlls and such can sometimes write past the bounds of memory allocated by Eu without problem, until that memory is freed--then it all crashes and burns. Or something like that. I tracked this down by writing a DLL in VC++ that wrapped malloc and free, and compiled in debug mode. It caught several things that might have gone unnoticed. Thanks also go to Euman for his help, and Thomas, as well. Matt Lewis