8000 [tests] add a smoke test for `System.IO.Directory` by jonathanpeppers · Pull Request #10331 · dotnet/android · GitHub
[go: up one dir, main page]

Skip to content

Conversation

jonathanpeppers
Copy link
Member

Context: #10330

The problem fixed in #10330 makes me think we are missing a test.

Context: #10330

The problem fixed in #10330 makes me think we are missing a test.
@jonathanpeppers
Copy link
Member Author

This crashes:

07-23 22:46:43.058  7510  7535 I NUnit   : DirectoryTest
07-23 22:46:43.058  7510  7535 I NUnit   : GetFiles 
07-23 22:46:43.061  7510  7535 D monodroid-assembly: [precompiled] clr_pinvoke_override ("libSystem.Native", "SystemNative_Stat")
07-23 22:46:43.062  7510  7535 D monodroid: [precompiled] p/invoke found
07-23 22:46:43.070  7510  7534 I droid.NET_Test: Explicit concurrent copying GC freed 45(32KB) AllocSpace objects, 0(0B) LOS objects, 57% free, 1148KB/2684KB, paused 1.838ms total 7.423ms
07-23 22:46:43.072  7510  7535 D monodroid-assembly: [precompiled] clr_pinvoke_override ("libSystem.Native", "SystemNative_OpenDir")
07-23 22:46:43.072  7510  7535 D monodroid: [precompiled] p/invoke found
07-23 22:46:43.072  7510  7535 D monodroid-assembly: [precompiled] clr_pinvoke_override ("libSystem.Native", "SystemNative_ReadDir")
07-23 22:46:43.072  7510  7535 D monodroid-assembly: Symbol 'SystemNative_ReadDir' in library 'libSystem.Native' not found in the generated tables, falling back to slow path
07-23 22:46:43.072  7510  7535 F monodroid-assembly: Missing pinvoke SystemNative_ReadDir@libSystem.Native
07-23 22:46:43.072  7510  7535 F monodroid-assembly: Abort at precompiled.cc:88:3 ('static void *xamarin::android::PinvokeOverride::monodroid_pinvoke_override(const char *, const char *)')
--------- beginning of crash
07-23 22:46:43.073  7510  7535 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7535 (Instrumentation), pid 7510 (droid.NET_Tests)
07-23 22:46:43.094  7550  7550 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
07-23 22:46:43.095  1870  1870 I /system/bin/tombstoned: received crash request for pid 7535
07-23 22:46:43.096  7550  7550 I crash_dump64: performing dump of process 7510 (target tid = 7535)
07-23 22:46:43.099  7550  7550 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-23 22:46:43.099  7550  7550 F DEBUG   : Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:10/QSR1.210820.001/7663313:userdebug/test-keys'
07-23 22:46:43.099  7550  7550 F DEBUG   : Revision: '0'
07-23 22:46:43.099  7550  7550 F DEBUG   : ABI: 'x86_64'
07-23 22:46:43.100  7550  7550 F DEBUG   : Timestamp: 2025-07-23 22:46:43+0000
07-23 22:46:43.100  7550  7550 F DEBUG   : pid: 7510, tid: 7535, name: Instrumentation  >>> Mono.Android.NET_Tests <<<
07-23 22:46:43.100  7550  7550 F DEBUG   : uid: 10119
07-23 22:46:43.100  7550  7550 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
07-23 22:46:43.100  7550  7550 F DEBUG   : Abort message: 'Missing pinvoke SystemNative_ReadDir@libSystem.Native'
07-23 22:46:43.100  7550  7550 F DEBUG   :     rax 0000000000000000  rbx 0000000000001d56  rcx 000078b597d263f8  rdx 0000000000000006
07-23 22:46:43.100  7550  7550 F DEBUG   :     r8  000078b50724aa40  r9  0000000000000000  r10 000078b4b9e158d0  r11 0000000000000246
07-23 22:46:43.100  7550  7550 F DEBUG   :     r12 000078b507358b00  r13 000078b4b9e159c0  r14 000078b4b9e15958  r15 0000000000001d6f
07-23 22:46:43.100  7550  7550 F DEBUG   :     rdi 0000000000001d56  rsi 0000000000001d6f
07-23 22:46:43.100  7550  7550 F DEBUG   :     rbp 000078b4b9e15a70  rsp 000078b4b9e158c8  rip 000078b597d263f8
07-23 22:46:43.263  7550  7550 F DEBUG   : 
07-23 22:46:43.263  7550  7550 F DEBUG   : backtrace:
07-23 22:46:43.263  7550  7550 F DEBUG   :       #00 pc 00000000000943f8  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+24) (BuildId: b5c6019a3b4ea61b5e9a2f56319b584e)
07-23 22:46:43.263  7550  7550 F DEBUG   :       #01 pc 0000000000097146  /apex/com.android.runtime/lib64/bionic/libc.so (abort+182) (BuildId: b5c6019a3b4ea61b5e9a2f56319b584e)
07-23 22:46:43.263  7550  7550 F DEBUG   :       #02 pc 00000000000c41c9  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk!libnet-android.release.so (offset 0x1850000) (xamarin::android::Helpers::abort_application(_LogCategories, char const*, bool, std::__ndk1::source_location)+425) (BuildId: f25730a1c837257e71f58c776b710328f9824f26)
07-23 22:46:43.263  7550  7550 F DEBUG   :       #03 pc 00000000000cee85  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk!libnet-android.release.so (offset 0x1850000) (xamarin::android::PinvokeOverride::monodroid_pinvoke_override(char const*, char const*)+8725) (BuildId: f25730a1c837257e71f58c776b710328f9824f26)
07-23 22:46:43.264  7550  7550 F DEBUG   :       #04 pc 00000000000cf191  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk!libnet-android.release.so (offset 0x1850000) (xamarin::android::Host::clr_pinvoke_override(char const*, char const*)+225) (BuildId: f25730a1c837257e71f58c776b710328f9824f26)
07-23 22:46:43.264  7550  7550 F DEBUG   :       #05 pc 00000000003f21f6  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk

