Comp Sci Fortran debugging help: faulty pointers?

AI Thread Summary
The discussion centers on a Fortran compilation issue where the user encounters a runtime error related to an undefined variable, OPT%INDEX, in their code. The user is uncertain whether the primary error lies with this undefined variable or subsequent deallocation messages. Suggestions include focusing on the first error regarding OPT%INDEX, indicating it may be the root cause. The user suspects potential float overflow or null pointer references as possible issues but lacks clarity on how to diagnose or resolve them. Assistance is requested to address these debugging challenges effectively.
ASGtFT
Messages
10
Reaction score
0
Hi, I tried compiling my program in Fortran using the following commands:

Code:
nagfor -g90 -C=all -C=undefined -g -gline -nan -u -mtrace=all test09b.f90 cell_functions.o -o test09b

I ended up getting this error message:

[Allocated item 15285 (size 17) = Z'FFFFFFFFB744A790']
Runtime Error: cell_test.f90, line 75: Reference to undefined variable OPT%INDEX
Program terminated by fatal error
test09b.f90, line 79: Error occurred in TEST08
[Deallocated item 2 (size 1025, at Z'FFFFFFFFB741B430')]
[Deallocated item 3 (size 1025, at Z'FFFFFFFFB741B850')]
[Deallocated item 15284 (size 1025, at Z'FFFFFFFFB744A370')]
[Deallocated item 15285 (size 17, at Z'FFFFFFFFB744A790')]
[Deallocated item 6 (size 65537, at Z'FFFFFFFFB741C320')]
[Deallocated item 7 (size 21, at Z'FFFFFFFFB742C340')]
[Deallocated item 1 (size 1025, at Z'FFFFFFFFB741B010')]
Aborted

I'm not sure exactly what this means. Is the error the bit which says "Runtime Error: cell_test.f90, line 75: Reference to undefined variable OPT%INDEX", or is it the bit below, which says "test09b.f90, line 79: Error occurred in TEST08
[Deallocated item 2 (size 1025, at Z'FFFFFFFFB741B430')]...etc"?

At the moment I think the problem is either a float overflow (which I don't really know how to spot, much less fix), or I've referenced a null pointer.

I'm not really sure how to solve either problem, does anyone have any suggestions? Thanks!
 
Physics news on Phys.org
ASGtFT said:
Hi, I tried compiling my program in Fortran using the following commands:

Code:
nagfor -g90 -C=all -C=undefined -g -gline -nan -u -mtrace=all test09b.f90 cell_functions.o -o test09b

I ended up getting this error message:

[Allocated item 15285 (size 17) = Z'FFFFFFFFB744A790']
Runtime Error: cell_test.f90, line 75: Reference to undefined variable OPT%INDEX
Program terminated by fatal error
test09b.f90, line 79: Error occurred in TEST08
[Deallocated item 2 (size 1025, at Z'FFFFFFFFB741B430')]
[Deallocated item 3 (size 1025, at Z'FFFFFFFFB741B850')]
[Deallocated item 15284 (size 1025, at Z'FFFFFFFFB744A370')]
[Deallocated item 15285 (size 17, at Z'FFFFFFFFB744A790')]
[Deallocated item 6 (size 65537, at Z'FFFFFFFFB741C320')]
[Deallocated item 7 (size 21, at Z'FFFFFFFFB742C340')]
[Deallocated item 1 (size 1025, at Z'FFFFFFFFB741B010')]
Aborted

I'm not sure exactly what this means. Is the error the bit which says "Runtime Error: cell_test.f90, line 75: Reference to undefined variable OPT%INDEX", or is it the bit below, which says "test09b.f90, line 79: Error occurred in TEST08
[Deallocated item 2 (size 1025, at Z'FFFFFFFFB741B430')]...etc"?
I would start by looking at the first error line, the one with OPT%INDEX. If you need some help, please show us your code.
ASGtFT said:
At the moment I think the problem is either a float overflow (which I don't really know how to spot, much less fix), or I've referenced a null pointer.

I'm not really sure how to solve either problem, does anyone have any suggestions? Thanks!
 

Similar threads

Replies
3
Views
2K
Replies
4
Views
2K
Replies
4
Views
3K
Back
Top