Windows have triggered a breakpoint in ..... The problem

Source: Internet
Author: User

Debugging code encountered a problem similar to the following:


Windows Has TriggeredaBreakpointIn . exe.
This is due to a corruption of the heap, which indicates a bug in. exe or any of the DLLs itHasloaded.

This may also is due to the user pressing F12 while. EXE has focus.
The Output window may has more diagnostic information


It can be concluded that the heap memory usage is wrong, that the requested heap memory is not freed, the memory is used out of bounds, or a piece of memory that has been destroyed has been used.

The following code:

......

Bufferl buffer;

size_t Buffer_len;

size_t Src_buffer_len = Motivation.data_len;

Buffer_len = Src_buffer_len;

buffer. Resize ( src_buffer_len );

SRes ret = lzmacompress (&buffer[sizeof (XXX)], &Buffer_len, &src_buffers[0], Src_buffer _len, Outprops, &outpropssize);


The size to buffer first isSrc_buffer_lenLength, which is the length of the src_buffers.Src_buffers the length after compression isBuffer_lenIfBuffer_len>Src_buffer_len, then there will be an assignment cross-boundary problem, because the dataBufferLength isSrc_buffer_len。 This makes it possible to "Windows has triggered a breakpointProblem, this problem may not occur immediately when the assignment is out of bounds, but this problem will occur sooner or later.

So it's important to have good coding habits.

Someone on the web recommended Pageheap.exe to check for memory out of bounds. For details, please refer to:

http://c.360webcache.com/c?m=fc2dda77b80c762a85d8be5548bf19f1&q=windows+has+triggered+a+breakpoint&u= Http%3a%2f%2fwww.xuebuyuan.com%2f759315.html,


Above, 2017.03.02

This article from the "Technical Knowledge carding" blog, reproduced please contact the author!

Windows have triggered a breakpoint in ..... The problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.