Home > Archive > Fortran > November 2005 > Problem that goes away when I turn debug on
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem that goes away when I turn debug on
|
|
| Dave Taylor 2005-11-23, 7:00 pm |
| Well, the subject header spells out my frustration with this fatal
error quite neatly. I presume I've done something silly with my code,
but I'm not entirely sure what...
What happens:
i) The code, compiled (using ifort v8.1) with debug on (-g), runs fine.
ii) The code, compiled without debug on, crashes with the following
error:
forrtl: severe (8): internal consistency check failure, file
../src/libfor/for_intrp_fmt.c, line 2080
Using the totalview debugger to step through the list of memory
addresses (I know very little about what goes on underneath the hood of
compiled code, forgive me if my terminology is not accurate), I find
that the following series of commands:
0x0806b574: 0xe8 call for_write_seq_fmt
0x0806b575: 0x33
0x0806b576: 0x6c
0x0806b577: 0x05
0x0806b578: 0x00
0x0806b579: 0x83 addl $24,%esp
is where it crashes. A breakpoint on the first line of this section is
reached, but one on the last line is not. Can anybody hazard a guess as
to what the code might be doing at this point? Or what might be going
wrong? 'for_write_seq_fmt' is not a call I have explicitly made, so I
presume it is something buried deep down inside.
I have a hunch this relates to the following F90 command, but putting
PRINT statements into the code causes the error to move around:
PRINT '(a)'," Reading in plasma current distribution information from
IDA file '"//TRIM(efmfile)//"'..."
Any help would be much appreciated; I am rather lost here!
Cheers,
Dave Taylor
| |
|
| On 23 Nov 2005 09:38:42 -0800
"Dave Taylor" <dtaylor@ukaea.org.uk> wrote:
> Well, the subject header spells out my frustration with this fatal
> error quite neatly. I presume I've done something silly with my code,
> but I'm not entirely sure what...
>
> What happens:
> i) The code, compiled (using ifort v8.1) with debug on (-g), runs
> fine. ii) The code, compiled without debug on, crashes with the
> following error:
>
> forrtl: severe (8): internal consistency check failure, file
> ./src/libfor/for_intrp_fmt.c, line 2080
>
> Using the totalview debugger to step through the list of memory
> addresses (I know very little about what goes on underneath the hood
> of compiled code, forgive me if my terminology is not accurate), I
> find that the following series of commands:
>
> 0x0806b574: 0xe8 call for_write_seq_fmt
> 0x0806b575: 0x33
> 0x0806b576: 0x6c
> 0x0806b577: 0x05
> 0x0806b578: 0x00
> 0x0806b579: 0x83 addl $24,%esp
>
> is where it crashes. A breakpoint on the first line of this section is
> reached, but one on the last line is not. Can anybody hazard a guess
> as to what the code might be doing at this point? Or what might be
> going wrong? 'for_write_seq_fmt' is not a call I have explicitly
> made, so I presume it is something buried deep down inside.
>
> I have a hunch this relates to the following F90 command, but putting
> PRINT statements into the code causes the error to move around:
>
> PRINT '(a)'," Reading in plasma current distribution information from
> IDA file '"//TRIM(efmfile)//"'..."
>
> Any help would be much appreciated; I am rather lost here!
>
> Cheers,
> Dave Taylor
>
I had the same kind of strange error which also disapperd when using
-g. The line number at which ifort gives the error differ somtimes when
changing the source where. :-(. After a couple of days I found
that the error was produced by an arraybound excidens somewere else in
de code in the following way: (not the real code, but to show the kind
of error)
module AA
real, allocatable :: A(:)
real, allocatable :: B(:)
real, allocatable :: C(:)
end module
subroutine BB
use AA
nr = 10
allocate(A(nr))
call CC(A(nr),nr)
(more lines of code)
allocate(B(nr))
(more lines of code)
allocate(B(nr)) <- location of error
(....)
end subroutine
subroutine CC(D,nr)
real :: D(*)
integer :: nr
do i = 1, nr
D(i+1) = D(i) + .. <-exidence
end do
end subroutine
Conclusion: do not use (*) in Fortran 95.
I hope this can help you.
Johan
| |
| Dick Hendrickson 2005-11-23, 7:00 pm |
|
Dave Taylor wrote:
> Well, the subject header spells out my frustration with this fatal
> error quite neatly. I presume I've done something silly with my code,
> but I'm not entirely sure what...
>
I'm not sure what you've done either. ;)
The usual suspects for errors which change when you do
something different with the compiler command line are:
1) Array subscript bounds errors.
2) Subroutine argument mismatches
3) Typo in a name.
They all can cause something to go wrong with where you
store data values and can easily mess up one of the
i/o system routines internal data storage.
Try turning on all of the run-time error checks you can
find. Especially subscript bounds checking.
If possible, put all of your subroutines in modules. This
essentially forces the compiler to do argument consistency
checks. If that's not easy to do, there might be a compiler
switch that does it magically.
Try putting IMPLICIT NONE in each routine (or maybe there's
also a command line option to do that magically).
Dick Hendrickson
> What happens:
> i) The code, compiled (using ifort v8.1) with debug on (-g), runs fine.
> ii) The code, compiled without debug on, crashes with the following
> error:
>
> forrtl: severe (8): internal consistency check failure, file
> ./src/libfor/for_intrp_fmt.c, line 2080
>
> Using the totalview debugger to step through the list of memory
> addresses (I know very little about what goes on underneath the hood of
> compiled code, forgive me if my terminology is not accurate), I find
> that the following series of commands:
>
> 0x0806b574: 0xe8 call for_write_seq_fmt
> 0x0806b575: 0x33
> 0x0806b576: 0x6c
> 0x0806b577: 0x05
> 0x0806b578: 0x00
> 0x0806b579: 0x83 addl $24,%esp
>
> is where it crashes. A breakpoint on the first line of this section is
> reached, but one on the last line is not. Can anybody hazard a guess as
> to what the code might be doing at this point? Or what might be going
> wrong? 'for_write_seq_fmt' is not a call I have explicitly made, so I
> presume it is something buried deep down inside.
>
> I have a hunch this relates to the following F90 command, but putting
> PRINT statements into the code causes the error to move around:
>
> PRINT '(a)'," Reading in plasma current distribution information from
> IDA file '"//TRIM(efmfile)//"'..."
>
> Any help would be much appreciated; I am rather lost here!
>
> Cheers,
> Dave Taylor
>
| |
|
| Dave Taylor wrote in message <1132767522.519067.311510@f14g2000cwb.googlegroups.com>...
>Well, the subject header spells out my frustration with this fatal
>error quite neatly. I presume I've done something silly with my code,
>but I'm not entirely sure what...
>
>What happens:
>i) The code, compiled (using ifort v8.1) with debug on (-g), runs fine.
>ii) The code, compiled without debug on, crashes with the following
>error:
>
>forrtl: severe (8): internal consistency check failure, file
>./src/libfor/for_intrp_fmt.c, line 2080
Problems of this sort are generally caused by an array subscript error
or a substring specification error.
You need to turn on checks for these errors.
|
|
|
|
|