public class DirectoryTest
{
[Test]
public void GetFiles ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs, not spaces!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what happened... I copy-pasted the whole thing from DriveInfoTest.cs to start.

@jonathanpeppers
Copy link
Member Author

New test looks good:
image

@jonathanpeppers jonathanpeppers merged commit 546b0f9 into main Jul 24, 2025
1 of 21 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/DirectoryTest branch July 24, 2025 13:27
jonathanpeppers added a commit that referenced this pull request Jul 24, 2025
Context: #10330

The problem fixed in #10330 makes me think we are missing a test.

And indeed, this crashed on CoreCLR!

    07-23 22:46:43.058  7510  7535 I NUnit   : DirectoryTest
    07-23 22:46:43.058  7510  7535 I NUnit   : GetFiles 
    07-23 22:46:43.061  7510  7535 D monodroid-assembly: [precompiled] clr_pinvoke_override ("libSystem.Native", "SystemNative_Stat")
    07-23 22:46:43.062  7510  7535 D monodroid: [precompiled] p/invoke found
    07-23 22:46:43.070  7510  7534 I droid.NET_Test: Explicit concurrent copying GC freed 45(32KB) AllocSpace objects, 0(0B) LOS objects, 57% free, 1148KB/2684KB, paused 1.838ms total 7.423ms
    07-23 22:46:43.072  7510  7535 D monodroid-assembly: [precompiled] clr_pinvoke_override ("libSystem.Native", "SystemNative_OpenDir")
    07-23 22:46:43.072  7510  7535 D monodroid: [precompiled] p/invoke found
    07-23 22:46:43.072  7510  7535 D monodroid-assembly: [precompiled] clr_pinvoke_override ("libSystem.Native", "SystemNative_ReadDir")
    07-23 22:46:43.072  7510  7535 D monodroid-assembly: Symbol 'SystemNative_ReadDir' in library 'libSystem.Native' not found in the generated tables, falling back to slow path
    07-23 22:46:43.072  7510  7535 F monodroid-assembly: Missing pinvoke SystemNative_ReadDir@libSystem.Native
    07-23 22:46:43.072  7510  7535 F monodroid-assembly: Abort at precompiled.cc:88:3 ('static void *xamarin::android::PinvokeOverride::monodroid_pinvoke_override(const char *, const char *)')
    --------- beginning of crash
    07-23 22:46:43.073  7510  7535 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7535 (Instrumentation), pid 7510 (droid.NET_Tests)
    07-23 22:46:43.094  7550  7550 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
    07-23 22:46:43.095  1870  1870 I /system/bin/tombstoned: received crash request for pid 7535
    07-23 22:46:43.096  7550  7550 I crash_dump64: performing dump of process 7510 (target tid = 7535)
    07-23 22:46:43.099  7550  7550 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    07-23 22:46:43.099  7550  7550 F DEBUG   : Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:10/QSR1.210820.001/7663313:userdebug/test-keys'
    07-23 22:46:43.099  7550  7550 F DEBUG   : Revision: '0'
    07-23 22:46:43.099  7550  7550 F DEBUG   : ABI: 'x86_64'
    07-23 22:46:43.100  7550  7550 F DEBUG   : Timestamp: 2025-07-23 22:46:43+0000
    07-23 22:46:43.100  7550  7550 F DEBUG   : pid: 7510, tid: 7535, name: Instrumentation  >>> Mono.Android.NET_Tests <<<
    07-23 22:46:43.100  7550  7550 F DEBUG   : uid: 10119
    07-23 22:46:43.100  7550  7550 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
    07-23 22:46:43.100  7550  7550 F DEBUG   : Abort message: 'Missing pinvoke SystemNative_ReadDir@libSystem.Native'
    07-23 22:46:43.100  7550  7550 F DEBUG   :     rax 0000000000000000  rbx 0000000000001d56  rcx 000078b597d263f8  rdx 0000000000000006
    07-23 22:46:43.100  7550  7550 F DEBUG   :     r8  000078b50724aa40  r9  0000000000000000  r10 000078b4b9e158d0  r11 0000000000000246
    07-23 22:46:43.100  7550  7550 F DEBUG   :     r12 000078b507358b00  r13 000078b4b9e159c0  r14 000078b4b9e15958  r15 0000000000001d6f
    07-23 22:46:43.100  7550  7550 F DEBUG   :     rdi 0000000000001d56  rsi 0000000000001d6f
    07-23 22:46:43.100  7550  7550 F DEBUG   :     rbp 000078b4b9e15a70  rsp 000078b4b9e158c8  rip 000078b597d263f8
    07-23 22:46:43.263  7550  7550 F DEBUG   : 
    07-23 22:46:43.263  7550  7550 F DEBUG   : backtrace:
    07-23 22:46:43.263  7550  7550 F DEBUG   :       #00 pc 00000000000943f8  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+24) (BuildId: b5c6019a3b4ea61b5e9a2f56319b584e)
    07-23 22:46:43.263  7550  7550 F DEBUG   :       #1 pc 0000000000097146  /apex/com.android.runtime/lib64/bionic/libc.so (abort+182) (BuildId: b5c6019a3b4ea61b5e9a2f56319b584e)
    07-23 22:46:43.263  7550  7550 F DEBUG   :     
8773
  #2 pc 00000000000c41c9  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk!libnet-android.release.so (offset 0x1850000) (xamarin::android::Helpers::abort_application(_LogCategories, char const*, bool, std::__ndk1::source_location)+425) (BuildId: f25730a1c837257e71f58c776b710328f9824f26)
    07-23 22:46:43.263  7550  7550 F DEBUG   :       #3 pc 00000000000cee85  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk!libnet-android.release.so (offset 0x1850000) (xamarin::android::PinvokeOverride::monodroid_pinvoke_override(char const*, char const*)+8725) (BuildId: f25730a1c837257e71f58c776b710328f9824f26)
    07-23 22:46:43.264  7550  7550 F DEBUG   :       #4 pc 00000000000cf191  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk!libnet-android.release.so (offset 0x1850000) (xamarin::android::Host::clr_pinvoke_override(char const*, char const*)+225) (BuildId: f25730a1c837257e71f58c776b710328f9824f26)
    07-23 22:46:43.264  7550  7550 F DEBUG   :       #5 pc 00000000003f21f6  /data/app/Mono.Android.NET_Tests-3-1TDlT55wuyU7WHXRhzQQ==/split_config.x86_64.apk

With the fix in place in #10330, it passes.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0