Crashes in Intel C++ Compiler, doesn't crash in Microsoft VS2005 C++ Compiler -- HELP!

jimdempseyatthecove
Total Points:
36,372
Status Points:
36,372
Black Belt
January 19, 2009 9:06 AM PST
Rate
 
#8 Reply to #7

>> The program should have crashed in the visual studio C++ compiler version as well, but it did not.

The correct statement is "The behavior of the program is undefined."
i.e.

a) it is not required to crash
b) it is not required to to be benign
c) it may trash something in your program that will not appear in testing
d) it may trash something in your program that will only appear at user site

I would suggest you perform a Find in Files for all occurences of "delete*[]"
Then for each, in seperate find window, locate all allocates to that pointer to check consistancy of use.

Then invert and find all allocates using [ and then for each check the delete.

PCLINT might be able to detect this (I don't use it, but I think it will detect this)

Using a container for the arrays can be helpful in eliminating this problem. If programmed correctly it will not add any computational overhead to the program (if may potentially for some vector optimizations).

Jim Dempsey


--------

Blog: The Parallel Void


www.quickthreadprogramming.com


Intel Software Network Forums Statistics

8458 users have contributed to 31572 threads and 100537 posts to date.
In the past 24 hours, we have 18 new thread(s) 132 new posts(s), and 152 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Quoting - rase if (k.eq.0

Please welcome our newest member soundmyth