Debug Error Damage After Normal Block
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up What could cause DAMAGE: after normal block error? up vote 0 down vote favorite I keep getting this error after my application is running for 2 days. I've been told it's been some kind of buffer overflow, but is it the only option? The app is written in C++ using Visual C++ 6.0. c++ visual-c++ share|improve this question asked Apr 27 '09 at 12:57 Rodrigo 2,03252234 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted In debug, when you get dynamic buffer by new, a special code gets inserted before and after the buffer to guard the buffer. Ex:
, Windows Desktop Development > Visual C++ Question 0 Sign in to vote Hi, i have a dynamic byte array "ba". i have used it as follows BYTE *ba = new BYTE[len]; //len is non zero ZeroMemory(ba, sizeof(ba)*(len)); memcpy(ba,p_btPgBodyPtr+f_dwStrtTblOff,len); ... .... .... if(ba) delete [] ba; //i get debug error out here can anybody help me solve this problem thanks Monday, April 06, 2009 4:27 PM Reply | Quote Answers http://stackoverflow.com/questions/793375/what-could-cause-damage-after-normal-block-error 1 Sign in to vote It should be:ZeroMemory(ba, sizeof(*ba)*(len)); Note the extra '*'. Otherwise, sizeof(ba) is 4, right? Marked as answer by nobugzMVP, Moderator Tuesday, April 07, 2009 2:23 AM Monday, April 06, 2009 4:36 PM Reply | Quote All replies 1 Sign in to vote It should be:ZeroMemory(ba, sizeof(*ba)*(len)); Note the extra '*'. https://social.msdn.microsoft.com/Forums/vstudio/en-US/d6dd29e2-5116-41b6-b54b-3e3ac23d4857/debug-error-damageafter-normal-block?forum=vcgeneral Otherwise, sizeof(ba) is 4, right? Marked as answer by nobugzMVP, Moderator Tuesday, April 07, 2009 2:23 AM Monday, April 06, 2009 4:36 PM Reply | Quote 0 Sign in to vote thanks brian that did the trick for me. cheers mate! Tuesday, April 07, 2009 10:36 AM Reply | Quote Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.Would you like to participate? Privacy statement Dev Centers Windows Office More... Related Sites Visual Studio Visual Studio Integrate VSIP Program Microsoft .NET Microsoft Azure Connect Forums Blog Facebook LinkedIn Stack Overflow Twitter Visual Studio Events YouTube Developer Resources Code samples Documentation Downloads Products & extensions for Visual Studio REST APIs Testing tools for web developers Videos and tutorials Virtual Labs United States (English) © 2016 Microsoft Terms of Use Trademarks Privacy Statement Site Feedback
Popular Forums Computer Help Computer Newbies Laptops Phones TVs & Home Theaters Networking & Wireless Windows 7 Windows 10 Cameras All Forums News Top Categories Apple Computers Crave Deals Google https://www.cnet.com/forums/discussions/error-message-damage-after-normal-block-276751/ Internet Microsoft Mobile Photography Security Sci-Tech Tech Culture Tech Industry Photo Galleries Video https://www.experts-exchange.com/questions/21529028/Debug-Error-in-Visual-C-program-Damage-after-Normal-block-56-at-0x00304700.html Forums Video Top Categories Apple Byte Carfection CNET Top 5 CNET Update Googlicious How To Netpicks Next Big Thing News On Cars Phones Prizefight Tablets Tomorrow Daily CNET Podcasts How To Top Categories Appliances Computers Gaming Home Entertainment Internet Mobile Apps Phones Photography Security Smart Home Tablets Wearable Tech Forums debug error Speed Test Smart Home Top Categories Tour CNET Smart Home Smart Home News Smart Home How To Best Smart Home Devices Cars Top Categories Car Reviews Best Cars New Cars Used Cars Deals Top Categories Cheapskate Best Tech Under $50 All Deals Tech Deals Non-Tech Deals Audio Deals Cell Phone Deals Desktop Deals Laptop Deals Hard Drive & Storage Deals Printer Deals Tablet Deals debug error damage Camera Deals Monitor Deals Software Deals TV Deals Web Hosting VPN Services WordPress Hosting Domain Names Download Sign In / Join Sign In to CNET Join CNET Member Benefits My Profile Forums Sign Out US Other editions United Kingdom Australia China France Germany Japan Korea CNET en Español CNET Forums Windows Legacy OS Error Message: Damage After Normal Block Windows Legacy OS forum About This ForumCNET's Forum on Windows legacy operating systems, (XP, 2000/NT, ME, & Windows 95/98) is the best source for finding help or getting troubleshooting advice from a community of experts. Discussions cover Windows 2003 Server, Windows installation, adding and removing programs, driver problems, crashes, upgrading, and other OS-related questions.Real-Time ActivityMy Tracked DiscussionsFAQsPoliciesModerators General discussion Error Message: Damage After Normal Block by wgoforth / December 21, 2007 12:07 PM PST I have a 1 year old HP pavilion with XP sp2.The past two days I have been having problems with IE. It will lock up, or sometimes automatically close itself. There is this error message:Microsoft visual C++ Debug LibraryProgram: C:\Program Files\Internet Explorer\EXPLORE.EXEDamage: after normal block (#47) at 0x03DA48A0.Any suggestions?Only thing new I have done
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Debug Error in Visual C++ program -- "Damage after Normal block (#56) at 0x00304700" Want to Advertise Here? Solved Debug Error in Visual C++ program -- "Damage after Normal block (#56) at 0x00304700" Posted on 2005-08-16 C++ 1 Verified Solution 2 Comments 1,388 Views Last Modified: 2008-03-06 I recently inherited a "supposedly" running program that I have to provide support and enhancments for. When I attempt to run the code in the Visual C++ 6 IDE, it seems to run fine until the destructor of one of the classes is called. Then I get the following Debug Error: "DAMAGE: after Normal block (#56) at 0x00304700. I've traced the problem down to a "delete" statement, but I haven't been able to determine exactly what's wrong with it. Here's the relevant code: ===== // Header file (.h) class MailRoomStarter : public NTService { private: bool m_running; // Stop the use of default and copy constructors MailRoomStarter(void); MailRoomStarter(MailRoomStarter&); protected: char *m_MailRoomProgramPath; ... } // CPP file (.CPP) MailRoomStarter::MailRoomStarter(const char* srvname, LPSERVICE_MAIN_FUNCTION fpSrvMain, LPHANDLER_FUNCTION fpSrvCtrl ) : NTService(srvname, fpSrvMain, fpSrvCtrl) { char path[MAX_PATH]; mStat.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; GetRegistryString(HKEY_LOCAL_MACHINE, "\\SOFTWARE\\xxx\\yyy\\Common\\ExePath", path); m_MailRoomProgramPath = new char[strlen(path)]; strcpy(m_MailRoomProgramPath,path); } //Destructor MailRoomStarter::~MailRoomStarter(void) { if(m_MailRoomProgramPath != NULL) // this is where the error occurs delete m_MailRoomProgramPath; } ====== I've tried altering the delete line to the following: delete [] m_MailRoomProgramPath; ...but, I still get the same error. If anyone has any suggestions, I'd appreciate it. 0 Question by:Pegasus40218 Facebook Twitter LinkedIn Google LVL 86 Best Solution byjkr The problem is m_MailRoomProgramPath = new char[strlen(path)]; That should be m_