 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Tue Mar 29, 2016 12:24 pm Post subject: JIT Compiler encountered an internal limitation |
|
|
Hello,
I face this problem with FTN95 Express today.
The Express solution platform is in .NET mode. But when I get into debug mode, at a point calling for a subroutine, it was showing this error as given below (unable to paste the screenshot here)
Quote: |
InvalidProgramException occured
JIT compiler encountered an internal limitation
System.InvalidProgramException occurred
Message: JIT Compiler encountered an internal limitation
|
So, I am unable to catch/ trace the bug in FTN95 Express IDE. My laptop has a 64bit processor.
But if I change the solution platform to Win32, it debugs and goes through nicely without any error or exceptions. Is this due to a conflict of 32bit Compiler on 64bit hardware. Any idea?
I thought of approaching our Support Forum to seek for the suitable solutions to make this to run in .NET or what should be done next. Pls. suggest. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Tue Apr 05, 2016 5:02 am Post subject: |
|
|
Thats a good suggestion John. Thanks.
But please let me know what is the issue. Even now, I am facing this problem.
When I go for Release .NET, Release Win32, Debug .NET the exe file is built, but gives the run time error of what I quoted earlier.
But when I build in Debug win32, Checkmate Win32 platform, it runs absolutely fine. In short, I am unable to make the Release executables as of now.
But I don't think it is of any code related issues, but with OS Bits related. I use Win7 64 bit i7 processor. If that is so, what parameters to be set while compiling and building to overcome this issue. Pls. suggest. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Tue Apr 05, 2016 5:35 am Post subject: |
|
|
Hi John
I just want to share more details, to give better understanding of the problems that I faced.
As said before, I show the error I faced in each build mode.
Quote: |
Debug .NET
D:\C00\C02\SparseDll\TestSparse\Debug\NET>TestSparse.exe
Please enter the input file:D:\C00\C02\Sparse\TestIn1b.dat
Please enter the Output file:D:\C00\C02\Sparse\SymmSparse\aa
10
Calling StoreMatrix Routine..
Unhandled Exception: System.InvalidProgramException: JIT Compiler encountered an internal limitation.
at TestSparse.STORESYMMATRIX()
at TestSparse.SPARSE() in D:\C00\C02\SparseDll\BiFact_01.F95:line 554
--------------------------------------
Release .NET
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at TestSparse.SIMLORDERSYMMATRIX()
at TestSparse.SPARSE() in D:\C00\C02\SparseDll\BiFact_01.F95:line 299
----------------------------------------------
Release Win32
Runtime error from program:d:\c00\c02\sparsedll\testsparse\release\win32\testsparse.exe
Access Violation
The instruction at address 004053af attempted to read from location 113ea9f0
00404760 STORESYMMATRIX [+0c4f]
00401960 SPARSE [+1002]
eax=0360f4f0 ebx=0360f654 ecx=00000045
edx=0008e3c8 esi=0040811c edi=03776d40
ebp=0360f888 esp=0360f4ec IOPL=2
ds=002b es=002b fs=0053
gs=002b cs=0023 ss=002b
flgs=00010202 [NC OP NZ SN DN NV]
004053af mov ecx,[eax+edi*4]
004053b3 mov esi,[ebp-0x248]
004053b9 mov [esi],ecx
|
I only see that Debug Win32 and Checkmate Win32 platform builds are absolutely fine working in runtime. The rest are showing the running time problem as above.
My Laptop is with Intel Core(TM) i7 processor, with Win7 64bit OS.
I am able to suspect, that the Compiled build does not support 64bits in Release Mode (.NET/Win32). But in that case, how the Debug Win32 are working fine.
What is the root cause of my problem. Can I overcome this with some switches while building. I have even tried with dbk_link4 for linking the dbk files in .NET platform.
Any suggestions, clues to overcome this issues. Thanks in advance.. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Thu Apr 07, 2016 2:50 am Post subject: Re: |
|
|
narayanamoorthy_k wrote: |
But I don't think it is of any code related issues, but with OS Bits related. If that is so, what parameters to be set while compiling and building to overcome this issue. Pls. suggest. |
I suspect that you are not only barking up the wrong tree but also doing so rather perversely.
You have not shown us the source code that is giving you errors, not even a fragment. If you think that there are some magical compiler options that will diagnose and fix the problem no matter what the source code is, you are mistaken.
FTN95/Win32 provides excellent debugging facilities, many of which are unavailable when you use FTN95/NET.
The error traceback that you showed in your post (of Mon Apr 04, 2016 10:35 pm) gives a clear indication to me that the problem is being caused by trying to do read-access on an array variable with an incorrect index. Specifically, I suspect that EDI would contain the index value, and EAX contains the address of the base of the array, each element of which occupies 4 bytes. In this case, you have something such as A(I), with I = Z'03776d40' = 58158400. Is it reasonable to have an index with a value of over 58 million?
I suggest that you recompile with /check and locate the line number in the source code where the subscript error occurs. If using /check makes the bug stay hidden, things are a bit tougher, but there are other methods that can be used -- a bridge to be crossed later, if necessary. |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Apr 07, 2016 7:09 pm Post subject: |
|
|
Thanks mecej4 and John.. I am still debugging that issue.
Perhaps, it just occurs that .NET was picking wrongly in my laptop. But I have already installed .NET Framework 4.5.1 and 4.6 SDK. Earlier, I just uninstalled the FTN95 Express and Reinstalled, but I have not invoked the FTN95 from FTN95 Express installer, as I have the FTN95 personal edition already active and the Express use that FTN95 personal edition kernal. This combination is excellent as it helps a lot in "Step-into (F11)" steps as it shows the values of arrays and others very clearly.
Coming back to my code which just calls another subroutine only. Pls. see the code below.
Code: |
551 print*, 'Calling StoreMatrix Routine..'
552 !iArrayRowSize=ToT
!iArrayColSize=ToT
554 call StoreSymMatrix
if (.not. StoreMatrix ) then
print*, 'Error: Problem in StoreSymMatrix..Exiting..'
goto 900
558 endif
|
But the StoreSymMatrix Routine is given below. _________________ Thanks and Regards
Moorthy
Last edited by narayanamoorthy_k on Sun Apr 10, 2016 7:51 am; edited 1 time in total |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Apr 07, 2016 7:13 pm Post subject: |
|
|
Thanks mecej4 and John.. I am still debugging that issue.
Perhaps, it just occurs that .NET was picking wrongly in my laptop. But I have already installed .NET Framework 4.5.1 and 4.6 SDK. Earlier, I just uninstalled the FTN95 Express and Reinstalled, but I have not invoked the FTN95 from FTN95 Express installer, as I have the FTN95 personal edition already active and the Express use that FTN95 personal edition kernal. This combination is excellent as it helps a lot in "Step-into (F11)" steps as it shows the values of arrays and others very clearly.
Coming back to my code which just calls another subroutine only. Pls. see the code below.
Code: |
551 print*, 'Calling StoreMatrix Routine..'
552 !iArrayRowSize=ToT
!iArrayColSize=ToT
554 call StoreSymMatrix
if (.not. StoreMatrix ) then
print*, 'Error: Problem in StoreSymMatrix..Exiting..'
goto 900
558 endif
|
But the StoreSymMatrix Routine is given below. _________________ Thanks and Regards
Moorthy
Last edited by narayanamoorthy_k on Mon Apr 11, 2016 5:20 am; edited 1 time in total |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Apr 07, 2016 7:15 pm Post subject: |
|
|
Sorry, my full reply does not show here in one post, hence splitting it .
Part 1:
Thanks mecej4 and John.. I am still debugging that issue.
Perhaps, it just occurs that .NET was picking wrongly in my laptop. But I have already installed .NET Framework 4.5.1 and 4.6 SDK. Earlier, I just uninstalled the FTN95 Express and Reinstalled, but I have not invoked the FTN95 from FTN95 Express installer, as I have the FTN95 personal edition already active and the Express use that FTN95 personal edition kernal. This combination is excellent as it helps a lot in "Step-into (F11)" steps as it shows the values of arrays and others very clearly.
Coming back to my code which just calls another subroutine only. Pls. see the code below.
Code: |
551 print*, 'Calling StoreMatrix Routine..'
552 !iArrayRowSize=ToT
!iArrayColSize=ToT
554 call StoreSymMatrix
if (.not. StoreMatrix ) then
print*, 'Error: Problem in StoreSymMatrix..Exiting..'
goto 900
558 endif
|
_________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Apr 07, 2016 7:17 pm Post subject: |
|
|
THanks John
I tried to delete this post. but There is edit/delete option of the individual post. When I clicked, it showed me Edit Post window, and I deleted the message window. But I am unable to see the "Delete Post" option in the respective message post. How do I do it. Thanks _________________ Thanks and Regards
Moorthy
Last edited by narayanamoorthy_k on Sun Apr 10, 2016 7:54 am; edited 1 time in total |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Thu Apr 07, 2016 7:19 pm Post subject: |
|
|
I see that the subroutine doesn't post completely. WIll send it through PM
The rest part of my reply
Part 3:
But here in StoreSymMatrix subroutine just stores a given array. It works fine with Win32 compilation, but not with .NET.
I am reproducing the code as mecej4 and you also liked to view it.
Anyhow, thanks for your attention to help me out. Even while I am talking now, I just uninstalled FTN95 Express and am going to reinstall again to check. Perhaps, the .NET version also I have to check and install if any latest one. However, I have noticed that FTN95 Express installs the "visual studio shell 2008 (isolated)" and later I just installed the latest shell 2013 (isolated) also, assuming that might help. But no success so far.
I keep pushing myself for this visual studio type of debugging, as I love it as it provides so many facilities to view the interim values of each line of codes and loops, which are very good for not to write so many print statements to view the code to understand how it behaves.. Thats why. Hope you also liked this. I see that PLATO does not provide that values to be shown dynamically for every lines of code. Thats only disadvantage I see with PLATO.
Thank a lot mecej4 and John. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Thu Apr 07, 2016 8:03 pm Post subject: |
|
|
I'm afraid that your code fragments add up to more lines of code than I am inclined to read line by line.
Not much can be done until you post the source codes for all the subroutines, modules and the main program plus any needed data files, and provide instructions for building and running the program in such a way that the bug can be reproduced.
The Silverfrost forum does not allow posting large amounts of code. Please zip up all the files that you need, upload the zip file to a shareable cloud storage space such as OneDrive, DropBox, Google Drive, etc., and provide a link in a post to this forum.
Last edited by mecej4 on Fri Apr 08, 2016 1:23 am; edited 1 time in total |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Apr 08, 2016 3:12 am Post subject: |
|
|
I may be wrong, but I have never considered that .NET is a useful coding environment for linear equation solution, while win32 and soon FTN95 /64 to be more suited. Win32 and .NET are very different.
Is finding the problem with this .NET approach more related to an unsuitable environment, rather than a code problem ? |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Fri Apr 08, 2016 5:37 am Post subject: Re: |
|
|
JohnCampbell wrote: | I may be wrong, but I have never considered that .NET is a useful coding environment for linear equation solution, while win32 and soon FTN95 /64 to be more suited. Win32 and .NET are very different.
Is finding the problem with this .NET approach more related to an unsuitable environment, rather than a code problem ? |
I think that the meanderings in this thread have spread more confusion than necessary. If I am not mistaken, OP is working with a character mode Fortran program. When he mentions ".NET", he is talking about using FTN95 to compile the Fortran source code into MSIL, which is then run on the .NET VM. In other cases, he has FTN95 compiling and linking the code to generate a Win32 PE EXE. Therefore, as far as "coding environment" is concerned, there is only one: Fortran source code using some editor (Plato, VS Editor, ...) .
When there are bugs in the Fortran source code, the (mis)behavior of the compiled program is, in general, ill-defined and, as we may expect, depend on the "instruction set" that is targeted (X86 instruction set or MSIL). |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Sun Apr 10, 2016 7:57 am Post subject: Re: |
|
|
mecej4 wrote: | I'm afraid that your code fragments add up to more lines of code than I am inclined to read line by line.
Not much can be done until you post the source codes for all the subroutines, modules and the main program plus any needed data files, and provide instructions for building and running the program in such a way that the bug can be reproduced.
The Silverfrost forum does not allow posting large amounts of code. Please zip up all the files that you need, upload the zip file to a shareable cloud storage space such as OneDrive, DropBox, Google Drive, etc., and provide a link in a post to this forum. |
Thanks mecej4. I realised this while posting my message. but before "submit"ting the post, while seeing the "Preview", it shows me the complete post preview, hence Am submitted that post.
I will follow the code sending like the way you suggested. Thanks a lot. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Sun Apr 10, 2016 8:01 am Post subject: Re: |
|
|
narayanamoorthy_k wrote: |
Thanks mecej4. I realised this while posting my message. but before "submit"ting the post, while seeing the "Preview", it shows me the complete post preview, hence Am submitted that post.
I will follow the code sending like the way you suggested. Thanks a lot. |
Hi mecej4. Just after posting the previous message, I see that my post shows the "x" button on its right top corner. Means, I am now only started getting that feature in my posting. Earlier I never seen it. But I don't get that in the older posts.
Thanks. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Sun Apr 10, 2016 8:07 am Post subject: Re: |
|
|
John-Silver wrote: | Quote: | I have the FTN95 personal edition already active and the Express use that FTN95 personal edition kernal |
I don't understand. The Express version is 'sealed' as far as I'm aware and uses v5.4 (very old now) of the compiler. As far as I'm aware its not possivle to 'activate' the latest compiler version from within Express.
hence my suggestion of community version of VS + Personal version compiler |
I mean the FTN95 express (visual studio IDE) V5.4 from this link where I downloaded.
http://www.silverfrost.com/52/ftn95_express.aspx
Is it frozen one and not active? _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|