Skip to content
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

Annotate APIs throwing PNSE on Android #47911

Closed
marek-safar opened this issue Feb 5, 2021 · 5 comments
Closed

Annotate APIs throwing PNSE on Android #47911

marek-safar opened this issue Feb 5, 2021 · 5 comments
Assignees
Labels
area-Meta os-android tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@marek-safar
Copy link
Contributor

All public APIs that throw PNSE needs to be annotated with System.Runtime.Versioning.UnsupportedOSPlatformAttribute.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 5, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@marek-safar marek-safar added os-android area-Meta tracking This issue is tracking the completion of other related issues. and removed untriaged New issue has not been triaged by the area owner labels Feb 5, 2021
@marek-safar marek-safar added this to the 6.0.0 milestone Feb 5, 2021
@steveisok steveisok assigned MaximLipnin and unassigned steveisok Feb 5, 2021
@MaximLipnin
Copy link
Contributor

This is a list of the library tests (thanks to @mdh1418) which fail with PNSE on Android:

System.Net.NetworkInformation.Functional.Tests
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: 127.0.0.1)
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: ::1)
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_AccessAllMethods_NoErrors
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_NotListening
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: 127.0.0.1)
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: ::1)

System.Net.Primitives.Functional.Tests
System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: Packet)
System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: ControllerAreaNetwork)

System.Console.Tests
CancelKeyPressTests.CanAddAndRemoveHandler
ReadAndWrite.OutputEncodingPreamble
ReadAndWrite.ReadAndReadLine
ReadAndWrite.OutputEncoding
SetIn.SetInReadLine
SetIn.SetInThrowsOnNull
Color.RoundtrippingColor
Color.RedirectedOutputDoesNotUseAnsiSequences
Color.InvalidColors
ConsoleEncoding.TestEncoding(inputString: \"This string has non ascii characters αßΓπΣσµ\")
ConsoleEncoding.TestEncoding(inputString: \"\\xd800\")
ConsoleEncoding.TestEncoding(inputString: \"This is Ascii string\")
ConsoleEncoding.TestEncoding(inputString: \"This string has invalid surrogates \\xd800\\xd800\\xd\"...)
ConsoleEncoding.TestEncoding(inputString: \"This is string have surrogates �\")
ConsoleEncoding.TestValidEncodings
SyncTextReader.ReadAsync
SyncTextReader.ReadBlockAsync
SyncTextReader.ReadLineAsync
SyncTextReader.Read
SyncTextReader.ReadToEnd
SyncTextReader.ReadBlock
SyncTextReader.Peek
SyncTextReader.ReadToEndAsync
TimeOut.OpenStandardXXX_ReadTimeOut
TimeOut.OpenStandardXXX_WriteTimeOut
TimeOut.OpenStandardXXX_CanTimeOut
ThreadSafety.SetStandardXXXCanBeCalledConcurrently
ThreadSafety.ReadMayBeCalledConcurrently
ThreadSafety.OpenStandardXXXCanBeCalledConcurrently
WindowAndCursorProps.GetCursorPosition_Invoke_ReturnsExpected
WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: False)
WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: True)
WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
WindowAndCursorProps.LargestWindowHeight_UnixGet_ReturnsExpected
WindowAndCursorProps.WindowHeight_GetUnix_Success
WindowAndCursorProps.WindowWidth_GetUnix_Success
WindowAndCursorProps.BufferWidth_GetUnix_ReturnsWindowWidth
WindowAndCursorProps.SetCursorPosition_Invoke_Success
WindowAndCursorProps.CursorSize_GetUnix_ReturnsExpected
WindowAndCursorProps.LargestWindowWidth_UnixGet_ReturnsExpected
WindowAndCursorProps.BufferHeight_GetUnix_ReturnsWindowHeight
WindowAndCursorProps.CursorTop_Set_GetReturnsExpected
WindowAndCursorProps.CursorLeft_Set_GetReturnsExpected

It can be helpful for annotating the unsupported APIs.

@marek-safar
Copy link
Contributor Author

The list looks reasonable perhaps except SocketAddressTest.ToString_UnsupportedFamily_Throws. I think ToString in general should never throw so that might need general fix.

MaximLipnin added a commit that referenced this issue Apr 15, 2021
…roperties as unsupported on Android (#50855)

Part of #47911.  

This is to annotate the following methods in System.Net.NetworkInformation.IPGlobalProperties as unsupported on Android since they throw PNSE:  

- GetActiveTcpConnections();
- GetActiveTcpListeners();
- GetActiveUdpListeners();
MaximLipnin added a commit that referenced this issue Apr 15, 2021
SocketAddressTest.ToString_UnsupportedFamily_Throws test fails on Android in case of AddressFamily.Packet and AddressFamily.ControllerAreaNetwork because it expects PNSE for both address family types but there is no any exception thrown.  

This change disables the mentioned test on Android due to different behavior. Also, I'm not sure whether the test has right name.  

#47911 (comment)
MaximLipnin added a commit that referenced this issue Apr 20, 2021
Annotated public System.Console APIs throwing PNSE on Android.  

Part of #47911.
@MaximLipnin
Copy link
Contributor

If we don't have any other issue where the PNSE-throwing APIs are listed, then this issue can be closed as resolved.

@MaximLipnin
Copy link
Contributor

This is a list of the library tests (thanks to @mdh1418) which fail with PNSE on Android:

System.Net.NetworkInformation.Functional.Tests
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: 127.0.0.1)
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: ::1)
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_AccessAllMethods_NoErrors
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_NotListening
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: 127.0.0.1)
System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: ::1)

