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

Debug / Release libraries

nick_jakeman
Beginner
2,010 Views
Has anyone else experienced the problem where the Debug version of a static library functions absolutely fine, but the Release version generates run-time errors?
Nick Jakeman
0 Kudos
11 Replies
nijhuis
Beginner
2,010 Views
That is a problem as old as the debugging mode exists. You should be aware of the fact that the compiled code is not the same in Debug mode and Release mode.
A well-known cause of such a problem is the exceeding of array bounds. It can happen that inDebug mode a memory address is overwritten which holds for example a program instruction, while with the same incorrect array bound inRelease mode an address is overwritten,which does no harm at that moment.
I think there are surely other causes of different actions inboth modes.
If not set yet: enable array bounds checking for the Debug mode.
In many cases this will show you the problem while executing the program in Debug mode.
Guus
0 Kudos
lklawrie1
Beginner
2,010 Views
Yes, I'm having this problem (IVF) right now but it's not array bounds. Most of my developers are using CVF. I had neglected to do "/fpe:0" with my port to IVF but it shows a lot of files not running whereas the debug (IVF) runs them fine as does CVF.
How far do we have to match the compilation parameters to assure a decent trip up in debug version (as I have turned off all debug in the release version and it shows nothing but "float invalid")
Linda
0 Kudos
nijhuis
Beginner
2,010 Views
Linda,
I'm afraid I can't help you at this moment. The only thing I want to make clear is, that it is not so surprising that Release mode fails while Debug mode runs well and the reverse also. Often it is an intensive search to locate such a problem, when it it not related to array bound errors.
Some causes I remember are: argument mismatches and overwriting a constant value by passing it to a subroutine and give it an other value within the routine. But , I assume there are much more causes for errors.
Guus
0 Kudos
aliho
Beginner
2,010 Views
Check particularly fixed length character arguments to ensure that the length in the call instruction is equal to the declared length.

CHARACTER*20 STRING

CALL DUMMY(STRING)

.....

SUBROUTINE DUMMMY(STRING)

CHARACTER*80 STRING

STRING=" "
END SUBROUTINE
0 Kudos
lklawrie1
Beginner
2,010 Views
I thought I would try working backwards from the one that fails, gradually adding more debug information to get at the real spot.
Adding "lines" -- still fails, but no traceback.
"Full" -- now it works.
Steve, how can I trace this as there is a crash that was missed in my "normal" one w/o debug but added more crashes. The 'release' version with full debug crashes on the appropriate ones but doesn't give me any line information (optimization is still on...)
Linda
0 Kudos
Steven_L_Intel1
Employee
2,010 Views
Linda,
Traceback is a separate option.
Are you sayijng that simply changing the debug level changes the operation of the program? That shouldn't happen. I'd ask that you report this to Premier Support and attach a reproducible example. We'd like to look at it.
0 Kudos
lklawrie1
Beginner
2,010 Views
Steve, You will remember this is a "big" program, yes? I don't believe I can "dumb" it down to just where it is crashing as I can't seem to determine where that is!
Yes, changing my "release" version from no debug to lines to full changed it from crashing on 1 input file to running (which it should have done, according to other compilers and the full debug version of IVF).
Linda
0 Kudos
Steven_L_Intel1
Employee
2,010 Views
Try selectively changing the debug level on certain files. You may find that you can identify one source file which, when the debug level is changed, changes the behavioir. Full debug does sometimes change the generated code. You should also be able to enable traceback independently.
0 Kudos
lklawrie1
Beginner
2,010 Views
That would be a lot of source files.....
Issue submitted.
Linda
0 Kudos
lklawrie1
Beginner
2,010 Views
Traceback, which I believe I have enabled, does not give me any information. Do I need more than the exe on the target machine to have the traceback? (i.e. Map file, pdb file?)
Linda
0 Kudos
lklawrie1
Beginner
2,010 Views
I did not have traceback enabled -- trying that now with the "lines" option which was crashing previously.
Linda
0 Kudos
Reply