Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 5179 [details]
command line program source
Opening a non-existent serial port should understandably cause an exception, however, the try/catch mechanism was not able to catch what appears to be an extra exception which causes an ugly error message.
The behavior on Windows .NET is a clean exit from the program with no errors, however, Mac OS X spews this:
Error opening COM port.
System.IO.IOException: Bad file descriptor
at System.IO.Ports.SerialPortStream.ThrowIOException () [0x00000] in <filename unknown>:0
at System.IO.Ports.SerialPortStream.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.IO.Ports.SerialPortStream.Finalize () [0x00000] in <filename unknown>:0
The fact that it printed from my catch block suggests that it caught one exception but then an extra one is thrown that I don't know how to catch. Source code is attached.
Command line repro: mono hello_world.exe <path to serial port>
Simply put in a non-existent serial port above to repro.
The exception is thrown from the finalizer on the finalizer thread this is why the try-catch can't catch it.
-> class libs.
I got the same problem, is there any solutions for this issue?
Fixed in mono master bfc3336224745663aaf6bd962684549b9f783241.