Skip to content

Conversation

jonathanpeppers
Copy link
Member

In 32fcc8b, I enabled tests related to the "GC Bridge" on NativeAOT, but discovered we still weren't running dotnet/java-interop's tests. Let's enable them.

We can also remove $(DefineConstants) for CORECLR and NATIVEAOT as there is nothing using these.

In 32fcc8b, I enabled tests related to the "GC Bridge" on NativeAOT,
but discovered we still weren't running dotnet/java-interop's tests.
Let's enable them.

We can also remove `$(DefineConstants)` for `CORECLR` and `NATIVEAOT`
as there is nothing using these.
@jonathanpeppers
Copy link
Member Author

This one crashes with:

09-17 20:22:12.204  9703  9724 I NUnit   : RegisterWithVM_PermitsAliases 
09-17 20:22:12.204  9703  9724 I NUnit   : 	Passed
09-17 20:22:12.204  9703  9724 I NUnit   : UnreferencedInstanceIsCollected 
09-17 20:22:12.227  9703  9723 I droid.NET_Test: Explicit concurrent copying GC freed 47(62KB) AllocSpace objects, 0(0B) LOS objects, 52% free, 1366KB/2902KB, paused 2.044ms total 12.476ms
09-17 20:22:12.242  9703  9723 I droid.NET_Test: Explicit concurrent copying GC freed 3(16KB) AllocSpace objects, 0(0B) LOS objects, 52% free, 1366KB/2902KB, paused 2.037ms total 10.965ms
09-17 20:22:12.243  9703  9741 F monodroid: The method is not implemented. This is a stub and should not be called.
09-17 20:22:12.243  9703  9741 F monodroid: Abort at internal-pinvoke-stubs.cc:10:3 ('void (anonymous namespace)::pinvoke_unreachable()')
--------- beginning of crash
09-17 20:22:12.243  9703  9741 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9741 (Thread-15), pid 9703 (droid.NET_Tests)
09-17 20:22:12.292  9760  9760 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
09-17 20:22:12.301  1870  1870 I /system/bin/tombstoned: received crash request for pid 9741
09-17 20:22:12.303  9760  9760 I crash_dump64: performing dump of process 9703 (target tid = 9741)
09-17 20:22:12.308  9760  9760 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-17 20:22:12.309  9760  9760 F DEBUG   : Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:10/QSR1.210820.001/7663313:userdebug/test-keys'
09-17 20:22:12.309  9760  9760 F DEBUG   : Revision: '0'
09-17 20:22:12.309  9760  9760 F DEBUG   : ABI: 'x86_64'
09-17 20:22:12.312  9760  9760 F DEBUG   : Timestamp: 2025-09-17 20:22:12+0000
09-17 20:22:12.312  9760  9760 F DEBUG   : pid: 9703, tid: 9741, name: Thread-15  >>> Mono.Android.NET_Tests <<<
09-17 20:22:12.312  9760  9760 F DEBUG   : uid: 10121
09-17 20:22:12.312  9760  9760 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
09-17 20:22:12.312  9760  9760 F DEBUG   : Abort message: 'The method is not implemented. This is a stub and should not be called.'
09-17 20:22:12.312  9760  9760 F DEBUG   :     rax 0000000000000000  rbx 00000000000025e7  rcx 000072e776f643f8  rdx 0000000000000006
09-17 20:22:12.312  9760  9760 F DEBUG   :     r8  000072e69daf3356  r9  0000000000000000  r10 000072e5205a54f0  r11 0000000000000246
09-17 20:22:12.313  9760  9760 F DEBUG   :     r12 000072e69daf3356  r13 000072e69daf9345  r14 000072e5205a5578  r15 000000000000260d
09-17 20:22:12.313  9760  9760 F DEBUG   :     rdi 00000000000025e7  rsi 000000000000260d
09-17 20:22:12.313  9760  9760 F DEBUG   :     rbp 000072e5205a57e0  rsp 000072e5205a54e8  rip 000072e776f643f8
09-17 20:22:12.412  9760  9760 F DEBUG   : 
09-17 20:22:12.412  9760  9760 F DEBUG   : backtrace:
09-17 20:22:12.413  9760  9760 F DEBUG   :       #00 pc 00000000000943f8  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+24) (BuildId: b5c6019a3b4ea61b5e9a2f56319b584e)
09-17 20:22:12.414  9760  9760 F DEBUG   :       #01 pc 0000000000097146  /apex/com.android.runtime/lib64/bionic/libc.so (abort+182) (BuildId: b5c6019a3b4ea61b5e9a2f56319b584e)
09-17 20:22:12.414  9760  9760 F DEBUG   :       #02 pc 000000000010409f  /data/app/Mono.Android.NET_Tests-Gfdg4USGyH70bxzMdRh4Tw==/split_config.x86_64.apk

Context: 869b0e0

The `pinvoke_unreachable` function, when invoked, would log
its own source location instead of that of the call site.
That's a bit useless in diagnosing issues, so let's improve
it by logging the call site location... :)
@grendello
Copy link
Contributor

I added the #10502 change to this PR, it should give us better info on which p/invoke was called.

grendello added a commit that referenced this pull request Sep 19, 2025
Context: #10496 (comment)
Context: 869b0e0

The `_monodroid_weak_gref_delete` p/invoke wasn't implemented
in 869b0e0 as it was thought to be unused. However, the test
failure in #10496 shows that it's not true.

Bring the `_monodroid_weak_gref_delete` implementation to NativeAOT
host from the CoreCLR host.
Context: #10496 (comment)
Context: 869b0e0

The `_monodroid_weak_gref_delete` p/invoke wasn't implemented
in 869b0e0 as it was thought to be unused. However, the test
failure in #10496 shows that it's not true.

Bring the `_monodroid_weak_gref_delete` implementation to NativeAOT
host from the CoreCLR host.
@grendello
Copy link
Contributor

Comitted the change in #10504 to this PR, it implements _monodroid_weak_gref_delete, the p/invoke that causing the crash.

@jonathanpeppers
Copy link
Member Author

Now we are beyond the crash, there are test failures that are probably bugs:

Mono.Android.NET_Tests, Java.InteropTests.JniPeerMembersTests.ReplaceStaticMethodName / Release
Java.Lang.NoSuchMethodError : no static method "Ljava/lang/Runtime;.remappedToGetRuntime()Ljava/lang/Runtime;"

Seems like some package name or text is missing before the .remappedToGetRuntime value.

jonathanpeppers pushed a commit that referenced this pull request Sep 19, 2025
Context: #10496 (comment)
Context: 869b0e0

The `_monodroid_weak_gref_delete` p/invoke wasn't implemented
in 869b0e0 as it was thought to be unused. However, the test
failure in #10496 shows that it's not true.

Bring the `_monodroid_weak_gref_delete` implementation to NativeAOT
host from the CoreCLR host.
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.

2 participants