-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime exception on android #9510
Comments
The NullReferenceException looks like a low-level bug, potentially a JIT bug. To start investigating it, run it under |
Hi,
Any suggestions would very helpful. |
You should disassemble say 30 instructions before this one |
The problem is that the You can try to to set
|
@dotnet/arm64-contrib |
/cc @qmfrederik |
I think Arm64 for Android is not very different from Arm64 Linux. Arm64 on Linux is usually stable. I would not start by looking at JIT. I would look at your build process. The tutorial you cite looked incomplete. It is important to match coreclr and corefx versions so they are compatible. (The tips are not always comaptible.) It can be determined by looking at the dependencies.prop in both projects. Look at the CoreFxCurrentRef and/or CoreClrCurrentRef tags. I would also start with a coreclr version which passes tests on Linux Arm64. This coreclr version was stable yesterday /cc @janvorli |
Yeah, that 'tutorial' contains my notes from about a year ago, so though it may still contain useful information, I don't think it's very accurate at this time. |
@qmfrederik @jkotas @janvorli, I took coreclr from here and corefx from here. Then I maked all, which described in this fix for coreclr. All builds had completed fine. After this, I transfered all files to my Android device with adb. And then I had run this command to test my application: But I have this error: Any suggestions would very helpful. |
@meold You need to set the
|
@qmfrederik I tried this, but nothing happens about n minutes(very long)... |
@meold corefx on Android was not particularly fast last time I tried it, but N minutes probably means the code hangs somewhere. There are a couple of environment variables you can set that help you keep track of what .NET Core is doing, but your best bet probably is to attach a debugger and get a native stack trace. That should give you an idea of where the code is hanging. I have some (old) notes at https://github.com/qmfrederik/coredroid#getting-ready-to-debug. Can you try to run your app via the debugger as described there? |
@qmfrederik, I had attached to debugger and here are results: |
@meold What you can try is this:
|
You can also try to set |
@qmfrederik, thanks. I have the following output now: But I do not understand what that means. |
@qmfrederik, OK, I copied the console output as text. |
@meold can you please run |
@janvorli, here is result of @janvorli, in the first case I took coreclr and corefx from |
@janvorli, and with |
@meold it is strange, since the hang happens during initialization of the process before any of our code is executed. Now thinking about it, it actually seems that the fact that it complained about the "libgnustl_shared.so" and you had to set the LD_LIBRARY_PATH while with your first attempt this was not happening seems to indicate that this actually may be an indication of the problem. Do you still have the previous binaries that worked (except for the globalization issue)? It would be helpful to compare dependencies of those and the dependencies of the ones you've just built. You can use the |
@meold There hasn't been any activity on this issue in a long time. I'm going to close it. If you are still debugging and have additional questions, please re-open. |
Hi,
I'm facing up with a strange behavior of the compiled HelloWorld app for android coreclr.
So, first of all, the cross building of the coreclr and corefx had a bunch of issues, but at the end it was built successfully.
So after that I've compiled a very simple app with a single "Console.WriteLine("Hello World");" statement in the Main. Than I prepared necessary files in the dist/helloworld folder (as described in this tutorial) and pushed it with adb tool to android device.
So, when I run
coreuser@Ubuntu16D:~/git/coredroid/apps/helloworld$ adb shell LD_LIBRARY_PATH=/data/local/tmp/coredroid/ /data/local/tmp/coredroid/corerun /data/local/tmp/coredroid/helloworld.dll
I got a known error "Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support." with the next output:
WARNING: linker: /data/local/tmp/coredroid/libcoreclr.so: unused DT entry: type 0xf arg 0x10e2 WARNING: linker: /data/local/tmp/coredroid/libclrjit.so: unused DT entry: type 0xf arg 0xa79 FailFast: Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. at System.Environment.FailFast(System.String) at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode() at System.Globalization.GlobalizationMode..cctor() at System.Globalization.GlobalizationMode.get_Invariant() at System.Globalization.CultureData.CreateCultureWithInvariantData() at System.Globalization.CultureData.get_Invariant() at System.Globalization.CultureData.GetCultureData(System.String, Boolean) at System.Globalization.CultureInfo.InitializeFromName(System.String, Boolean) at System.Globalization.CultureInfo..ctor(System.String, Boolean) at System.Globalization.CultureInfo.Init() at System.Globalization.CultureInfo..cctor() at System.Globalization.CultureInfo.get_InvariantCulture() at System.IO.TextWriter+NullTextWriter..ctor() at System.IO.TextWriter..cctor() at System.IO.StreamWriter..ctor(System.IO.Stream, System.Text.Encoding, Int32, Boolean) at System.Console.CreateOutputWriter(System.IO.Stream) at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func1<System.__Canon>) at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func1<System.__Canon>) at System.Console.WriteLine(System.String) at ConsoleApp.Program.Main(System.String[]) Aborted
Then I've tried to add
CORECLR_GLOBAL_INVARIANT=1
env variable to the previous command, but got another runtime error:WARNING: linker: /data/local/tmp/coredroid/libcoreclr.so: unused DT entry: type 0xf arg 0x10e2 WARNING: linker: /data/local/tmp/coredroid/libclrjit.so: unused DT entry: type 0xf arg 0xa79 Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.IO.StreamWriter..ctor(Stream stream, Encoding encoding, Int32 bufferSize, Boolean leaveOpen) at System.Console.CreateOutputWriter(Stream outputStream) at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Object& syncLock, Func1 valueFactory) at System.Threading.LazyInitializer.EnsureInitialized[T](T& target, Object& syncLock, Func1 valueFactory) at System.Console.WriteLine(String value) at ConsoleApp.Program.Main(String[] args) in /home/padre/git/coredroid/apps/helloworld/Program.cs:line 9 Aborted
So I'm wondering how I can to localize this error - is it something wrong with cross-building of the coreclr or some other issue?
Any suggestions would very helpful.
Thanks.
The text was updated successfully, but these errors were encountered: