- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am porting a compaq fortran project (version 6.x) over to the intel
fortran compiler (version 8.0). However, crash always happens at the
internal write statement under the intel fortran compiler.
=========
project brief:
=========
The soultion comprises two parts, one is the c++ project, which in charge of
the user interface, the other project is a Fortran Dll project. The Fortran
Dll is invoked by the C++ project. the problem I meet here is every simple,
the C++ project is just a framework of the dialog based mfc win32
application. In the code response to the click OK button, it will invoke the
fortran dll. The Fortran dll is built as the name of TestDll.dll. The core
part of the C++ and Fortran code are shown as follows:
=========
C++ code
=========
...
typedef unsigned int (__stdcall *_FPTR_START_APP) ( void * );
...
if (nResponse == IDOK) ////code corresponding to the click OK
button
{
CString fileName = "abc";
m_hSimDLL = LoadLibrary((LPCTSTR)"TestDll");
FARPROC fPtrStartApp = ::GetProcAddress( m_hSimDLL, "StartApp" );
void* pvSecurity = NULL;
unsigned int* puiThrdAddr = NULL;
m_hThread = (HANDLE) _beginthreadex( pvSecurity, 0,
(_FPTR_START_APP)fPtrStartApp, (void *)(LPCTSTR)fileName.GetBuffer(0), 0,
puiThrdAddr );
...//idle or do something here so that the thread of the fortran Dll will
run and can be debugged.
}
=========
Fortran code
=========
Corresponding Fortran Dll is made of by the following code:
! ---------------------------------------------------------------------
Subroutine StartApp(iAddressStrBuf)
!DEC$ ATTRIBUTES DLLEXPORT::StartApp
!DEC$ ATTRIBUTES ALIAS: 'StartApp'::STARTAPP
!DEC$ ATTRIBUTES VALUE::iAddressStrBuf
integer iAddressStrBuf
integer i
character*32 strTest
i=555
write(strTest,'(i10.10)') i
return
end subroutine StartApp
!----------end of the fortran dll project ----------------------------------
=========
Symnpton
=========
Whenever the internal write statement is invoked, the program will crash and
report the error of access violation occurred.
If there is anyone knows the issue, could you please give me a hand.
=========
Attached
=========
It appears that I can not send the whole project sample files in zip format,
I will send to those who responsed to this email either in person or to the
newsgroup if needed.
Best Regards,
David
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See this thread:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks for the help, the dll seems work with the link to the single threaded libraryBut new problems emerge as I have to work around the calling to endthreadex which is not supported in the above library.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I am not that familiar with everything that each of these particular libraries do, nor do I pretend to. I am just wondering if there is work being done on the consistancy with which they work? In other words, why is one library compatible and another one is incompatible? I get frustrated when i have to recompile my code until I get the right setup.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Message Edited by JugoslavDujic on 04-19-2004 11:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To Bob,
I don't the reasons why it happens, When I install the IVF, the library file, such as libmmd.dll, libifcoremd.dll were not in the windowssystem32 directory, subsequently, I was not able to make this project work when linked to multi-threaded dll library, apart from the same as you, only the statically linked single threaded dll works.
Regards,
David.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David,
Thanks for the tip. That did the trick. Now my dll's will work with multi-thread dll run-time library.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
My application is crashing in aninternalFORTRAN WRITE statement on XP using the 8.1 compiler in VisualStudio.NET. Any new development since 2004?
Rachel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not aware of any issues with internal WRITE in current compilers and libraries. Which revision of the 8.1 compiler are you using? (8.1.???) Do you have a test case I can look at?
The current version is 9.1.028.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I am using Version 8.1.2380.2003. My application is 250,000 lines long, higly propriatery and I can note create a simple case where it crashes. However, I can make it crash all the time in one of the statments. I have a total of 5500 WRITE statents in the code. Come writing to a UNIT and some are internal WRITE. Even trying to wrap the fortran internal WRITE is a major effort. Any words of wisdom?
Rachel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Generally, I would advise trying a current compiler version. You can have 8.1 and 9.1 installed side by side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I have installed the Version 9.1.3291.2003 and I am getting the crash in the same location in an Internal FORTRAN WRITE stament.
Am I the only person with this problem on XP? XP has been around for almost 5 years. We are only now migrating to this environment.
P.S. I had a problem where NatDbgEE.dll was missing from the Visual Studio .NET 2003 environment. I copied it from a machine that had the 8.1 Compiler. I also had a problem installing 9.1 without deleting 8.1. Therefore, I uninstalled 8.1 from my PC.
Any other ideas?
Thanks,
Rachel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this reproducible while in the debugger? What virtual address (VA) is shown in the error message? What is the address of the variable into which you are writing?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page