Based on a number of exceptions being raised, we want to track down the reason
for some of the exception. This patch both fixes the build (fixes the last
commit) and provides more information for the reason that the Alert is being
sent to the remote end.
The alert is currently being sent to the remote end when something fails in
the negotiation. We likely need to *not send* alerts when the reason the
negotiation failed was that the connection was shutdown in some form (that is
why we have ObjectDisposed, or NotConnected exceptions).
This patch is a step towards verifying the theory. This will help us
establish which step failed. And the next step is determine why it failed.
Fixes a crash when there are two methods overloaded by arity:
System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.Single[XElement] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00038] in /private/tmp/source-mono-mac-3.10.0-branch/bockbuild-mono-3.10.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.10.0/mcs/class/System.Core/System.Linq/Enumerable.cs:2371
at System.Linq.Enumerable.SingleOrDefault[XElement] (IEnumerable`1 source, System.Func`2 predicate) [0x00007] in /private/tmp/source-mono-mac-3.10.0-branch/bockbuild-mono-3.10.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.10.0/mcs/class/System.Core/System.Linq/Enumerable.cs:2445
at Xamarin.ApiDiff.MemberComparer.Find (IEnumerable`1 target) [0x00019] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/MemberComparer.cs:72
at Xamarin.ApiDiff.MemberComparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x0003c] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/MemberComparer.cs:83
at Xamarin.ApiDiff.MemberComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x000a2] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/MemberComparer.cs:55
at Xamarin.ApiDiff.ClassComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0005b] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/ClassComparer.cs:210
at Xamarin.ApiDiff.Comparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x00093] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/Comparer.cs:80
at Xamarin.ApiDiff.ClassComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x00055] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/ClassComparer.cs:67
at Xamarin.ApiDiff.NamespaceComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0001a] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs:75
at Xamarin.ApiDiff.Comparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x00093] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/Comparer.cs:80
at Xamarin.ApiDiff.NamespaceComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x00055] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs:49
at Xamarin.ApiDiff.AssemblyComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0002b] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs:70
at Xamarin.ApiDiff.Comparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x00093] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/Comparer.cs:80
at Xamarin.ApiDiff.AssemblyComparer.Compare () [0x0004a] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs:50
at Xamarin.ApiDiff.Program.Main (System.String[] args) [0x00328] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/ApiDiff.cs:164
A tools thread is one that can access core runtime structures but not touch anything managed (code or heap).
It's intended to enable the profiler to resolve missing backtraces from its helper thread.
THIS IS A HACK.
The right solution would be to not perform this on the profiler at all and simply log IPs and let the decoder
resolve them. But then there's reality and we can't simply break the current format without consequences.
We're taking this hack for now until we can fix the profiler to do something sensible.
As mentioned in commit 789517f8, I'm trying to compare inter-API level
differences in Mono.Android.dll, and want to reduce as much
"meaningless noise" as possible -- changes which don't meaningfully
break API or ABI.
Among those "meaningless" changes are the addition of property setters
to properties. Adding a setter doesn't break API or ABI.
Add a `mono-api-html --ignore-changes-property-setters` option.
--ignore-changes-property-setters:
Ignore the addition of property setters.
If a source property contains a getter and the target property
contains both a getter and a setter, do not flag this as a
change.
As mentioned in commit 789517f8, the intentino of
`mono-api-html --ignore-changes-virtual` is so that when a method is
changed from non-virtual to virtual or override, or from virtual to
override, a "Removed member" message isn't triggered.
However, the previous implementation was too lenient. While *adding*
virtual to the method is fine, *removing* is NOT fine, as that would
be an API breaking change (e.g. all classes which attempt to override
a previously virtual method could no longer do so).
Make the virtual check stricter so that virtual/override to
non-virtual changes are not ignored.
I've been trying to review API diffs in Xamarin.Android between API
levels, but the diffs are "noisy" because Google will change parameter
names at-will, or will change a non-virtual method into a virtual
method, or a virtual method into an override, all of which are
acceptable changes but individually generate a Removed line in
mono-api-html output, and manually removing the *hundreds* of changes
is error-prone.
Add two new option flags to mono-api-html:
--ignore-changes-parameter-names:
Ignore changes in constructor and method parameter names.
If parameter names change between <reference.xml> and
<assembly.xml>, don't report a change for the constructor or
method.
--ignore-changes-virtual:
Ignore changes in "virtual-ness".
If a method or property changes from non-virtual to virtual,
non-virtual to override, or virtual to override, don't report a
change for the member.
This is a jumbo commit that addresses multiple issues with statistical backtrace collection:
1) It's not possible to reliably collect MonoMethod* so we check that they exist before
serializing to the .mlpd file and retrieve in sync context.
2) It was reporting the generic instance MonoMethod* under gsharing. Those methods are
not reported to the profiler since they are never compiled. They would turn out as unknowns.
3) Collecting IL offsets from async context is currently impossible to be done safely, so it's
now disabled. The way we'll do it in the future is by serializing the sequence point table when
JIT'ing.
4) The way we used to collect frames in statistical ignored all frames until the first LMF, which
discards a lot of them under statistical mode. We now properly pass sigcontext and have it been consumed.
In the future we should simply use the callchain mode.
The current signal profiling code depended on invalid linux behavior of setitimer
allowing multiple threads to register for the same timer. Linux kernel 2.6.12 fixed
this and only the main thread gets the signal. Always.
The correct POSIX behavior happens on OSX/iOS.
On Linux we could use timer_create and SIGEV_THREAD_ID but that would not work on iOS/OSX
since it's specific to it. Given that little detail, I'll leave implementing it as an
exercise to the reader.
The solution, which aims to be as portable as possible, is to use a pair of signals and
have the first one fire the second one against all other threads.
We use a pair of signals since it's not well defined which thread will receive the signal
so detecting this from the signal is non-trivial.
FileSystemWatcher.cs: Fixed multicast events.
SearchPattern.cs : Fixed issue where case insensitivity was not being honored.
KeventWatcher.cs:
* Fixed several race conditions
* Fixed file descriptor duplication & leaks
* thread-safe/cleaner state transitions for watcher, and much cleaner stopping
* Now uses fsw.Filter parameter and respects IncludeSubdirectories = false. Use fsw.Filter to watch very large trees
* Added more error handling + OnError event
* Lots of behavior/reliability fixes and optimizations for Monitor() loop
* Fixed kevent/timespec struct definitions (for 64-bit build)
Reworked a lot of the internals of the kqueue FileSystemWatcher. There
is now a separate thread and a separate kqueue for each FileSystemWatcher
object.
https://bugzilla.xamarin.com/show_bug.cgi?id=16259
Adds a configuration file to facilitate build of Mono with Cygwin
on Appveyor Windows-based build workers.
Dependencies are installed on a clean Appveyor build image for
each build and the result of the 'make install' step is stored
as a build output 'artifact' for further testing or deployment.
Signed-off-by: Alex J Lennon <[email protected]>
Error generated by socket-io.c was:
/usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2:
error: #error "ws2tcpip.h is not compatible with winsock.h.
Include winsock2.h instead."
Signed-off-by: Alex J Lennon <[email protected]>
- Ref: https://bugzilla.xamarin.com/show_bug.cgi?id=20048
- Mono currently doesn't support 2-args Socket ctor added in .NET 4.5
- Absence of this ctor prevents KestrelHttpServer (web server for
ASP.NET vNext: https://github.com/aspnet/KestrelHttpServer ) test
code from working
- I hesitated to put IPv4 only implementation, but full dual stack
(IPv4/v6) support would need bunch of works to be done. So, I pinned
supported protocol of new ctor to IPv4. Also, I filed v4/v6 support
issue as a MonoTODO entry inside the source code.
On Mono/.NET, TimeZoneInfo.Local has a TimeZoneInfo.Id value of
"Local" and a TimeZoneInfo.DisplayName value of "Local":
$ csharp
csharp> TimeZoneInfo.Local.Id;
"Local"
csharp> TimeZoneInfo.Local.DisplayName;
"Local"
That isn't the case on Xamarin.Android, which returns the timezoneinfo
ID value from both DisplayName and Id, e.g. TimeZoneInfo.Local could
have Id and DisplayName values of "Australia/Sydney".
Rework things so that the TimeZoneInfo.Id and TimeZoneInfo.DisplayName
properties return "Local" on Xamarin.Android for the instance returned
from TimeZoneInfo.Local, just like normal Mono/.NET does.
The issue was with the new heuristic of the thread pool which would not create new threads, leading to deadlock between dependent tasks.
The fix is to check if every worker threads are sleeping, waiting or joining, and if that's the case, then we create a new thread because we might be in the case where the tasks being currently run depends on one still being enqueued in the cq or one of the wsq.
The following tests would previously fail :
1) MonoTests.System.Threading.Tasks.TaskTests.DoubleWaitTest : #1
Expected: True
But was: False
at MonoTests.System.Threading.Tasks.TaskTests.<DoubleWaitTest>m__27 () [0x00077] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:800
at MonoTests.System.Threading.Tasks.ParallelTestHelper.Repeat (System.Action action, Int32 numRun) [0x00007] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTestHelper.cs:48
at MonoTests.System.Threading.Tasks.TaskTests.DoubleWaitTest () [0x00000] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:790
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
2) MonoTests.System.Threading.Tasks.TaskTests.HideSchedulerTest : #1
Expected: True
But was: False
at MonoTests.System.Threading.Tasks.TaskTests.HideSchedulerTest () [0x0003d] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:1914
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
3) MonoTests.System.Threading.Tasks.TaskTests.WaitAll_TimeoutWithExceptionsAfter : #1
Expected: True
But was: False
at MonoTests.System.Threading.Tasks.TaskTests.WaitAll_TimeoutWithExceptionsAfter () [0x00070] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:317
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
4) MonoTests.System.Threading.Tasks.TaskTests.WaitAll_TimeoutWithExceptionsBefore : #1
Expected: True
But was: False
at MonoTests.System.Threading.Tasks.TaskTests.WaitAll_TimeoutWithExceptionsBefore () [0x00070] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:341
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
5) MonoTests.System.Threading.Tasks.TaskTests.WaitAnyTest : #3
Expected: not -1
But was: -1
at MonoTests.System.Threading.Tasks.TaskTests.<WaitAnyTest>m__0 () [0x00026] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:142
at MonoTests.System.Threading.Tasks.ParallelTestHelper.Repeat (System.Action action, Int32 numRun) [0x00007] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTestHelper.cs:48
at MonoTests.System.Threading.Tasks.ParallelTestHelper.Repeat (System.Action action) [0x00000] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTestHelper.cs:42
at MonoTests.System.Threading.Tasks.TaskTests.WaitAnyTest () [0x00000] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:128
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
6) MonoTests.System.Threading.Tasks.TaskTests.WaitChildTestCase : #0b
Expected: True
But was: False
at MonoTests.System.Threading.Tasks.TaskTests.<WaitChildTestCase>m__25 () [0x0006d] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:705
at MonoTests.System.Threading.Tasks.ParallelTestHelper.Repeat (System.Action action, Int32 numRun) [0x00007] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTestHelper.cs:48
at MonoTests.System.Threading.Tasks.TaskTests.WaitChildTestCase () [0x00000] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:684
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
7) MonoTests.System.Threading.Tasks.TaskTests.WaitingForChildrenToComplete : #3
Expected: True
But was: False
at MonoTests.System.Threading.Tasks.TaskTests.WaitingForChildrenToComplete () [0x00048] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:734
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /Users/ludovic/Xamarin/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
The internal allocator used size segregated blocks which were always
16k large. Since we have quite a few different size classes this led
to a lot of allocation even for very small programs.
We now use block sizes that are determined by the slot size and are as
small as possible. They're power-of-two multiples of the page size,
so we end up with blocks of 4k, 8k and 16k.
The formula for calculating allowance was not only overly complicated
but completely broken, which resulted in the allowance always being the
minimum (4 times the nursery size). That resulted in too frequent garbage
collections when the heap grew larger.
Now we do something very similar to what Boehm does: Allow the heap
to grow by a third before the next major collection happens.
This is especially relevant if we have to shrink the width because of
padding. In this case it is possible that MeasureString calculated that
the string would fit in one line, but because of padding we reduce the
width. If the button is large enough we want to display additional lines
even if MeasureString told us we only need one line.
pid_t (used at line 216) is available on Linux in `unistd.h` and so on on FreeBSD (`sys/types.h` to be precise, included in `unistd.h`), yet on FreeBSD this header is not automatically included.
Because the monitor thread was not marked as background thread, remove_and_abort_threads (threads.c:2807) would mark it as needed to be waited to shutdown the runtime, and wait_for_tids (threads.c:2652) would then wait indefinitely for it to finish. The issue was that the monitor was waiting on the semaphore monitor_sem, and thus would never exit.
Thread 7 (Thread 0x1c13 of process 99776):
#0 0x00007fff86590a56 in ?? () from /usr/lib/system/libsystem_kernel.dylib
#1 0x00000001003cc03a in mono_sem_wait (sem=0x1004f7f50, alertable=0) at mono-semaphore.c:103
#2 0x00000001002cef41 in monitor_thread (unused=0x0) at threadpool.c:898
#3 0x00000001002cb78f in start_wrapper_internal (data=0x10500abf0) at threads.c:657
#4 0x00000001002cb4a1 in start_wrapper (data=0x10500abf0) at threads.c:704
#5 0x00000001003d61d4 in inner_start_thread (arg=0x7fff5fbfe500) at mono-threads-posix.c:84
#6 0x00007fff8e7c9899 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib
#7 0x00007fff8e7c972a in _pthread_start () from /usr/lib/system/libsystem_pthread.dylib
#8 0x00007fff8e7cdfc9 in thread_start () from /usr/lib/system/libsystem_pthread.dylib
#9 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x1503 of process 99776):
#0 0x00007fff86594716 in ?? () from /usr/lib/system/libsystem_kernel.dylib
#1 0x00007fff8e7cbc3b in _pthread_cond_wait () from /usr/lib/system/libsystem_pthread.dylib
#2 0x000000010039cfaa in _wapi_handle_timedwait_signal_handle (handle=0xa55, timeout=0x0, alertable=1, poll=0) at handles.c:1595
#3 0x000000010039d03d in _wapi_handle_wait_signal_handle (handle=0xa55, alertable=1) at handles.c:1540
#4 0x00000001003b7ba3 in WaitForSingleObjectEx (handle=0xa55, timeout=4294967295, alertable=1) at wait.c:194
#5 0x00000001003b865d in WaitForMultipleObjectsEx (numobjects=1, handles=0x7fff5fbff1f8, waitall=1, timeout=4294967295, alertable=1) at wait.c:516
#6 0x00000001002c75df in wait_for_tids (wait=0x7fff5fbff1f8, timeout=4294967295) at threads.c:2658
#7 0x00000001002c70e5 in mono_thread_manage () at threads.c:2951
#8 0x00000001000d551b in mono_main (argc=6, argv=0x7fff5fbff9e8) at driver.c:2021
#9 0x0000000100001bd1 in mono_main_with_options (argc=6, argv=0x7fff5fbff9e8) at ./main.c:91
#10 0x00000001000017d3 in main (argc=6, argv=0x7fff5fbff9e8) at ./main.c:122
Thanks @akoeplinger for the help debugging
Because the monitor thread was not marked as background thread, remove_and_abort_threads (threads.c:2807) would mark it as needed to be waited to shutdown the runtime, and wait_for_tids (threads.c:2652) would then wait indefinitely for it to finish. The issue was that the monitor was waiting on the semaphore monitor_sem, and thus would never exit.
Thread 7 (Thread 0x1c13 of process 99776):
#0 0x00007fff86590a56 in ?? () from /usr/lib/system/libsystem_kernel.dylib
#1 0x00000001003cc03a in mono_sem_wait (sem=0x1004f7f50, alertable=0) at mono-semaphore.c:103
#2 0x00000001002cef41 in monitor_thread (unused=0x0) at threadpool.c:898
#3 0x00000001002cb78f in start_wrapper_internal (data=0x10500abf0) at threads.c:657
#4 0x00000001002cb4a1 in start_wrapper (data=0x10500abf0) at threads.c:704
#5 0x00000001003d61d4 in inner_start_thread (arg=0x7fff5fbfe500) at mono-threads-posix.c:84
#6 0x00007fff8e7c9899 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib
#7 0x00007fff8e7c972a in _pthread_start () from /usr/lib/system/libsystem_pthread.dylib
#8 0x00007fff8e7cdfc9 in thread_start () from /usr/lib/system/libsystem_pthread.dylib
#9 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x1503 of process 99776):
#0 0x00007fff86594716 in ?? () from /usr/lib/system/libsystem_kernel.dylib
#1 0x00007fff8e7cbc3b in _pthread_cond_wait () from /usr/lib/system/libsystem_pthread.dylib
#2 0x000000010039cfaa in _wapi_handle_timedwait_signal_handle (handle=0xa55, timeout=0x0, alertable=1, poll=0) at handles.c:1595
#3 0x000000010039d03d in _wapi_handle_wait_signal_handle (handle=0xa55, alertable=1) at handles.c:1540
#4 0x00000001003b7ba3 in WaitForSingleObjectEx (handle=0xa55, timeout=4294967295, alertable=1) at wait.c:194
#5 0x00000001003b865d in WaitForMultipleObjectsEx (numobjects=1, handles=0x7fff5fbff1f8, waitall=1, timeout=4294967295, alertable=1) at wait.c:516
#6 0x00000001002c75df in wait_for_tids (wait=0x7fff5fbff1f8, timeout=4294967295) at threads.c:2658
#7 0x00000001002c70e5 in mono_thread_manage () at threads.c:2951
#8 0x00000001000d551b in mono_main (argc=6, argv=0x7fff5fbff9e8) at driver.c:2021
#9 0x0000000100001bd1 in mono_main_with_options (argc=6, argv=0x7fff5fbff9e8) at ./main.c:91
#10 0x00000001000017d3 in main (argc=6, argv=0x7fff5fbff9e8) at ./main.c:122
Commit 5564dad1 broke the self-test (for testing on the developer
machine, not an Android target). Fixup the comment so that appropriate
data is grabbed and used for testing, and improve
AndroidTimeZones.GetDefaultTimeZoneName() so that the default timezone
ID can be specified via the __XA_OVERRIDE_TIMEZONE_ID__ environment
variable for testing.
Finally, demonstrate TimeZoneInfo.GetUtcOffset(DateTime) use so that I
can get better insight into the timezone data stored within the
database:
$ __XA_OVERRIDE_TIMEZONE_ID__=America/New_York ANDROID_ROOT=`pwd` ANDROID_DATA=`pwd` mono --debug tzi.exe --offset=1969-01-01
Using DateTime Offset: 1/1/1969 12:00:00 AM
DB type: System.AndroidTzData
name=Africa/Abidjan Africa/Abidjan From Offset: 00:00:00
name=Africa/Accra Africa/Accra From Offset: 00:00:00
name=Africa/Addis_Ababa Africa/Addis_Ababa From Offset: 03:00:00
...
This fixes a problem with calculating the text width of a button
which caused the text to get truncated under certain circumstances
instead of being wrapped. This fixes Xamarin-23168.
Change-Id: Iac0d8a2720a99cf5433e05d5123a04c4b019e493
The test changes TZ environment variable and compares DateTime.Now with system date.
The test checks all the timezones installed in /usr/share/zoneinfo/.
The change does not have a negative impact on StringBuilder performance; under variable-string-length microbenchmarks it seems to perform ~15-20% faster than the managed implementation.
Use the new MONO_GC_DEBUG option "nursery-canaries" to suffix each nursery object with a canary (guard) word, which is checked on each minor collection. Can be used to detect/debug
heap corruption issues.
Adding canaries to LOS is also easy if wanted - not sure about major heap.
In some cases the timezone transitions provided by iOS are not convertible to AdjustmentRules because of changes on the base offset.
Now we store the transitions so they can be used instead of an incomplete list of AdjustmentRules.
Depending on alignment and packing, part of the string might be inside the MonoString struct boundaries. This e.g. shows up on 64-bit builds of mono where we were allocating 4 extra bytes per string.
We were spending a lot of time in major_iterate_live_block_ranges() on
the lcscbench benchmark, mainly from following the linked block list.
This change makes it much faster.
We trim the free list of the gray queue to a maximum number of
sections, but we did it at each collection start, so the extraneous
sections were kept around between collections.
At the point where we enqueue objects we have already fetched their
descriptors, and when we later scan them (after dequeuing) we need the
descriptor again, so we avoid cache misses by enqueuing them together.
Later on, when we enqueue objects with their GC descriptors, we won't
load the vtable before scanning (because we'll already have the
descriptor), so the scanning macros shouldn't take them as arguments.
It's not well-tested, not widely used, we can surpass its speed with
upcoming improvements and we won't put those into the fixed
configuration because it's too much of a diversion.
Before the change when the property default value was not null or empty the deserialized value would be the concatenation of the default value and the serialized value.
The correct behavior is to use the serialized value only.
Fixes 18908.
To resolve casting we make all relevant interfaces to use the generic variance casting code.
This only affected ICollection`1 and IList`1, which are not terribly popular.
To fix dispatch we augment vtable resolution to treat those interfaces as variant and use
the already in place machinery.
Memory reduction numbers for the corlib test suite:
Initialized classes 8004 -> 7470 (7% reduction)
Corlib mempool size: 2719832 -> 2678872 (1.5% reduction)
Inflated classes 4500: 3.972 (12% reduction)
Inflated signatures size: 166128 -> 139812 (16% reduction)
Inflated methods size: 565152 -> 485664 (15$ reduction)
https://bugzilla.xamarin.com/show_bug.cgi?id=18411
If a class explicitly implements an internal interface, those members will no
longer be documented, nor will the interface show up in the class' signature.
This allows for a library to hide internal implementation details that an end
user would not be able to take advantage of (ie. can't cast to internal
interface to call methods).
Includes test (check-monodocer-internal-interface) added to makefile.
This should fix c30a3e46d2 failing to link properly with ld 2.22 and GCC 4.9.1, on Linux, with non-LLVM builds.
./.libs/libmini.a(libmini_la-mini.o): In function `llvm_init_inner':
mini.c:(.text+0x1182b): undefined reference to `mono_llvm_init'
/usr/bin/ld: .libs/libmonoboehm-2.0.so.1.0.0: hidden symbol `mono_llvm_init' isn't defined
/usr/bin/ld: final link failed: Bad value
- Tds.cs: Use SecureString objects for passwords; Add method to retrieve string from SecureString
- Tds42.cs: Use SecureString for passwords
- Tds50.cs: Use SecureString for passwords
- Tds70.cs: Use SecureString for passwords
- TdsConnectionParameters.cs: Use SecureString for passwords; Initialize Password parameter as cleared string; Add indicator for when password is set
- SqlConnection.cs: Use SecureString for passwords; Add SqlConnect method that accepts an SqlCredential along with the Connection string; Perform checking of parameters to ensure user/password not specified in connection string if credentials have been specified or using credentials when domain login is specified.
- SqlCredential.cs: Add new class with support for credentials
- System.Data.dll.sources: Add SqlCredential.cs to the build list
[02131] CC libmonoruntimesgen_la-sgen-marksweep.lo
[02131] In file included from sgen-major-copy-object.h:35:0,
[02131] from sgen-marksweep.c:1128:
[02131] sgen-copy-object.h:38:1: warning: always_inline function might not be inlinable [-Wattributes]
[02131] par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword objsize, SgenGrayQueue *queue)
[02131] ^
[02131] sgen-marksweep.c: In function 'par_copy_object_no_checks':
[02131] sgen-copy-object.h:38:1: error: function 'par_copy_object_no_checks' can never be copied because it saves address of local label in a static variable
[02131] make[3]: *** [libmonoruntimesgen_la-sgen-marksweep.lo] Error 1
[02131] make[3]: Leaving directory `/root/rpmbuild/BUILD/mono-3.10.1/mono/metadata'
[02131] make[2]: *** [all-recursive] Error 1
[02131] make[2]: Leaving directory `/root/rpmbuild/BUILD/mono-3.10.1/mono'
[02131] make[1]: *** [all-recursive] Error 1
[02131] make[1]: Leaving directory `/root/rpmbuild/BUILD/mono-3.10.1'
[02131] make: *** [all] Error 2
[02131] error: Bad exit status from /var/tmp/rpm-tmp.YxcUOE (%build)
Kpp.Load() will throw an unhandled exception if _filename (a folder to use as the key store) does not exist and it cannot be created.
This is an entirely valid thing to have happen - cert importing into the machine store (mozroots --import --machine --sync) as root will create a /usr/share/.mono/certs/ folder, but will not create /usr/share/.mono/keypairs - and since the root user owns /usr/share/.mono/, if the user tries to enumerate the certificates in /usr/share/.mono/certs/, they get 0 certificates returned due to the unhandled exception dropping each loaded certificate on the floor.
Closes: Xamarin bug 23015
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=23077
Reverts commit 53ce92470.
Commit 53ce92470 disabled use of statfs(2) on Android, for unspecified
reasons. (My *suspicion* is that the Android version mono was
originally ported to didn't have statfs(2), but I can neither confirm
nor deny that guess.)
Android has supported statfs(2) since API-4 Android v1.6 (in that
statfs(2) is in the header files); what's missing is MNT_RDONLY. What
IS present is MS_RDONLY, which appears to serve the same purpose.
Re-enable use of statfs(2) and use MS_RDONLY when building against the
Android NDK.
This fixes the command to check for dos2unix and makes mkbundle usable again with mingw.
We need first to redirect the standard input, otherwise the check always fails with an InvalidOperationException and set CreateNoWindow=false to avoid spawning a new window.
The problem already starts when creating the OperationDescription; we need
to also look at the End* method here to correctly parse the reply parameters.
Then ClientRuntimeChannel.Process needs to distinguish between sync/async
and copy the out/byref parameters when needed.
SerializationCodeGenerator and XmlSerializationWriterInterpreter will no longer serialize an attribute named {V} if its object has a method named ShouldSerialize{V}() that returns false.
{V}Specified now is also checked to be true before serializating the attribute even if it is a property that is not settable.
Fixes#1852.
{V}Specified is a property or field and ShouldSerialize{V} is a method that can be set to false if we do not want to serialize an attribute with name {V}.
Based on pull request feedback, this is a simpler usage, and meets our required use-case. A sample version of this parameter would be: `--dropns MyUnifiedAssembly=MyDroppedPrefix`
We take the loader and the root domain locks before doing a thread dump. This reduces the odds
of us suspending a thread that holds either of them and deadlocking, for example, while decoding
AOT JIs.
Users have been complaining about strange errors arising when using the OracleClient classes.
I have tracked it down to the OciDefineHandle and OciDefineByPos calls, and OracleParameter
handling of amanged objects by unmanaged code. Currently two of the parameters passed to the
above OCI call are short variables. They are passed as "ref" fields as Oracle uses their
address to put size and indicator data once the data is fetched. However, being defined as
short means that they are eligible for being moved during garbage collection. Thus if that
field is moved between the OciDefineByPos call and the fetch of the data then what Oracle is
pointing to may no longer be variable. I'm thinking it may be better to define these fields as
IntPtr and allocate them and retrieve their values via Marshal.ReadInt16. As for OracleParameter,
it uses a managed object "indicator" that is also used in a similar way. This reference is replaced
by a IntPtr and a get/set method to access the contents.
iOS 8 GM lists "Asia/Chita" among its time zones, but when requesting
the time zone data for that time zone, no data is returned.
With this change we ignore time zones without any data when fetching
all the timezones on the system.
In some cases fixed_from_dmy is used with the month parameter greater than the number of months of that year.
Year is now incremented until month parameter is valid.
The changes from 3408b8e5f1 cause
regressions in distros which do not use lib as folder for
arch-specific libraries, like Fedora x86_64.
Instead, reloc_libdir should be used (as in data/mono.pc.in).
This change is released under the MIT/X11 license.
We observed on multiples benchmarks that most internal allocations are for 8, 16, 296 (32bits), 328 (64bits), 504 (32bits) and 1016 (64bits) bytes of memory. To minimize waste, we added these memory sizes to the default allocator sizes.
This split a single chunk of intractable ifdef hell into a beautiful set of per-target
files.
This will allow us to actually figure out what's going on on each target.
Removed unnecessary parameters ref byte [] bufferArg.
This changes are required by UTF8EncodingTest.EncodingFallback that in some cases is expecting multibyte values..
In theory, this test is used to verify that no unknown glib symbols exist
in eglib. However, it's tripping on g_Ctoc which is not a glib (or eglib)
symbol, instead it comes from the IO layer - and glib symbols never use
uppercase characters anyway
A change in Uri.Compare was making IsBaseOf to return false when arguments were null.
NullReferenceException is thrown by .NET, nonetheless the correct behavior is to throw a ArgumentNullException..
PR #1229 added a test that relies on the GAC and fails when it isn't available, like when building on a clean machine with monolite.
Skip the test in that case.
asl_vlog last parameter is a va_list and giving it a char* leads to crash
which calls our native unhandled exception handler, which also tries to
log what happens making the watchdog unhappy about the food quality
0x000000008badf00d
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18763#c12
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18763#c14
Context: http://stackoverflow.com/a/1789879/83444
mono_set_crash_chaining() was added in 8ffc4070 in order to better
support Android crash logs.
Crash logging in Android is "weird" (something we didn't know at the
time of 8ffc4070); when a process crashes on Android, ideally:
1. The Android signal handler is executed,
2. Bionic will attempt to connect to /system/bin/debuggerd.
3. debuggerd will try to connect to the crashing process, then
retrieve "useful" information from the crashing process (stack
trace, register values, etc.)
The problem with 8ffc4070 was that there is a "window" between steps
(1) and (3) during which the crashing process continues to execute but
debuggerd hasn't attached to the process. It is possible that the
crashing process can thus exit before debuggerd has had a chance to
attach, killing the purpose of the crash logs.
Case in point: consider mono_sigsegv_signal_handler(). In 8ffc4070,
if mono_do_crash_chaining is TRUE, then Mono will execute:
mono_handle_native_sigsegv (SIGSEGV, ctx);
mono_chain_signal (SIG_HANDLER_PARAMS);
mono_arch_handle_exception (ctx, NULL);
Because mono_chain_signal() doesn't block, abort the process, or
otherwise do anything to prevent execution from continuing, execution
will hit mono_arch_handle_exception(), which will exit the process.
If you're unlucky, this will happen before debuggerd has had a chance
to attach to the process.
The obvious fix is to prevent mono_arch_handle_exception() from being
invoked. The question is, *how*? jonp suggested [0] that after
mono_chain_signal() returns then _exit(2) or a busy loop could be
invoked. Unfortunately, _exit(2) makes the process exit explicit, and
~reliably prevents debuggerd from doing anything.
A busy loop doesn't work because it just causes the process to hang
within signal handler context, and debuggerd is never able to log
anything about the crashed process.
It would seem that the signal handler itself must exit without causing
the process to exit so that debuggerd has a chance to do ANYTHING,
otherwise nothing will happen reliably.
Thanks to T.J. Purtell for investigating and providing the patch.
[0]: https://github.com/mono/mono/pull/1206#issuecomment-52357802
--- Original commit message [formatted] ---
re #18763: After the chained handler executes, it may return to allow
the crashed instruction to be restarted or it may have taken
corrective action so the instruction can be resumed successfully.
For example, bionic resets the signal handler for SIGSEGV to default
expecting that the kernel will restart the offending instruction and
cause the kernel to abort the process. Don't do mono exception
handling after chaining to support these types of signal management.
Compilation of eglib/src/goutput.c was broken in commit 989165e1:
mono/eglib/src/goutput.c: In function 'monoeg_log_default_handler':
mono/eglib/src/goutput.c:159:75: error: 'args' undeclared (first use in this function)
__android_log_vprint (to_android_priority (log_level), log_domain, "%s", args);
^
mono/eglib/src/goutput.c:159:75: note: each undeclared identifier is reported only once for each function it appears in
mono/eglib/src/goutput.c: In function 'default_stdout_handler':
mono/eglib/src/goutput.c:168:2: error: incompatible type for argument 4 of '__android_log_vprint'
__android_log_vprint (ANDROID_LOG_ERROR, "mono", "%s", message);
^
mono/eglib/src/goutput.c:139:0:
$ANDROID_NDK_PATH/platforms/android-4/arch-arm/usr/include/android/log.h:109:5: note: expected 'va_list' but argument is of type 'const gchar *'
int __android_log_vprint(int prio, const char *tag,
^
mono/eglib/src/goutput.c: In function 'default_stderr_handler':
mono/eglib/src/goutput.c:175:2: error: incompatible type for argument 4 of '__android_log_vprint'
__android_log_vprint (ANDROID_LOG_ERROR, "mono", "%s", message);
^
(The cause of the breakage is that __android_log_vprint() takes a
va_args parameter, which is no longer present in 989165e1.)
Use __android_log_write() instead of __android_log_vprint().
Note: __android_log_write() writes a "simple string" to `adb logcat`,
meaning there is no printf(3)-style formatting applied.
When the stream returned by WebClient.OpenWrite() / OpenWriteAsync() /
OpenWriteTaskAsync(), we need to call GetResponse() and read the full
response.
Unfortunately, there is no async API available for this, so this API should
not be used in async applications.
XmlSerializerTests was mostly testing XmlSerializationReaderInterpreter and XmlSerializationWriterInterpreter.
XmlSerializerGeneratorTests forces the usage of SerializationCodeGenerator while running XmlSerializerTests.
This test requires a simple single mapping for Hostname<->IP with one IP and reverse DNS. Using EC2-hosted sites doesn't work as they don't have valid reverse DNS. Use the Jenkins subdomain, since that fits the criteria.
In the case where more than one pointer pointed to the same empty region within
the nursery we would search through that empty region for each pointer instead of
just once.
Assume we have an object at address 0x1000, with size 0xf0, then
a hole of size 0x10, and the next object starting at 0x1100, of
size 0x20. In the pin queue we have the addresses 0x10f8 and
0x1100.
When we process the first pin queue entry, 0x10f8, we jump over
the object at 0x1000, to 0x10f0. Then we skip the hole and end
up at 0x1100. We set last_obj to that address. Then we check
against the pin queue entry we're looking for and find that we've
overshot it, so we end our search and go to the next pin queue
entry, 0x1100. There's an object at that address, but because of
this check we don't pin it:
if (addr >= last_obj && (char*)addr < (char*)last_obj + last_obj_size) {
addr == 0x1100, last_obj == 0x1100, last_obj_size == 0x20
This commit changed the gray stack to support work items. When a big
array of objects is marked, Sgen now create several work items. Every
work item rappresents a pieces of the array that must be scanned.
Since they are different pieces, the workers can now parallel scan
and mark the array, resulting in a better work distribution between
the workers.
I release this change under the MIT license.
This commit transport the scan macro from sgen-descritor.h to
sgen-scan-object.h. This is useful for modify at compile time
the scan macro according to the scan function.
I release this change under the MIT license.
The latter is now hosted on a different IP behind a CDN and the IP may change depending on location.
Using xamarin.com instead fixes the tests for now.
This makes difference when the build has started from a solution especially
via command line with /p option. Those command-line-passed properties need
to be inherited to each project, but they weren't.
xbuild worked fine here.
This optimization is activated in the ldvirtftn + delegate case, and is deactivated in the case where the architecture does not support it (mono_arch_get_delegate_virtual_invoke_impl return NULL)
Since NET_4_0 and NET_4_5 share the same ToolsVersion (4.0) there seems no
way to distinguish the appropriate framework .targets file, so I ended up
to add the missing members as internal for 4.0.
CompareInvalidTest is still not working because .NET PackUriHelper.ComparePackUri is doing something that uses Uri and throws an exception whereas Mono is not.
- the dropns flag now lets you define a namespace that is dropped in a new version of the assembly during update.
- the ntypes flag lets you tell the update command that certain methods are now using native types, and as such will attempt to match with old types in order to preserve documentation.
- the preserve flag will avoid removing members. This is to avoid dropping documentation for members that changed from one version of the framework to another new-style version (ie. iOS).
- Fixed bug in creating CREF strings.
- Refactored XML file processing for customization during new style iOS assembly. This was done through the new file source interface, which lets you use dependency injection to customize the process.
- Added the ability to rewrite CREF references when assembling docs that use native types. Also, the ability to handle dropped namespaces.
If we encounter such a device we assign it an empty name followed by index number, so that we can
put any number of such devices in the dictionary and report them to the user.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=21741
We can now pass a file size limit to the `binary-protocol` option. It will
create numbered binary protocol files, and only keep the last two around.
This is useful for cases where the only way to reproduce a bug is through
a long run that would otherwise create a protocol that's much too big.
With the debug policy, we do clear at TLAB creation, but at GC time, whenever
we would clear with `clear-at-gc`, instead of not clearing, we fill with 0xff.
This define covers kFreeBSD, not just Linux. This is required because
the error which 120d194d10 works around is
a GNU problem, not a Linux problem, so causes FTBFS on kFreeBSD.
Xinerama has only ever had a soname of 1.
Checking for 1, 2, and 3 is just weird and pointless. And by not using a
default value, we duplicate the bug which add24aaa1 fixed.
We complain that we can't find "X development files", but the reverse
is true - if we had X development files, we'd find libX11.so (which
we aren't looking for). What we look for (and find) are the runtime files.
GNU/kFreeBSD is an experimental OS provided by the Debian project, consisting
of a FreeBSD kernel and GNU userland/libc. For a small number of cases, this
offers advantages over a more common GNU/Linux combination, such as fast
in-kernel support for ZFS storage.
This patch changes various ifdefs, either using __FreeBSD_kernel__ where a
trait from the kernel is what matters, or __GLIBC__ where a trait from the
C library matters.
This patch set has been carried downstream, in one form or another, since
1.2.3.1-1.
https://bugzilla.novell.com/show_bug.cgi?id=321634
Added code to call Xamarin.Android internal implementation of getifaddrs/freeifaddrs to provide us
with the required information to fulfill the request.
Added a handful of Linux ARP hardware IDs which are considered to be tunnel devices and which may occur
on Android devices.
Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=1969
As @marek-safar noted in mono@cf4f10e#commitcomment-7128403, the IL code for the 4.0 profile is never used
for running (the assemblies are just built for having metadata), so it makes no sense to execute 4.0 tests during "make check"
In some cases, usually when dealing with IntPtr <> void* conversions, 2nd order aliases arises.
To handle them, first we consider the lowered load/stores for alias information, second
we iterate over handle globals/dce while aliases can still be eliminated.
We need to pass the right generic context to the method parsing so local variables with
generic argument types get the owner properly set.
In addition to that, harden the icall in case the owner is not set.
claims must be added regardless of identity parameter
Since constructors are chained in that class, this wrong behaviour causes chained trouble of claims to be never added
The previous fix to handle curried delegates with DynamicInvoke did not correctly handle
those create with IL (in contrast to Delegate.CreateDelegate), as they don't hit any managed code.
The solution is to always require DelegateData to be filled for InvokeDynamic, if not, lazily
calculate it.
DataRow's RowError is supposed to be String.Empty to indicate
no errors, but is sometimes wrongly set to null, falsely indicating
errors. Fixed to be String.Empty.
UriKind was added so Relative Uri can be parsed by UriParseComponent.ParseComponents.
String error was added so a error can be returned when an invalid Uri is provided.
The method is only public in .NET 4+, previously it was protected. Wrapping the access modifier in a #if NET_4_0 ensures that when building .NET 2, it is protected but when building 4+ it is public.
If the backing file doesn't exist, it will be ignored.
The previous message made it sound like this is a serious problem, which confused people as it is the last message that is
printed when building Mono (because of a reference to 'DoesNotExist' in docs/toc.xml) while in reality everything is fine.
The Microsoft version is public, so should this be.
NuGet.MSBuild.Tools.CommandLineBuilderExtensions:AppendTextUnquotedIfNotNullOrEmpty attempts to call this method in NuGet for MSBuild NuGet package.
The WebSocketMessageType values were being used to send data over the
wire. This is likely the reason why WebSocketMessageType had values
that were not compatible with .NET.
With this patch, we see a 3x execution speed improvement in the following micro-benchmark :
using System;
class Foo {
public int Test () { return 10; }
}
class Program {
public static int Main (String[] args) {
long n = 50000000;
if (args.Length > 0)
n = Math.Max (n, Int64.Parse (args [0]));
var a = new Foo ();
for (long i = 0; i < n; i++) {
var f = new Func<int> (a.Test);
if (f () != 10)
return 1;
}
return 0;
}
}
The TestTimeoutPropertyWithServerThatDoesntExist test sometimes failed with a 'ConnectFailure' instead of a 'Timeout'.
As per the discussion in PR #1145, the test should actually check that a ConnectFailure is thrown before the timeout is reached.
This proved unreliable with the 10.128.200.100 IP address, as it was up to the networking stack to decide whether the endpoint can be reached,
which can take quite a long time (sometimes >100secs).
Instead, we now use the loopback address with a port where no service listens, which should be equivalent.
Additionally, the assert which checks for the correct exception switched the 'expected' and 'actual' parameter, which resulted in the wrong output, this is fixed as well.
Socket.ConnectAsync uses BeginConnect, and ends here in
ConnectCallback. It needs to call EndConnect so any error can be
propagated up.
See Xamarin bug: https://bugzilla.xamarin.com/show_bug.cgi?id=21017
- Fix detection of extra characters in JSON input
- Fix detection of invalid negative numeric literals
- Disallow leading zeros
- Use "round-trip" format for floating point numbers
- Serialize NaN and Infinity as strings
- Use NumberFormatInfo.InvariantInfo for Convert.To*()
- Use standard number parsing methods in ReadNumericLiteral()
- Add test cases
* Implement DW_CFA_remember_state/restore_state opcodes.
* Add a DW_CFA_mono_advance_loc opcode to advance to a location stored outside
of the unwind info. Use this to allow the sharing of unwind info between
methods.
This is need to prevent crashes during unwinding when the ip of the last frame is in the epilog. This can be reproduced by
running sgen-new-threads-dont-join-stw.exe in a loop.
With GetComponentsHelper components with format UriHelper.ToStringUnescape can be retrieve without the ArgumentOutOfRangeException thrown by GetComponents.
Reduce tests now test sequences of 1 to 3 encoded or decoded dots inside paths with or without trailing character and encoded fowardslash and backslash.
This reverts commit 265060cc22.
The test is still failing:
2) MonoTests.System.Threading.Tasks.TaskTests.TaskContinuationChainLeak : Expected: False
But was: True
at MonoTests.System.Threading.Tasks.TaskTests+TaskContinuationChainLeakTester.Verify () [0x00000] in /var/lib/jenkins/workspace/Mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:1991
at MonoTests.System.Threading.Tasks.TaskTests.TaskContinuationChainLeak () [0x00022] in /var/lib/jenkins/workspace/Mono/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs:1948
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /var/lib/jenkins/workspace/Mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
These tests occasionally time out:
Test Case Failures:
1) MonoTests.System.ServiceModel.PeerResolvers.CustomPeerResolverServiceTest.CloseTest : System.TimeoutException : The operation has timed-out.
at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd () [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
I.e. we're timing out waiting for the async wait handle here: https://github.com/mono/mono/blob/master/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs#L495
Since we have no current WCF maintainer and this is deep, deep within
WCF land and causes unstable builds on Jenkins, disable these tests
for now.
Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=21069
The WaitOne () call has a tendency to time out on the Jenkins
VMs. However, reproducing the problem outside of Jenkins has
proven futile.
This makes the WaitOne () call block for as long as needed and
still fails the test if the elapsed time was longer than 30s.
We print the actual elapsed time to the console.
Hopefully this'll help us find out if it's just taking quite a
long time to run or if it's a hang.
With IriParsing the presencee of encoded alpha numeric, non ASCII, '-', '.', '_' and '~' characters trigger the decoding of some other characters.
Tested permutations now include tests with and tests without those characters.
Changed Format methods to receive FormatFlags.
Added FormatFlag.HasCharactersToNormalize, which improves character decoding.
The flag is set when Iriparsing is true and the Uri contains an encoded alpha numeric, non ASCII, '-', '.' , '_' and '~'.
When the flag is set some other encoded charcaters need also to be decoded.
* MONO_ARCH_HAVE_ATOMIC_* macros have been removed.
* Backends now report whether they support atomic opcodes via
the mono_arch_opcode_supported () function.
* The default implementation of mono_arch_opcode_supported ()
has been removed as almost all backends need to define one
anyway.
* All old atomic_add_* opcodes have been removed. These were no
longer being used but some backends still had code for them.
* atomic_add_new_* opcodes have been renamed to atomic_add_* as
they are now the only atomic add opcodes.
* Itanium-specific atomic_add_imm_* opcodes have been moved to
the __ia64__ section of mini-ops.h.
* Comments have been added to mini-ops.h explaining the precise
semantics of the atomic opcodes.
The net result of this change is a simpler backend interface at
the cost of a slightly bigger binary.
MONO_PATH was missing when running the tests.
Use "libMonoPosixHelper.so" in local directory when checking if DllImport of a development library generates a warning (libglib2.0-dev might not be installed, but libMonoPosixHelper is always built with mono)
Since libgdiplus is not installed together with Mono, it should not be
assumed to be in the same prefix.
The new policy for the --with-libgdiplus configure option is the
following:
- --with-libgdiplus=/absolute/path/to/libgdiplus.{so,dylib}
both during build/check and after installation Mono will try to use
the specified libgdiplus library; the rationale is that when an
absolute path is given, it can be assumed to be the full path to
the library that is already installed (possibly in a non-default
path).
- default, --with-libgdiplus=no, --with-libgdiplus=installed
both during build/check and after installation Mono will try to use
a system-wide libgdiplus library, that is assumed to reside in the
paths that are automatically searched by the dynamic linker; the
library is supposed to be already installed in the default path and
to be useable both during the build and afterwards.
- --with-libgdiplus=sibling, --with-libgdiplus=yes
during build/check Mono will try to use the libgdiplus library that
is assumed to be in the sibling folder (../libgdiplus), but after
the installation it will try to use a system-wide libgdiplus
library, that should be in the paths that are automatically
searched by the dynamic linker; the assumption is that the library
is not yet installed, but it will go to the default prefix after
installing it.
- --with-libgdiplus=../some/relative/path/to/libgdiplus.{so,dylib,la}
during build/check Mono will try to use the specified libgdiplus
library, but after the installation it will try to use a
system-wide libgdiplus library, that should be in the paths that
are automatically searched by the dynamic linker; the assumption is
that the library is not yet installed, but it will go to the
default prefix after installing it.
The libMonoPosixHelper is installed together with Mono, hence its path
in the configuration should be relative to the Mono prefix.
It was previously assumed to reside in a system path, so the the
dynamic linker would find it anyway.
This patch is based on the one included in bug #18555 (by Gaëtan
Lehmann <[email protected]>), but it also updates
runtime/Makefile.am to keep runtime/etc/mono/config consistent.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=18555
Created a new set of tests that create&store or that load&assert uri permutations.
Uris are created with permutations of schemes, components, characters then methods and properties output is asserted against expected values obtained on .NET.
Recent versions of Git co-host submodule GIT_DIRs in <root-project>/.git/
by default, and write their relative path into <subproject>/.git,
which is a regular file:
$ ls -l external/cecil/.git
-rw-r--r-- 1 foo bar 42 Jun 16 12:50 external/cecil/.git
$ cat external/cecil/.git
gitdir: ../../.git/modules/external/cecil
Relax the expression in Makefile.am to also delete these (broken)
"symlinks" when preparing a distribution tarball.
This reverts commit ed11296c51.
When a ThreadAbortException is thrown during request processing in AsyncRun () the _done.Set () call is not executed.
This then results in a deadlock because _done.WaitOne () doesn't get signaled and waits forever.
One solution would be enclosing the _done.Set () in a finally clause, but even then we'd need to relaunch the AsyncRun () loop to be in a usable state.
A simpler solution is to revert the commit that introduced the AsyncRun () in the first place, as it doesn't seem necessary now (the tests pass just fine without it).
The test that was disabled in 429cdf17cf is reenabled too, as it wasn't the culprit of the problem.
When a % was found HexUnescapeMultiByte output was always considered escaped.
Now a % that is not a percentage encoded character will be processed has a not escaped character.
The property IriParsing will be used to change between .NET 4.5 and .NET 4.0 default percentage encoding/decoding behavior.
A private field named s_IriParsing same as .NET was also added so it can be changed the same way through reflection in .NET and Mono.
The idea is simply to make a worker tries to steal work from the workers that are next to him firs, before trying back at the beginning.
This reduce lock contention on the first workers and distribute more evenly work between workers by not starving the first ones.
We would previously run this everywhere, but it only works on
x86 and amd64 at the moment (similar to finally_guard.exe).
This meant that it would always fail on e.g. ARM and PPC. We
still disable it under NaCl (because it uses Thread.Abort ())
and Win32.
Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=20961
These tests fail under this particular profile only with the following:
1) MonoTests.Microsoft.Build.Evaluation.ProjectCollectionTest.GlobalProperties : #2
Expected: True
But was: False
at MonoTests.Microsoft.Build.Evaluation.ProjectCollectionTest.GlobalProperties () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
2) MonoTests.Microsoft.Build.Evaluation.ProjectTest.BuildCSharpTargetBuild : Microsoft.Build.Exceptions.InvalidProjectFileException : Attribute "KeepDuplicates" is not known on node "_TargetFrameworkDirectories" [type Microsoft.Build.Construction.ProjectItemElement]. at: /home/alexrp/Projects/mono/mcs/class/lib/net_4_5/Microsoft.Common.targets (182,5)
at Microsoft.Build.Construction.ProjectElement.LoadAttribute (System.String name, System.String value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectItemElement.LoadAttribute (System.String name, System.String value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectRootElement.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectRootElement.Create (System.Xml.XmlReader xmlReader, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Import (Microsoft.Build.Construction.ProjectImportElement import) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project+<EvaluatePropertiesAndImportsAndChooses>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[ProjectElement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Import (Microsoft.Build.Construction.ProjectImportElement import) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project+<EvaluatePropertiesAndImportsAndChooses>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[ProjectElement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.ProcessXml () [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Initialize () [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, ProjectLoadSettings loadSettings) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion) [0x00000] in <filename unknown>:0
at MonoTests.Microsoft.Build.Evaluation.ProjectTest.BuildCSharpTargetBuild () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
3) MonoTests.Microsoft.Build.Evaluation.ProjectTest.CreateProjectInstance : Microsoft.Build.Exceptions.InvalidProjectFileException : Attribute "KeepDuplicates" is not known on node "_TargetFrameworkDirectories" [type Microsoft.Build.Construction.ProjectItemElement]. at: /home/alexrp/Projects/mono/mcs/class/lib/net_4_5/Microsoft.Common.targets (182,5)
at Microsoft.Build.Construction.ProjectElement.LoadAttribute (System.String name, System.String value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectItemElement.LoadAttribute (System.String name, System.String value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectRootElement.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectRootElement.Create (System.Xml.XmlReader xmlReader, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Import (Microsoft.Build.Construction.ProjectImportElement import) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project+<EvaluatePropertiesAndImportsAndChooses>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[ProjectElement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Import (Microsoft.Build.Construction.ProjectImportElement import) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project+<EvaluatePropertiesAndImportsAndChooses>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[ProjectElement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.ProcessXml () [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Initialize () [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, ProjectLoadSettings loadSettings) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion) [0x00000] in <filename unknown>:0
at MonoTests.Microsoft.Build.Evaluation.ProjectTest.CreateProjectInstance () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
4) MonoTests.Microsoft.Build.Evaluation.ProjectTest.LoadCaseInsensitive : Microsoft.Build.Exceptions.InvalidProjectFileException : Attribute "KeepDuplicates" is not known on node "_TargetFrameworkDirectories" [type Microsoft.Build.Construction.ProjectItemElement]. at: /home/alexrp/Projects/mono/mcs/class/lib/net_4_5/Microsoft.Common.targets (182,5)
at Microsoft.Build.Construction.ProjectElement.LoadAttribute (System.String name, System.String value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectItemElement.LoadAttribute (System.String name, System.String value) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.LoadValue (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectElementContainer.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectRootElement.Load (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at Microsoft.Build.Construction.ProjectRootElement.Create (System.Xml.XmlReader xmlReader, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Import (Microsoft.Build.Construction.ProjectImportElement import) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project+<EvaluatePropertiesAndImportsAndChooses>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[ProjectElement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Import (Microsoft.Build.Construction.ProjectImportElement import) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project+<EvaluatePropertiesAndImportsAndChooses>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[ProjectElement] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.ProcessXml () [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project.Initialize () [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, ProjectLoadSettings loadSettings) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <filename unknown>:0
at Microsoft.Build.Evaluation.Project..ctor (Microsoft.Build.Construction.ProjectRootElement xml, IDictionary`2 globalProperties, System.String toolsVersion) [0x00000] in <filename unknown>:0
at MonoTests.Microsoft.Build.Evaluation.ProjectTest.LoadCaseInsensitive () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
- Whitespace Espressions:
-- if a column expression is a pure whitespace, use an empty string instead
-- if a column expression is surrounded by whitespace, preserve whitespace
-- if a column expression is null/empty, use an empty string
- Get a row's column value:
-- make sure we throw exceptions if the column we are looking at is null
-- make sure we throw exceptions if we can't find the column with the provided name
When building sln files, they are first converted to sln.proj
files, then the project file is built.
The engine unloaded and reloaded the sln.proj file itself, but
not the projects implicitly loaded while parsing the sln file.
This meant that some state was kept around that prevented
AfterTargets from being handled correctly
BXC18761 - AfterTargets and AfterBuild ignored by xbuild
This reverts commit dd412cfb2e.
We need to know what target was broken by this and verify that this won't break the platitude of libc's around.
This is currently a non-trivial job, so let's just revert this for now.
The former used to miscompile back in 2005, but this no
longer appears to be the case. Further, using strtod ()
is problematic on Linux/ARM systems with many non-US
locales that use a comma as the decimal separator.
In particular, this breaks almost all compilation with
MCS because it can't parse floating point literals.
Based on investigation by Damien Diederen <[email protected]>.
- bugzilla.xamarin.com issue 20925
- if an expression column was added ayer there were rows, and then IsNull is called, the result is incorrect (it will always be true)
sgen-domain-unload.exe test would crash because of a bug involving queue->alloc_prepare_func => workers_gray_queue_share_redirect => sgen_gray_object_dequeue_section on queue => set queue->first->size depending on queue->cursor. The solution is simply to make sure that the cursor is set on the queue, before allocating a new section, even if it is does not seems necessary in the first place.
Instead of generating a sequence of AMD64 instructions for
power-of-two OP_[IL]REM_IMM, portably decompose them to intermediate
code.
OP_IREM_IMM is decomposed on 32 and 64 bit archs, OP_LREM_IMM only on
64 bit archs.
By using StringAssert we get a more descriptive error message when the test fails, i.e. the expected vs. the actual string value instead of just true/false.
The pid_t type is required by POSIX to be a signed integer type (and that it
isn't wider than long in at least one programming environment). Mono has a
bunch of issues with 64-bit pids at the present, this is a start. Cast the
pid to the largest available signed type before printing it.
This change is released under the MIT/X11 license.
The u_char, u_short and u_int types are non-standard and no system headers
are required to provide them. There are no particular use for them and the
builtin standard types will do just as well.
This change is released under the MIT/X11 license.
I had to use the null garbage collector due to boehm being troublesome. The
code appears unmaintained but I can see a recent git commit enabled support
again. However, I had to do more than that to get it working. I'm really not
sure how semantically correct this is and it needs review from an expert in
how threads and garbage collection interplay in Mono. It seems very odd that
various attributes (such as its short id) about the main thread is
initialized as a side effect of initializing the garbage collection. The
mono_thread_info_attach was needed to prevent a crash.
This change is released under the MIT/X11 license.
Welcome to the world of tomorrow! It's been almost a decade since this was
made obsolete in 2005. Nothing uses this function any longer. Additionally
it is completely broken as utimes takes a pointer to an array with two
timevals, but the code passes only a pointer to a single timeval.
This change is released under the MIT/X11 license.
This test was added in 2004 to work around buggy Linux distributions and is
not needed today. The test caused problems as it also ran on non-Linux
operating systems and assumed dynamic linking was available. This caused it
to mistakenly decide thread-local storage was unavailable on operating
systems with no dynamic linking (but perfectly usable thread-local storage).
This change is released under the MIT/X11 license.
The __USE_GNU macro is an internal macro used by glibc to enable the GNU
extensions. Programs are instead meant to use the _GNU_SOURCE macro before
including any system header.
This change is released under the MIT/X11 license.
The SIGPROF signal is an XSI option and obsolescent in XSI. POSIX systems
are not required to have it.
This change is released under the MIT/X11 license.
There is no standard bzero function, only the standard memset function, and
Mono does not declare its own bzero function.
This change is released under the MIT/X11 license.
The configure script determines the size of the sun_path member in struct
sockaddr_un. However the test is broken during cross-compilation (with a
comment that there is no macro to determine the size of struct members at
configure time) and MONO_SIZEOF_SUNPATH defaults to 0 (leading to buffer
underflows and overflows). There is no reason to determine this at configure
time when a simple traditional sizeof will do the job at compile time.
This change is released under the MIT/X11 license.
The MAP_FAILED macro is the standard return value of mmap() upon failure and
it is allowed to have other values than (void*)-1.
This change is released under the MIT/X11 license.
The dump_ubin function is only used by the elf_dl_callback function. It
should be wrapped in the same #if conditional to avoid a warning if the
preprocessor conditional isn't true.
This change is released under the MIT/X11 license.
The get_fstypename function is only used by the GetVolumeInformation
function. It should be wrapped in the same #if conditional to avoid a
warning if the preprocessor conditional isn't true.
This change is released under the MIT/X11 license.
The S_IWRITE macro is a non-standard macro provided by some operating
systems for compatibility with BSD. POSIX specifics a standard macro with
identical semantics with the name S_IWUSR.
This change is released under the MIT/X11 license.
POSIX defines struct timespec in time.h and struct timeval in sys/time.h.
Some operating systems have merged these headers, but this isn't required or
encouraged by POSIX.
This change is released under the MIT/X11 license.
Only mono/metadata/icall.c and mono/metadata/filewatcher.c include the
mono/metadata/filewatcher.h header and none of them depend on the contents
of the non-standard header <sys/syscall.h>.
This change is released under the MIT/X11 license.
POSIX specifies <poll.h> as the standard header that declares the poll
function. Many systems provide <sys/poll.h> to be compatible with historical
practice. Prefer the <poll.h> header over <sys/poll.h> if it is available.
This change is released under the MIT/X11 license.
POSIX mandates that select is declared in <sys/select.h> (and in the header
<sys/time.h> for compatibility). It would be best to include the new header
if it is available. This is already done throughout the source tree, though
not in all instances.
This change is released under the MIT/X11 license.
This patch consist in changing the way we access the current element value in the gray queue. Before, we would save the index of the last element in the queue, then to access to the current value, we would have to make 2 memory access + 1 array offset access. Now we store a pointer to the current element, so we only need 1 memory access, thus reducing the number of memory indirection. We see ~25% speed improvement in major gc collection time on gc-graystack-stress test.
This is a stopgap measure: This test hangs a *lot* on Jenkins
and it's only being disabled to get stable-ish builds. It's
being actively investigated still.
Without this, three of the tests fail on Linux kernels without IPv6
support.
This is a minimal fix, copy'n'pasting a conditional which was used in
other tests. It might be nicer to factor out the SupportsIPv6 to its
own utility function.
When DataMember is already set before DataSource we need to verify that it refers to a valid property in the DataSource setter, otherwise we'd get an exception in ResetList ().
This fixes the following failing tests: BindingSourceTest.DataMemberBeforeDataSource and BindingSourceTest.DataSourceAssignToDefaultType.
Commit licensed under MIT/X11.
Instead of using mono_valloc we create a temp file and unlink it. With this we can have the right
mmap semantics regarding CoW and access rights.
This does simplify the code too by completely removing the mapping kind.
This patch is from Brendan Zagaeski and fixes bug 11307
The description of the problem was:
In Mono 2.10.12, the BasicHttpBinding property no longer supports
EnableHttpCookieContainer because it is Depreciated. The replacement
is AllowCookies, but this property does not work. Upon inspection of
the source source, we find that the HttpCookieContainerBindingElement
is added in accordance with EnableHttpCookieContainer, but not
AllowCookies.
The conditional compile logic at [1] is no longer needed for
Xamarin.iOS or Xamarin.Android.
Apparently on slow systems the items with 1sec expiration time are already removed from the cache by the time the #CS3 Assert() is hit, which caused the test to fail.
Increasing the expiration time by +2sec should hopefully fix this.
Commit licensed under MIT/X11.
BindingList subscribes to PropertyChanged events of eligible contained objects. Iff the PropertyName provided is valid,
the list event's ListChangedEventArgs will also contain a PropertyDescriptor.
This is to match MS behavior.
Now the user has access to all struct elements in EpollEvent when
using epoll_ctl. This is in particular very intersting when the
user wants to access the ptr field.
The user can use GCHandle.ToIntPtr to give the struct a GCHandle
and then handle the pointer later on when using epoll_wait.
The 'minimum' default value of NumericUpDown was set to 0.0M, which caused the ToString() to format it as "0.0" instead of "0" as it does on .NET.
A similar change was done for the 'maximum' default value already in f6c8d48a3a.
Commit licensed under MIT/X11.
Several System.Resources tests rely on a DummyAssembly.dll, which was removed in 016b0b5170 (possibly by accident?).
This commit adds the assembly back.
Commit licensed under MIT/X11.
The .NET AddCacheDependency method signature is `public void AddCacheDependency(params CacheDependency[] dependencies);` Mono should mirror the signature (even if it isn't implemented) to prevent build errors. Conditional code, of course, will need to be used for an alternative mono path.
Removed code that stripped CDATA statements (but not blocks) from input when showing a namespace page:
The function Ecma2Html.WrapStream(TextReader,Dictionary<String,String>) very explicitly returns a new `AvoidCDataTextReader` when the system is showing a namespace. The `AvoidCDataTextReader` strips the CDATA statement, but not it's internal contents. The intent, according to AvoidCDataTextReaderTests, is to allow class summaries of this form:
"<elements><summary>Addressbook APIs.</summary><remarks /><class name=""ABAddressBook"" fullname=""MonoTouch.AddressBook.ABAddressBook"" assembly=""monotouch""><summary><![CDATA[
Provides access to the system Address Book.]]>
</summary></class></elements>"
But that form is not desired.
The bug arose because the input to `WrapStream` is very large (it actually includes the entire *description* for each class and member in the namespace!). If any CDATA-block contained entities such as, e.g., < or >, the resulting XML would (obviously) be ill-formed:
"<xml>This should be valid <![CDATA[<T>]]> </xml>"
would throw because the <T> would be attempted to be parsed as XML. Obviously, samples that contain generics or lambda or XAML would cause this problem.
Although an XMLException was thrown, Macdoc swallows the exception in DocTools.GetHTML(). That is why this caused a silent failure on macdoc and was visible on Webdoc.
Remove the "ConnectionState" from the connection list before closing the connection,
this should avoid ServicePoint.SendRequest() ever crashing with a NullReferenceException
due to getting a null return value from WebConnectionGroup.GetConnection().
The fragment list has one invariant, the next pointer is tagged if the current fragment is been deleted,
which means the list head can never point to a tagged pointer.
If this invariant is broken, the code in find_previous_pointer_fragment will end up in an infinite loop.
The infinite loop happens in this simplified fragment:
try_again:
prev = &allocator->alloc_head;
1) cur = unmask (*prev);
while (1) {
2) if (*prev != cur)
goto try_again;
So assume allocator->alloc_head points to 0x121, which is tagged.
So execution goes like this:
1) cur is set to 0x120
2) *prev (value 0x121) is different than cur (value 0x120) so retry.
The above will loop forever as the fixup code never touches allocator->alloc_head.
Now that we understand the infinite loop, let's see how the remove code can trigger it.
Use use the following notation in the event sequence:
-> a non tagged pointer
-*> a tagged pointer
first CAS: InterlockedCompareExchangePointer ((volatile gpointer*)&frag->next, mask (next, 1), next)
second CAS: InterlockedCompareExchangePointer ((volatile gpointer*)prev_ptr, next, frag)
Assuming the following initial fragment list and two threads removing two separate fragments:
fragment list; -> A -> B -> C
thread 1 removes A
thread 2 removes B
thread 2 succeed the first CAS
-> A -> B -*> C
thread 1 succeed the first CAS
-> A -*> B -*> C
thread 2 fail the second CAS because of thread 1
-> A -*> B -*> C
thread 1 succeed the second CAS
-> B -*> C
thread 2 succeed the second CAS and set prev_ptr to next,
which at this point is a tagged pointer. Leaving the fragment list like this:
-*> C
After the last CAS, we end up with alloc_head with a tagged pointer, which will cause
the infinite loop we previously explained.
The fix is to unmask the value we store in the second CAS, as the objective is to link
two live fragments and not flag the previous fragment for deletion.
The exact same bug exists in mono-linked-list-set and was fixed there.
The is no reason to ever invoke the callback on the ThreadPool,
it would in fact only cause trouble.
Marek's commit db92449f was correct, I removed the commented out
code and the no longer used method.
Thanks a lot for Martin Potter to find and report the race condition
which was causing the problem.
ServicePointManager.RecycleServicePoints() was a left-over from the
old times when we didn't have an idle-timer based approach.
Here's the scenario that causes the crash:
Exception is fired, which invokes mono's vectored exception handler. It
is not an exception mono recognizes, so falls through to the default:
case in the exception handler. The problem is the return value has been
initialized to EXCEPTION_CONTINUE_EXECUTION. This causes SEH not to
process any other handlers, and just attempt to continue execution at
the point the exception was thrown.
The problem is much of windows internals will catch various exceptions
internally and handle them. So instead of the exception being handled,
we would just crash in the bowels of windows.
The solution is to set mono_win_chained_exception_needs_run to TRUE in
the default case - this is what the various exception handlers do if the
exception is not in JIT'd code. This causes the handler to return
EXCEPTION_CONTINUE_SEARCH, which causes SEH to search for the next
handler, and no crash is produced.
Both x86 and x64 had this bug, so I fixed it in both places.
Fix contributed by Steve Anichini.
The problem is that on some platforms we call the function
without having provided a prototype for it. This breaks when
building with `-Werror`.
Now we declare it in the private `vasprintf.h` header when
the platform doesn't have a declaration in `stdio.h`. This
should also let us remove the hack in `glib.h` for MSVC.
This may or may not break the build on some platforms; I've
tried on those that I have access to with success. Let me
know if this breaks anything.
We now use generic atomics which work on all platforms, so there's
no reason to keep this constraint here. This allows the `perf`-backed
profiler to be used on mips, ppc, s390x, etc.
This reverts commit 8e35b7d01e.
The fallback implementation (as used on other platforms) appears to hang
the runtime. Having a maybe-working `perf`-backed sample profiler is better
than a not-working sample profiler.
This reverts commit 1fdc8789a7.
This breaks the ios build:
../../../../../mono/mono/utils/atomic.c: In function ‘InterlockedCompareExchange64’:
../../../../../mono/mono/utils/atomic.c:572: error: ‘spin’ undeclared (first use in this function)
../../../../../mono/mono/utils/atomic.c:572: error: (Each undeclared identifier is reported only once
../../../../../mono/mono/utils/atomic.c:572: error: for each function it appears in.)
When using "HTTP CONNECT" to create a tunnel to a proxy server,
check the proxy server's response for the HTTP Version and close
the connection if it's HTTP/1.0.
- ADDED: Implemented NetworkInterface property "OperationalStatus" to be UP, in case the IFF_UP flag is set
- ADDED: Implemented NetworkInterface property "SupportsMulticast" to be true, in case the IFF_MULTICAST flag is set
This change is released under the MIT license.
I cannot explain why, but this affects building solution that has more than
one projects for MS.Build.dll. <MSBuild/> task returns false for successful
builds without this change.
Most likely codegen or runtime issue, but a bit too high level to drill down.
UploadString call UploadData that encapsulates all exceptions in a WebException. ThreadInterruptedException were encapsulated into a WebException, so UploadStringAsync now uses e.InnerException is ThreadInterruptedException instead of trying to catch it.
Tests that UploadStringAsync triggers UploadStringCompleted with Cancelled == true.
Tests that UploadDataAsync triggers UploadDataCompleted with Cancelled == true.
Tests that UploadValuesAsync triggers UploadValuesCompleted with Cancelled == true.
Tests that UploadFileAsync triggers UploadFileCompleted with Cancelled == true.
This is enabled only with Microsoft.Build.dll because property function
support is not fully implemented in MS.Build.Engine.dll and simply fails.
Since the targets files are shared between xbuild and msbuild, I added
some well-known property for msbuild and used it in the targets file.
This behavioral difference between ProjectRootElement, Project and
ProjectInstance was discovered while trying to get F# project working
(where item order significantly matters).
If the base_stream was a NetworkStream UnmanagedRead loop would call base_stream.Read a second time and block until one byte was available to return. Without the loop UnmanagedRead will only read the base_stream once.
This fixed a runtime exception when trying to get a ClaimsPrincipal from an IIdentity.
Noticed this work working with aspnet Identity in a Web Api 2 controller.
Exception fired when running User.Identity.IsAuthenticated.
Exception detail:
http://falk.pw:7777/tocehuhemo.xml
Previously if --with-gc=none --with-sgen=yes was specified the sgen runtime
would include the null GC and the sgen GC which would confuse the linker.
This change released uner the MIT license.
This patch includes a few fixes:
* CreateNew will actually create a memory map file, the previous logic
in MemoryMapImpl.Open was wrong, and would fail if the file did not
exist. We now cope with this (bug #20052 was caused by this).
* Some exceptions were wrong, so this patch updates the
exceptions being thrown to be the right ones
* On Mobile, we inverted the logic to ensure that capacity must be
bigger or equal than the file size (which is what the API needs to do),
previously it performed the opposite test.
Added tests that match the behavior on .NET for this.
Dequeue sets the head.Value to its default. When TryPeek is interrupted in the process of retrieving the value some times Dequeue sets the value to its default. TryPeek now checks the head has not been changed before returning the value.
The Color property was obsoleted, but the suggested replacement
SetSourceRGBA has 4 double parameters, which can be unconvenient.
Add a SetSourceColor that takes a Cairo.Color parameter, make the Color
property use it, and update the message on the Obsolete attribute.
The new finalizer API allows an embedder to be notified during a collector
when an object is queued for finalization.
This is a VERY low level interface, as this is called with the world stopped, so the
code MUST be async safe. If you don't precisely know what that means, don't use it.
When loading assemblies, we must ensure that a basedir is provided otherwise
things like custom attributes and Type.GetType won't be able to load sibling
assemblies when basedir is not the same of the domain.
The compiler seems to ignore reference assemblies with a full path when the
-lib: directive is passed, so things like:
-lib:FOO -r:BAR/bar.dll
Would resolve bar.dll to FOO/bar.dll, instead of BAR/bar.dll.
This is a problem with the test suite as it needs to reference the
final build of System.Configuration from $(the_libdir_base) and not
the intermediate step.
To work around this issue, we introduce "test_remove" variable that is
a piece of text that will be removed from the TEST_COMPILE variable
when this is evaluated.
This means that it gets CSCOMPILE and then it removes the bits that we
are not interested in.
Now a solution turns into a project with "BuildingSolutionFile" property
which is assigned by SolutionParser and subsequently gets _ExplicitReference
that is to store path to mscorlib.dll and thence projects build.
Issue: The previous code, with new tests [1], failed when the linker was
enabled.
That was caused because the code looks for the Keys and Item properties
getter using reflection. The linker handled that imperfectly (it left
some holes), in part because:
* System.Collections.Generic.IDictionary`2 does not implement
System.Collections.IDictionary; and
* It preserved the explicit methods - not the implicit one that were
used the the reflection-based code;
That later fact is also a bug (without the linker involvment) and solved
by this commit. A unit test was added to show the issue (NRE).
The patch also avoid the use of reflection for IDictionary since we can
simply typecast to get the same result (without the additional cost).
Also simplify the code a little bit, there's no need to have separate
code paths for ARM64, since using the correct objc_msgSend signature
works on all architectures.
MonoJenkins repeatedly complains about:
mono-counters.c:xxx:1: warning: function declaration isn't a prototype
[-Wstrict-prototypes]
This is caused by the missing declaration of the function arguments.
This change is released under the MIT license.
This silences the following gcc/clang warnings from MonoJenkins:
sgen-tarjan-bridge.c:395:2: warning: ISO C90 forbids mixed declarations and code
proflog.c:1942:2: warning: ISO C90 forbids mixed declarations and code
proflog.c:1999:3: warning: ISO C90 forbids mixed declarations and code
decode.c:2409:6: warning: ISO C90 forbids mixed declarations and code
decode.c:2433:6: warning: ISO C90 forbids mixed declarations and code
Moving the declarations to the beginning of the blocks is sufficient
to silence the warnings.
This change is released under the MIT license.
Visual C++ does not support intermixed declarations and code and
errors out with:
error C2275: 'guint' : illegal use of this type as an expression
This also silences gcc/clang warnings such as:
mono-counters.c:xxx:3: warning: ISO C90 forbids mixing declarations
and code
In this case this can be fixed easily by skipping the intermediate
variable.
Based on pull request #1043 by J-M <[email protected]>
This change is released under the MIT license.
Currently the flag is passed on the command line, but this is
problematic for us since our xbuild implementation does not seem to support
the attribute that generates the /keyfile: argument
The use case for this function compared to the one that take MonoClass/MonoImage is for lookups
and the failed names are usually freshly alloc'd.
Fix a leak in class.c usage of mono_error_set_type_load_name.
Remove all internal usages of mono_custom_attrs_construct and replace with mono_custom_attrs_construct_by_type
that takes a MonoError.
Introduce mono_custom_attrs_get_attr_checked and replace usage of the old one where it's needed.
The LOCAL_MCS_FLAGS are passed to the compiler before the standard
directory for the profile. This is important both for correctness,
and also assists the solution generator, since we can now precisely
determine which intermediate project must be referenced.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=19991
The original Mono.Unix.Native.Errno design used the Linux <errno.h>
constants and values...largely because it was easy.
As it turns out, this is also incomplete. The getxattr(2) defines
ENOATTR as a possible error code. On Linux, ENOATTR is an alias for
ENODATA [0]. On OS X, ENOATTR is _not_ an alias. Furthermore, since
ENOATTR is not a Linux errno value (it's an alias!),
Mono_Posix_ToErrno() couldn't check for the native ENOATTR value, so a
Syscall.GetLastError() call after a failing Syscall.getxattr() would
fail with a System.ArgumentOutOfRangeException:
$ csharp -r:Mono.Posix.dll
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using Mono.Unix.Native;
csharp> byte[] value;
csharp> Syscall.getxattr(".", "test", out value);
-1
csharp> Syscall.GetLastError();
System.ArgumentOutOfRangeException: Current platform doesn't support this value.
Parameter name: value
93
at Mono.Unix.Native.NativeConvert.ThrowArgumentException (System.Object value) [0x00000] in <filename unknown>:0
at Mono.Unix.Native.NativeConvert.ToErrno (Int32 value) [0x00000] in <filename unknown>:0
at Mono.Unix.Native.Stdlib.GetLastError () [0x00000] in <filename unknown>:0
The fix is to add an Errno.ENOATTR field [1].
The complication is one of what enum value to use: at present, the
Errno values are based on the Linux values. In the case of ENOATTR
(and others), there is no Linux value. Meanwhile, there is the
possibility of additional Linux error values; how do we future proof
ourselves?
This isn't a perfect solution, but it should punt the problem down the
road a bit: Errno is an `int` enum, and thus has large range. To
support the OS X values, we add 1000 to the OS X error value.
/* OS X: <errno.h> */
#define ENOATTR 93 /* Attribute not found */
// C# Errno enum:
public enum Errno : int {
// ...
ENOATTR = 1093,
}
This gives us 0..1000 for POSIX+Linux error codes, 1000..2000 for OS X
specific error codes, and as new platforms require additional support
they can all start at multiples of 1000.
Hopefully no single *nix platform will add more than 1000 error codes...
[0]: http://linux.die.net/man/2/getxattr
[1]: Related part of the fix: add all the OTHER <errno.h> values that
OS X includes but weren't included in the Errno enum.
From Dick Porter:
The IPv6 address parser misses some syntax errors, and can become confused by
addresses that at first glance look IPv4 compatible. The attach patch contains
the following fixes:
Don't fail to parse an address if we mistakenly thought it was IPv4 compatible
or mapped, just treat it as IPv6.
Fix IPv4-compatible and mapped address formatting in ToString().
Fix parsing of colons - specifically occurrences of ':::'.
Make sure blocks of digits are no longer than 4 characters.
Add some more parsing tests to Mono's NUnit test suite.
Add a NUnit test for bogus IPv6 addresses.
- ITaskFactory could return null, so check the return value.
- UsingTask descendants could have property references, so use ExpandString.
- TaskBody was not appropriately passed to internal structure.
And since the code is almost the same as existing ProjectInstance one, just
make it identical. (Should be unified, but depends on members, hence TODO.)
This reverts commit 3f7ad8f457.
WebProxy.BypassProxyOnLocal is really broken! There seems to be no
way of actually bypassing a proxy on local connections.
When libgdiplus is configured as sibling, it is available in the
libgdiplus_loc path. This path was added to runtime/mono/config, but
it was later overridden by the prefix-based path.
Using the same approach as for libMonoPosixHelper fixed the lookup of
the library (performed, for example, when testing
MonoTests.System.Drawing without installing libgdiplus).
This change is released under the MIT license.
When compiling mono with icc (ICC) 14.0.0 20130728 the build fails on
CC libmonoruntimesgen_la-sgen-stw.lo
with the following error:
Assembler messages:
Error: suffix or operands invalid for `lea'
Apparently icc (or the assembler) dislikes the rip-based LEA
operation. This can be worked around by manually assembling the
instruction and replacing it with the corresponding byte sequence.
This change is released under the MIT license.
So, it seems that where MSBuildExtensionsPath* is evaluated should be likely
evaluated multiple times, and find actually matching files in one of those.
F# build .targets file expects that.
Since it is almost impossible to assume in which usage scenario it is going
to be evaluated multiple times (those properties can be used anywhere by
simple $(...) syntax), it limits the attempts only for Import() so far.
Old xbuild actually does so too. That way, the particular F# issue is fixed.
Added local targets (csproj-local) to all the assemblies that have
staged builds to dump their build information for the underlying
dependencies.
This information is needed to create the new Visual Studio csproj
files.
This commit also updates the collected build metadata from running:
make update-csproj
make package-inputs
As described in msvc/scripts/README
To be precise, now the implementation returns ItemSpec for ToString().
WriteLinesIntoFile task writes ITaskItem[] lines into a file, without calling
ItemSpec.
Maybe it is better to fix Tasks.dll but I'm unsure about xbuild compatibility.
This missing ToString() override caused target framework monikor output
to become invalid source file (i.e. it used to write ItemSpec as code(!) but
this ITaskItem impl. in BuildEngine4 just wrote its type name as .ToString()
result).
We must use the secxml library directory to reference System, not
bare.
The bare build does not contain a full signature for some interfaces
(there is a using XmlNode = object in a few interfaces that
System.Configuration depends on).
So System.Configuration must reference the System that has been
compiled with XML support.
The parallelization is done by overriding the default "all" target
and instead of using the serial subdirectory processing that goes
over the SUBDIR and xx_SUBDIR rules, we turn the list of
subdirectories into the name of the target, for example:
System.Collections.Concurrent
becomes:
../../class/lib/net_4_5/Facades/System.Collections.Concurrent.dll
Then a pattern is added to handle that rule:
$(target_dir)/%.dll:
This allows the build to be parallized.
This patch introduces an infrastructure to stage the builds for the core
assemblies that have cyclic dependencies. This deals directly with
the following cycle:
System.dll requires:
System.Configuration.dll
Mono.Security.dll
System.Xml.dll
They all require System.dll to be built
System.Xml requires:
System.dll
System.Configuration.dll
System.Security.dll requires:
System.dll
Mono.Security.dll
System.Xml.dll
Principle
=========
The patch works by directing the build infrastructure to place
intermediate build steps on their own directory. For example the
first System.dll build that only takes a dependency in mscorlib.dll is
placed not under the final directory but on a subdirectory called
"bare".
The second time that System.dll is built (after Mono.Security and
System.Xml have been built) is placed on the "secxml" directory.
The third time is the final build, and that one ends in the profile
directory.
The same principle is applied to System.Xml.
Better Dependency Tracking
==========================
To handle the multiple stages, the new Makefiles for the various
parties involved in this loop are now able to build their
dependencies. This means that typing "make" on System.Security or
System.Xml or System will build all of the intermediate steps as
required, without needing the toplevel Makefile to perform multiple
build shots to incrementally build the result.
Bug fixes
=========
We must have regressed at some point the build of System.Xml as we
were only doing one build of it, one without System.Configuration
support. This patch introduces back the changes to build System.Xml
in two steps.
This patch fixes the setup where we end up rebuilding System.dll and
overwriting it two times as the build progresses as a side effect
(this is what required LIBRARY_USE_INTERMEDIATE_FILE).
Details
=======
library.make:
Introduces a new "the_libdir_base" which is the raw directory
where the final output will go. This points to the same location
that libdir_base previously pointed to.
The existing libdir_base is modified to contain an optional
"intermediate" directory, where intermediate builds can be
placed.
The Screen.FromRectangle method was too simple minded. It did not try to
find the best match for a screen when the system has more than one screen.
The new implementation makes at least some effort to find the closest
screen with the most overlap with the rectangle.
The number of displays and sizes can be retrieved with the help of
libXinerama. The implementation was done in a way that is backwards
compatible, so on non-Linux systems or when libXinerama is not
available the behavior will be the same as before.
Also fixed the implementation of FormStartPosition.CenterScreen to
bring up the form centered on the current display (with the current
display being either the screen the top left corner of the owner
form is on, or if there is no owner the screen that has the mouse
pointer). This fixes Novell bug #325669 on Linux
(https://bugzilla.novell.com/show_bug.cgi?id=325669).
We now have a pair of functions to match mono_thread_info_safe_suspend_sync.
They should be used instead of mono_thread_resume as they do the right thing
WRT to hazard pointers.
mono_thread_info_lookup leaves the current value on hazard pointer 1,
so all callers must clean it afterwards. This was not done in all cases
by mono_thread_info_resume.
This function was called from code that uses hazard pointers, so their values could get overridden.
Besides that, we did not clean up the hazard pointer table afterwards, which is wrong too.
Right now all the input parameters are computed based on string, and any
metadata items are simply chopped out when it is passed to a Task.
To fix this, we need to replace ExpandString() use with more complicated
evaluator that takes ITaskItem into consideration.
(It is not complete as of now; evaluation method needs to be replaced and
any regressions need to be fixed.)
(Reported by directhex on #mono 2014-05-14 at 14:28 EDT.)
When importing Microsoft XML Documentation, if a //altmember/@name,
//exception/@name, or //permission/@name attribute is encountered then
mdoc will die with a NullReferenceException:
mdoc: System.NullReferenceException: Object reference not set to an instance of an object
at Mono.Documentation.MsxdocDocumentationImporter.ImportDocumentation (Mono.Documentation.DocsNodeInfo info)
at Mono.Documentation.MDocUpdater.MakeDocNode (Mono.Documentation.DocsNodeInfo info)
at Mono.Documentation.MDocUpdater.UpdateMember (Mono.Documentation.DocsNodeInfo info)
at Mono.Documentation.MDocUpdater.MakeMember (System.Xml.XmlDocument doc, Mono.Documentation.DocsNodeInfo info)
at Mono.Documentation.MDocUpdater.DoUpdateType2 (System.String message, System.Xml.XmlDocument basefile, Mono.Cecil.TypeDefinition type, System.String output, Boolean insertSince)
at Mono.Documentation.MDocUpdater.StubType (Mono.Cecil.TypeDefinition type, System.String output)
at Mono.Documentation.MDocUpdater.DoUpdateType (Mono.Cecil.TypeDefinition type, System.String basepath, System.String dest)
at Mono.Documentation.MDocUpdater.DoUpdateAssembly (Mono.Cecil.AssemblyDefinition assembly, System.Xml.XmlElement index_types, System.String source, System.String dest, System.Collections.Generic.HashSet`1 goodfiles)
at Mono.Documentation.MDocUpdater.DoUpdateAssemblies (System.String source, System.String dest)
at Mono.Documentation.MDocUpdater.Run (IEnumerable`1 args)
at Mono.Documentation.MDoc.Run (System.String[] args)
at Mono.Documentation.MDoc.Main (System.String[] args)
The cause of the NullReferenceException is due to inconsistent
checking: we check that _either_ `child.Attributes["cref"]` OR
`child.Attributes["name"]` is not null, and if one of them IS non-null
then we just grab `child.Attributes["cref"].Value`, which will throw a
NullReferenceException if the @name attribute was present but not the
@cref attribute.
The fix is to be consistent: once we grab an XmlAttribute, use the
already looked up XmlAttribute, don't re-look it up.
For a variety of reasons, we need to bump the assembly version of
System.Net.Http.dll to "4.0.0.0" (from 2.0.5.0) on our MOBILE
profiles, lest much pain and suffering occur, e.g.:
http://motzcod.es/post/78863496592/portable-class-libraries-httpclient-so-happy
> For some reason at compile time the facades don’t kick in
> properly and it tries to use the NuGet version of
> System.Net.Http which has some specific functionality for
> older platforms. ...
> All you need to do is create a new app.config file in your
> Android and iOS project.
The need to create a custom app.config is ugly and something
to be avoided. Setting our System.Net.Http.dll version to
v4.0.0.0 removes the need for the custom app.config.
The two races in question are:
In signal_thread_state_change we need to block the target from
further waiting before we signal it or otherwise it might miss the
broadcast asking it to wakeup.
In mono_thread_request_interruption we need to ensure we self interrupt
before returning from the signal handler.
Unblock the GC suspend/restart signals and SIGCHLD. Those are required to make the GC
and process watching work.
The SIGCHLD issue was found on mod_mono that fork a process with that signal blocked.
The GC signals are been preemptively unblocked as we can never know what sort of sig mask
we'll start with.
This merely introduces a more readable version of some of the constants that
were hardcoded on the source code.
There is a suspect value "20" that was on the original source code, that
stands for VNodeLink and VNodeExtend, but perhaps the original author
meant to say VNodeRename. In any case, it seems like we should catch all
of them (except for Revoke).
The section mapping system wasn't being initialized and used properly since some ifdefs had
been left in the source code. This caused a null reference exception while trying to perform
some HTTP requests and, as the result, broke Xamarin Studio activation.
Two main way to dump :
- per Time : equivalent to a --stats but every seconds, useful to see the overall evolution of all counters
- per Category : print sample values grouped per category and counters, useful to see the evolution of a specific counter over time
This variables are respectively :
- the list of all counters
- the list of all counters grouped by sections
- the list of all counters groupes by sample value timestamps and sections
Counter : contains metadata concerning a counter. There is one in memory per counter index (right now ~100).
CounterValue : represent a sample value of a counter.
CounterList : it is a utility struct that contains a list of counters.
CounterSection : represent all the counters that are in this sections. Used only when we sort counters per category.
CounterTimestamp : represent all the counters that have a sample value at this timestamp. Used only when we sort counters per time.
It's now also much more compatible with the subtleties of
the MS .NET parser and includes a substantial test suite.
Fixes BXC19542 - Broken F# Error Reports
Since we are invoking make recursively to satisfy the dependencies
for any of the cyclic components, we need to inform make to not try
to parallelize any work on any of the cyclic dependencies, otherwise
multiple builds will execute building the same binary, and the result
will be truncated outputs.
For example, System's Makefile would launch all the parallel builds for
the dependencies:
$(secxml_libdir)/System.dll \
$(the_libdir_base)System.Xml.dll \
$(the_libdir_base)Mono.Security.dll \
$(bare_libdir)/System.dll
They could be launched in parallel, and in turn the makefiles on those
directories might try simultaneously to invoke recursively a component
that has not been built yet.
So we use .NOTPARALLEL to flag all the cyclic dependencies on a given
directory to instruct make to not run those in parallel.
This patch is a continuation of the previous work on System to remove
the multi-stage build configuration in Mono's class libraries and avoid
the overwriting of assemblies in a multi-stage build setup.
This patch introduces an infrastructure to stage the builds for the core
assemblies that have cyclic dependencies. This deals directly with
the following cycle:
System.dll requires:
System.Configuration.dll
Mono.Security.dll
System.Xml.dll
They all require System.dll to be built
System.Xml requires:
System.dll
System.Configuration.dll
System.Security.dll requires:
System.dll
Mono.Security.dll
System.Xml.dll
Principle
=========
The patch works by directing the build infrastructure to place
intermediate build steps on their own directory. For example the
first System.dll build that only takes a dependency in mscorlib.dll is
placed not under the final directory but on a subdirectory called
"bare".
The second time that System.dll is built (after Mono.Security and
System.Xml have been built) is placed on the "secxml" directory.
The third time is the final build, and that one ends in the profile
directory.
The same principle is applied to System.Xml.
Better Dependency Tracking
==========================
To handle the multiple stages, the new Makefiles for the various
parties involved in this loop are now able to build their
dependencies. This means that typing "make" on System.Security or
System.Xml or System will build all of the intermediate steps as
required, without needing the toplevel Makefile to perform multiple
build shots to incrementally build the result.
Bug fixes
=========
We must have regressed at some point the build of System.Xml as we
were only doing one build of it, one without System.Configuration
support. This patch introduces back the changes to build System.Xml
in two steps.
This patch fixes the setup where we end up rebuilding System.dll and
overwriting it two times as the build progresses as a side effect
(this is what required LIBRARY_USE_INTERMEDIATE_FILE).
Details
=======
library.make:
Introduces a new "the_libdir_base" which is the raw directory
where the final output will go. This points to the same location
that libdir_base previously pointed to.
The existing libdir_base is modified to contain an optional
"intermediate" directory, where intermediate builds can be
placed.
Other cycles
============
The System.Design assembly was listed as having cycles, but while this
cycle exists in theory, in practice we have not implemented any of the
code that brings the cycle in System.Windows.Forms.Design's
ImageListImageEditor and chances are, we wont any time soon.
Less common case - unless the API difference has a large delta.
Some additional spacing is added to ease readability: if an entry takes two line then it needs a empty line.
All uses of the mono_dont_free_global_codeman variable (including its
definition) have been removed in
4a1ae4694a.
Its declaration should be removed as well to keep the codebase clean.
* The existing regex was not always used (e.g. new sections);
* It's now possible to use a regex on 'removed' (not just added) elements;
* It's possible to use the same regex for both (or have different ones);
counters_init is called at the end of runtime initialization, on runtime_initialized hook
counters_sample is called in the helper_thread at least once per second
Add new function mono_counters_register_with_size which let the counters API now what is going to be the max size of the string.
The type of the value passed when MONO_COUNTER_STRING is passed must be char* (instead of char** previously). This is to guarantee that, if we want to change the value of the counter, we do not reallocate and free the old value, but we change the value in place. Thus to avoir race condition and access to freed memory.
This is useful when the files needs to be pre-processed (e.g. a major change between the assemblies internals) and where some duplicate entries might be created (e.g. merged types/namespaces).
Note: normally the mono-api* tools should not produce such files (so it's better not used unless required)
After discussion with Kumpera, it was decided to load them lazily when calling mono_counters_foreach for the first time. It has to be inside the mono runtime, and not in a profiler because it accesses proclib API which is all MONO_INTERNAL functions.
The tarjan-coloring bridge is significant departure from the old bridge. It's design is based
on the Tarjan Strongly Connected Component algorithm.
SCC links are calculated as part of the Tarjan dfs on the second scan to calculate the low index and
form the components.
The algorithm does inspect all children after they have been processed, which enables us to do backward
propagation of the reachable SCCs.
In order to avoid the xref mess of the old algorithm, we color each component based on the sum of all
reachable components (colors). This means no matter how many non-bridge objects are in between two bridges,
they will all receive the same color and be represented in the final output as a single node in the SCC
graph.
This allows for a reasonably compact output graph as it will only include colors with no bridges when
a single object has multiple bridges reachable.
Said that, the basic algorithm received a series of optimizations:
1)Flag based merging, great idea from Mark, it bounds color and xref merging to be linear on the number of
colors found.
2)Objects and Colors bucket allocation. Instead of using expansible arrays we use fixed size buckets that
form a linked list. This allow us to use direct pointers instead of indexes. It avoid the expensive expansions.
Another benefit is that it reduces the work by sgen's malloc, which can be really slow.
3)Replace the object hash table with header patching. We tag objects with both pinning and forwarded bits and
store a pointer in the lock word. This eliminates the hashtable, a big source of perf issues. Patching objects
back at the end of bridge processing is much much cheaper than free'ing all the hashtable entries.
4)Color deduplication. It's possible to produce duplicated colors due to mutually unreachable paths that
both points to the same set of bridges. A cache is introduced to reduce it for colors points to 2 or 3 others.
The way we build colors allow us in the future to fix the hub object problem (SetupDoubleFan).
Experimental results with sgen-bridge-pathologies shows this implementation been 2-3x faster than the new one.
If currentCell still has a value when we call Columns.Clear() we
might try to end the editing. Because the columns got disposed
before calling Columns.Clear() we get a crash. This patch fixes
the problem by setting currentCell to null.
The tests require that the debug file is available, however in the net_4_0 profile this file isn't generated by default.
We now ensure the debug file is always generated for the test assembly.
This was previously used to not store counters that were not going to be dumped, but because we can now sample them, we have to make sure that they are stored, even if we do not plan to dump or sample them.
We can't forward to HashEntry's because they are volatile - the
hash table will resize, and the entries move. We need to point to
the objects, and then look them up via the hash. Also, we have
to forward chains of forwards.
Instead of merging the two lists by keeping them sorted, use the flag on
the SCCs the indicate whether an SCC has already been merged in, and
just append it if not. This makes it as fast as the new algorithm on one
test case where it was pathologically slow, while not exhibiting another
pathology that the new algorithm has.
Tha previous behaviour of MONO_PATH for relative paths (that implied
using the paths as relative to the current directory when loading
assemblies) was not yet documented and led to some failures when
executing tests.
In order to fix the failures, a new behaviour has been introduced:
relative paths are resolved at launch time, so that the folders which
are examined when loading assemblies do not depend on the current path
of the program.
This patchset is released under the MIT license.
When MONO_PATH contains relative folders, they are meant as relative
from where the application is launched, not from the current directory
of each assembly load.
Fixes#19380.
metadata/threads.c: fix regression from the 695b17f8d5 change and
avoid useless memory allocation. Report thread name to the profiler at
thread startup if it was set before that.
profiler/decode.c: fix typo.
profiler/proflog.c: ensure we get a consistent first buffer header at runtime
initialization.
We now try and trigger assembly resolve events for referenced assemblies
in a way that is more compatible with the MS runtime behaviour. If that still
fails we continue falling back and looking in the same directory as the referencing
image as before to keep compatibility with code that relies on the previous mono
behaviour.
The assemblyresolve_event3.cs test that used to fail on the MS runtime has been fixed
so it works now with both engines.
bugzilla.xamarin.com bug reference: Bug 19304
ComboBox reverts to original selection when it loses focus.
The LostFocus handler for the internal ComboTextBox class
was being called after it had been disposed. The dispose
was correctly called when the ComboBoxStyle changed from
it's initial default value to DropDownList. However, when
the ComboBox control lost focus later on, the LostFocus event handler
was called, which resulted in the Text value for the ComboBox
being overwritten by the value in the disposed object.
Could not see how to write a unit test within the ComboBoxTest.cs
that would simulate losing focus so only providing fix.
Change-Id: I9ca4cc75da5711a7d7c1dd166d5f52d580f44df1
The previous behavior when using mono_counters_dump was to pass -1 as the section and get all
counters dumped. This commit restore this behavior.
In addition to that, we want to enable callers to filter by variance as non monotonic counters are not useful
to be dumped at shutdown. To do so you just OR the variance with the sections you want. So what the runtime wants is:
mono_counters_dump (MONO_COUNTER_SECTION_MASK | MONO_COUNTER_MONOTONIC, stdout);
Dump all counters that are monotonic. Perfect.
Finally, to make the above neat, a reorg of the type bitfield was needed. Variance is now using a bit per kind.
Variance and unit where shrunk to 4 bits each, to open space for more sections.
This is more portable than using the mono_arch_instrument_* functions and
thus isn't prone to nasty arch-specific bugs. In particular, the old way
of instrumenting function prologues/epilogues resulted in a somewhat elusive
stack corruption bug on Android (ARM). Eventually, we should get rid of these
functions entirely and only use icalls, with JIT opcodes for special cases
(such as saving arguments for --trace).
This new way of doing things also makes profiler instrumentation AOT-safe,
since we're now going through the proper channels to emit references to the
runtime functions (mono_profiler_method_enter/leave) and to embed MonoMethod
pointers.
Since we're using icalls without wrappers to do this, there should be no
visible performance impact from this commit.
- Expanded monodoc-ecma schema to support the 'preserve-mono' attribute, and the attribution tag.
- Added preserve-mono to several pieces of documentation that we would like to preserve across future automated documentation imports: CipherSuitesCallback, ServicePointManager, CultureInfo, Environment+SpecialFolder.xml
- XSL template changes for monodoc HTML generation to support <attribution>
This patch builds upon commit 96a8500795 which placed parts of Mono.Security
responsible for dealing with SSL/TLS certificates for the purpose of certificate verification. The code enables
validation of the certifcates even if the user does not provide their own validation callback. The changes as related to
the original commit are few, basically consisting of enabling the same code used by MonoTouch in the MonoDroid context with
the only actual code change being the certificate validation bit mentioned above.
Since the change involves adding a subset of Mono.Security files to the monodroid version of System.dll, it is
also necessary to remove Mono.Android's dependence on Mono.Security.dll. The reason is that the code in AndroidPlatform
which looks up TLS support methods in Mono.Android.dll would use a type (X509CertificateCollection) that is now part of
System.dll but is *also* in Mono.Security.dll referenced by Mono.Android.dll and therefore the lookup would fail since
we'd have two distinct types from the reflection point of view.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=18962
This reverts commit 8f09dad435.
8f09dad435 is reverting a merge commit,
which will not do what you think it does. It will revert much more,
so revert the revert to get back the unintentionally reverted commits.
It looks like the next commit (1a15d4ec54)
is doing the original intention (reverting 164f9cbec4),
so this revert will leave the tree in a good state, with no pending
reverts.
Some types are statically known to never lead to a bridge. Objects like
string or int[]. By filtering them out very early in dfs1 we save memory by
not inserting them into the hashtable and reduce work done by all further steps.
The bridge implementation can be picked by having bridge-implementation=old|new in
MONO_GC_PARAMS.
This commit just prepared the ground to land experimental improvements to the bridge
while retaining an working implementation by default.
When the xbuild_12 profile is verified, the corlib from the net_4_5
profile should be in the MONO_PATH, otherwise the verification will
fail with:
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `.../mono/4.5/mscorlib.dll' directory.
The adjustment rule must take into account that DST can start in the previous year and extend to some initial period
of the DateTime's year. This patch makes the code take that into account and correctly applies the DST offset to the
date being converted to some target timezone.
Fixes xambug https://bugzilla.xamarin.com/show_bug.cgi?id=17155
* ConvertTime (DateTime, TimeZoneInfo) now correctly takes the date kind from the DateTime parameter
and uses it to select the source time zone according to this criteria:
if DateTime kind is Utc, use TimeZoneInfo.Utc as source, in all other cases use TimeZoneInfo.Local
* Move argument checks in ConvertTime (DateTime, TimeZoneInfo, TimeZoneInfo) so that there's no risk of a NREX
should sourceTimeZone be null.
Added relevant tests for all of the above changes.
Otherwise this happens:
MCS [monotouch] Mono.CSharp.dll
../../mcs/codegen.cs(294,7): error CS1061: Type `System.Reflection.Emit.ILGenerator' does not contain
a definition for `BeginExceptFilterBlock' and no extension method `BeginExceptFilterBlock' of
type `System.Reflection.Emit.ILGenerator' could be found. Are you missing an assembly reference?
The runtime category is for high level counters on runtime operations.
Things like number of threads, threadpool status, total memory consumption
and so on.
The system category is for synthetic counters that report system values
such as RSS, user time and load.
../../libgc/alloc.c: In function ‘GC_stopped_mark’:
../../libgc/alloc.c:501:9: error: implicit declaration of function ‘GC_cond_register_dynamic_libraries’ [-Werror=implicit-function-declaration]
GC_cond_register_dynamic_libraries();
This accounting mode logs the "cost" of each bridge-object during bridge processing.
This should give a very good first clue on how expensive each object is.
My previous changes modified the way how we're handing the request body when
resending a request due to a 30x redirection.
Authentication is a "special" form of redirection because we sometimes need
to resend a request with additional authentication headers. Unfortunately,
I forgot this, causing a regression which is now fixed.
This has been reported as bugs #19119 and #19068.
This removes a lot of duplicated logic and special-casing for Wrench. There
are now only 3 important top-level targets:
* `check`: Run all stable (~fast) tests.
* `check-full`: Run all stable, unstable, and slow tests.
* `check-parallel`: Compile tests in parallel, then run `check-full`.
By default, `no-dump` is passed to the test runner. To pass `dump-output` and
get `stdout`/`stderr` dumped to console when a failure occurs, set `V` as in:
$ make check V=1
Or:
$ make check-full V=1
If you're running tests in a CI environment, it may be desirable to disable
tests that are known to be unstable. To do so, run:
$ make check CI=1
Or:
$ make check-full CI=1
We end up with faux arrays when we’re allocating new objects, but
the nursery must be zeroed. We just zero the first few words when the
TLAB is created to get rid of the array header.
An alternative would be to erase the headers once the nursery
collection is over, which is cleaner and would only zero what we know
must be zeroed, i.e. it would catch errors in cases where we now
overwrite non-zero garbage in the nursery. That’s an unlikely case,
though, and we don’t use this debug feature often anyway.
This removes an old and broken patch that did not allow for
clean builds of Mono. The old patch was so bad, that instead
of fixing the actual source of the problem (the ability to build
the runtime documentation when the source directory was not the
same as the build directory), a hack was added to circumvent
`make distcheck''s security system and changed the permissions
at build time for the source directory to become read/write.
This fixes the problem
Stack probing on windows must be done a page a time so we must always force it to happen on windows.
Disable omit_fp on win64 for now as it makes the tail call tests fail.
property is not present on the system or its value is an empty string. This ensures that
we obtain valid timezone info on systems which do not define the above property.
Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=4902
When an argument to String.Format has no formatter, its ToString method
is called. This change takes care that the FormatHelper can handle
arguments whose ToString() method returns null.
* Respect the `volatile.` prefix on all instructions specified in
Ecma 335, Partition III, 2.6.
* Emit release barriers _before_ the instructions they affect.
* Skip certain optimizations when the `volatile.` prefix is used,
since we can't easily emit barriers correctly in those
optimization paths.
* Use `ins_flag` to check for `MONO_INST_VOLATILE` as it doesn't
depend on an instruction having been emitted. This would kind of
not work when we need to emit barriers before other instructions.
* Set `ins_flag` to zero in all cases where it's consumed.
When running 'make check', test-mono-linked-list-set fails with:
* Assertion at hazard-pointer.c:353, condition `small_id == i' not met
This happens since 71ad74dc11, because
that commit changes the behaviour of mono_thread_smr_init() so that
invoking it should not be invoked more than once.
ScrollableControl.OnLayout sets the scroll bar display before doing the
actual layout. If any children are autosized, they may change size as
a result of the layout, and that may change whether or not the scrollbar
is needed. (This addresses Xamarin bug 18874.)
If we try to copy a file which does not exist, we log the error (as we have
always done) but now we return failure from the Copy task if any errors were
logged.
This means we will correctly fail the build later on instead of having a
successful build which did not complete correctly.
This resolves bug # 18398 and other OOM scenarios in long running applications that make use of FromAsync, ContinueWith, etc. to "rearm" asynchronous operations.
This reverts commit 2086958399.
Revert this as it breaks the build:
MCS [net_2_0] Microsoft.Build.Engine.dll
Microsoft.Build.BuildEngine/Engine.cs(114,81): error CS0117: Microsoft.Build.Utilities.TargetDotNetFrameworkVersion' does not contain a definition forVersion30'
/root/my-mono-fork/mcs/class/Microsoft.Build.Engine/./../../class/lib/net_2_0/Microsoft.Build.Utilities.dll (Location of the symbol related to previous error)
Microsoft.Build.BuildEngine/Engine.cs(116,81): error CS0117: Microsoft.Build.Utilities.TargetDotNetFrameworkVersion' does not contain a definition forVersion35'
/root/my-mono-fork/mcs/class/Microsoft.Build.Engine/./../../class/lib/net_2_0/Microsoft.Build.Utilities.dll (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings
mono_set_crash_chaining tells mono to chain crash signals instead of just
running the next one.
This allows us to get the crash info from both mono and the native system.
AssemblyBuilder is not a good class for doing that but simply taking only the file name covers most cases.
The best solution is to rewrite this tool using Mono.Cecil.
FYI AL.exe from .NET is not written in managed because of the SRE limitation
- in the previous version the IsEmpty could be false, but by time we get
to head.Next.Value we get an exception since Value is now null
- passes existing test cases, although these are not definitive since
they don't show threading issue
- would need to adapt System.Threading.Tasks.ParallelTestHelper to allow
TryPeek() to be called during Enqueue/Dequeue operations to truly
test this change out
This fixes the TableLayoutPanel implementation to check for control names
as well as the the controls themselves in looking up the row and column
values.
Replace GC_free with GC_INTERNAL_FREE. The former might take the GC lock
and deadlock us.
Replace GC_INTERNAL_MALLOC with GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE as
we don't need the rest of the GC messing around with the toggleref array.
The right behavior is that the loop move values up to the original size
and them the store after the loop store past it.
Let's see the last 2 iterations:
//i == size - 1 (value = array[size - 2], tmp = array [size - 1])
dyn_array_int_set (array, size, value); //ok
value = tmp; //ok
tmp = dyn_array_int_get (array, i + 1); //tmp has an unknown value, as the last element was never stored to.
//i == size (value = array[size - 1], tmp = array [size])
dyn_array_int_set (array, size, value); //This sets the last element to the right value
value = tmp; //value is undefined, as tmp has
tmp = dyn_array_int_get (array, i + 1); //this is an out-of-bounds read as we're reading 2 elements past the end.
The after the loop store (tmp = array [size + 1]):
dyn_array_int_set (array, size + 1, tmp); //This sets the last element to an unknown value.
With the fix on the last iteration is - 1. The post store will use value, which has
the right value (array [size - 1]).
The height we calculate is the inner height, so we need to add the top
and bottom borders when setting the height of the listbox. The width
however is the outer width so we need to subtract the left and right
borders when setting the client width.
Vertically centered text on buttons didn't show up centered. The
referenced bug reports it on Windows. Matters were worse on Linux.
This patch tries to fix the problem on both Windows and Linux. On Linux
the positioning is improved although probably still not perfect.
This fixes Novell bug #463149
(https://bugzilla.novell.com/show_bug.cgi?id=463149).
We rely on signed overflow in many places (in particular for *detecting*
signed overflow), so we need to tell GCC and Clang to not perform any
optimizations that rely on it being undefined.
When setting both Row.Height and MinimumHeight we need to set the
MinimumHeight first otherwise we will get a crash if the new Height
value is less than the old MinimumHeight value.
This change adds unit tests that demonstrate the bug #2394
where setting Row.Height below MinumumHeight in a DataGridView
doesn't work as expected. The unit tests also document the
behavior of .NET which isn't documented in MSDN.
When the MinimumHeight gets changed to a value less than Height
we set height to the new minimum height (and fire the
DataGridView.RowMinimumHeightChanged event). This matches the
behavior on .NET.
When the user tries to set Height to a value less than MinimumHeight
we silently set the height to the minimum height (instead of
throwing an exception). This matches also the behavior on .NET.
- fix the tests (tests made partially wrong assumptions which didn't
match the behavior of .NET).
- split MinimumHeight test in multiple smaller tests that test only
one thing.
- add a few more tests for MinimumHeight and Row.
Previously some characters might have been concatenated on a message
box that displayed an icon because the size of the text area was
calculated wrong. This fixes bug #2090
(https://bugzilla.xamarin.com/show_bug.cgi?id=2090).
There is an additional axis to bridge processing than just if a type is a bridge or not.
It can be processing transparent or opaque.
We didn't make this distinction before and treated all types as transparent.
Opaque types means that bridge processing should stop at them. An opaque bridge, in
addition to that, means it should be reported in.
This change paves the way for bridge graph pruning.
- when MemoryCacheEntryPriorityQueue grows the timed items after a shrink
the value of the member variable heapSize is wrong allowing an out-of-
bounds exception which would normally be prevented by bounds tests
- A test case was added for the out-of-bounds exception
- Added overloads for PopulationCount and LeadingZeroCount that take ulong.
- Added helper method BuildDouble that constructs a double by sign, mantissa
and exponent. This method truncates the mantissa, thus may differ in
rounding to Math.Pow.
- The new implementation avoids Math.Pow by using BuildDouble.
- Passing all recently added tests.
When reading and writing data at the same time over an
System.Net.Security.SslStream, an exception will be thrown often.
Usually the exception is: Mono.Security.Protocol.Tls.TlsException “Bad
record MAC”
The issue is that the single TlsCipherSuite instance used for both
reading and writing does not synchronize access to the “header” member.
If the contents get corrupted the MAC calculation returned by
ComputServerRecordMAC or ComputeClientRecordMAC is incorrect.
See https://bugzilla.xamarin.com/show_bug.cgi?id=15293. Reproduced in
OS X, iOS and Windows.
When libX11-dev is not installed on an end-user's machine MWF apps
will crash in XCreateFontSet. This change uses dynamic search path
when building instead of hard coded directories when
searching for libX11.so.*. This fixes bug 708856
(https://bugzilla.novell.com/show_bug.cgi?id=708856).
We use an overlapping card table on 64 bits, meaning that the address
space wraps around our card table (every 4gb). We had assumed in a few
places that an object could wrap around the end of the card table at most
once, but with objects larger than 4gb that is not the case.
Fixes the corlib test suite crash on OSX/64bit
(in SortedListTest.TestCapacity4).
The test tried to resolve an assembly from the GAC, which doesn't work on a
clean machine without an existing Mono installation.
We now check if the GAC directory is missing and ignore the test in that case.
This is mostly cosmetic and won't help unless you're sending a very large
buffer due to the kernel's internal buffering. Unfortunately, there is no
way of getting a notification when the data has actually been sent over the
wire - socket.Write() returns after the kernel has accepted the data.
The new API allows to set the program arguments from embedders that don't call
mono_jit_exec() and related functions that set them automatically. This change
also fixes the NullRef exception that would happen if the arguments are not set.
F# PCL projects expect this file to exist in:
$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.Common.targets
So in order to avoid pristine F# PCL projects (created from VS) fail
the build that file has to exist, and import the Core targets like
its CSharp counterpart (Microsoft.Portable.CSharp.targets) does.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=17906
Given two TG objects A and B. A is strong, B is weak, A points to B. B should remain registered
for TG processing since it's reachable thru A.
This means we have to split processing in multiple steps. Phase one marks all strong refs that should
happen before finalizer processing and phase two that happens after finalizers that cleanup those
that turned unreachable.
Previously, many tests just had a return statement when the test shouldn't
be executed (e.g. Unix-only). This made it look like the test was successful
when in fact it wasn't executed at all.
Assert.Ignore() is now used instead to correctly exclude those tests.
Some MSBuild targets premises \ to work just like a path separator, and they
cannot be logically distinguished from any possible "normal" use of '\'.
(Except for escaped strings, which is why this change replaces \ with / after
expanding strings.)
I have added another override for NormalizeFilePath() and rather renamed old
one that works as file lookup, but there is no obvious difference in use.
They may be unified later to bring less confusion.
Xamarin.Android has historically used the "v2.0.50727" runtime
version -- which works -- but has the side effect that Mono constantly
generates runtime "warnings" akin to:
The request to load the assembly mscorlib v2.0.5.0 was remapped to v2.0.0.0
The reason for this is that all of the Xamarin.Android assemblies have
the version number v2.0.5.0, while the "v2.0.50727" runtime version
expects assemblies to have version number v2.0.0.0; they differ.
Result: Mono warns (appropriately), and I do my best to ignore the
~meaningless warning message. (For years and years and years...)
It's time we fixed this.
Introduce a "mobile" runtime version which specifies the
Xamarin.Android v2.0.5.0 assembly versions. Xamarin.Android 4.14+ will
then specify the "mobile" runtime version, "fixing" the assembly remap
messages.
* Merged WebConnection.EndWrite() and EndWrite2().
* WebConnectionStream.BeginWrite(): Use the same async-write
callback for both chunked and non-chunked; remove the single-use
small WriteRequestAsync() and inline it here to make the code
more readable.
* WebConnectionStream.WriteRequestAsyncCB(): Now called for all
async writes, call WebConnection.EndWrite() here.
The code is now more readable and easier to understand. This is
the first part of a series of cleanups, which should eventually
lead towards full async and 100-continue.
This is because d0-d7 are argument registers and d8-d15 are
preserved registers - we can't use any of them as scratch
registers without restoring their previous values.
After reviewing all usage of mono_gc_bzero and mono_gc_memmove, I found that there are two usage patterns
we care for:
1)Aligned pointer, any size, have managed pointers.
This happens when directly dealing with managed objects like when cloning of boxing.
On this case, all pointers MUST be aligned.
2)Maybe aligned pointer, any size, might have managed pointers.
This happens for functions dealing with structs, specially around boxing and unboxing them.
Our data layout code ensures that structs with managed layout are aligned to at least a word.
This means that if the pointer is unaligned, no managed pointer can exists in the memory range
been processed.
Given those two scenarios, lets introduce two variants that enforce those constrains.
_aligned:
Pointers must be aligned, ensures atomicity of word copies;
_atomic:
If pointers are aligned, works like _aligned, otherwise it inherits the behavior of the
system memmove&memset.
The above split ensures we won't have to deal with any RISC unaligned load nonsense.
It also adds some sanity checks to code that must respect alignment.
We still need fast code for mono_gc_memmove_aligned and mono_gc_bzero_aligned.
We still need to verify if a version of memcpy version is needed. Maybe the extra
branch is not such a perf penalty.
Call zlib's inflate() even if no data was read from the stream, there might still be some data left to process.
Originally reported by Eric Roller, as Xamarin bugzilla #17183.
https://bugzilla.xamarin.com/show_bug.cgi?id=17183
Reviewed by Rodrigo Kumpera.
Revert "Revert "Merge pull request #829 from symform/httpwebreq-async-ssl""
This reverts commit 56d9a057eb, which was a
revert of 35899c07ff, thus putting 35889 back.
* ServicePoint now uses an idle timer to close idle connections.
* WebConnectionGroup has been mostly rewritten to use a linked
list of open connections and their idle times.
This fixes both the problem that we were leaking sockets and
that we were not reusing existing connections.
* ServicePoint now correctly keeps track of the number of open
connections.
* ServicePointManager now uses the correct default idle time
of 100 seconds (previously 15 minutes).
* WebConnection uses the new WebConnectionGroup's busy logic
to correctly flag connections as busy / reusable.
There was a typo in DependsOnTargets attribute of the
_AddCorlibReference target definition. It didn't break any
behaviour, since the target it depended on was always built
earlier in the build anyway, so it was really a sanity check.
However, it broke the tests for the new (unused) engine,
Microsoft.Build.dll, which checks for unexpected attributes.
The current implementation was wrong, did not bother with pct-encoding
(despite being listed in the comments) and did not use the actual set
of characters listed on the spec, instead of using a white-list, it
had its own incorrect black-list.
The old implementation threw an exception requesting that the method be implemented
in a derived class, but the method is not virtual, so it could have never been
implemented.
Since Mono does not support this, at least we keep the token around and avoid
throwing.
The Dispose function in ToolStripItem should not remove itself from its owner during finalization. Finalization implies that the owner has also been garbage collected, and accessing it may result in undesirable behaviour. More specifically, the call to owner.Items.Remove ultimately may boil down to a call to GDI+ throwing an Exception like the following:
Program.UnhandledException: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in <filename unknown>:0
at System.Drawing.Graphics.GdipMeasureString (IntPtr graphics, System.String text, System.Drawing.Font font, System.Drawing.RectangleF& layoutRect, IntPtr stringFormat) [0x00000] in <filename unknown>:0
at System.Drawing.Graphics.MeasureString (System.String text, System.Drawing.Font font, Int32 width, System.Drawing.StringFormat format) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:MeasureString (string,System.Drawing.Font,int,System.Drawing.StringFormat)
at System.Windows.Forms.TextRenderer.MeasureTextInternal (IDeviceContext dc, System.String text, System.Drawing.Font font, Size proposedSize, TextFormatFlags flags, Boolean useMeasureString) [0x00000] in <filename unknown>:0
at System.Windows.Forms.TextRenderer.MeasureText (System.String text, System.Drawing.Font font, Size proposedSize, TextFormatFlags flags) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.CalculateAutoSize () [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.set_InternalOwner (System.Windows.Forms.ToolStrip value) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:set_InternalOwner (System.Windows.Forms.ToolStrip)
at System.Windows.Forms.ToolStripItemCollection.Remove (System.Windows.Forms.ToolStripItem value) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripDropDownItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripMenuItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.ComponentModel.Component.Finalize () [0x00000] in <filename unknown>:0
Now that mcs supports multi-targeting, we can use the MSBuild 4.0+
system of finding mscorlib.dll in the target framework folders and
passing it to the compiler, along with the /nostdlib argument.
Like MSBuild, the old NoStdLib property can be set to true to disable
passing mscorlib.dll to the compiler, and the new NoCompilerStandardLib
property can be set to false to disable passing /nostdlib to the compiler.
This makes custom target frameworks work correctly without having to
override CscExe with a wrapper script.
The Tuples.cs code generator dies with:
Unhandled Exception:
System.NotImplementedException: The requested feature is not implemented.
at TupleGen.computeHash (Int32 destVar, Int32 start, Int32 count) [0x00000] in <filename unknown>:0
at TupleGen.WriteHash (Int32 destVar, Int32 start, Int32 count) [0x00000] in <filename unknown>:0
at TupleGen.Main () [0x00000] in <filename unknown>:0
This is caused by the incorrect definition of WriteHash(), which
instead of recursively calling itself is calling computeHash().
Thanks to Marek Safar for reporting the issue in
https://github.com/fsharp/fsharp/issues/188#issuecomment-34351850
This fixes the behavior of process spawning when UseShellExecute is
set to true.
The right behavior is to return no process only when we used the system
launcher. So, spawning /bin/cat should behave in the same way independent
of how UseShellExecute is set.
If initialization of the Form class or one of its base classes fails, possibly because X11 is not available and the constructor of the parent Control class throws an exception, the owned_forms member is not initialized. This results in a NullReferenceException during initialization, if the error that occurs during construction is handled.
Stack traces:
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)
Parameter name: Display
at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0
at AutoCRCheck.frmOptions..ctor () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) AutoCRCheck.frmOptions:.ctor ()
at AutoCRCheck.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)
Parameter name: Display
at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0
at AutoCRCheck.frmOptions..ctor () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) AutoCRCheck.frmOptions:.ctor ()
at AutoCRCheck.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
---------------------------------------------------------
Handling the previous exception results in the following exception:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Windows.Forms.Form.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at AutoCRCheck.frmOptions.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.ComponentModel.Component.Finalize () [0x00000] in <filename unknown>:0
When a higher-priority tasked appeared in the dispatcher queue, the
dispatcher stopped processing of the current queue but moved to a low
priority queue instead of processing the most high priority queue.
When a Dispatcher exits due to 'frame.Continue' being false, it does not
clear queue_bits. As result, the next run of the Dispatcher could try to
dequeue a non-existing dispatcher operation.
If the dispatcher encounters that frame.Continue is false, it should return
immediately and do not try to execute anything. The unit test may be seen as
rather artificial, but the problem may happen in more realistic situations
when frames are unwound.
The source and the destination indexes are confused. The source index, which
is the second parameter, should be 0 and the destination index, which is the
fourth parameter, should be 1.
The property was introduced with PR #870 but it missed to convert network byte order to host byte order, so the comparison
wasn't working correctly and the corresponding unit test failed. @marek-safar erroneously "fixed" the test in 27e07c7.
This is the corrected implementation and the original test now works as intended.
The escaping/unescaping behaviour of TaskItem:ITaskItem was undocumented
originally in MSBuild, so our implementation did not perform any. This
caused issues with Tasks getting metadata and paths that were escaped,
trying to use them as-is, and failing horribly.
Fortunately the ITaskItem2 interface in .NET 4 provides complementary
accessors with documentation that indicates that it stores values
escaped internally, and the old accessors unescape the values.
This commit implements ITaskItem2, fixes the escaping behavior of the
old accessors, and removes some superluous uses of IDictionary.Contains.
Directory separators are automatically converted from Windows->Native
when parsing MSBuild files, but any paths provided in code must already
be native.
This should hopefully fix compilation of projects using files with
names like '[email protected]' in various places like embedded resources
or content items which must be copied to the output directory.
With tests.
The right way to compare assembly versions is by translating the major/minor
pair into a single number and compare that.
Since each element can only be one byte long, we multiply major by 256
before adding to minor.
This solves the problem where version 100.0.0.0 was not after 3.5.0.0.
In commit 425fdc03fa:
[xbuild] Build & install MSBuild 12.0 assemblies
The net_3_5_only_dirs containing the Build classes were moved to
various xbuild_X_dirs variables, but an undefined $(xbuild_dirs)
variable was appended to DIST_ONLY_SUBDIRS.
This patch adds $(xbuild_4_0_dirs) instead.
In commit 35287878b9:
[xbuild] Reorganize xbuild targets/frameworks/bin data
Several files were shuffled around, but the EXTRA_DISTFILES was
not fully updated with the new file paths.
This patch is required to build a 3.2.7 tarball.
The calculating the native size of structs with explicit layout we need to take into consideration the minimum alignment
needed and the packing asked.
If no packing is supplied, we should respect the minimum alignment. If packing is supplied we should use the minimum required.
Since we no longer care about Moonlight, this patch is no longer needed,
and enables some cute functionality on the iOS REPL.
This reverts commit ec445c82f7.
This reverts commit 85841d0bbd.
Some scripts unfortunately depend on the verbage "Mono JIT compiler"
in the "mono --version" message. While this was never a blessed
or supported way of getting the version (use pkg-config) of Mono,
nonetheless this breaks some important stuff. We can use the better
message in the (somewhat distant) future.
1. MONO_THREADS_PER_CPU affects ThreadPool min threads rather than max threads
2. Effect is MONO_THREADS_PER_CPU * cpu_cores, there is no +20
3. Default is 1, not 10
It is incorrect to escape the FullPath metadata for a build item when
we invoke GetEvaluatedMetadata. If we do this we end up completely breaking
every file with a special character in it as things like this would always
fail as we'd pass an escaped path to the filesystem:
File.Exists (item.GetEvaluatedMetadata ("FullPath"))
The iOS designer encountered this issue when we added retina images
called "[email protected]" to our solution.
With tests.
The existing check only verified if owner had write privileges.
Which returns the wrong value when the file is not owned by the user.
And doesn't work when the file is globally writeable or the user
belongs to the user of the file.
We check flags for when euid/egid matches file's. Otherwise we fallback
to access(2), which sucks, but it's the only thing close to working
that exists on unix and has a reasonably portable behavior.
GetFlaggedEnumValue converts values to Int64 which
can cause a NumberOverflow exception when the value
is too large to fit (e.g. a large UInt64). Special
case UInt64 values for now (duplicates the logic,
which sucks).
They had been squashed into one single source directory
despite being installed into very different locations.
Made it easier to follow what's what by separating them
into:
* data: targets and data files for xbuild bin directory
* targets: misc pcl/web targets for extension directory
* frameworks: framework definitions
Drop the requirement to call mono_class_init in mono_class_is_assignable_from.
The solution is not ideal as it relies on mono_class_implement_interface_slow which
is significantly slower than the regular checks and is less tested / complete.
The right approach here would be to promote setup_offsets to have proper laziness and
not be hidden behind vtable initialization. Until this happen we can't drop the
usage of the slow variant here.
Because of Cecil the fullname attribute does expect the fullname attribute to be in the format of ECMA-335. This is in certain cases not the same as the name reported by Type.FullName.
See jbevain/cecil#150 for some details on this.
The pc info file cache (~/.config/xbuild/pkgconfig-cache-2.xml) stored data
for files which don't exist anymore on the system which causes
https://bugzilla.xamarin.com/show_bug.cgi?id=11133.
This patch removes obsolete entries from the cache when
PcFileCache.Update() is called.
* PcFileCache.filesByFolders held copies of the package infos in
PcFileCache.infos grouped by the resp. pkg config directories the pc files
resided in.
* Rewrite GetPackages:
- Returns a snapshot-in-time IEnumerable<PackageInfo> ordered by pkg config
folder.
- Noramilzes paths of pkgConfigDirs parameter
* Remove now superfluous method PcFileCache.Add(,,)
All internal members (such as PcFileCache) have been made public to make them unit-testable.
* mcs/class/Makefile: Add Mono.XBuild.Tasks as build target
* mcs/class/Microsoft.Build.Tasks/Makefile: Add Mono.XBuild.Tasks.dll as build
reference of Microsoft.Build.Tasks.dll
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj:
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_3_5.csproj:
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_0.csproj:
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_5.csproj: Remove
source files, which have been moved to Mono.XBuild.Tasks.dll and add a
project reference to Mono.XBuild.Tasks.dll
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources: Remove
files that have been moved to Mono.XBuild.Tasks.dll from
Microsoft.Build.Tasks.dll
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs:
* mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/LibraryPcFileCache.cs:
This file was moved to Mono.XBuild.Tasks.dll
* mcs/class/Mono.XBuild.Tasks/Assembly/AssemblyInfo.cs: Moved from
Microsoft.Build.Tasks.dll. Signing key is mono.pub.
* mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks/PcFileCache.cs:
* mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks/LibraryPcFileCache.cs:
Moved from Microsoft.Build.Tasks.dll. All internal members have been made
public.
* mcs/class/Mono.XBuild.Tasks/Test/Mono.XBuild.Tasks/PcFileCacheTest.cs: Create
test file stub.
Array indexes can be 32-bits integers even on 64-bits
architectures. This causes most loops to fail Array Bounds Checking
REMoval because the index is sign-extended before the check (see
mini_emit_ldelema_1_ins).
Sign-extending an I4 to I8 preserves its value, hence it is possible
to propagate the relation between the variables.
The .NET implementation of CancellationTokenSource invokes the
callbacks in the opposite order from that of the registration.
In order to mixamize compatibility, use the same order.
Fixes ReEntrantRegistrationTest, Cancel_Order, Cancel_ExceptionOrder
(in CancellationTokenSourceTest) and
https://bugzilla.xamarin.com/show_bug.cgi?id=16992
This test run on .NET would result in both "unregister" and "register"
set to a "true" value. In order to ensure that the "unregister = true"
fragment is not executed, its disposal needs to be registered after,
because on .NET the CancellationTokenSource has a LIFO behavior.
This change simplifies the code and makes the expected behavior
consistent with that of .NET.
The F# compiler optimizes the hashing of tuples when it can inline
it. This is consistent with the hashing algorithm used in .NET, but it
is not with the one used in Mono, as pointed out in
https://github.com/fsharp/fsharp/issues/188
This patch modifies Tuples.cs so that the hashing algorithm is the
same as that used in F#, i.e. the XOR variant of DJB2, using a
balanced tree parenthesization.
Added support for the three leading HTML5 Video mime types
.mp4 video/mp4
.ogv video/ogg
.webm video/webm
When Internet Explorer 10 or 11 receives application/octet-stream as the mime type for HTML5 video, it will not play the video. This resolves the issue in an Apache/mod_mono environment.
The System.Diagnostics.Process API always return a null process when starting with UseShellExecute=true.
This means we should not track the launched process and not gather information regarding it.
EndGetRequestStream with TransportContext parameter was introduced in .NET 3.5. Also added "using" statement for System.Net (namespace for TransportContext).
I am not sure if a "do-nothing" implementation like this is acceptable in the Mono code base, but it does solve the problem described in https://bugzilla.xamarin.com/show_bug.cgi?id=12875 (successfully executing simple requests using the Google API .NET client library).
FIXME: This is only a stub, the only type currently present is
`System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken',
which is only a stub.
Added the type-forwarder for `ConditionalWeakTable<T,V>', put all the
others inside a `!FULL_AOT_RUNTIME' conditional, then enabled this in
the MonoTouch build.
Moreover according to RFC2616 header names are subset of ASCII chars [0-127],
so culture-aware comparison is useless and eats too many processor time
(according to my benchmarks get an item from Hashtable with OrdinalIgnoreCase
comparers more than 20x times faster compared to Hashtable with InvariantCultureIgnoreCase
comparer)
This is deadlock prone as the GC lock is a leaf lock while the domain
lock required to free a JI is not.
There are plenty of places where we alloc memory while holding the
domain lock, so we cannot do it the other way.
More details:
* HttpWebRequest now writes the HTTP request headers asynchronously. This will avoid blocking a thread pool thread until the headers are written.
* SslClientStream was doing the TLS negotiations in a blocking manner. Converted the negotiation method to an async state machine where all operations are done asynchronously.
* The test case identified in #15451 now completes quickly with less than 15 threads created, vs. 100s of threads used before this fix.
Future work if needed:
* I did not convert SslServerStream but the same pattern could be used here.
* SendAlert is still blocking. I thought it was not worth converting it to non-blocking.
mono(1) supports a "joined" verbose flag, `mono -v-v-v-v`, which
Mono.Options doesn't support. Attempting to use it, however, resulted
in a "weird" error message:
$ csharp -r:Mono.Options.dll
csharp> using Mono.Options;
csharp> var p = new OptionSet { { "v", v => {} } };
csharp> p.Parse (new[]{"-v-v-v"});
Mono.Options.OptionException: Cannot bundle unregistered option '--'.
...
This looks very weird to users because they never used a "--" option,
and if they had then `--` would have disabled further option
processing (as documented and implemented in OptionSet.Parse()).
Confusion all around.
Improve the error message so that it instead generates:
Mono.Options.OptionException: Cannot use unregistered option '-' in bundle '-v-v-v'.
That way the user gets the full context of where this "unregistered
option" came from.
mono_mb_create_method no longer requires the loader lock. All use sites
replace the loader lock with simpler locks.
Those new locks cannot be held while we're building the methods themselves
as that piece of code does type resolution - thus taking the loader lock.
We should not need the loader lock here as this only deals with dynamic images
that belong to the current domain that is been shutdown.
To ensure this is the case, added an assert to mono_image_append_class_to_reflection_info_set.
'TestMessageLogger.Count' should not be used in tests to check for the
number of logged messages because it would also includes diagnostic messages.
Extra diagnostic messages should not be considered an error condition; in
fact, we have too few diagnostic messages, not too many.
Use 'TestMessageLogger.NormalMessageCount' and 'TestMessageLogger.WarningMessageCount'
instead.
This fixes a problem with the "Microsoft.Bcl.Build" NuGet package, which
overrides the "GetTargetPath" target in a custom .targets file and uses
"Returns" instead of "Outputs".
Those two functions are not guaranteed to do word-atomic copying or
zeroing under any circumstances. memmove() on OSX, for instance,
has an SSE optimized variant that, if source and destination are 8-byte,
but not 16-byte aligned, will copy the first 8 bytes byte-wise, which can
crash SGen.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=16449.
BuildSubmission.IsCompleted is valid now.
Renamed some argument in BuildEngine4.
Removed ProjectTargetInstance field by moving them to arguments in BuildEngine4.
We cannot simply "expand strings first then evaluate condition as boolean"
because there are things like "$(A)=='true'" which is expanded as "=='true'".
BuildSubmission could be posted multiple times so that multiple projects can
be built within one BuildManager. Now node manager should be implemented too...
It has to be adjusted dynamically as with OP_SWITCH since
we emit extra instructions in the various call opcodes when
the argument list contains single-precision floats.
Also, allocate extra storage space when needed (we would
potentially overflow previously).
Using d0 and d1 is problematic because they're argument registers
and so can end up being clobbered by instructions inserted in the
middle of a call sequence.
d14 and d15 on the other hand are OK because they don't have any
particular meaning in the ABI, and we don't even use them in the
register allocator at the moment anyway.
This is done with a gross hack that maintains a list of args
in the MonoCallInst and emits them as late as possible. This
is not pretty, but we have to work around the register
allocator. See the code comments for details.
This is currently only for float32/float64 values. They are passed
in the d0 register. The code is a bit complicated because we only
speak float64 in the JIT, so float32 values have to be converted
to/from float64.
Referencing the assemblies by DLL name isn't enough for MonoDevelop to
pick them up for listing. Use the full path so they show up the
references list.
BuildSubmission.IsCompleted is valid now.
Renamed some argument in BuildEngine4.
Removed ProjectTargetInstance field by moving them to arguments in BuildEngine4.
We cannot simply "expand strings first then evaluate condition as boolean"
because there are things like "$(A)=='true'" which is expanded as "=='true'".
BuildSubmission could be posted multiple times so that multiple projects can
be built within one BuildManager. Now node manager should be implemented too...
This patch prevents the problem in https://bugzilla.xamarin.com/show_bug.cgi?id=15572. This change allows the DataContractSerializer to deserialize DataMembers that use an array KnownType, at least for the test case in the bug report.
One way to prevent https://bugzilla.xamarin.com/show_bug.cgi?id=15574 is to add the problematic array type to the `known_types`.
On the other hand, this might not be the intended use of `known_types`. In that case, perhaps a better fix would be to guard against recursion in the `foreach` loop:
if (t != type)
RegisterTypeAsKnown (t);
mono-proclib.c: In function ‘get_cpu_times’:
mono-proclib.c:600:24: warning: ‘sirq_ticks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*sirq = (sirq_ticks) * 10000000 / hz;
^
mono-proclib.c:598:22: warning: ‘irq_ticks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*irq = (irq_ticks) * 10000000 / hz;
^
mono-proclib.c:602:24: warning: ‘idle_ticks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*idle = (idle_ticks) * 10000000 / hz;
^
mono-proclib.c:596:29: warning: ‘system_ticks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*systemt = (system_ticks) * 10000000 / hz;
^
mono-proclib.c:594:23: warning: ‘nice_ticks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*user = (user_ticks + nice_ticks) * 10000000 / hz;
^
mono-proclib.c:594:23: warning: ‘user_ticks’ may be used uninitialized in this function [-Wmaybe-uninitialized]
On windows, a value to IP_MULTICAST_IF with a most significant byte of zero is interpreted as an interface index instead of an ip address.
This makes it possible to set the interface index from .NET as follows:
socket.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(ifindex));
For this to work on other platforms, we need to detect this case and handle it with an ip_mreqn struct.
Recent versions of mingw-w64 have moved this definition to a header
included by this file, so checking simply for GCC would cause a multiple
definition error. We should instead check for this function's
availability at configure-time.
These changes are released under MIT/X11 license.
The locale descriptions in
<mono/metadata/culture-info-tables.h:culture_name_entries> use 'xx-yy'
format, where most current systems use 'xx_YY', including Mono itself in
<eglib/src/gmisc-win32.c:g_win32_getlocale>. In normalizing the system
locale for comparison, we should switch any underscores for dashes.
Mono used to do this, but commit
be532638f5 removed this behavior, which
causes System.Globalization.CultureInfo.CurrentCultureInfo to always
point to the invariant culture on systems with LANG similar to xx_YY.
These changes are released under MIT/X11 license.
The way DefaultThreadCurrentCulture is to be implemented is that its current value
will always be used by a thread that didn't set a value for its culture.
This means we can't cache DefaultThreadCurrentCulture value as it's allowed to
change and threads must always show the latest value.
the problem of changing the culture when a new value is set in the current thread
is that is doesn't work well with CultureInfo.DefaultThreadCurrentCulture.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=16071
Improve compatibility of the MOBILE profile with Desktop .NET:
Add (nearly) everything from System.ComponentModel (and nested
namespaces) _except_ for things that depend on Licensing.
This includes System.ComponentModel.Design.HelpKeywordAttribute
(requested in Bug #16071), many many other attributes, more
exceptions, more EventArgs subclasses, etc.
SRE encodes references to self-instantiated generic types in a different way
that regular code.
This is required as there's no clear way to differentiate between an open type
and a self-instantiated type when using System.Type.
Given that restriction, code that deals with loading such methods must take
special case and not cache then as the context under generic sharing will not
be used - so it would be seen as cacheable.
When using regular instantiation the same method lookup will require the context
to be used but will hit the cache before.
This is another problem of passing the instantiation context around. It messes
up with way too much stuff.
After much trouble building Mono in Debian/MIPS, @directhex
narrowed it down to this issue:
https://sourceware.org/ml/binutils/2009-11/msg00387.html
So since some of the 2E and 2F versions of the Loongson CPUs
break with a regular `sll zero, zero, 0` we need to issue an
`or at, at, 0`. This makes sure we don't randomly deadlock or
blow up when the CPU is under heavy load.
Yes, really.
If you use a stored procedure or a prepared statement, with
CommantType.StoredProcedure the ar variable is not set as the result of
onnection.Tds.BeginExecuteProcedure().
We previously depended on the presence of a backtick in a generic type name to try to
parse a generics argument list. This is not what the spec says and F# breaks this expectation.
The right way to handle this is to probe for array syntax.
This TestConnectionStringRetrieval unit test (committed by me some months
ago) succeeds for me in a clean checkout, but I don't understand why it
fails in the buildbot, so let's place some sanity check in it.
We don't need to expand variant interfaces in 4.5 as they work
just fine.
This saves us from loading a lot of extra metadata and inflating
spurious classes.
Commit 0a2c38df changed Delegate.Remove() so that it uses
Locale.GetText(), which thus introduces additional exceptions which
can be possibly thrown from Delegate.Remove().
This is similar to the situation in corlib/3d3fe6af (added
Locale.GetText() use) and mdoc/574dbc8e (updated unit tests).
On systems where 'Liberation Sans' is not installed out-of-the-box
(e.g. Ubuntu Server, OpenSuse Server) it falls back to 'DejaVu Sans',
which makes the GetHashCode_NameDiffers_HashesNotEqual() test fail as
the two font names are now equal. Instead we use 'Arial' and 'Courier New'
which resolve to different fonts on most systems.
Changes licensed under MIT/X11.
MS implementation of Attribute.GetHashCode does not depend on TypeId property, so you can return any value in TypeId and hashcode in MS.NET will be the same.
Fixes :
https://bugzilla.xamarin.com/show_bug.cgi?id=16021https://bugzilla.xamarin.com/show_bug.cgi?id=12754
Resolves:
http://lists.ximian.com/pipermail/mono-list/2013-June/050008.html
A reference to the variable bufsize, local to the else-if block was being passed to the function setsockopt hence
the properties ReceiveBufferSize & SendBufferSize were being set to garbage on the Socket class. This could and did have a SERIOUS performance hit on socket communication. It is not inconceivable that people would try to increase the
buffer sizes and inadvertently shrink them considerably with a consequence of drastically degrade performance.
Narinder Claire
narinder.claire <> gmail.com
Signed-off-by: Narinder CLAIRE <[email protected]>
This would happen because _lock is nullified by the GC during
finalization. Dispose () calls Close () which sets the Enabled
property to false, which then attempts to lock on _lock.
In order allow for arbitrary code in the profiler callback we must invoke it without
holding any runtime leaf lock - this happens quite frequently with sdb as it tries to
suspend the world on those callbacks.
So thread shutdown is now split in two phases, first one that does the no-locks part
where the thread remains suspendable afterwards and then onewith locks taken where we
do the final cleanup and final shutdown.
The build argument --enable-extension-module now takes a comma separated list
of arguments that are passed down. Passing no arguments triggers the old behavior.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=15857
Scenario (for which I couldn't easily create a testcase, but can
sketch out): Imagine using HttpClient...in a multithreaded manner:
// shared:
static CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource ();
// Thread 1
var request = new HttpRequestMessage(HttpMethod.Post, "https://www.google.com/") {
Content = new StringContent (new string('x', 1024)),
};
using (request)
using (HttpClient httpClient = new HttpClient())
using (HttpResponseMessage response = await httpClient.SendAsync(request,
_cancellationTokenSource.Token)) {
string responseContent = await response.Content.ReadAsStringAsync();
Console.WriteLine ("Read {0} chars", responseContent.Length);
}
// Thread 2
_cancellationTokenSource.Cancel ();
This isn't entirely farfetched; in the case of #15857, Thread 2 was
the Main thread (due to the user clicking a button), while Thread 1
was the ThreadPool (because of async/await).
The _occasional_ result: a TargetInvocationException exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
at (wrapper delegate-invoke) <Module>:invoke_bool__this___HttpsClientStream (Mono.Security.Protocol.Tls.HttpsClientStream)
at System.Reflection.MonoProperty.GetterAdapterFrame[HttpsClientStream,Boolean] (System.Reflection.Getter`2 getter, System.Object obj)
at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index)
--- End of inner exception stack trace ---
at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index)
at System.Net.WebConnection.Write (System.Net.HttpWebRequest request, System.Byte[] buffer, Int32 offset, Int32 size, System.String& err_msg)
at System.Net.WebConnectionStream.WriteHeaders ()
at System.Net.WebConnectionStream.SetHeaders (System.Byte[] buffer)
at System.Net.HttpWebRequest.SendRequestHeaders (Boolean propagate_error)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.Http.HttpResponseMessage].GetResult ()
at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext ()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult ()
at HttpClientAsyncCancellationRepro.Activity1+<AccessGoogleButton_Click>c__async0.MoveNext ()
Huh?
The reason why is because HttpClientHandler.SendAsync() registers a
Cancel handler with the CancellationTokenSource, and the registered
handler calls HttpWebRequest.Abort() (which eventually calls
WebConnection.Close()). This causes WebConnection.nstream to _change_
while WebConnection.Write() is executing, causing
WebConnection.nstream to go from non-null to null, which
WebConnection.Write() does not expect:
# WebConnection.CreateStream; from 5 Threadpool worker
# WebConnection.Write; from 5 Threadpool worker
# WebConnection.Close; from 1 at at System.Environment.get_StackTrace()
at System.Net.WebConnection.Close(Boolean sendNext)
at System.Net.WebConnection.Abort(System.Object sender, System.EventArgs args)
at System.Net.WebConnection+AbortHelper.Abort(System.Object sender, System.EventArgs args)
at System.Net.HttpWebRequest.Abort()
at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.<>m__0(System.Object l)
at System.Threading.CancellationToken+<Register>c__AnonStorey0.<>m__0()
at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
at System.Threading.CancellationTokenSource.Cancel()
at System.Threading.CancellationTokenSource.SafeLinkedCancel()
at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
at System.Threading.CancellationTokenSource.Cancel()
at HttpClientAsyncCancellationRepro.Activity1.CancelButton_Click(System.Object sender, System.EventArgs e)
at Android.Views.View+IOnClickListenerImplementor.OnClick(Android.Views.View v)
at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_(IntPtr jnienv, IntPtr native__this, IntPtr native_v)
at System.Object.e7b5b870-ea0f-434f-bc31-984f665a44ad(IntPtr , IntPtr , IntPtr )
# WebConnection.Write: checking piTrustFailure; from 5 Threadpool worker
(Yay extra logging. Notice that WebConnection creates a stream from
the ThreadPool, starts WebConnection.Write(), then before it can se
piTrustFailure the instance is Close()d, which nulls out nstream.)
Since WebConnection.Write() attempts to access the (now null)
WebConnection.nstream field, it results in a NullReferenceException,
which is wrapped into a TargetInvocationException by
System.Reflection.
The fix? As usual, "don't do that."
In this case, WebConnection.Write() has already captured
WebConnection.nstream into the local variable `s` (which thus can't be
changed by another thread). Instead of using WebConnection.nstream,
reuse the `s` local variable, which cannot be null, thus avoiding the
NullReferenceException.
(This solution could fail if HttpsClientStream ever throws e.g.
ObjectDisposedException from HttpsClientStream.TrustFailure, but at
present HttpsClientStream.TrustFailure never throws, so this is fine.)
The inliner could not handle optimally when we inline code inside the try block as it would be linked
with the catch block.
Since the source block would have more than one exit, the inliner would conservatively not link them together,
which hinders further local optimizations.
The satellite assembly generated by the Makefile was suffixed with '.Resources.dll', but the assembly loader looks for '.resources.dll', thus the satellite assembly wasn't found.
The alias analysis pass is capable of simplifying indirection against
local or temporary variables. It will replace a memory load or store
with direct access to the variable.
It does a local pass looking for addresses and replacing memory
ops with direct ops.
If any conversion happens, it does a DCE pass to try to kill those
LDADDR and then recalculate the indirect flag.
Finally, if the number of indirect variables is reduced, it does a
global to local vreg pass and another DCE pass to kill most spurious
copying.
Performance numbers on 32bits OSX:
Code size:
mcs: -11.366 (0.6%)
corlib: -15.397 (0.6%)
Execution time increased by less than 0.2% which is about the same
value of the test variance.
Numbers are not impressive since we don't perform store forwarding
or constant load elimination. Proper handling of value type aggregates
and longs would move us much further.
To reduce the cost of alias analysis we detect which methods can potentially profit from
the optimization.
The current detection logic is very simple, every time LDADDR is generated, we set
has_indirection to TRUE.
The indirect flag should only be used to signal that the address of the given variable
has been taken. This means that it should be possible to recompute that flag from the IR.
The usage of the volatile flag remains not ideal as it conflates two separate issues
and will in the future hinder efforts to implement address based alias analysis.
We need to resolve all the TypeReferences before we update their scopes.
After setting the scope to null, calling Resolve() on a nested child would
crash.
The checks here were wrong in the first place; they should have
checked for MONO_ARCH_HAVE_ATOMIC_ADD rather than SIZEOF_VOID_P.
But regardless, these methods need to work when invoked via
reflection, which they wouldn't previously.
This is a bit tricky. The System.Threading.Thread.Volatile* methods
don't actually guarantee atomicity; all they guarantee is that the
runtime will insert acquire barriers for loads and release barriers
for stores. The methods in the System.Threading.Volatile class,
however, require both barriers *and* atomicity.
So, we need an entirely separate set of icalls for the Volatile
class in order to get the right semantics there.
These APIs are insane.
Previously, the icall that was used for the IntPtr overload was
used for this overload as well. Having a separate icall is less
error-prone for future modification as the two types are no longer
conflated.
This would result in the following warnings on e.g. PowerPC:
sgen-gc.c: In function 'scan_thread_data':
sgen-gc.c:4045:6: warning: passing argument 1 of 'conservatively_pin_objects_from' from incompatible pointer type [enabled by default]
sgen-gc.c:1467:1: note: expected 'void **' but argument is of type 'void * (*)[32]'
sgen-gc.c:4045:6: warning: passing argument 2 of 'conservatively_pin_objects_from' from incompatible pointer type [enabled by default]
sgen-gc.c:1467:1: note: expected 'void **' but argument is of type 'void * (*)[32]'
New --skip-scan flag allow us to handle resource assemblies as opaque data.
New --static-ctor flag allows us to better interop with weird C libraries requirements.
We have various issues:
* All of the functions assumed that doing volatile loads/stores was
enough, when load-acquire, store-release semantics were actually
needed. This may have worked before purely by chance. We now use
proper memory barriers so that we don't have to hope for the
compiler and CPU to do the right thing.
* Removes the hack for 64-bit quantities on 32-bit systems. This is
no longer needed now that we use explicit memory barriers in
these functions. Also, these functions are not supposed to do
atomic reads/writes in the first place - they're purely about the
memory barrier semantics.
* The VolatileWrite (object&, object) overload was not using the
volatile qualifier at all, thus not getting volatile semantics
as per: http://gcc.gnu.org/onlinedocs/gcc/Volatiles.html
The --single-method option run regression tests from an assembly, like
--regression. Instead of going through a list of optimizations,
however, it takes one optimization combination, runs all tests with
all optimizations turned off, while gathering a list of which methods
were jitted. Then, for each jitted method, it runs all tests again,
with the optimizations applied to only that one method, stopping as
soon as a test fails. Example:
mono --single-method=branch,peephole basic-float.exe
The previous implementation of GetMaxByteCount has two bugs: it incorrectly took into account the byte order mark and it was taking the max of a byte count (3) and a character count (EncoderFallback.MaxCharCount). This could result in returning the max number of bytes required to convert a string that was less than the number bytes used when converting the string.
GetMaxCharCount did not previously take into account DecoderFallback.MaxCharCount or the fact that there may still be part of a surrogate pair left on the buffer from a previous call to convert.
I removed the #if NET_2_0 conditionals and NotWorking category since these methods now return results consistent with Microsoft's implementation. I also added two simple tests for custom EncoderFallback and DecoderFallback cases.
This commit is licensed under MIT/X11.
The previous version used SCNetworkReachability
in C inside libMonoPosixHelper. This was less
than ideal and made it more problematic for
supporting iOS as it doesn't actually link
MPH in.
Rewrite using P/Invokes directly into the
SCNetworkReachability APIs for Mac OS X and
iOS.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=13642
for iOS and Mac OS X.
With the anonymous counters on ModuleContainer,
anonymous method and type names will be generated
in a way that depends on the order of the sources
passed to mcs. This can cause undesirable API
and IL differences.
Moving the counters to TypeContainer instead
avoids this issue.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=15214
This is a regression introduced in be532638.
Xamarin.Android assumes that the $LANG environment variable can be
used to control System.Globalization.CultureInfo.CurrentCulture,
setting LANG based on the current Java locale.
This was broken in be532638 because $LANG was no longer being checked
to determine the default locale, as $LC_ALL was not set.
Fix the fallback logic so that $LANG is checked when $LC_ALL is not.
Existing prefix replacement was incorrect as
it tested for a prefix but performed a multi
search and replace instead of just a prefix
replace. Fix that.
Add -r|--regex mode to indicate that path
replacement should be performed with regular
expressions.
Add -f|--filename mode to indicate that
replacements should be performed only on
a file name and not the full absolute path.
Add -v|--verbose mode to print the replacements
that are performed.
e.g: '$(MSBuildAssemblyVersion)' == '' and ('$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' >= '12.0'), used in the .targets files shipped with VS2013
From VS2013, MSBuild is now decouple from the .NET Framework and is a separate redistributable. This means it has a new location and version numbering scheme. There are also some addition MSBuild properties because of this
This commit is causing unbound growth in the number of threads for a series of workloads.
It's leading a sgen test to crash with 800 tp threads around, which doesn't make sense on a
4 cores system with default TP configuration.
This reverts commit 3c347d5d3a.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=14767
Some people, when confronted with a problem, think
“I know, I'll use regular expressions.” Now they have two problems.
- http://regex.info/blog/2006-09-15/247
ToolTask uses a regular expression to extract various bits of
information from the warning/error message. Unfortunately it was
inadequate, and didn't correctly match on some errors.
The error message in this case is:
class1.cs(16,4): error CS0152: The label `case 1:' already occurs in this switch statement.
The problem was that while the previous regular expression would
succeed in matching the above string, it was horribly inaccurate in
what it captured:
${file} = "error CS0152"
${line} = "16"
${column} = "4"
${level} = "The"
${number} = "label `case 1"
${message}= "' already occurs in this switch statement."
Did I mention hilariously wrong?
There were two problems with the previous pattern:
1. It allowed filename+(line,column) to be _repeated_, which is
clearly insane. Filename/etc. shouldn't be repeated.
2. ${number} captured ".*\d", i.e. anything ending with a number, so
when the message had a number embedded within it, it was captured.
For good measure, use RegexOptions.IgnorePatternWhitespace so that
we don't have a horrendously long regex pattern to compare for diffs
the next time this needs fixing, and add NUnit tests.
If the GC stops the world and a thread is in the process of starting
up, but has not yet registered (it's not in the thread_list), it is
possible that the thread does register while the world is stopped.
When restarting the GC will then try to restart said thread, but since
it never got the suspend signal, it cannot answer the restart signal,
so a deadlock results.
This is triggered by `tests/sgen-bridge.cs`, about once every 10 runs.
We solve this by using a negative value in the `signal` field in the
thread info to indicate threads that have never been suspended.
We depend on the latent liveness state of objects at the time we collect bridged objects. To
preserve this we must perform the dfs1 step right after collecting them and before we drain the
gray stack or all objects pointed by candidate bridge objects will be marked as alive.
For now mcs/class/System.Web/Test/mainsoft/NunitWebResources/adapters.browser
depends on System.Web_test_net_2_0.dll
Signed-off-by: Etienne CHAMPETIER <[email protected]>
Without that referencing browser 'Default' (parentID="Default")
in a .browser file make the app throw exceptions here
mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Build.cs#L206
Signed-off-by: Etienne CHAMPETIER <[email protected]>
This is used by monotouch to add a reference to monotouch.dll.
Also add a profile-specific sources file for monotouch so the
extensions module can add even more files.
We previously failed to provide a consistent view of the registered threads set. This
would should up in the following ways:
-New threads would join in between two FOREACH_THREAD passes. The recently joined threads
lead to broken invariants that one loop carried to the other.
-Existing threads would leave during a FOREACH_THREAD. The now defunct threads lead
to code waiting them to ack back and deadlock in the process.
-It was possible to witness an in-progress cleanup. This would show up by
mono_thread_info_current returning null when it should not.
To amend this we provide a a consistent view of all registered threads once the global
suspend lock is acquired. This is done by acquiring that lock when registering/unregistering.
This allows us to remove some of the work-around in the sgen thread registration
code and avoid taking the GC lock.
Binary protocol buffers are linearly linked from newest to oldest, but need to be
written out from oldest to newest. This was sloppily implemented with a recursive
call, which caused a stack overflow when there were too many buffers. We now
allocate an array and store pointers to all the buffers in it, then iterate over it in
reverse.
The previous behavior used the entire local identifier string that includes optional settings such as variant and calendar format. This returns locales like en_US_POSIX@calendar=buddhist which result in the user's culture being the invariant culture.
This change builds the locale from the language, country code and optional script code so that the locale returned is in the expected format.
This commit is licensed under MIT/X11.
Improves a60ff0fd1e
Tests for file existence and outputs diagnostic rather than treating it as a local recoverable exception.
Leaving the question of general mdoc error-reporting for another day.
commit 6ec0ddc7e5c4d5640da7420600898c10578a7974
Author: Larry O'Brien <[email protected]>
Date: Sun Sep 15 11:03:32 2013 -1000
Coding style
commit f034514fca8298a8ed2a167f3ab288f32bc7c74f
Author: Larry O'Brien <[email protected]>
Date: Sun Sep 15 10:28:47 2013 -1000
Bugzilla 14672
Added namespace file ("ns-{namespace}.xml") summary and remarks into the nsSummaries, which results in displaying the data prior to the namespace type-list when the user searches at the namespace level.
Appears to only be necessary for native viewer (Web viewer for some reason "knows" about the summaries).
The thing is, unlike the standards describe in codepoints, .NET String
characters beyond BMP are represented as surrogate pairs and they can be
converted all in 3 bytes.
The implementation didn't take care of encoder fallbacks, or byte order
marks either, so take them into considertion too.
I created a new 'mono-master' branch in ivkm-fork, which is based
at the previous ikvm commit, then cherry-picked my single commit.
Apparently, there are API changes in IVKM which prevent it from
being applied cleanly.
SDB does suspend/resume during thread cleanup. It used to work until I introduced
critical regions. This won't work anymore as we need to lookup the thread info object
and during cleanup it will be gone.
The fix is to introduce mono_thread_info_current_slow which is a variant of
mono_thread_info_current that does search the thread list if the TLS key
is gone.
The reasoning behind doing CAS on longs was to avoid overflowing
which is not a problem because 2-completement math does the trick.
This is much more reliable than using longs on 32 bits.
* Fixes Broken Test in BuildEngine for 4.0 and 3.5
* Fixes build for Mono.Debugger.Soft not in 4_5 profile
* Fixes build for NET_4_0 profile (CustomAttributes and HasDefaultValue)
When building with DISABLE_JIT, mono_inst_name which is normally defined in helpers.c is not. But, mini-codegen.c tries to use it anyway. This fix updates mini-codegen.c to not rely on this logging feature.
HttpWebRequest is a very tricky piece of code when it comes to its socket, this patch is more like a hack to get something working out of it but it's definitely not the best option.
Currently, WS_EX_TOPMOST is handled by making the window transient-for
the root window. I was unable to find any documentation that indicated
that this would have the desired effect. Instead, use SetTopmost to
set _NET_WM_STATE to _NET_WM_STATE_ABOVE, per EWMH.
Also, use XMapRaised to raise topmost windows to the top of the stack
when mapped, as a last ditch effort to support window managers that
do not respect _NET_WM_STATE, such as xmonad.
This fixes an issue I encountered when running a winforms application
in xmonad, whereby drop down menus would fail to re-open if windows
had been re-arranged after the menu was first opened (in reality,
the menu was hiding behind the form).
* On Itanium, you must obtain libunwind: http://www.hpl.hp.com/research/linux/libunwind/download.php4
* On Solaris
1. Make sure that you used GNU tar to unpack this package, as
Solaris tar will not unpack this correctly, and you will get strange errors.
2. Make sure that you use the GNU toolchain to build the software.
3. Optional dependencies
* libgdiplus - Required for System.Drawing. This library in turn requires glib and pkg-config
* pkg-config - Available at: http://www.freedesktop.org/Software/pkgconfig
* glib 2.4 - Available at: http://www.gtk.org/
* libzlib - This library and the development headers are required for compression
file support in the 2.0 profile.
4. Mono is required to build Mono. Use a system package or monolite (explained further below)
5. If you have a system Mono (not monolite), you will need to read this: http://mono-project.com/Parallel_Mono_Environments#Setting_up_a_Build_Environment
b. Building the Software
------------------------
If you obtained this package as an officially released tarball,
this is very simple, use configure and make:
`./configure --prefix=/usr/local ; make ; make install`
Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
S/390x, AMD64, ARM and PowerPC systems.
If you obtained this as a snapshot, you will need an existing
Mono installation. To upgrade your installation, unpack both
mono and mcs:
tar xzf mcs-XXXX.tar.gz
tar xzf mono-XXXX.tar.gz
mv mono-XXX mono
mv mcs-XXX mcs
cd mono
./autogen.sh --prefix=/usr/local
make
The Mono build system is silent for most compilation commands.
To enable a more verbose compile (for example, to pinpoint
problems in your makefiles or your system) pass the V=1 flag to make, like this:
` make V=1`
c. Building the software from GIT
---------------------------------
If you are building the software from GIT, make sure that you
have up-to-date mcs and mono sources:
* If you are an anonymous user: `git clone git://github.com/mono/mono.git`
* If you are a Mono contributor with read/write privileges: `git clone [email protected]:mono/mono.git`
Then, go into the mono directory, and configure:
cd mono
./autogen.sh --prefix=/usr/local
make
For people with non-standard installations of the auto* utils and of
pkg-config (common on misconfigured OSX and windows boxes), you could get
an error like this:
./configure: line 19176: syntax error near unexpected token 'PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
This means that you need to set the ACLOCAL_FLAGS environment variable
where $acprefix is the prefix where aclocal has been installed.
This will automatically go into the mcs/ tree and build the
binaries there.
This assumes that you have a working mono installation, and that
there's a C# compiler named 'mcs', and a corresponding IL
runtime called 'mono'. You can use two make variables
EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
can say:
make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
If you don't have a working Mono installation
---------------------------------------------
If you don't have a working Mono installation, an obvious choice
is to install the latest released packages of 'mono' for your
distribution and running `autogen.sh; make; make install` in the
mono module directory.
You can also try a slightly more risky approach: this may not work,
so start from the released tarball as detailed above.
This works by first getting the latest version of the 'monolite'
distribution, which contains just enough to run the 'mcs'
compiler. You do this with:
# Run the following line after ./autogen.sh
make get-monolite-latest
This will download and automatically gunzip and untar the
tarball, and place the files appropriately so that you can then
just run: `make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe`
That will use the files downloaded by 'make get-monolite-latest.
Testing and Installation
------------------------
You can run *(part of)* the mono and mcs test suites with the command: `make check`.
All tests should pass.
If you want more *extensive* tests, including those that test the
class libraries, you need to re-run 'configure' with the
'--enable-nunit-tests' flag, and try: `make -k check`
Expect to find a few test suite failures. As a sanity check, you
can compare the failures you got with
https://wrench.mono-project.com/Wrench/
You can now install mono with: `make install`
You can verify your installation by using the mono-test-install
script, it can diagnose some common problems with Mono's install.
Failure to follow these steps may result in a broken installation.
d. Configuration Options
------------------------
The following are the configuration options that someone
building Mono might want to use:
*`--with-sgen=yes,no` - Generational GC support: Used to enable or disable the
compilation of a Mono runtime with the SGen garbage collector.
* On platforms that support it, after building Mono, you will have
both a mono binary and a mono-sgen binary. Mono uses Boehm, while
mono-sgen uses the Simple Generational GC.
*`--with-gc=[boehm, included, sgen, none]` - Selects the default Boehm garbage
collector engine to use.
* *included*: (*slighty modified Boehm GC*)
This is the default value, and its
the most feature complete, it will allow Mono
to use typed allocations and support the
debugger.
* *boehm*:
This is used to use a system-install Boehm GC,
it is useful to test new features available in
Boehm GC, but we do not recommend that people
use this, as it disables a few features.
* *none*:
Disables the inclusion of a garbage collector.
* This defaults to `included`.
*`--with-tls=__thread,pthread`
* Controls how Mono should access thread local storage,
pthread forces Mono to use the pthread APIs, while
__thread uses compiler-optimized access to it.
* Although __thread is faster, it requires support from
the compiler, kernel and libc. Old Linux systems do
not support with __thread.
* This value is typically pre-configured and there is no
need to set it, unless you are trying to debug a problem.
*`--with-sigaltstack=yes,no`
* **Experimental**: Use at your own risk, it is known to
cause problems with garbage collection and is hard to
reproduce those bugs.
* This controls whether Mono will install a special
signal handler to handle stack overflows. If set to
`yes`, it will turn stack overflows into the
StackOverflowException. Otherwise when a stack
overflow happens, your program will receive a
segmentation fault.
* The configure script will try to detect if your
operating system supports this. Some older Linux
systems do not support this feature, or you might want
to override the auto-detection.
*`--with-static_mono=yes,no`
* This controls whether `mono` should link against a
static library (libmono.a) or a shared library
(libmono.so).
* This defaults to `yes`, and will improve the performance
of the `mono` program.
* This only affects the `mono' binary, the shared
library libmono.so will always be produced for
developers that want to embed the runtime in their
application.
*`--with-xen-opt=yes,no` - Optimize code for Xen virtualization.
* It makes Mono generate code which might be slightly
slower on average systems, but the resulting executable will run
faster under the Xen virtualization system.
* This defaults to `yes`.
*`--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
* This defaults to `no`.
*`--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
and disk footprint at the expense of some capabilities.
* Typically this means that the number of threads that can be created
is limited (256), that the maximum heap size is also reduced (256 MB)
and other such limitations that still make mono useful, but more suitable
to embedded devices (like mobile phones).
* This defaults to `no`.
*`--with-ikvm-native=yes,no` - Controls whether the IKVM JNI interface library is
built or not.
* This is used if you are planning on
using the IKVM Java Virtual machine with Mono.
* This defaults to `yes`.
*`--with-profile4=yes,no` - Whether you want to build the 4.x profile libraries
and runtime.
* This defaults to `yes`.
*`--with-moonlight=yes,no`
* Whether you want to generate the Silverlight/Moonlight
libraries and toolchain in addition to the default
(1.1 and 2.0 APIs).
* This will produce the `smcs` compiler which will reference
the Silverlight modified assemblies (mscorlib.dll,
System.dll, System.Code.dll and System.Xml.Core.dll) and turn
on the LINQ extensions for the compiler.
*`--with-moon-gc=boehm,sgen` - Select the GC to use for Moonlight.
* *boehm*:
Selects the Boehm Garbage Collector, with the same flags
as the regular Mono build. This is the default.
* *sgen*:
Selects the new SGen Garbage Collector, which provides
Generational GC support, using the same flags as the
mono-sgen build.
* This defaults to `boehm`.
*`--with-libgdiplus=installed,sibling,<path>` - Configure where Mono
searches for libgdiplus when running System.Drawing tests.
* It defaults to `installed`, which means that the
library is available to Mono through the regular
system setup.
* `sibling' can be used to specify that a libgdiplus
that resides as a sibling of this directory (mono)
should be used.
* Or you can specify a path to a libgdiplus.
*`--disable-shared-memory`
* Use this option to disable the use of shared memory in
Mono (this is equivalent to setting the MONO_DISABLE_SHM
environment variable, although this removes the feature
completely).
* Disabling the shared memory support will disable certain
features like cross-process named mutexes.
*`--enable-minimal=LIST`
* Use this feature to specify optional runtime
components that you might not want to include. This
is only useful for developers embedding Mono that
require a subset of Mono functionality.
* The list is a comma-separated list of components that
should be removed, these are:
*`aot`:
Disables support for the Ahead of Time compilation.
*`attach`:
Support for the Mono.Management assembly and the
VMAttach API (allowing code to be injected into
a target VM)
*`com`:
Disables COM support.
*`debug`:
Drop debugging support.
*`decimal`:
Disables support for System.Decimal.
*`full_messages`:
By default Mono comes with a full table
of messages for error codes. This feature
turns off uncommon error messages and reduces
the runtime size.
*`generics`:
Generics support. Disabling this will not
allow Mono to run any 2.0 libraries or
code that contains generics.
*`jit`:
Removes the JIT engine from the build, this reduces
the executable size, and requires that all code
executed by the virtual machine be compiled with
Full AOT before execution.
*`large_code`:
Disables support for large assemblies.
*`logging`:
Disables support for debug logging.
*`pinvoke`:
Support for Platform Invocation services,
disabling this will drop support for any
libraries using DllImport.
*`portability`:
Removes support for MONO_IOMAP, the environment
variables for simplifying porting applications that
are case-insensitive and that mix the Unix and Windows path separators.
*`profiler`:
Disables support for the default profiler.
*`reflection_emit`:
Drop System.Reflection.Emit support
*`reflection_emit_save`:
Drop support for saving dynamically created
assemblies (AssemblyBuilderAccess.Save) in
System.Reflection.Emit.
*`shadow_copy`:
Disables support for AppDomain's shadow copies
(you can disable this if you do not plan on
using appdomains).
*`simd`:
Disables support for the Mono.SIMD intrinsics
library.
*`ssa`:
Disables compilation for the SSA optimization
framework, and the various SSA-based optimizations.
*`--enable-llvm`
*`--enable-loadedllvm`
* This enables the use of LLVM as a code generation engine
for Mono. The LLVM code generator and optimizer will be
used instead of Mono's built-in code generator for both
Just in Time and Ahead of Time compilations.
* See the http://www.mono-project.com/Mono_LLVM for the
full details and up-to-date information on this feature.
* You will need to have an LLVM built that Mono can link
against.
* The --enable-loadedllvm variant will make the LLVM backend
into a runtime-loadable module instead of linking it directly
into the main mono binary.
*`--enable-big-arrays` - Enable use of arrays with indexes larger
than Int32.MaxValue.
* By default Mono has the same limitation as .NET on
Win32 and Win64 and limits array indexes to 32-bit
values (even on 64-bit systems).
* In certain scenarios where large arrays are required,
you can pass this flag and Mono will be built to
support 64-bit arrays.
* This is not the default as it breaks the C embedding
ABI that we have exposed through the Mono development
cycle.
*`--enable-parallel-mark`
* Use this option to enable the garbage collector to use
multiple CPUs to do its work. This helps performance
on multi-CPU machines as the work is divided across CPUS.
* This option is not currently the default as we have
not done much testing with Mono.
*`--enable-dtrace`
* On Solaris and MacOS X builds a version of the Mono
runtime that contains DTrace probes and can
participate in the system profiling using DTrace.
*`--disable-dev-random`
* Mono uses /dev/random to obtain good random data for
any source that requires random numbers. If your
system does not support this, you might want to
disable it.
* There are a number of runtime options to control this
also, see the man page.
*`--enable-nacl`
* This configures the Mono compiler to generate code
suitable to be used by Google's Native Client:
http://code.google.com/p/nativeclient/
* Currently this is used with Mono's AOT engine as
Native Client does not support JIT engines yet.
Using Mono
==========
Once you have installed the software, you can run a few programs:
*`mono program.exe` runtime engine
*`mcs program.cs` C# compiler
*`monodis program.exe` CIL Disassembler
See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
for further details.
Directory Roadmap
=================
*`docs/` - Technical documents about the Mono runtime.
*`data/` - Configuration files installed as part of the Mono runtime.
*`mono/` - The core of the Mono Runtime.
*`metadata/` - The object system and metadata reader.
*`mini/` - The Just in Time Compiler.
*`dis/` - CIL executable Disassembler
*`io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
*`cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
*`arch/` - Architecture specific portions.
*`man/` - Manual pages for the various Mono commands and programs.
*`samples/` -Some simple sample programs on uses of the Mono
runtime as an embedded library.
*`scripts/` - Scripts used to invoke Mono and the corresponding program.
*`runtime/` - A directory that contains the Makefiles that link the
mono/ and mcs/ build systems.
*`../olive/`
* If the directory ../olive is present (as an
independent checkout) from the Mono module, that
directory is automatically configured to share the
same prefix than this module gets.
Contributing to Mono
====================
Before submitting changes to Mono, please review the contribution guidelines at http://mono-project.com/Contributing. Please pay particular attention to the [Important Rules](http://mono-project.com/Contributing#Important_Rules) section.
Git submodules maintenance
==========================
Read documentation at http://mono-project.com/Git_Submodule_Maintenance
Maintainer
==========
Mono is maintained by miguel@xamarin.com
Reporting bugs
==============
To submit bug reports, please use Xamarin's Bugzilla:
https://bugzilla.xamarin.com/
Please use the search facility to ensure the same bug hasn't already
been submitted and follow our guidelines on how to make a good bug
You can take the loader lock without holding a domain lock.
You cannot take a domain lock if the loader lock is held.
You can take the domain load while holding the loader lock
You cannot take the loader lock if only the domain lock is held.
You cannot take a domain lock while holding the lock to another domain.
TODO:
We have a few known ok violation. We need a way to whitelist them.
Known ok issues:
ERROR: tried to acquire lock DomainLock at mono_domain_code_reserve_align while holding DomainLock at mono_class_create_runtime_vtable: Hierarchy violation.
This is triggered when building the vtable of a non-root domain and fetching a vtable trampoline for an offset that has not been built. We'll take the root
domain lock while holding the other one.
This is ok since we never allow locking to have in the other direction, IOW, the root-domain lock is one level down from the other domain-locks.
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_class_from_name
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_image_add_to_name_cache
Both of those happen when filling up the name_cache, as it needs to alloc image memory.
This one is fixable by spliting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriatedly.
#define g_assert(x) G_STMT_START { if (G_UNLIKELY (!(x))) g_assertion_message ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x); } G_STMT_END
#define g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); } G_STMT_END
#define g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); eg_unreachable(); } G_STMT_END
for counter in 1 2 3 4 5 ; do if test -f $(topdir)/../msvc/scripts/inputs/$$config_file ; then config_file=`basename $(LIBRARY) .dll`-$(PROFILE)-$$counter.input; fi ; done ;\
Loaded 100 of 11722 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.