System.Net.Primitives.Functional.Tests
System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: Packet)
System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: ControllerAreaNetwork)

System.Console.Tests
CancelKeyPressTests.CanAddAndRemoveHandler
ReadAndWrite.OutputEncodingPreamble
ReadAndWrite.ReadAndReadLine
ReadAndWrite.OutputEncoding
SetIn.SetInReadLine
SetIn.SetInThrowsOnNull
Color.RoundtrippingColor
Color.RedirectedOutputDoesNotUseAnsiSequences
Color.InvalidColors
ConsoleEncoding.TestEncoding(inputString: \"This string has non ascii characters αßΓπΣσµ\")
ConsoleEncoding.TestEncoding(inputString: \"\\xd800\")
ConsoleEncoding.TestEncoding(inputString: \"This is Ascii string\")
ConsoleEncoding.TestEncoding(inputString: \"This string has invalid surrogates \\xd800\\xd800\\xd\"...)
ConsoleEncoding.TestEncoding(inputString: \"This is string have surrogates �\")
ConsoleEncoding.TestValidEncodings
SyncTextReader.ReadAsync
SyncTextReader.ReadBlockAsync
SyncTextReader.ReadLineAsync
SyncTextReader.Read
SyncTextReader.ReadToEnd
SyncTextReader.ReadBlock
SyncTextReader.Peek
SyncTextReader.ReadToEndAsync
TimeOut.OpenStandardXXX_ReadTimeOut
TimeOut.OpenStandardXXX_WriteTimeOut
TimeOut.OpenStandardXXX_CanTimeOut
ThreadSafety.SetStandardXXXCanBeCalledConcurrently
ThreadSafety.ReadMayBeCalledConcurrently
ThreadSafety.OpenStandardXXXCanBeCalledConcurrently
WindowAndCursorProps.GetCursorPosition_Invoke_ReturnsExpected
WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: False)
WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: True)
WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
WindowAndCursorProps.LargestWindowHeight_UnixGet_ReturnsExpected
WindowAndCursorProps.WindowHeight_GetUnix_Success
WindowAndCursorProps.WindowWidth_GetUnix_Success
WindowAndCursorProps.BufferWidth_GetUnix_ReturnsWindowWidth
WindowAndCursorProps.SetCursorPosition_Invoke_Success
WindowAndCursorProps.CursorSize_GetUnix_ReturnsExpected
WindowAndCursorProps.LargestWindowWidth_UnixGet_ReturnsExpected
WindowAndCursorProps.BufferHeight_GetUnix_ReturnsWindowHeight
WindowAndCursorProps.CursorTop_Set_GetReturnsExpected
WindowAndCursorProps.CursorLeft_Set_GetReturnsExpected

It can be helpful for annotating the unsupported APIs.

All the respective APIs were processed so I'm closing this issue as resolved.

@ghost ghost locked as resolved and limited conversation to collaborators May 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta os-android tracking This issue is tracking the completion of other related issues.
Projects
No open projects
Development

No branches or pull requests

3 participants