Skip to content

Conversation

jonathanpeppers
Copy link
Member

We think some of the recent changes in main, should fix .NET APIs related to crypto on both CoreCLR and NativeAOT.

We think some of the recent changes in main, should fix .NET APIs related to crypto on both CoreCLR and NativeAOT.
@jonathanpeppers
Copy link
Member Author

It seems like in the middle of AndroidMessageHandlerSendsClientCertificate(False), we crash:

09-17 17:29:12.466 21031 21056 I NUnit   : AndroidMessageHandlerSendsClientCertificate(False) 
...
09-17 17:29:12.756 21031 21056 E droid.NET_Test: JNI ERROR (app bug): attempt to use stale Global 0x36f6 (should be 0x36f2)
09-17 17:29:12.756 21031 21056 F droid.NET_Test: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: use of deleted global reference 0x36f6
09-17 17:29:12.756 21031 21056 F droid.NET_Test: java_vm_ext.cc:570]     from void crc643df67da7b13bb6b1.TestInstrumentation_1.n_onStart()

@grendello
Copy link
Contributor

It seems like in the middle of AndroidMessageHandlerSendsClientCertificate(False), we crash:

09-17 17:29:12.466 21031 21056 I NUnit   : AndroidMessageHandlerSendsClientCertificate(False) 
...
09-17 17:29:12.756 21031 21056 E droid.NET_Test: JNI ERROR (app bug): attempt to use stale Global 0x36f6 (should be 0x36f2)
09-17 17:29:12.756 21031 21056 F droid.NET_Test: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: use of deleted global reference 0x36f6
09-17 17:29:12.756 21031 21056 F droid.NET_Test: java_vm_ext.cc:570]     from void crc643df67da7b13bb6b1.TestInstrumentation_1.n_onStart()

Might possibly be a GC bridge bug? /cc @simonrozsival

@simonrozsival
Copy link
Member

That might be a GC bridge bug or it could be a bug in runtime's Crypto PAL code which also uses JNI.

@jonathanpeppers can you repro it locally?

@jonathanpeppers
Copy link
Member Author

After fixing merge conflict with main, it seems like these passed on CoreCLR and nothing crashed.

NativeAOT has some failures like:

Certificate validation
Expected: No Exception to be thrown
But was:   (net_auth_SSPI)
at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__159`1.MoveNext() + 0xa9f
--- End of stack trace from previous location ---
at System.NetTests.SslTest.DoVerifyTrustedCertificates() + 0xb1
at System.NetTests.SslTest.RunIgnoringWebException(Action test) + 0x34
at NUnit.Framework.Constraints.VoidInvocationDescriptor.Invoke() + 0xc
at NUnit.Framework.Constraints.ExceptionInterceptor.Intercept(Object) + 0x2a

So, let me change this to only add the category to CoreCLR and see if it is green.

@jonathanpeppers
Copy link
Member Author

Seems like CI gets the same error, but it's working for me locally:

# arm64 device
.\dotnet-local.cmd build tests\Mono.Android-Tests\Mono.Android-Tests\Mono.Android.NET-Tests.csproj -t:Install,RunTestApks -r android-arm64 -bl -p:IncludeCategories=SSL -p:UseMonoRuntime=false -c Release
# API 29 emulator
.\dotnet-local.cmd build tests\Mono.Android-Tests\Mono.Android-Tests\Mono.Android.NET-Tests.csproj -t:Install,RunTestApks -r android-x64 -bl -p:IncludeCategories=SSL -p:UseMonoRuntime=false -c Release

@jonathanpeppers
Copy link
Member Author

Ok, weird it seems to pass about 50% of the time. Let me just run it again to see.

@jonathanpeppers
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Successfully merging this pull request may close these issues.

3 participants