Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28381 Discussions

debug version works release version doesn't

Brooks_Van_Horn
New Contributor I
335 Views

In developing my project I've come to a point where the x64 Debug version works and it works great. But the x64 Release version launches and then gives me a message saying my application has stopped working and it doesn't resume. I've compiled both with all the warning/remark flags set and resolved. I've run all the MSVS 2013 tests that I know about and no signs arise.  I'm running a Win 10 Enterprise x64 version with all the patches applied. I have an Intel i7-4770 cpu running at 3.4GHz and 32GB of RAM. I have 3TB of disk storage and using only about 30% of that. Hardware is not a problem and even if I leaked like a sieve, I couldn't leak enough to stop it from working right off the bat. My project has 45 subroutines/procedures and I'm using a lot of heap space for arrays but I've set the heap size to a large number. I've uploaded a pdf of the screen at first startup.

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
335 Views

You are running a Windows Forms (dialog) based application. One of the usual mistakes that presents this symptom (working in Debug, but not in release), happens when you port a 32-bit application to 64-bit application.

The root cause for this is usually not type/kind arguments properly.

On 32-bit build, many of the interface argument sizes (kinds) are interchangable

sizeof(DWORD)==sizeof(INTEGER)==sizeof(HANDLE)==sizeof(...)

However on a port of the code to 64-bit the above does not hold true.

Debug build sometimes work (by accident) due to Debug build possibly zeroing out undefined data (e.g. the high 32-bits of a now 64-bit variable).

Jim Dempsey

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
335 Views

The program obviously worked for a bit What I would do is insert some logging code as it makes progress and see at what point the error occurs. You could also try building a Debug configuration with optimization (you'll need to disable the Stack Check option under Run Time, though) and see where it is at the point of error. The debugger may also tell you what kind of error it is..

0 Kudos
jimdempseyatthecove
Honored Contributor III
336 Views

You are running a Windows Forms (dialog) based application. One of the usual mistakes that presents this symptom (working in Debug, but not in release), happens when you port a 32-bit application to 64-bit application.

The root cause for this is usually not type/kind arguments properly.

On 32-bit build, many of the interface argument sizes (kinds) are interchangable

sizeof(DWORD)==sizeof(INTEGER)==sizeof(HANDLE)==sizeof(...)

However on a port of the code to 64-bit the above does not hold true.

Debug build sometimes work (by accident) due to Debug build possibly zeroing out undefined data (e.g. the high 32-bits of a now 64-bit variable).

Jim Dempsey

0 Kudos
Brooks_Van_Horn
New Contributor I
335 Views

Jim,

I thought I was careful to specify the kind= everywhere but I'll check it out. Steve's suggestion led me to optimization issues.

Brooks

0 Kudos
Reply