ºìÁªLinuxÃÅ»§
Linux°ïÖú

Çë½Ì´óÏÀ£ºSegmentation fault

·¢²¼Ê±¼ä:2007-06-01 16:36:55À´Ô´:ºìÁª×÷Õß:spring627
¸÷λ´óÏÀ£¬ÎÒÊǸսӴ¥ linux µÄ£¬²»µÃ²»ÔÚÕâ¸öϵͳϵ÷ÊÔ fortran ³ÌÐò¡£ÓÉÓÚʱ¼äºÜ½ô£¬Ç¿¶ÈºÜ´ó£¬ËùÒÔÔÚÍøÉÏËÑÁ˺ܶàÌìҲûÓкܴó½øÕ¹£¬ÏÖ²»µÃ²»ÇóÖú¸÷λ´óÏÀ£¬¸æËßÎÒÏÂÒ»²½ÒªÔõô×ö£¬»òÕß¿´Ð©ÄÄ·½ÃæµÄÊé²ÅÄܼÌÐøÏÂÈ¥¡£
ÊÇÕâÑùµÄ£¬ÀÏʦ¸øÁËÎÒÒ»¸öfortranÔ´³ÌÐò£¬Ö®Ç°ÔÚ UNIX ϱàÒë²¢³É¹¦ÔËÐйý£¬ÏÖÔÚÎÒÓõÄÊÇ linux £¬ÒѾ­±àÒë³É¹¦£¬µ«ÊÇÔËÐоͳö´í£¬Ïȸø³öÎҵıàÒëÎļþ£º


[CODE]
[hujinhe@console ~]$ cat com
mpif77 -g mdrdipord.f -c
mpif77 -g libmd.f -c
mpif77 -g dceign.f -c
mpif77 -g mdrdipord.o libmd.o dceign.o -o mdord.exe
[hujinhe@console ~]$
[/CODE]
ÔËÐнá¹ûÈçÏ£º


[CODE]
[hujinhe@console ~]$ ./mdord.exe out.out
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
mdord.exe 000000000041E998 Unknown Unknown Unknown
mdord.exe 0000000000405C6A Unknown Unknown Unknown
mdord.exe 0000000000403074 Unknown Unknown Unknown
mdord.exe 000000000040302A Unknown Unknown Unknown
libc.so.6 000000378851C4BB Unknown Unknown Unknown
mdord.exe 0000000000402F6A Unknown Unknown Unknown
[hujinhe@console ~]$
[/CODE]
ËùÒÔÎÒ¾ÍѧϰÓÃgdbµ÷ÊÔ£¬³öÏÖÏÂÃæµÄÇé¿ö£º


[CODE]
[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 out.out
Starting program: /export/home/hujinhe/mdord.exe 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)
[/CODE]
ΪÁËѧ»áµ÷ÊÔ³ÌÐò£¬ÎÒ°ÑÂÛ̳ÉϽéÉܵÄÓйØÌû×Ó¶¼¿´ÁË£¬·¢ÏÖÎÄÕºܺ㬾ÍÊÇÀý×ÓºÜÉÙ£¬ÎÒ´ó¸ÅµÄÃüÁ֪µÀ£¬¾ÍÊDz»»áʵ¼ÊÓ¦Óã¬ËùÒÔÓöµ½ÉÏÃæµÄÎÊÌâÎҾͲ»ÖªµÀÔõô°ìÁË£¬´ó¸ÅÖªµÀÊǶδíÎ󣬵«Ôõô¿´¾ßÌå´íÎó³öÔÚÄÄ£¿½ÓÏÂÀ´ÎÒÒªÔõô×ö£¿
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