Topic: Confused - Application runs sometimes but sometimes does not!!
Hello dear FORTRAN users,
I am having a strange problem with my FORTRAN application. Here are some details about my application:
- Uses ALLOCATABLE Data structures to hold information
- Interfaces with a C++ dll which returns an array pointer. I convert the C++ array pointer to FORTRAN pointer using the intrinsic method c_f_pointer
- Reads from an XML file and writes outputs to an XML file, and two text files.
The application builds without any problem and after I built it, I tried it in debug mode within SF and it runs perfectly. So today morning I just thought I will double click the application EXE. In doing so, I found out that the application is not responding. I had to go to Task manager and kill the program. I tried multiple times and everytime that happened. So just randomly, I deleted the output files created by the application and gmon.out and again double clicked the EXE. Voila, the program runs again.
It might run a few times and randomly it will freeze. Then I repeat the above process and bring the application back to life. I am really lost what is the problem here. Is it a process of bad memory management? Is it something to do with how the C++ pointer and FORTRAN pointer is handled?
I thought it could be a problem with the debug version, so I changed the project to options to no include Debug variables. The problem however exists.
Any ideas/help/suggestion is much appreciated.
Regards
Sankar
skp