sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Running a native binary fails on Ubuntu 14.04.3 LTS

Open khellang opened this issue 10 years ago • 13 comments

I just installed the tooling and ran the following commands

dotnet new
dotnet restore
dotnet build -n

Running the binary fails with the following message:

ILCompiler failed generating code for this method; execution cannot continue.
This is likely because of a feature that is not yet implemented in the compiler.
Method: [System.Private.CoreLib]System.Text.UTF8Encoding.GetBytes

Reason: System.NotImplementedException: getFunctionEntryPoint
   at Internal.JitInterface.CorInfoImpl.getFunctionEntryPoint_wrapper(IntPtr _this, IntPtr& exception, CORINFO_METHOD_STRUCT_* ftn, CORINFO_CONST_LOOKUP& pResult, CORINFO_ACCESS_FLAGS accessFlags)

Any tips? Something's telling me that that I'm not really dealing with a fully native app, but...

ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24

khellang avatar Jan 26 '16 19:01 khellang

@glhanna79. Native is still maturing, so I expect the message is accurate and expected.

TheRealPiotrP avatar Jan 26 '16 20:01 TheRealPiotrP

@gkhanna79

TheRealPiotrP avatar Jan 26 '16 20:01 TheRealPiotrP

This is definitely not expected because we should be able to compile a "Hello World".

The really bizarre part is:

If I restored and published the below project.json and used the published directory as --ilcpath it succeeds in compiling.

The issue occurs only in the current ubuntu drop. Is this drop up to date and good? Cc @Sridhar-MS

{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true,
    },

    "dependencies": {
        "NETStandard.Library": "1.0.0-beta-23704",
        "Microsoft.NETCore.Runtime": "1.0.1-beta-23704",
        "Microsoft.NETCore.TestHost": "1.0.0-beta-23504",
        "Microsoft.DotNet.ILCompiler.SDK": "1.0.4-prerelease-00006",
        "Microsoft.DotNet.ILCompiler": "1.0.4-prerelease-00006",
    },

    "frameworks": {
        "dnxcore50": {
                "imports": "portable-net451+win8"
        }
    }
}

@brthor the CI hello test is still enabled right?

schellap avatar Jan 27 '16 10:01 schellap

@schellap Is there anything I can do to be able to run the native binary? Pass an extra flag or something? I'm going to demo the dotnet tools later today and would like to show the "Hello World" sample.

khellang avatar Jan 27 '16 11:01 khellang

"--native" switch is a compiler that is still under development and in early phases of the same. It is a long way from supporting anything that is more than just plain, vanilla "HelloWorld".

Are you unable to compile and run "HelloWorld" that is produced by doing "dotnet new" ?

gkhanna79 avatar Jan 27 '16 15:01 gkhanna79

@schellap The current Ubuntu drop is not up to date. @Sridhar-MS has been dealing with some weird issues in the VSO CI.

brthor avatar Jan 27 '16 19:01 brthor

@brthor Ubuntu CI builds were failing in VSO but it has been fixed by dotnet/cli#1060.

Sridhar-MS avatar Jan 27 '16 19:01 Sridhar-MS

Nice, so when that goes through we should see some updated drops

brthor avatar Jan 27 '16 19:01 brthor

I had a suspicion of DLL stomping going on again -- the libryujit.so that was brought in conflicts with the ILC's dependency. To workaround for your presentation, you can replace the copy of libryujit.so from this package (replace .nupkg to .zip and libryujit.so is in runtimes/ubuntu.14.04-x64/native/)

schellap avatar Jan 27 '16 22:01 schellap

@schellap AFAIK libryujit is only brought in by ILC?

brthor avatar Jan 27 '16 22:01 brthor

From my .nuget cache -- /home/senthil/.nuget/packages/runtime.ubuntu.14.04-x64.Microsoft.NETCore.Runtime.CoreCLR/1.0.1-rc2-23704/runtimes/ubuntu.14.04-x64/native/libryujit.so. I think this dependency problem needs to be taken care of now that CLI is beyond beta. @piotrpMSFT, you were suggesting commands will go into their own folders, is that plan still on?

schellap avatar Jan 27 '16 22:01 schellap

@kyulee1, is there a reason libryujit.so gets included in the ubuntu CoreCLR package?

schellap avatar Jan 27 '16 22:01 schellap

Since we don't support building native binaries with the CLI anymore, I will close this. @khellang, if needed, please reopen this on dotnet/corert.

thesmithee avatar Jul 27 '16 04:07 thesmithee