Argument problems in all fortran calls

Argument problems in all fortran calls

htigner's picture

I am having problems viewing arguments in fortran calls. I hope this is a simple issue, but I am currently at a loss. The following is an example stack trace I see when entering a fortran function:

Cannot access memory at address 0x6e2e6d62
#2 0x00006c6d in ?? ()
#1 0xbfffd4f8 in ?? ()
) at mytestfunc.f:12
#0 mytestfunc (myint=Cannot access memory at address 0x0

(This is using ddd with gdb. I see similar results when using idb.)

This occurs in calls from C and fortran to fortran routines. The strange thing is that sometimes I can read from the arguments passed in into other local variables, the data appears magically, even though the argument is displayed in the debugger as NULL, and sometimes the arguments and most of the local variables are unreadable.
I have been able to successfully build and run several of our programs using ifc 7.0 and 7.1 and gcc using glibc 2.2.4.x. The results of running the programs at this point is a mixed bag: they all seem to work, but various fortran calls are not returning the data that should be returned.
I know there are still some problems in our code, but it is becoming more and more difficult to isolate real problems when I am seeing stuff like this in the debugger.

Any help would be greatly appreciated.

We are currently in the process of migrating from IRIX 6.5.x on SGI hardware to RH 7.2 on.IBM compat.hardware. The code base is pretty large, and contains a few generations of fortran 77 reuse and C code.

Here are some software versions:

% ifc -V
Intel Fortran Compiler for 32-bit applications, Version 7.1 Build 20030412Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.

GNU ld version 2.11.90.0.8 (with BFD 2.11.90.0.8)
Supported emulations:
elf_i386
i386linux
elf_i386_glibc21

% rpm -q glibc
glibc-2.2.4-32

% rpm -q gcc
gcc-2.96-112.7.2

% ddd --version
GNU DDD 3.3.1 (i686-pc-linux-gnu)
Copyright (C) 1995-1999 Technische Universitt Braunschweig, Germany.
Copyright (C) 1999-2001 Universitt Passau, Germany.

% rpm -q gdb
gdb-5.2-2

Flags used for ifc link/compile:
-C90 -no_cpprt -Vaxlib -w90 -w95 -cm -i4 -r8 -g -O1
(I have also tried the -save and -zero flags.)

Flags used for gcc:
-g -O1

(I have used both ifc and gcc in the link step, and the programs appear to behave similarly.)

Thanks again for any ideas.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
htigner's picture

Please ignore the ramblings above. I finally found the
-gdwarf-2 option in the debugger manual, and the line about turning off all optimization. Now I see the argument values and the source code in the graphical display.
Thanks,
Harley Tigner

Login to leave a comment.