-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Mono][Android] App crashes with InvalidProgramException #78833
Comments
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsDescriptionMy code started crashing after pulling from Reproduction StepsReplace using System;
using System.Net.Http;
try
{
using var handler = new SocketsHttpHandler();
using var client = new HttpClient(handler);
var response = await client.GetAsync("https://dot.net");
Console.WriteLine(response);
return 42;
}
catch (Exception ex)
{
Console.WriteLine(ex);
return 1;
} Expected behaviorThe HTTP response is pritnted in logcat. Actual behaviorAn exception is thrown: System.TypeInitializationException: The type initializer for 'System.Net.CookieContainer' threw an exception.
---> System.InvalidProgramException: Invalid IL code in (wrapper managed-to-native) Interop/Sys:GetDomainName (byte*,int): IL_0012: calli 0x00000003
at Interop.Sys.GetDomainName()
at System.Net.NetworkInformation.HostInformationPal.GetDomainName()
at System.Net.NetworkInformation.HostInformation.get_DomainName()
at System.Net.CookieContainer.CreateFqdnMyDomain()
at System.Net.CookieContainer..cctor()
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnectionSettings.CloneAndNormalize()
at System.Net.Http.SocketsHttpHandler.SetupHandlerChain()
at System.Net.Http.SocketsHttpHandler.SendAsync(HttpRequestMessage , CancellationToken )
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage , CancellationToken )
at System.Net.Http.HttpClient.<>n__0(HttpRequestMessage , CancellationToken )
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage , HttpCompletionOption , CancellationTokenSource , Boolean , CancellationTokenSource , CancellationToken )
at Program.<Main>$(String[] ) Regression?No response Known WorkaroundsNo response Configuration
Other informationI've traced the problem to #75542. Basic hello world program works but when I try to make an HTTP request, the program crashes. The tests in CI seem to pass which is quite strange. /cc @lambdageek @naricc
|
This comment was marked as outdated.
This comment was marked as outdated.
Hmm, so I figured out that when I run the Android sample and I explicitly include the
|
ok, in that case we should figure out:
/cc @naricc |
@simonrozsival Can you please verify that the issue still occurs? |
@jandupej I tested it on latest main and the Android app still crashes when I don't explicitly set
|
The crashes are resolved with #89564. Closing. |
Description
My code started crashing after pulling from
main
. There seems to be a some problem with the IL that's emitted by Mono on Android arm64.Reproduction Steps
Replace
src/mono/sample/Android/Program.cs
with the following code and run it usingmake -C src/mono/sample/Android MONO_ARCH=arm64
:Expected behavior
The HTTP response is pritnted in logcat.
Actual behavior
An exception is thrown:
Regression?
No response
Known Workarounds
No response
Configuration
3cfd6cffc495e4539bf6cdb5919922b8d8972e57
)Other information
I've traced the problem to #75542. Basic hello world program works but when I try to make an HTTP request, the program crashes. The tests in CI seem to pass which is quite strange.
/cc @lambdageek @naricc
The text was updated successfully, but these errors were encountered: