Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

canGetCookieForPInvokeCalliSig not implemented #5587

Closed
mellinoe opened this issue Mar 20, 2018 · 7 comments
Closed

canGetCookieForPInvokeCalliSig not implemented #5587

mellinoe opened this issue Mar 20, 2018 · 7 comments

Comments

@mellinoe
Copy link
Contributor

mellinoe commented Mar 20, 2018

I was trying to compile this project with CoreRT: https://github.com/mellinoe/veldrid/tree/master/src/NeoDemo.

I added the latest Microsoft.DotNet.ILCompiler package and simply ran dotnet publish -r win-x64.

  ILCompiler.CodeGenerationFailedException: Code generation failed ---> System.NotImplementedException: canGetCookieForPInvokeCalliSig
     at Internal.JitInterface.CorInfoImpl.canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig)
     at Internal.JitInterface.CorInfoImpl._canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig)
     --- End of inner exception stack trace ---
     at Internal.JitInterface.CorInfoImpl.CompileMethod(IMethodCodeNode methodCodeNodeNeedingCode, MethodIL methodIL)
     at ILCompiler.RyuJitCompilation.ComputeDependencyNodeDependencies(List`1 obj)
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes()
     at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile, ObjectDumper dumper)
     at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile, ObjectDumper dumper)
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)

Any plans to implement this functionality, or is it tracked anywhere else? I searched briefly but didn't find anything.

@MichalStrehovsky
Copy link
Member

Thanks for reporting it! We don't track this anywhere because we didn't hit it yet. Seems like this is from a calli to a p/invoke. I'll have a look if we can do something easy there in the next couple of days.

@mellinoe
Copy link
Contributor Author

Seems like this is from a calli to a p/invoke.

Yes, that's likely, and it's probably from this library. If that's the case, then a simpler repro could probably be created from that package alone.

@mellinoe
Copy link
Contributor Author

mellinoe commented Apr 7, 2018

Small update: I checked again and this is indeed caused by the above library. SharpDX hits the same issue since it also uses calli directly.

@Krakean
Copy link

Krakean commented Apr 13, 2018

@MichalStrehovsky +1, can't use SharpDX due this :-\

@feliwir
Copy link
Contributor

feliwir commented Apr 14, 2018

@MichalStrehovsky +1 we are hitting this issue aswell in our project. Would greatly appreciate a fix

MichalStrehovsky added a commit to MichalStrehovsky/corert that referenced this issue Apr 17, 2018
This is a building block to be able to write a repro case for dotnet#5587 in C#. With this, it's possible to use `AddrOf` intrinsic in connection with `StdCall` to hit the unimplemented functionality with pure C#.
jkotas added a commit that referenced this issue Jun 24, 2018
MichalStrehovsky added a commit that referenced this issue Jul 2, 2018
This is a building block to be able to write a repro case for #5587 in C#. With this, it's possible to use `AddrOf` intrinsic in connection with `StdCall` to hit the unimplemented functionality with pure C#.
MichalStrehovsky pushed a commit that referenced this issue Jul 2, 2018
@jkotas
Copy link
Member

jkotas commented Jul 2, 2018

@mellinoe @Krakean @feliwir The CoreRT packages with the fix are available now. Please give it a try and please let us know if you run into other blocking issues for you project.

@mellinoe
Copy link
Contributor Author

mellinoe commented Jul 3, 2018

@jkotas I get a lot further now, and most of my code works. I still have an issue with SharpDX which I filed over in #6042 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants