Silverfrost Forums

Welcome to our forums

Access Violation on STOP

5 Feb 2016 8:37 #17175

Dear Paul,

in one of our applications we get an access violation when we try to close the application while using STOP. For testing we have compiled all sources with option /undef but the application works fine. Only when we try to close the application the problem occurs. STOP/END is the last code sequence of the program.

http://www2.pic-upload.de/img/29645180/Zwischenablage01.jpg

Do you have an idea what the problem could be?

We use FTN95 Ver. 7.10.0

:edit

We have figured out that this problem has something to do with WINIO using %HW, %LW and OPEN_TO_WINDOW@. The code is very old but until now we had no problems with it. Maybe OPEN_TO_WINDOW@ is not needed in our case no more...

In the debbuger the problem does not occur. It happens most of the time during run time. Very strange behavior.

5 Feb 2016 4:04 #17178

This looks like the problem you get when the return code path is no longer available. Explaining it simply (which is the way I understand it!) if you have

ii = winio@ ....

and ii is a local variable, then it may no longer be a valid place to put the winio@ exit code as everything shuts down - including the window accepting fortran output.

My solution when I had a similar problem was to SAVE things, either whole blocks of subroutines, or just the return variables, or put them in COMMON blocks. Which you choose depends on your programming style. If you use lots of local variables, the the compiler SAVE option may not be helpful.

You might just need to explicitly close down that window by finding its handle and operating on that.

Eddie

Please login to reply.