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.
For my password manager project, I have created a small popup that appears whenever a lengthy operation takes place. Both to inform the user of said operation and also to prevent the user from interfering. This popup takes the form of a modal dialog that automatically closes whenever the operation is concluded.
The way I went about doing this is to simply create a separate thread for it.
Now, I keep running into issues while doing this in Linux (Ubuntu 14.10.1 to be precise); I keep experiencing fatal errors in the window manager. Fatal errors that I cannot implement any form of exception handling form as it seems to be outside the scope of whatever exception handling C# will allow me. I've also experienced SIGABRT fatal errors and such. I've coded some workarounds to close up most of these cases of fatal errors but I have not been completely successfull.
Leading me to conclude it is something I have no control over and it is simply a case of tardieness of some sort in either the window manager or in Mono.
For reference, see my implementation of a popup window: https://github.com/Altorffer/Invium/blob/master/Invium/Popup.cs
You cannot access the UI from arbitrary threads.
I can, just fine. The code works... most of the time. Let me pose this to you -- if the code was flawed in some way or another, it should not compile or at the very least, should not work as expected. It does. It just randomly causes a fatal error in the window manager. Randomly. Had it been consistently, I might have agree the code was flawed.
Anyhow, given the fact the issue was closed as invalid, I suppose I'll have to come up with more workarounds. For the record, do some research, you will find there are plenty of issues still with all of the various window managers available in Linux. And with Mono itself. Point being -- don't dismiss this so easily, it's kind of insulting.
Leave this closed however, I do not have the time or the patience at this time.
Just for the record, an example of what I'm experiencing. 'Condition 'domain' not met' is just one example of random fatal errors in Mono. I've seen these before, completely random errors, totally unrelated to my code. Sometimes even network related errors. In an application that does not contain a single sliver of network code. Yeah, definitely my code that's flawed. ;)
Sorry, bad day at the office.
Anyhow... here's the error:
* Assertion at mini-exceptions.c:834, condition `domain' not met
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Environment.Exit (int) <0xffffffff>
at Invium.Invium.InviumExit () <0x000a3>
at Invium.Invium.Main (string) <0x0058b>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>
Debug info from gdb:
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
The reason I closed it as invalid was because your sample is clearly accessing the UI code from a background thread.
This will not work reliably since System.Windows.Forms is not threadsafe (and practically no UI toolkit in any language or OS is threadsafe).
About the best we could do to improve this case would be to add assertions to check the thread ID so that it would reliably fail, but this would have a non-negligible performance impact.
If you have other issues, please file them separately with test cases.