I have raised this issue in the General forum and perhaps I should really have raised it here. Below is a summary of the discussion so far which I am nopw raising here in the hope that someone can give me an idea on how to go forward to find a solution.
Thanks for reading.
Hi I have been using FORTRAN for some time (Salford 77 and now Silverfrost Ftn95) and I am now getting an 'illegal pointer' error and thus an access violation during execution. The program has been growing slowly with no problems until now. As far as I am aware, I am not using pointers (certainly not defined, anyway) so I am wondering if anyone can shed some insight on what is/may be going on. I am running under DOS.
The code at which the problem occurs has been executed at least once before failing. The program is very basic and unsophisticated but I do need to overcome this problem to proceed.
Any comments. views, suggestions welcome!
Thanks
Can you reduce the size of the malfunctioning program and post the source code here? If the program needs to read data files or uses include files, those will also be needed.
When a program crashes, you usually receive a traceback. Please record and provide the traceback information, since we can determine from it whether the illegal access occurred in your code, the runtime library or in the OS.
Hi I was afraid that this would be necessary! The program has about 50 subroutines and reads data from 30 or so tables in different directories (it is a game I am working on). In addition there are saved games that need selection and loading so it would be a substantial undertaking (for me and for anyone looking at it also.
When you refer to traceback, do you refer to the list of called routines? That is certainly available.
If there is no other reasonable way to investigate the matter I will get a zipped file together; please let me know.
Thank you for your interest and help.
Yes. The traceback will let you know whether the crash occurred in one of your Fortran subroutines, the Fortran RTL or the OS. Having that information would let you look at the offending routine more closely than otherwise.
I am developing thr program using the Salford debugger, SDBG so I know just where the fault occurs. I give below the point at which it fails.
The ORGPLY routine is executed (at least) once and all seems to be OK. Then before the last HEADER call the variable P is 5 (P is not in a common block). When the problem is to happen, the HEADER call executes OK as far as the results are concerned (a screen commentary on progress) but when control comes back to the ORGPLY routine, P is already declared as an illegal pointer.
So the HEADER routine seems to do something to upset things. I have stepped through HEADER and checked the screen and I cannot see anything amiss - but clearly something odd is happening.
I tried putting P into a common block and this did allow the MENU call to work OK; but then the illegal pointer error happened in an input routine in the MENU routine.
Do you have any ideas for a way forwards from here?
Thanks!
SUBROUTINE ORGPLY (Text plus common blocks in INCLUDE statements. INTEGER K, I, L, P 10 CALL HEADER P=5 CALL MENU(P, K) IF(K.EQ.1) THEN ..........
Any help would be appreciated.
Thanks