Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: [apple scitech] GDB debug fortran code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [apple scitech] GDB debug fortran code



Many thanks to those who replied.

I'm pretty certain this is a compiler bug unless someone can point out what is wrong with the test code below.

ZeVoyager:crash gohara$ cat crash.f
c
c Compile with: ifort crash.f (make sure you are calling the 64-bit ifort)
c Run with: ./a.out
c
program crash

character*120 keyfile
character*120 record

keyfile = 'file.txt'

write(*,*) 'Hello World'

open (unit=1, file=keyfile,status='OLD')
dowhile (.true.)
read (1,30,err=50,end=50) record
30 format (a120)
write(*,*) record
end do
50 continue


	  end
ZeVoyager:crash gohara$ cat file.txt

 Here is some text
ZeVoyager:crash gohara$

ZeVoyager:crash gohara$ ifort crash.f
ZeVoyager:crash gohara$ ./a.out
 Hello World
forrtl: severe (174): SIGSEGV, segmentation fault occurred


All this does is read a file called file.txt (note that the first line is a blank line with no spaces) and then print that out to stdout. If you use the 64-bit version of ifort it crashes in the place I mentioned in an earlier email. YOu can make it not crash if you do one of the following:


1) Add a single (or multiple spaces or characters) on the first line of the file.
2) Comment out the first write statement in the program (Hello World).
3) Use 32-bit ifort, gfortran (32- or 64-bit) or the Portland Compilers for Mac OS X.


It doesn't matter if the code is compiled with the optimizer on or off, debug symbols on or off. The only exception I've seen is in the case of the production code with bounds checking on the program runs to completion.

If there is something wrong with the test code please let me know. Otherwise I'll classify it as a bug and file a report with Intel.

  Thanks again for all of the help and suggestions.

Dave

David W. Gohara, Ph.D.
Center for Computational Biology
Washington University School of Medicine
http://gohara.wustl.edu
http://www.macresearch.org
314-362-1583 (phone)
617-216-8616 (cell)




_______________________________________________ Do not post admin requests to the list. They will be ignored. Scitech mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >[apple scitech] GDB debug fortran code (From: David Gohara <email@hidden>)
 >Re: [apple scitech] GDB debug fortran code (From: Brendan Younger <email@hidden>)
 >Re: [apple scitech] GDB debug fortran code (From: Rich Cook <email@hidden>)
 >Re: [apple scitech] GDB debug fortran code (From: David Gohara <email@hidden>)
 >Re: [apple scitech] GDB debug fortran code (From: Rich Cook <email@hidden>)
 >Re: [apple scitech] GDB debug fortran code (From: David Gohara <email@hidden>)
 >Re: [apple scitech] GDB debug fortran code (From: Albert DeFusco <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.