forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JIT Compiler encountered an internal limitation
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Tue Mar 29, 2016 12:24 pm    Post subject: JIT Compiler encountered an internal limitation Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Mon Apr 04, 2016 3:49 pm    Post subject: Reply with quote

In order to get any sensible suggestions on the forums you'll have to provide some code to give anyone who answers a starting point.

If the case you describe was 'known' then I'm sure you'd have had a respondìse by now.

Error messages are, to say the least, sometimes rather cryptic for all compilers and FTN95 is no exception to the rule. We've had lots of discussion on the forums about the meanings of some cryptic messages.
Best to post code to hope to get any idea of what the problem might be.

Preferably an as simple as possible 'reproducer' code, rather than full programs.
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Tue Apr 05, 2016 5:02 am    Post subject: Reply with quote

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
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Tue Apr 05, 2016 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Apr 06, 2016 8:37 pm    Post subject: Reply with quote

Hi,
sorry I have little .NET experience and don't use it at all nor Vs.
My previous comments were aimed at helping much more able members of the forum than I to try to help you trace the origin of your problem.

However, a quick google of the 'JIT compiler ecountered an internal limitation' error message revealed this forum article (link below) which might (or probably not) help you as it mentions some of the symptoms you do.
Could be it's a VS/.NET problem ?

https://connect.microsoft.com/VisualStudio/feedback/details/872506/jit-compiler-encountered-an-internal-limitation

Do 'Intellisense settings' wrt VS mean anything to you ? - scroll down in the link check out the comments, there seems to be a simple solution ìfor their problem.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Thu Apr 07, 2016 2:50 am    Post subject: Re: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Apr 07, 2016 5:31 pm    Post subject: Reply with quote

mecej4 is probably spot on with his initial diagnosis - as usual :O)

It does appear that the line numbers in your code where the problem may be are in fact listed (although that could somtimes be a red herring, but it's worth a start there).
What's interesting is that there are 2 different line numbers (or red herrings) quoted as the problem location in the 2 examples you give, lines 554 (Debiìug .NET) or line 299 (.NET) which is curious.
__________________

However, Moorthy, I've also just noticed in your original post that you said you're using the Express Version and your machine is Win7 x64.

I'd suggest you also try downloading and installing VS Community Edition (this was mentioned in one of your other recent posts) and using the latest Personal Compiler version (which is 7.2), simply because the version of compiler is v5.4 in Express and was released a long time ago and also the cut-down VS shell used goes way back too.

To quote past wise words from another of our erstwhile experts, Eddie (a.k.a. Litusaxonicum) :-
Quote:
It is unreasonable to expect a version of FTN95 that may well precede a particular Windows version to work faultlessly: Microsoft are not sticklers for backwards compatability. This forum is full of discussions each time MS brings out a new .NET version OR a new Windows version


... and while your at it, or before even, try installing the latest version of .NET if you haven't already !!!

even if mecej4's indication helps you solve the current problem doing the above will minimise potential problems in the future I'd guess.
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Apr 07, 2016 7:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Apr 07, 2016 7:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Apr 07, 2016 7:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Apr 07, 2016 7:17 pm    Post subject: Reply with quote

Code:


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
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Apr 07, 2016 7:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Thu Apr 07, 2016 8:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Apr 07, 2016 8:35 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Apr 07, 2016 8:36 pm    Post subject: Reply with quote

PS - if you log in you can delete the several incomplete posts with missing code by clicking on the V at top right corner of each post window.

As mecej4 says above, all the code is needed otherwise noone can even see the lines where the error message says it has failed in the 2 cases where it's indicated.
Have you found those locations (which lines) ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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