Sync SystemNative pinvoke tables with dotnet/runtime#11531
Open
jonathanpeppers wants to merge 1 commit into
Open
Sync SystemNative pinvoke tables with dotnet/runtime#11531jonathanpeppers wants to merge 1 commit into
jonathanpeppers wants to merge 1 commit into
Conversation
Update the SystemNative entries in both CLR and MonoVM generate-pinvoke-tables.cc to match the .NET 11 runtime from the VMR (dotnet/dotnet @ 3c45e4f3e8), then regenerate the pinvoke-tables.include files. Removed (no longer in runtime): - SystemNative_GetFileSystemType - SystemNative_GetFormatInfoForMountPoint - SystemNative_LowLevelFutex_WaitOnAddress - SystemNative_LowLevelFutex_WaitOnAddressTimeout - SystemNative_LowLevelFutex_WakeByAddressSingle - SystemNative_ReadProcessStatusInfo Added: - SystemNative_GetFileSystemTypeNameForMountPoint - SystemNative_GetNextAreaInfo - SystemNative_GetPlatformSIGSTOP - SystemNative_IsAtomicNonInheritablePipeCreationSupported - SystemNative_LowLevelCrossProcessMutex_* (8 functions) - SystemNative_ReadFromNonblocking - SystemNative_ReadProcessInfo - SystemNative_ReadThreadInfo - SystemNative_ReadV - SystemNative_WriteToNonblocking - SystemNative_WriteV Also add a PingTest that exercises Ping.Send() on localhost to ensure the pinvoke resolution works end-to-end on device. Fixes: dotnet#11530 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Syncs the native SystemNative_* pinvoke override tables used by the CoreCLR and MonoVM Android runtimes to match the .NET 11 VMR (entrypoints.c), addressing crashes when managed code calls missing SystemNative_* exports (e.g., Ping.Send()).
Changes:
- Updated CoreCLR and MonoVM
generate-pinvoke-tables.ccsymbol lists to match the .NET 11 runtime entrypoints. - Regenerated CoreCLR and MonoVM
pinvoke-tables.includewith updated counts/hashes (494 → 507 entries). - Added an on-device
Ping.Send("127.0.0.1")NUnit test and included it inMono.Android.NET-Tests.csproj.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Mono.Android-Tests/Mono.Android-Tests/System.Net.NetworkInformation/PingTest.cs | Adds a device test exercising Ping.Send() to cover the reported crash scenario. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj | Includes the new PingTest.cs in the test project build. |
| src/native/mono/pinvoke-override/generate-pinvoke-tables.cc | Updates the MonoVM pinvoke symbol source list to match .NET 11 runtime entrypoints. |
| src/native/mono/pinvoke-override/pinvoke-tables.include | Regenerates the MonoVM pinvoke override table with updated entries/count. |
| src/native/clr/pinvoke-override/generate-pinvoke-tables.cc | Updates the CoreCLR pinvoke symbol source list to match .NET 11 runtime entrypoints. |
| src/native/clr/pinvoke-override/pinvoke-tables.include | Regenerates the CoreCLR pinvoke override table with updated entries/count. |
Member
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
SystemNative_*pinvoke table ingenerate-pinvoke-tables.cc(both CLR and MonoVM) had drifted from the .NET 11 runtime shipped via the VMR (dotnet/dotnet @ 3c45e4f3e8,Microsoft.NETCore.App.Ref 11.0.0-preview.5). This causes a SIGABRT when managed code tries to call native functions that exist inlibSystem.Native.sobut are missing from the pinvoke override table -- for example,Ping.Send()crashes becauseSystemNative_IsAtomicNonInheritablePipeCreationSupportedwas not listed.Changes
Synced both CLR and MonoVM tables to match the VMR's
entrypoints.c, then ranbuild-tools/scripts/generate-pinvoke-tables.shto regenerate thepinvoke-tables.includefiles.Removed (no longer in runtime):
SystemNative_GetFileSystemTypeSystemNative_GetFormatInfoForMountPointSystemNative_LowLevelFutex_WaitOnAddress/WaitOnAddressTimeout/WakeByAddressSingleSystemNative_ReadProcessStatusInfoAdded (new in runtime):
SystemNative_IsAtomicNonInheritablePipeCreationSupportedSystemNative_GetFileSystemTypeNameForMountPointSystemNative_GetNextAreaInfoSystemNative_GetPlatformSIGSTOPSystemNative_LowLevelCrossProcessMutex_*(8 functions)SystemNative_ReadFromNonblocking/ReadProcessInfo/ReadThreadInfo/ReadVSystemNative_WriteToNonblocking/WriteVTest
Added a
PingTestthat exercisesPing.Send("127.0.0.1")on device to catch this class of regression.Fixes #11530