runtime icon indicating copy to clipboard operation
runtime copied to clipboard

JITTrackingEnabled on coreclr making internals visible to not work correctly

Open KevinRansom opened this issue 10 years ago • 5 comments

When the F# compiler emits a DebuggableAttribute with JitEnabled false, the built binary can no longer access internals in another assembly when internals visible has been correctly specified.

The attached zip file has two complete fsharp compilers and its coreclr dependencies.

jit-tracking.zip

fsc.portable has jit tracking on. fsc-pdbonly has jit tracking off.

Not that corerun fsc.exe, fails for fsc.portable and runs correctly for fsc-pdbonly.

Expected both to work.

Kevin Ransom

KevinRansom avatar Mar 06 '16 23:03 KevinRansom

The same problem exists for DisableJITcompileOptimizer flag.

jkotas avatar Aug 10 '16 01:08 jkotas

Repro:

\\scratch2\scratch\kevinr\bin.zip
unzip bin.zip --- it contains the rtm coreclr+fsharp
dotnet.exe fsi.exe

observe the output:
c:\KevinRansom\visualfsharp\debug\coreclr\bin>dotnet.exe fsi.exe

Unhandled Exception: System.MethodAccessException: Attempt by method 'Microsoft.FSharp.Compiler.Interactive.Shell.MainMain(System.String[])' to access method 'Microsoft.FSharp.Compiler.Lib+SaveAndRestoreConsoleEncoding..ctor()' failed.
   at Microsoft.FSharp.Compiler.Interactive.Shell.MainMain(String[] argv)

c:\KevinRansom\visualfsharp\debug\coreclr\bin>cd ..

KevinRansom avatar Aug 11 '16 06:08 KevinRansom

We need to mask the attribute here: https://github.com/dotnet/coreclr/blob/master/src/vm/baseassemblyspec.cpp#L271

@fadimounir We need to fix this for 2.0. It is blocking F# on .NET Core. If you are not able to get to it, somebody else in Gaurav's team should be able to take care of it. Thanks.

jkotas avatar Mar 28 '17 23:03 jkotas

@gkhanna79, can someone on your team take a look at this issue?

fadimounir avatar Mar 30 '17 23:03 fadimounir

@kouvel can take a look.

gkhanna79 avatar Mar 30 '17 23:03 gkhanna79