|
请教各位,有个fortran程序,编译通过了,但是调试的时候出现下面的情况
- [hujinhe@console ~]$ gdb ./mdord.exe
- GNU gdb Red Hat Linux (6.3.0.0-1.96rh)
- Copyright 2004 Free Software Foundation, Inc.
- GDB is free software, covered by the GNU General Public License, and you are
- welcome to change it and/or distribute copies of it under certain conditions.
- Type "show copying" to see the conditions.
- There is absolutely no warranty for GDB. Type "show warranty" for details.
- This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".
- (gdb) run <in.dip> out.out
- Starting program: /export/home/hujinhe/mdord.exe <in.dip> out.out
- [Thread debugging using libthread_db enabled]
- [New Thread 182894224864 (LWP 13692)]
- Program received signal SIGSEGV, Segmentation fault.
- [Switching to Thread 182894224864 (LWP 13692)]
- 0x000000000041e998 in rand_ ()
- (gdb) backtrace
- #0 0x000000000041e998 in rand_ ()
- #1 0x0000000000405c6a in start () at mdrdipord.f:559
- #2 0x0000000000403074 in main$mdrdipord_$BLK () at mdrdipord.f:36
- #3 0x000000000040302a in main ()
- (gdb)
复制代码
刚接触编程,有些迷糊。请问是不是第36和559行有问题?
- (gdb) l 36
- 31 C
- 32 C READ IN AND INITIALISE DATA.
- 33 CALL SYSDEF
- 34 C
- 35 C SET UP STARTING CONFIGURATION
- 36 CALL START
- 37 C
- 38 C PRINT OUT SYSTEM PARAMETERS
- 39 CALL OUTPUT(1)
- 40 C***********************************************************************
复制代码
第36行是调用子程序START,第559行是START子程序里的一部分,如下:
- (gdb) l 559
- 554 COMMON/CMVELO/VMOM(3,NSP),ANGM(3,NSP)
- 555 COMMON/CMFRCS/FXYZ(3,NSP),TXYZ(3,NSP)
- 556 DIMENSION XB(4),YB(4),ZB(4)
- 557 DATA XB/0.5,-.5,0.5,-.5/,YB/0.5,-.5,-.5,0.5/,ZB/0.5,0.5,-.5,-.5/
- 558 C XRANF(IDUM)=2.0*RANF()-1.0
- 559 XRANF(IDUM)=2.0*RAND()-1.0
- 560 IDUM=0
- 561 IF(.NOT.NLRES)GO TO 10
- 562 CALL AGAIN(1)
- 563 GO TO 32
复制代码
可我还是看不出来是哪有问题,所以要请教各位大侠,不胜感激 |
|