Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29239 Discussions

crash in instrinsic function on win2k

drb
Beginner
865 Views
Hi,

I have a multithreaded code with which I am runnin into some problems. I have calls to the intrinsic function DATE_AND_TIME and GETDAT. When I start a second thread, the function DATE_AND_TIME causes a crash, so I replaced it with CPU_TIME which seems to work. However, later on there is call to GETDAT which causes the crash in a similiar way. However, both of these subroutines were called in the original master thread without problem.

More confusingly, this does not crash on windows xp, and does not crash on windows2000 with the development env (compilers etc) installed, only when I move the exe over to another machine running win2k (it works on winxp without compilers) without the compilers installed do I get this problem.

This leads me to think that it is a runtime library problem, however, I have taken over the required dll's I think, so it is difficult to understand the problem. It isn't consistent however, i have two options, which are similiar, that start different subroutines in threads. It is only with one threaded subroutine that causes the problem.

Any tips greatly appreciated, I cannot debug since the problem doesn't happen when the compilers are installed

Thanks

Ben
0 Kudos
6 Replies
Steven_L_Intel1
Employee
865 Views
Please elaborate on "crash". What is the exact and complete error message? Are you building with the multithreaded libraries?
0 Kudos
drb
Beginner
865 Views
Sorry, I should have been clearer. I get the error:

"The instruction at "0x78003ef8" referenced memory at "0x00000046". The memory could not be "read".



I have tried to increase the stacksize for the new thread, but this has not made any effect.



Thanks,



Ben

edit: Yes, I have the multithreaded libraries switched on. I have tried the exe on two win2k machines without compilers, one with the dotnetfx.exe applied one without, I am not sure if this should make a difference. The project is a mixed C++/IVF project, the IVF being the main code, the C++ linked in. Using Intel 9.0 and C++.NET 2003

Message Edited by drb on 09-15-2005 06:07 AM

0 Kudos
Steven_L_Intel1
Employee
865 Views
I have no idea what dotnetfix.exe is.

Here's an experiment. On the system where this program doesn't work, boot into Safe Mode (typically you press F8 during the boot process to specify this) and then try running the program. What happens?
0 Kudos
Paul_Curtis
Valued Contributor I
865 Views
I run highly multithreaded F90 codes on all varieties of WinXP and Win2K without any crashes. These codes make extensive use of timing functions, using the Win32 API GetLocalTime (st) where st is a TYPE T_SYSTEMTIME. The systemtime data type provides millisecond resolution andeasily supports any sort of elapsed-time calculations.
0 Kudos
drb
Beginner
865 Views
Thank you for the replies. I think I have discovered a solution, but not the problem (which I suspect lies in some memory problems somewhere else in the code).
In an attempt to resolve the crash, I tried add the instrinsic call in various places to the subroutine. If I place the call to DATE_AND_TIME at the first executable line in the subroutine,then the program works fine.

Ben
0 Kudos
jim_dempsey
Beginner
865 Views
For the modules that contain the call the the intrinsic subroutine DATE_AND_TIME is the compiler option -Qauto used?.
i.e. is the 8 entry integer array for values on the stack?
Without the -Qauto a common name mangled block is created for the integer arrayfor exclusive use by the module (not the thread calling the module)and then used by all threads calling the particular routine?
Jim Dempsey
0 Kudos
Reply