Strange and difficult to solve error: Windows has triggered a breakpoint in xxx.exe

Source: Internet
Author: User

Windows has triggered a break in xxx.exe. the cause may be a heap damage. This indicates that there is a bug in xx.exe or any DLL it loads. The cause can also be that the user presses F12 when xx.exe has a focus. The output window may provide more diagnostic information.
When this error occurs, it is basically because we are processingArray or pointerIt appearsCross-border (most likely) or ultra-long
As a resultStack heap.
My own program is caused by a Hidden variable that is not set to zero. Every time you reuse the cor space, correlation is set to 0, while cor_index is not set to 0.
Therefore, the value of cor_index is getting larger and larger with repeated reuse. Therefore, serious cross-border occurs when you access cor [cor_index]. These settings are related to the implementation of add_correlation,
How to use correlation and cor_index in it directly causes you to reset cor []. correlation = 0 and cor_index = 0 when calling this function repeatedly.
Of course, the cause of this error is hard to find, and programming habits are somewhat related. When designing algorithms, we do not have to consider the simplicity of reuse. We have too many global variables.
The algorithm is not general. Pay attention to improvement in the future. This problem has been plagued for two days. At the beginning, it was implemented by programming in the linux system. Because the debugging environment in linux is not very familiar,
It is not very intuitive. I have not found any problems after debugging for a day. As long as I comment out these memory release statements in the place where the memory space is released, the program will be able to run again, but I always think that
It is absolutely okay to release the local memory, but why cannot I run a few steps after these statements are added? I am confused. I began to doubt my knowledge about memory management. So I will
The memory release statement reported by the program is commented out. At this time, when the data volume is small, the program is correctly executed; but when the data volume is larger, the program will be stuck or say that the data volume is out of bounds somewhere.
. This result made me wonder if there was a problem with the gsl_matrix library. Therefore, I replaced all gsl_matrix with my own matrix library and found an error.
So I'm sure there's something wrong with the program. In order to quickly find out the error, I re-wrote the program, moved the program to the windows platform, and found this error through debugging.
When I checked it, I found that the cor_index was reset.
For a programmer, it cannot be said that his program has no errors at all. In many cases, you have not discovered some errors. In general, these errors are not shown.
It may have been a fatal error. We should also be skeptical about what we already know, because we may not fully understand it correctly. We may not have considered it. Using others' Libraries
When there is a problem, we may also think more about our own problems. In short, programming requires patience, constant practice, and constant learning.
 

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.