Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Segmentation Fault error with WRITE command

Status
Not open for further replies.

pritter

Technical User
Jun 9, 2011
2
US
Hi,
I have been working on the development of a code in Fortran to model the trajectory of a rocket. It consists of a for loop that time steps through the trajectory with conditional statements that adapt certain parameters of the rocket. After the loop, there is a section that prints the final results to the prompt window and also writes each time step to a matrix in an output file. The code will run, and I can see the print screen output, but when the code tries to write to the output file it has the error "Segmentation fault." Does anyone have an idea of what might be causing this error?

In debug mode I get this notification:
t@1 (l@1) signal SEGV (no mapping at the fault address) in _malloc_unlocked at 0xfe 65446c
0xfe65446c: _malloc_unlocked+0x022c: ld [%o1 + 8], %o3


I've been using F90, and am not sure of the compiler because it is
through a unix server connection. Thanks in advance.

Paul
 
1) Has the file been opened for writing?
2) Is the file write protected or accessible?
 
I was able to figure it out. It turns out I mislabeled the matrix dimensions in the 'ALLOCATE' command as compared to the size of the matrix that I was trying to write to the file. I had also misplaced the 'ALLOCATE' command. I originally had it in front of the 'READ' command that contained a necessary variable for allocation. I needed to move it behind. Thanks anyway for your help!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top