forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Illegal Pointer

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
alangr



Joined: 24 Oct 2016
Posts: 14
Location: Oxford,UK and Athens, Greece

PostPosted: Mon Oct 24, 2016 1:59 pm    Post subject: Illegal Pointer Reply with quote

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.

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
_________________
Alan
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 656

PostPosted: Mon Oct 24, 2016 2:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
alangr



Joined: 24 Oct 2016
Posts: 14
Location: Oxford,UK and Athens, Greece

PostPosted: Mon Oct 24, 2016 3:55 pm    Post subject: Reply with quote

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.
_________________
Alan
Back to top
View user's profile Send private message
alangr



Joined: 24 Oct 2016
Posts: 14
Location: Oxford,UK and Athens, Greece

PostPosted: Mon Oct 24, 2016 3:58 pm    Post subject: Reply with quote

Perhaps I should also add that I am operating under DOS.
_________________
Alan
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 656

PostPosted: Mon Oct 24, 2016 5:00 pm    Post subject: Re: Reply with quote

alangr wrote:
When you refer to traceback, do you refer to the list of called routines? That is certainly available.

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.
Back to top
View user's profile Send private message
alangr



Joined: 24 Oct 2016
Posts: 14
Location: Oxford,UK and Athens, Greece

PostPosted: Tue Oct 25, 2016 8:49 am    Post subject: Reply with quote

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
..........
_________________
Alan
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 656

PostPosted: Sun Oct 30, 2016 1:08 pm    Post subject: Re: Reply with quote

alangr wrote:
I am developing thr program using the Salford debugger, SDBG so I know just where the fault occurs.

A symbolic debugger is a useful tool, but its ability to trap machine level errors is limited. All that you can claim to know is where a fault becomes noticeable.
Quote:
I give below the point at which it fails.

Again, you may know the point at which there is some indication of failure. The failure could have been initiated somewhere else -- in your code, in the FTN95 RTL or the Windows DLLs.

The string "Illegal pointer" occurs in the debugger DLL sdbgdll.dll. If your Fortran source code does not use pointers, something is going wrong at a lower level.

It is unreasonable to expect that the bug can be understood or reproduced based on a few lines of code that you think are relevant.

If you can construct a short "reproducer", i.e., a test Fortran source that can be compiled and run to exhibit the bug, someone may be able to help. I doubt that anyone would undertake to debug your entire game program for you, even if you were willing to provide the source code in its entirety.
Back to top
View user's profile Send private message
alangr



Joined: 24 Oct 2016
Posts: 14
Location: Oxford,UK and Athens, Greece

PostPosted: Sun Oct 30, 2016 5:15 pm    Post subject: Reply with quote

Thanks for your response: I agree with you about the unreasonableness of using simply a few lines of code but I was trying to get a feel for what might be going on. I am not sure that I am really that much clearer about the detail but thanks for your help; it is appreciated. t least I can now proceed, for a while at least.
_________________
Alan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group