This is a very useful script for debugging sent to me by Prakash
Narayan, in case his response was not posted I am going to repost it for
others.
------------------------------------------------------------------
#!/bin/csh
/bin/rm -f core
# you may get rid of the following two checks if your current setting is ok
if (`limit | grep core | awk '{print $2;}'` == 0) then
limit coredumpsize 10M
endif
if (`which dbx | grep 'no dbx' | wc -l` != 0) then
echo "can't find dbx"
exit 1
endif
$argv[1-]
if ($status && -e core) then
echo "where; quit" | dbx -q $1 core | grep -v "core file";
endif
--------------------------------------------------------------
Instructions:
Compile your program with -g
Then run the attached script on the generated a.out
[Give execute permission to the script and also make sure that you
have dbx in your "PATH"]
Your output will look like:
3 allocate (a(20))
[1] kill(0x0, 0x6, 0x0, 0x0, 0xffffffff, 0x4cdb0), at 0xef5f40d8
[2] abort(0x583, 0xffffffff, 0xeffff65c, 0x4c848, 0x4c844, 0x1), at
0xef5ba57c
[3] _lerror(0x4, 0x583, 0x0, 0x13cb0, 0x2, 0x0), at 0x310a0
[4] _ALLOCATE(0xeffff7a4, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x13f78
=>[5] main(), line 3 in "bal.f90"
So you know that the failure is in line 3.
In this case the program was:
integer, allocatable :: a(:)
allocate (a(10))
allocate (a(20))
end
_______________________________________________________________________
| Pete Bismuti |
| Supercomputer Computations Research Institute |
| Florida State University - Department of Mathematics |
| [log in to unmask] (904)644-6263 |
|_____________________________________________________________________|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|