Skip to content

SerialPorts Linux issues #27773

@krwq

Description

@krwq

Collective issue for all issues while work is still happening.
Most of the issues were identified when working on async implementation: dotnet/corefx#33027

There are still lots of failures, all of them are marked with custom [KnownFailure] - most of the tests won't run on CI because it doesn't have physical port.

Things known to still be broken on Linux:

  • (Issue dotnet/corefx#33374; PR System.IO.Ports native package corefx#35126) System.IO.Ports package cannot be used with netcoreapp2.1 even though it depends on netstandard2.0 (requires 3.0)
  • software emulated RTS (XonXoff) is not working (or at least all related tests are failing)
  • There are issues with parity replacement - likely just doesn't work
  • There are issues with DTREnable - those could be test issues
  • BytesToWrite (looks ok through code inspection but seem to be misreporting, possibly data from the queue should be added there)
  • SerialPort.ReadBufferSize is not respected (see below conversation)
  • in certain cases DataReceived event can fire more than once (SerialStream does it correctly but code on top of that in SerialPort is not) - this is likely also issue on Windows - I've added a comment why this happens how this can be fixed on Linux (likely something similar can be done on Windows) - we need to explore if this is something we want to fix
  • Some tests related to StopBits are failing when measuring the transmission time - this is likely a test issue but needs to be looked at to double check
  • non standard BaudRates are currently not supported but I've seen some article explaining how to emulate those - there are also couple of test failures (or rather hangs) but likely those are test issues (except for when non-standard baud rate is used) - currently allowed baud rate ranges are hard coded on linux (couldn't find an easy way to get that info from OS - perhaps just trying to set it and seeing if OS allows it is a way to go)
  • flushing is not working (currently no-op)
  • BytesToRead may return -1 when error occurs which is causing APIs such SerialPort.ReadLine throw ArgumentException in some cases where there are errors during communication
  • [test] HasHardwareFlowControl is not working correctly - this can be checked similarly as RTS related tests are doing it (this might have a broader meaning than just RTS/CTS so needs more look)
  • (Running CoreCLR tests on Mono - Update the issues.target file with Git hub links as new issues are created for each failing excluded test #33258) Uart port is not always detected
  • (ConcurrentDictionary.GetOrAdd is not always thread safe. #33221) Dispose implementation (i.e. Shutdown call might need to be moved to a new SafeHandle class)
    • exclusive access need to be removed explicitly since some devices do not get rid of it making device not openable after closing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions