This is to guarantee that even in the case an exception is thrown between both calls, we switch back and forth correctly from RUNNING to BLOCKING state.
- fixes#38818
- setting the *unchanged* scope to non-marked types is harmful,
because in case the type has declaring type, the scope of declaring
type is set as well. see
https://github.com/mono/cecil/blob/master/Mono.Cecil/TypeReference.cs#L132
public virtual IMetadataScope Scope {
get ...
set {
var declaring_type = this.DeclaringType;
if (declaring_type != null) {
declaring_type.Scope = value;
return;
}
scope = value;
}
}
so in our case, we first set correctly scope of
System.Collections.Generic.Dictionary`2 to mscorlib, then (re)set
scope of System.Collections.Generic.Dictionary`2/ValueCollection
and
System.Collections.Generic.Dictionary`2/ValueCollection/Enumerator
to System.Collection (note that these types are not marked and are
swept away by linker), which sets scope of its declaring type
System.Collections.Generic.Dictionary`2 back to System.Collection
and because the System.Collection is linked-out, the typeref is
incorrectly written with the scope set to System later
In the following case we would have a race between Wait and Unregister methods:
- T1 calls ThreadPool.RegisterWaitForSingleObject to wait on waitHandle
- registeredWaitHandle is constructed to wait on waitHandle
- registeredWaitHandle.Wait method is enqueued on the ThreadPool
- T1 calls registeredWaitHandle.Unregister
- T1 calls waitHandle.Close (happens in Process.StopWatchingForExit)
- TTP (the threadpool thread) calls registeredWaitHandle.Wait
- TTP calls WaitHandle.WaitAny (waitHandle, ...)
The last step try to access the waitHandle that has been previously closed, leading to a _wapi_handle_ref / _wapi_handle_unref_full error message.
The fix is to ensure that the RegisteredWaitHandle keeps the WaitHandle alive. To achieve this, we simply use the SafeWaitHandle inside the WaitHandle by: increasing its ref count when constructing the RegisteredWaitHandle, and decrementing it when unregistering it.
We also increase the count when using it in Wait, so if we execute Unregister and Wait concurrently, we guarantee that the WaitHandle is still valid in Wait, or get an exception if not.
FileInfo.MoveTo was not moving a file from one directory to another when
the file name did not change.
Fixes#18361.
An ArgumentException when destFileName is an empty array was added,
otherwise FileInfoTest.MoveTo_DestFileName_Empty would fail. Both
Path.GetFullPath and File.Move throw similar exceptions but
MoveTo_DestFileName_Empty expects the one from File.Move so it was added
to this method.
Mono has a list of assemblies considered "internal", whose versions are automatically remapped to the distro default version.
Since we no longer bundle Npgsql, it is up to individual distributions to package their own Npgsql - but Mono cannot load any version other than 4.0.0.0 from the GAC, due to this remapping:
Mono: Assembly Ref addref npghello[0x17e2fd0] -> mscorlib[0x1789c00]: 2
Mono: The request to load the assembly Npgsql v2.2.7.0 was remapped to v4.0.0.0
Mono: Assembly Loader probing location: '/usr/lib/mono/gac/Npgsql/4.0.0.0__5d8b90d52f46fda7/Npgsql.dll'.
Npgsql, Version=2.2.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7
This was added in 2687866e99, but on systems where /bin/sh (which make uses by default) isn't bash this doesn't work.
Fix is to use a standard switch-case which works in all shells.
Do not run 4GB string tests on low memory systems (fixes#38392)
"Low memory" here is defined as 32-bit, less than 6GB of physical RAM, or mobile (since mobile lacks the class for querying physical RAM).
Without this patch, one of the corlib tests allocates 4 GB of RAM, which causes OOM crashes on low-memory Jenkins instances and also mobile phones.
This reverts commit a7955a93f5.
The Process import commit was reverted in f74f703719,
this reverts the added tests as well since they fail on Jenkins now.
The implementation added in b5d0ffe7dd forgot to multiply vmstat.free_count (== number of free pages)
by the page size in the __APPLE__ case, making the reported number much smaller than the reality.
[reflection] Signal pending loader error in mono_reflection_get_custom_attrs_data
Fixes [Bugzilla 38222](https://bugzilla.xamarin.com/show_bug.cgi?id=38222)
While we're at it, convert `mono_reflection_get_custom_attrs_data` to use
`MonoError` and mark it external only. Runtime should use
`mono_reflection_get_custom_attrs_data_checked`
`sgen_ensure_free_space()` assumed that if `size` was larger than
`SGEN_MAX_SMALL_OBJ_SIZE`, it should find free space on the major
heap, so it wouldn't consider triggering a nursery allocation. Making
TLABs larger than that would thus never trigger nursery collections
anymore.
Now we pass in the generation that says where we want space.
Allows opening a character device or named fifo more than once with code like:
using (var f = new FileStream ("/dev/zero", FileMode.Open))
{
...
}
using (var f = new FileStream ("/dev/zero", FileMode.Open))
{
...
}
[System] Fix a few more hardcoded ports in tests
They'd cause "address already in use" errors when two builds are running concurrently on the same machine on Jenkins.
@monojenkins merge
InternalThread is a fundamentally different type WRT to appdomain. All instances of Thread bound to the same
os thread have a reference to a shared InternalThread.
InternalThread is always allocated in the root domain, so it MUST NOT have references to other domains as
it will lead to crashes on unload.
This was the case with pending_exception. It could point to an exception meant to the domain unloading.
This bug became more and more frequent as we move to use mono_set_pending_exception in more places. I could
reproduce it in 10 minutes of looping appdomain-unload.exe.
Separate the code path for async and self abort/suspend. This make the code intention more clear. It also allows us to remove some unused parameters (can_raise_excetpion which is always TRUE). Add some comments and harmonise locking behaviours : async_suspend_internal and self_suspend_internal now both call UNLOCK_THREAD.
When MONO_PATH is set, the corlib lookup returns early on in mono_assembly_load_corlib (),
without adding the Facades dir to default_path.
This causes any app/library that relies on the facades to fail at runtime.
Fixing this by always doing the Facades lookup when returning the found corlib image.
Fixes [Bugzilla 38222](https://bugzilla.xamarin.com/show_bug.cgi?id=38222)
While we're at it, convert mono_reflection_get_custom_attrs_data to use
MonoError and mark it external only. Runtime should use
mono_reflection_get_custom_attrs_data_checked
fix for the following problem:
> [13:33:37] src/System/Test/System.Diagnostics/ProcessTest.cs(1048,19): error CS0103: The name `GetCrossPlatformStartInfo' does not exist in the current context
[threadpool] Improve the monitor thread heuristic
Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.
To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).
The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.
Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.
Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.
To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).
The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.
Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.
There's no managed code calling mono_domain_try_unload, so raising was
wrong. Thread the error out through exc which gets checked by callers.
Fixup for 45bd9bb5d5
[AsyncResult] Fix unhandled exception behaviour in AsyncCallback
The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.
The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.
@monojenkins merge
The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.
The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.
Recognize OS X file "locked" state (fixes#37834)
Quick fix for https://bugzilla.xamarin.com/show_bug.cgi?id=37834
IOLayer is_file_writable/System.IO.File.GetAttributes on posix systems looks only at the unix file permissions and does not consider special OS flags. This leads to an easily end-user-triggered bug on OS X if a mono app (the bug was observed in Xamarin Studio) uses GetAttribute on a file which has been "Locked" using the checkbox in Finder Get Info. This patch recognizes the "uchg" flag for non-writability which Finder uses.
The performance team discovered this on their bots using the Jenkins snapshot packages. Mono would fail to start with a message like:
```
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/opt/mono-2016.02.08+15.25.39/lib/mono/4.5/mscorlib.dll' directory.
```
The one odd thing is that they are using Mono installed in a path which is different from the prefix used during compilation.
It turns out that the runtime has a hardcoded check for lib/mono/2.0 in https://github.com/mono/mono/blob/7d5a7ea7ac324bb4ee63094ddcf8e20ae9ba4322/mono/metadata/assembly.c#L633-L637.
Since we recently stopped shipping 2.0 in the packages (we moved to 2.0-api for the reference assemblies) this directory wasn't there,
so the code in fallback() called into mono_config_get_assemblies_dir() which just returns the MONO_ASSEMBLIES preprocessor symbol.
That preprocessor symbol is defined to the value of --prefix during compilation, so Mono couldn't find corlib there as well since it's installed in another path which ultimately results in the above error message.
The fix is to change the hardcoded value to 4.5, which is what we established as the directory with the "latest" assemblies now.
Ideally we should find a way to stop hardcoding those paths in the runtime.
PS: I grepped through the runtime source to make sure we don't hardcode 2.0/3.5/4.0 elsewhere and only found one instance in a test.
I fixed it there as well, though the test looks suspicious since it hardcodes /usr ...
IOLayer is_file_writable/System.IO.File.GetAttributes on posix systems
looks only at the unix file permissions and does not consider special
OS flags. This leads to an easily end-user-triggered bug on OS X if a
mono app (the bug was observed in Xamarin Studio) uses GetAttribute on
a file which has been "Locked" using the checkbox in Finder Get Info.
This patch recognizes the "uchg" flag for non-writability which Finder
uses.
It failed twice on Jenkins over the weekend:
```
Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues : #EGV4
Expected: 0
But was: 9
at MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues () [0x0012b] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:1304
```
We're sleeping just as long as the expiry time of the cache items (1s) which might not be enough.
Bumping the sleep time should fix this.
Mark mono_assembly_get_object external only.
Runtime should use mono_assembly_get_object_checked.
Also propagated MonoError through a few static functions in reflection:
mono_reflection_get_type_internal () and
mono_reflection_get_type_internal_dynamic ()
The concurrent collector typically uses more memory because more memory is allocated during the concurrent phase, which also leads to more objects surviving the major collections and higher allowances. We improved the memory situation by forcing synchronous finishing of the concurrent mark if too much memory is allocated during the concurrent mark phase. Still, this doesn't tackle the underlying problem. Even if we have less memory allocated during the CMS phase, some is still allocated and leads to increased overall memory usage. And how much memory growth should we allow in the first place ? The even greater problem is that it appears to force a lot of synchronous finishes, significantly increasing finishing pause times.
This commit attempts to solve this problem by following an ideal mathematical approach. We use the following notations : H - heap size at start of major collection, Gs - heap growth during sync collection, Gc - heap growth during conc collection, s - survival rate of the collection, a - allowance ratio (0.33), Ts - trigger for next major sync, Tc - trigger for next major conc.
Assume we have the heap size H at the start of a major collection. For the two types of majors we would have :
Ts = (H + Gs) * s * (a + 1)
Tc = (H + Gc) * s * (a + 1)
Obviously the problem is that Gc > Gs, which leads to Tc > Ts and higher memory usage. In order to have the two triggers equal we need to find an X that we can subtract from Tc to obtain Ts. Considering Gs = 0 (only a few nursery objects are promoted during a major sync collection) and similar survival rates for the two types of collection, we get X = Gc * s * (a + 1). In order to get equal triggers we would need to subtract this value from the allowance computed after a concurrent collection.
The more the heap grows, the more X grows. If X gets bigger than the available starting allowance ((H + Gc) * s * a), it would mean that we are trying to set a trigger that it is lower than the actual heap size at the end of the collection (which means we already exceeded the target memory usage). In order to avoid this problem we need to enforce Tc - X > (H + Gc) * s. Doing the substitutions we get Gc < a * H. When the heap growth exceeds this value it means we need to force the finish of the concurrent collection.
When sample profiling is enabled and we send a SIGPROF signal to a thread that
hasn't yet transitioned to a running state (e.g. STATE_RUNNING), the signal can
sometimes be delivered at such an early point that libc has not even finished
initializing TLS for that thread yet. This is problematic because we then go
right on to crash in the SIGPROF signal handler when we try to save errno. We
then further crash in the SIGSEGV handler because we can't access the jit_tls
variable either.
The fix is fairly simple: Only send SIGPROF to threads that have transitioned
to a running state. Technically, TLS is initialized 'much' earlier than when
this state transition happens, but since the worst thing that can happen is
that we miss one sampling event (i.e. ~1sec by default) right at the beginning
of the thread's lifetime, this simple fix is good enough.
This crash seemingly only happened on OS X.
With GCC 5.x, the compiler optimises away the dummy load used to
estimate the stack pointer address in GC_approx_sp; it returns
zero. This leads to segfaults when embedding Mono.
Instead, use __builtin_frame_address, which GCC's libgc uses for
the same purpose.
[runtime] Use MonoError for mono_string_new
We are refraining from changing runtime callers of `mono_string_new` to `mono_string_new_checked` in one commit. String creation is used in several hundred places and threading error handling through all the callers is very intrusive. Additionally, AFAIK the only error condition from mono_string_new is out-of-memory. In a lot of cases there's no way to meaningfully recover.
We should revisit individual callers when it makes sense, but just mechanically updating everywhere doesn't get us a lot of benefit.
[runtime] Use MonoError for mono_method_get_object
Depends on #2532
Issues:
- [x] ~~depends on #2486~~
- [x] ~~Should use `mono_object_new_checked` #2532~~
- [x] ~~Should use `mono_string_new_checked`~~ (`mono_string_new` will assert instead of raising an exception - #2530)
[threads] avoid race between setting the state flag and suspension
there's a short window where we release the lock and another thread
could modify the state. That is what we saw on the ARM machines for a
while, e.g. in `subthread-exit.cs` there's a race between
`mono_thread_execute_interruption` and `mono_thread_suspend_all_other_threads`:
> Thread 2 (Thread 0x429ff430 (LWP 5189)): // SUB THREAD
> #0 0x40398e30 in nanosleep () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1 0x0028c0ac in monoeg_g_usleep (microseconds=86650) at gdate-unix.c:53
> #2 0x0027b1d8 in suspend_sync_nolock (id=1079603792, interrupt_kernel=1) at mono-threads.c:913
> #3 0x0027b2d4 in mono_thread_info_safe_suspend_and_run (id=1079603792, interrupt_kernel=1, callback=0x1ab109 <suspend_thread_critical>, user_data=0x429fe534)
> at mono-threads.c:935
> #4 0x001ab28a in suspend_thread_internal (thread=0x401c0120, interrupt=1) at threads.c:4807
> #5 0x001a91ec in mono_thread_suspend_all_other_threads () at threads.c:3297
> #6 0x00158d8c in ves_icall_System_Environment_Exit (result=0) at icall.c:6378
> #7 0x400e7d9c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 1 (Thread 0x40597250 (LWP 5186)): // MAIN THREAD
> #0 0x4039a5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1 0x4039796e in do_futex_wait () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2 0x403979da in sem_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #3 0x002788d8 in mono_os_sem_wait (sem=0x388248, flags=MONO_SEM_FLAGS_NONE) at ../../mono/utils/mono-os-semaphore.h:163
> #4 0x00279722 in mono_thread_info_wait_for_resume (info=0x388210) at mono-threads.c:144
> #5 0x0027ad5e in mono_thread_info_end_self_suspend () at mono-threads.c:700
> #6 0x001ab2d2 in self_suspend_internal (thread=0x401c0120) at threads.c:4822
> #7 0x001aab0a in mono_thread_execute_interruption () at threads.c:4337
> #8 0x001a6a82 in ves_icall_System_Threading_Thread_Sleep_internal (ms=1200) at threads.c:1217
> #9 0x400da75c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
there's a short window where we release the lock and another thread
could modify the state. That is what we saw on the ARM machines for a
while, e.g. in `subthread-exit.cs` there's a race between
`mono_thread_execute_interruption` and `mono_thread_suspend_all_other_threads`:
> Thread 2 (Thread 0x429ff430 (LWP 5189)): // SUB THREAD
> #0 0x40398e30 in nanosleep () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1 0x0028c0ac in monoeg_g_usleep (microseconds=86650) at gdate-unix.c:53
> #2 0x0027b1d8 in suspend_sync_nolock (id=1079603792, interrupt_kernel=1) at mono-threads.c:913
> #3 0x0027b2d4 in mono_thread_info_safe_suspend_and_run (id=1079603792, interrupt_kernel=1, callback=0x1ab109 <suspend_thread_critical>, user_data=0x429fe534)
> at mono-threads.c:935
> #4 0x001ab28a in suspend_thread_internal (thread=0x401c0120, interrupt=1) at threads.c:4807
> #5 0x001a91ec in mono_thread_suspend_all_other_threads () at threads.c:3297
> #6 0x00158d8c in ves_icall_System_Environment_Exit (result=0) at icall.c:6378
> #7 0x400e7d9c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 1 (Thread 0x40597250 (LWP 5186)): // MAIN THREAD
> #0 0x4039a5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1 0x4039796e in do_futex_wait () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2 0x403979da in sem_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #3 0x002788d8 in mono_os_sem_wait (sem=0x388248, flags=MONO_SEM_FLAGS_NONE) at ../../mono/utils/mono-os-semaphore.h:163
> #4 0x00279722 in mono_thread_info_wait_for_resume (info=0x388210) at mono-threads.c:144
> #5 0x0027ad5e in mono_thread_info_end_self_suspend () at mono-threads.c:700
> #6 0x001ab2d2 in self_suspend_internal (thread=0x401c0120) at threads.c:4822
> #7 0x001aab0a in mono_thread_execute_interruption () at threads.c:4337
> #8 0x001a6a82 in ves_icall_System_Threading_Thread_Sleep_internal (ms=1200) at threads.c:1217
> #9 0x400da75c in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
The wildcard `$(wildcard ../../../external/binary-reference-assemblies/v4.5/*)` would include the directory entry `../../../external/binary-reference-assemblies/v4.5/Facades/` which returns an error during "make dist".
Fixing this by including only the .dll files in the wildcards.
mono_runtime_invoke might be called by P/Invoked code, which is in blocking mode. Not switching back to running can lead to a crash when hitting a safepoint.
[sgen] Fix register scanning on ARM
This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.
The issue would arise on ARM, as `MonoContext` and `ARCH_NUM_REGS` are defined as followed :
```
typedef struct {
mgreg_t pc;
mgreg_t regs [16];
double fregs [16];
mgreg_t cpsr;
} MonoContext;
\#define ARCH_NUM_REGS 14
```
As you can see, the MonoContext structure is bigger than 14 words, and it does not even covers the last 3 values of `regs`. By using pointer arithmetic, we ensure that we do not miss some parts of the `MonoContext` structure.
The observed behaviour in System.Threading.Tasks.Task.FinishContinuations would be that `continuationObject` would not be marked, and thus freed; `continuationObject` would still contains the pointer to the old location, meaning it wouldn't be null. We would then try to check its type via a call to the `as` operator. This would call the `isinst` IL opcode which would load `continuationObject->vtable->klass->supertypes [...]`, which would trigger a segfault, as `supertypes` would be null.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
Current Debian packaging puts libtool in its own package (libtool-bin)
leaving only libtoolize in the main package. The mono build process
uses libtoolize not libtool, so during autogen check for libtoolize
not libtool.
* only call EndEdit in scrollbar value changed handlers when currently
editing a node
* fix for bug 33183
Change-Id: I54407e00314f4bfbdc175e883199d3d1ef057911
This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.
The issue would arise on ARM, as `MonoContext` and `ARCH_NUM_REGS` are defined as followed :
```
typedef struct {
mgreg_t pc;
mgreg_t regs [16];
double fregs [16];
mgreg_t cpsr;
} MonoContext;
\#define ARCH_NUM_REGS 14
```
As you can see, the MonoContext structure is bigger than 14 words, and it does not even covers the last 3 values of `regs`. By using pointer arithmetic, we ensure that we do not miss some parts of the `MonoContext` structure.
The observed behaviour in System.Threading.Tasks.Task.FinishContinuations would be that `continuationObject` would not be marked, and thus freed; `continuationObject` would still contains the pointer to the old location, meaning it wouldn't be null. We would then try to check its type via a call to the `as` operator. This would call the `isinst` IL opcode which would load `continuationObject->vtable->klass->supertypes [...]`, which would trigger a segfault, as `supertypes` would be null.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
In reference source HttpHeaderCollection [1] when Add, Set or Remove is
called and the collection is readonly a PlatformNotSupportedException is
thrown.
Mono HeadersCollection was throwing NotSupportedException and
Microsoft.Owin.Host.SystemWeb.OwinCallContext.RemoveAcceptEncoding was
not catching the exception because it was expecting
PlatformNotSupportedException.
Fixes#33809
[1] http://referencesource.microsoft.com/#System.Web/HttpHeaderCollection.cs,73
We now add data-is-[non-]breaking attributes to the generated
html elements, and then use some javascript logic to show/hide
non-breaking elements (and the javascript also looks in the
container elements show/hide containers that have only
non-breaking descendants).
Also use css classes/styles to colorize.
This allow us catching and rethrowing the exception on the main thread, as well as making sure we wait for the Listen thread to finish in a timely manner.
The use of HttpResponseMessage.ReasonPhrase means:
* marking the HttpListenerResponse.GetStatusDescription method;
* marking the HttpListenerResponse type;
* which implements IDisposable, so it's Dispose method is marked
* marking the Close method...
from there a metric ton of code gets recursively marked to the point
where the whole SSL/TLS server code gets inside the app.
To avoid this we move the GetStatusDescription to a different
type that won't bring the end of the civilized world so fast.
The format of the test assembly name changed in 860334ff45
from System.Web_test_net_4_x.dll to net_4_x_System.Web_test.dll.
This fixes all the places where the old name was used.
[jit] Add a new jit icall mono_interruption_checkpoint_from_trampoline () and use that instead of mono_thread_force_interruption_checkpoint () so the latter can go away eventually.
This macro should be used to decorate functions that are part of the public API but the runtime is
not supposed to call.
This is to allow us to keep them around but not go crazy with commit reintroducing their usage.
I noticed this in https://jenkins.mono-project.com/job/test-mono-pull-request-armhf/1715/ which reported success in the "profiler" test step,
even though the step actually reported errors:
```
MONO_PATH=/media/ssd/jenkins/workspace/test-mono-pull-request-armhf/mcs/class/lib/net_4_x perl ./ptestrunner.pl ../..
Checking test-alloc.exe with report ...
Checking test-busy.exe with report ...
Checking test-busy.exe with report,sample ...
Error: Missing thread Finalizer.
Error: Missing thread Main.
Error: Wrong loaded images 2.
Error: Not enough compiled method.
Error: Not enough compiled code.
Error: Missing thread BusyHelper.
Total errors: 6
Checking test-monitor.exe with report ...
Checking test-excleave.exe with report ...
Checking test-heapshot.exe with report,heapshot ...
Checking test-heapshot.exe with heapshot,output=-traces.mlpd ...
Checking test-traces.exe with output=-traces.mlpd ...
Checking test-traces.exe with nocalls,output=-traces.mlpd ...
make[1]: Leaving directory `/media/ssd/jenkins/workspace/test-mono-pull-request-armhf/mono/profiler'
make: Leaving directory `/media/ssd/jenkins/workspace/test-mono-pull-request-armhf/mono/profiler'
++ bc
+++ date +%s
++ echo 1453874768 - 1453874741
+ echo -e '*** end(27): profiler: \e[42mPassed\e[0m'
*** end(27): profiler: Passed
```
The culprit is that ptestrunner.pl checks whether $total_errors is non-zero to determin the process exit code.
This is wrong, as $total_errors is cleared before each test so unless the last test fails the exit code would always be zero.
Introduced a new $global_errors variable which is only incremented and never cleared to fix this.
[System] Fix error in new BeginConnectToIPV4EndPointUsingDualModelSocket test
It was added with 78c758494a. The test fails on Jenkins:
```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket : System.InvalidOperationException : EndConnect can only be called once per asynchronous operation
at System.Net.Sockets.Socket.ValidateEndIAsyncResult (IAsyncResult ares, System.String methodName, System.String argName) [0x0004a] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:3412
at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00006] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:1584
at MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket () [0x0005d] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:4365
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) [0x00038] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```
The reason is that BCCallback already calls EndConnect() so we need to remove it and just wait for the callback in the test itself.
@monojenkins merge
It was added with 78c758494a. The test fails on Jenkins:
```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket : System.InvalidOperationException : EndConnect can only be called once per asynchronous operation
at System.Net.Sockets.Socket.ValidateEndIAsyncResult (IAsyncResult ares, System.String methodName, System.String argName) [0x0004a] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:3412
at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00006] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:1584
at MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket () [0x0005d] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:4365
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) [0x00038] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```
The reason is that BCCallback already calls EndConnect() so we need to remove it and just wait for the callback in the test itself.
Failed on Jenkins on ARM today:
```
Tests run: 38, Failures: 1, Not run: 0, Time: 32.132 seconds
Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration : #A4-4
Expected: not null
But was: null
at MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration () [0x002b6] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:902
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) [0x00038] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```
100ms could be too short, bumping the timeout should make it more reliable on the slower ARM machines.
[array] Replace raise exception by pending exception in jit-icalls
The convention for jit-icalls is to set the pending exception, instead of raising it from native.
The following legacy functions are no longer used by the runtime and don't need loader-error conversion:
mono_method_get_signature_full
mono_method_get_signature
mono_field_from_token
May all that is unholy smite upon those attempting to use those functions again.
[runtime] Add MONO_ERROR_EXCEPTION_INSTANCE MonoError
This kind of MonoError can encapsulate a managed MonoException
object. (For example as a result of mono_runtime_invoke ()).
Issues:
- [x] Memory leak correctness.
`MonoError` already leaks memory if you simply swallow it without calling `mono_error_cleanup` or some function that calls it (for example `mono_error_raise_exception` or `mono_error_convert_to_exception`).
Now if we have an encapsulated exception, we'll leak a GC handle unless cleanup happens.
Unlike Linux, OSX does not allow multiple SCM_RIGHTS control messages in
sendmsg().
The SocketTest.ControlMsg() test is split into two tests, one which sends
only a single control message (containing two FDs), and another one which
sends two control messages (each containing one FD). The second test is not
executed on OSX.
Warning: System.Net.Mail is broken by design and sends incorrect emails.
This is not to fix SmtpClient itself but to ensure it remains compatible
(even if incorrect/broken) with older Mono releases.
The commit associated with bug# 33551 [1] can cause issues on computer
and devices that cannot resolve their hostname using the Dns API (which
have their own issues).
This commit catch the exception that occurs when resolution fails and
continue to send an email without a fully qualified domain name - just
like earlier Mono versions did in the past.
This solve bug #32746 [2] where some, but not all, AppleTV devices fails
to execute some of the System.dll unit tests.
Note: Whenever possible stay clear of SmtpClient (and friends) and use
something else like MimeKit/MailKit for your email needs
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=33551
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=37246
[handle] Remove chunk_last field from MonoHandleArena
Remove the `chunk_last` field. This changes MonoHandleArena from a queue of chunks to a stack of chunks. More importantly, the MonoHandleArena has an initial chunk that is allocated on the stack together with the arena. Previously that chunk was at the front of the list of chunks, but now it is at the end.
Added with https://github.com/mono/mono/pull/2097. Fails on Jenkins:
```
Test Case Failures:
1) MonoTests.Mono.Unix.Native.SocketTest.ControlMsg : System.ArgumentException : Invalid argument
----> Mono.Unix.UnixIOException : Invalid argument [EINVAL].
at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00000] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs:460
at MonoTests.Mono.Unix.Native.SocketTest+<ControlMsg>c__AnonStorey2.<>m__0 (Int32 so1, Int32 so2) [0x0018f] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:778
at MonoTests.Mono.Unix.Native.SocketTest.WithSocketPair (System.Action`2 f) [0x00025] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:68
at MonoTests.Mono.Unix.Native.SocketTest.<ControlMsg>m__9 (Int32 inner_so1, Int32 inner_so2) [0x00014] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:739
at MonoTests.Mono.Unix.Native.SocketTest.WithSocketPair (System.Action`2 f) [0x00025] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:68
at MonoTests.Mono.Unix.Native.SocketTest.ControlMsg () [0x00000] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs:738
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) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline@2/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
--UnixIOException
```
Because we could sleep for too long, while being in RUNNING state, the cooperative suspend would not finish in a timely manner. That would lead to the abort in `mono_threads_wait_pending_operations`.
When tracing multi-threaded program execution, it is useful to have a
way of separating which events happen on which thread. The
System.Threading.Thread.Name and Thread.ManagedThreadId properties are
useful proxies for tracking program execution.
However, if program execution spans both managed and embedded mono
native code, there is no existing mechanism to read the Thread.Name or
Thread.ManagedThreadId properties from native code without using
delegates, and delegates may not be usable in all circumstances (e.g.
within a mono_gc_register_bridge_callbacks() callback).
Add the following APIs to the embedding API to permit reading the
Thread.Name and Thread.ManagedThreadId properties:
char *mono_thread_get_name_utf8 (MonoThread *thread);
gint32 mono_thread_get_managed_id (MonoThread *thread);
mono_thread_get_name_utf8() returns the Thread.Name value as a UTF-8
string in newly allocated memory; the caller must g_free() this value.
mono_thread_get_managed_id() returns the Thread.ManagedThreadId value.
When the linker is enabled (default for device builds) unused methods
are removed and cannot be reflected.
In this case we do not need reflection as the answer to port reuse is
always true.
https://bugzilla.xamarin.com/show_bug.cgi?id=34133
We would previously open the standard output for the Console.Error StreamWriter. This behavior has never surfaced so far, because if you try to redirect the process standard output through a pipe or to a file, then the condition ConsoleDriver.IsConsole does not apply, and the other path does not have the same bug.
The only way to reproduce it is to redirect the standard error to another file, and observe that you would still have the Console.Error content. For example, with mono/tests/console-output.exe:
Expected output:
$> MONO_PATH=mcs/class/lib/net_4_x mono/mini/mono mono/tests/console-output.exe 2>/dev/null
Out
Actual output:
$> MONO_PATH=mcs/class/lib/net_4_x mono/mini/mono mono/tests/console-output.exe 2>/dev/null
Out
Error
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=36988
Fixes failure, where XmlSerializer would crash while serializing
a list with multiple XmlElement when a sub class of the XmlElement is
used.
Fixes#36829.
[runtime] Add SA_RESTART to SIG{CONT,INT,PROF,QUIT,USR2,WINCH}.
We need this as these signals can be delivered at any point and can interrupt system calls that external (non-Mono) code is executing, which such code may not be written to handle gracefully.
So we were previously taking the set symmetric difference of the
.sources and the .excludes files. This is semantically wrong, and the
change makes us take the difference. What we were doing is concatenating
the two files and taking any lines that are only seen once. If a file is
in excludes and not in sources, then we will include it. This is wrong.
This change always duplicates excludes, so anything present in excludes
is seen at least twice. This has the effect of making sure that only
things in .sources but not in .excludes are in the output file.
We need this as these signals can be delivered at any point and can interrupt
system calls that external (non-Mono) code is executing, which such code may
not be written to handle gracefully.
commit d2325f1483 (only since 4.3.2, not
4.3.1) caused the failure when an application is linked.
The use of `GetOrCreateValue` uses reflection to create an `NtlmSession`
instance so the linker won't see it as used anymore (and removes it).
Fixed by avoiding reflection (which will also perform better).
https://bugzilla.xamarin.com/show_bug.cgi?id=37732
The following exception would arise if we dispose the Process before making sure the AsyncStreamReader finished its work:
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:158
at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) [0x00015] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:670
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) [0x0005e] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:696
at System.Threading.Tasks.Task.FinishContinuations () [0x0009a] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3633
at System.Threading.Tasks.Task.FinishStageThree () [0x00045] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
at System.Threading.Tasks.Task.FinishStageTwo () [0x000f8] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2339
at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) [0x00049] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2239
at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00079] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2834
at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) [0x0006f] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2760
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2707
at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:857
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:1212
This would arise in test-runner.cs when one of the test would timeout, leading to the Process being disposed. This would then dispose the AsyncStreamReader, setting its `stream` value to null. The callback to ReadBuffer would then try to access `stream`, but would throw a NullReferenceException. By not disposing the AsyncStreamReader explicitely, we close the stream first, which will trigger a call to ReadBuffer, thus not triggering the NullReferenceException.
We were using get_runtime_invoke_type () to reduce the number of
wrappers we were using by sharing the wrappers that have MONO_TYPE_I
with that of MONO_TYPE_PTR. They have the same size, but these are not
valid types to share because they have different levels of indirection,
so runtime wrappers that have been aot'ed for the MONO_TYPE_I will be
used for MONO_TYPE_PTR and will dereference the value in the first word
of the pointer. In the case that this is null, we observed a segfault.
Specifically, the wrapper code in marshal.c looks like so:
```
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_I4:
case MONO_TYPE_U4:
case MONO_TYPE_R4:
case MONO_TYPE_R8:
case MONO_TYPE_I8:
case MONO_TYPE_U8:
mono_mb_emit_byte (mb, CEE_LDIND_I);
mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i]));
break;
case MONO_TYPE_STRING:
case MONO_TYPE_CLASS:
case MONO_TYPE_ARRAY:
case MONO_TYPE_PTR:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i]));
break;
```
showing that the two types are not equivalent.
The test was reenabled in 3f3df26945 and we were seeing it randomly fail
on Jenkins on OSX like that:
```
[...]
***** MonoTests.Mono.Unix.UnixSignalTest.TestNoEmitAny
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaise
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaiseAny
***** MonoTests.Mono.Unix.UnixSignalTest.TestRaiseStorm
/bin/sh: line 1: 40164 Hangup: 1 PATH="/Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/runtime/_tmpinst/bin:/opt/mono/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" MONO_REGISTRY_PATH="/Users/builder/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="./../../class/lib/net_4_x::$MONO_PATH" /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/runtime/mono-wrapper --debug ./../../class/lib/net_4_x/nunit-console.exe Mono.Posix_test_net_4_x.dll -noshadow -labels -exclude=NotOnMac,NotWorking,ValueAdd,CAS,InetAccess -labels -xml=TestResult-net_4_x.xml
make[1]: *** [run-test-lib] Error 1
make[1]: Leaving directory `/Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/Mono.Posix'
make: *** [do-run-test] Error 1
```
The problem is that (especially on OSX it seems) the signals raised by the threads in the test can be
delivered after we closed the UnixSignal, which means the default behavior of terminating the program kicks in.
The simplest fix is to just sleep for some time to make sure the signal is delivered and ignored before closing.
This eliminates the builtin 128 bytes char array in MonoError and forces the error message to be always malloc'd.
It makes the code simpler and sacrifices a bit in terms of what we can handle in the case of a malloc OOM.
Malloc OOM is not a solvable problem for a few reasons.
1) Overcommit and virtual memory makes relying on malloc returning zero not an useful thing.
2) Everything goes south when malloc starts to fail. There's nothing much the runtime can do beyond
give up.
OTOH, saving stack space is pretty nice for its own reasons.
1) Clang now generates stack guards by default for frames larger than 120 bytes on amd64. This
means that MonoError has a much bigger overhead than needed.
2) We conservatively scan the stack and, with this change, those are 128 bytes less for the gc to figure out.
On ABI compatibility. We promise backward but not forward compatibility. Meaning someone compiling against 4.4
can't expect it to works against 4.2, but vice versa is fine.
We can handle old users because the struct is now smaller and has always being opaque, meaning callers just
a bit of waste space and that's it.
This means the following:
mono_object_new_mature handles OOM and finalization.
GC glue code returns NULL on failure and doesn't deal with finalization.
Finally, correctly implement mono_gc_alloc_mature in boehm and null-gc instead of the
semantically different implementation we had before.
The current gc interface requires the GC to call mono_gc_out_of_memory on allocation failure.
It won't work if we move away from implementing it with mono_raise_exception as we need to manually bubble
the OOM all the up to the m2n border.
The good thing is that this simplified the gc interface and actually fixes a corner case bug in sgen where
it did not call mono_gc_out_of_memory on alloc failure.
Due to how JI table search works, tombstones must be malloc'd as they must have the same address range
of the JI they are replacing.
Since tombstones are heap allocated, they must be freed together with the chunks they belong to.
The current code free tombstones when the chunk refcount goes to zero. The freeing code identify
tombstones by looping through the chunk entries.
The problem is that, under heavy contention, a domain can have multiple tables live at the same time.
It happens there's another thread using the old table while the first creates the new one.
During that period of multiple live tables, we don't free JIs straight away, we queue them to be
freed together with the next table to go through it.
So far so good. Here's the problematic scenario:
1) We expand the JI table, there's contention and the old old is delay freed.
While doing it, chunk X is split. Meaning its refcount will remain 1.
2) JI Y that belongs to chunk X is freed, the tombstone is installed in a chunk of the new table.
That chunk *is not* X.
Since there was contention in (1), Y is put in jit_info_free_queue.
3) We run mono_jit_info_table_free for the old table.
3.a) We free all delayed JIs. Y is freed.
3.b) The old table is freed, chunk X will be freed too, since its refcount dropped to zero.
We walk X looking for tombstones, which includes a pointer to Y, which is freed memory at this point.
I found this issue to be possible with delegates being marshaled to function pointers.
Part (1) just requires a process with high activity, like XS.
Part 2 & 3 requires really bad scheduling in that once sgen restarts the world, the finalizer thread
runs before mono_thread_hazardous_try_free_some (done right after dropping the GC lock).
An alternate to bad scheduling is that the finalizer thread was suspended holding the domain lock and
now after restart, it forces the GC initiator to deschedule when it tries to get that lock.
It goes without saying that this bug is EXTREMELY hard to reproduce. It required me to change the runtime
to force all the above conditions to happen. Let me mention them in case someone needs it:
- In mono_thread_hazardous_free_or_queue, I commented the calls to try_free_delayed_free_item to avoid
freeing the old table too early. I changed the conditional so free_func is never called straight away.
- In mono_thread_hazardous_try_free_some I added a sleep of 100ms, this gave the finalizer thread enough
time to free some JIs.
Finally, the fix itself, the solution is pretty straightforward. Stop scanning chunks and store a singly
linked list of tombstones installed in a given chunk. We build that list by coopting next_jit_code_hash
for this use.
This is safe because chunks are ref counted so we know nothing else could point to those tombstones and
when we copy a chunk into a new one we remove all tombstones.
[Mono.Posix] Fix OSX build break by checking if accept4() is available
It's a Linux-specific extension and not available on OSX or Linux <2.6.28
/cc @steffen-kiess @jonpryor
@monojenkins merge
The messages contain useful debugging information which is unavailable
unless the mono runtime is recompiled. The debugging information is
particularly useful on mobile platforms and in test runs on bots.
The I/O layer trace messages can be disabled on compile time by
defining the DISABLE_IO_LAYER_TRACE preprocessor symbol.
This changes MonoHandleArena from a queue of chunks to a stack of
chunks. More importantly, the MonoHandleArena has an initial chunk that
is allocated on the stack together with the arena. Previously that
initial chunk was at the front of the list of chunks, but now it is at
the end.
Cprop can convert more binops to their _IMM counterpart, which would otherwise not be detected at method_to_ir time, allowing us to do strength reduction.
We allocate a temporary bb where we can emit the optimization of an instruction. After doing strength reduction, we verify if the bb has instructions, in which case we need to replace the original instruction with the optimized code.
The code in mono_arch_allocate_vars would set cfg->ret->dreg to cfg->ret->inst_c0
regardless. This is ok in some cases, but bad in others.
For OP_REGVAR this would do the right thing, dreg should be register that holds
that argument.
For when vret_addr is used, it would modify a var that is not used, so harmless.
For OP_REGOFFSET, inst_c0 alias with inst_offset, which is set to the offset from
RBP to read the var from. So we'd have a dreg set to, sometimes, a negative number.
This was not a problem as after mono_arch_allocate_vars only mono_spill_global_vars
is called and it only checks the dreg in the case of gsharedvt.
The fix is pretty simple, move setting from happening in all cases to only for OP_REGVAR.
The usage of is_gsharedvt_return_value is easier than having a separate storage as supporting
it would require changing all usage sites and this is only needed by start_call.
All incoming arguments in registers must be saved on the stack as the rest of the JIT
expects to be able to load them from their well known places. Without this change, it would
load a random value instead.
This was enough to get mscorlib to FullAOT with gsharedvt enabled.
Makefile.am.in:
Don't exclude GSHAREDVT from the tests.
Removed DYNCALL too, as it's supported too.
mini-amd64.c (mono_arch_init):
Register mono_amd64_start_gsharedvt_call jit icall.
mini-amd64.c:
Fix a typo in the ifdef guarding inclusion of the gsharedvt extension.
mini-amd64.c (mono_arch_emit_outarg_vt):
Implement decomposing of ArgGSharedVtOnStack to a simple store on the stack.
mini-amd64.h:
define MONO_ARCH_GSHAREDVT_SUPPORTED
Export mono_amd64_start_gsharedvt_call
tramp-amd64.c (mono_arch_create_sdb_trampoline):
Add missing mono_profiler_code_buffer_new call.
Add a couple of functions to !ENABLE_GSHAREDVT
aot-compiler.c (arch_emit_gsharedvt_arg_trampoline):
Implement it for amd64 as a pair of GOT loads (same for other archs).
[corlib] Remove left-over files from long ago (System.PAL/Linux)
They are no longer in use and cause confusion as they show up in search results.
@monojenkins merge
mono-context currently uses a mix of MONO_SIGNAL_USE_SIGACTION and
UCONTEXT_REG_RAX #ifs to determine whether ucontext_t is available.
UCONTEXT_REG_RAX is unreliable, and MONO_SIGNAL_USE_SIGACTION is
misnamed because it is nowhere used to gate use of sigaction.
Standardize on a new MONO_SIGNAL_USE_UCONTEXT_T, replacing SIGACTION.
processes.c contains implementations for module loading for several
platforms. Rather than scattering PLATFORM_MACOSX etc through the
file, pick a loader at the top of the file and base #ifs on that. This
makes BSD code clearer and makes it easier to special-case OS variants
where the normal loader is not available.
Bugfixes in mono-rand.c
2 commits:
* Make mono-rand consistent (fixes threadpool on some UNIX systems)
mono-rand.c defines a function interface and provides three implementations (Windows, modern UNIX, base C standard). The clients of this file (RNGCryptoServiceProvider.cs, threadpool-ms-io.c) appear to be consistent in how they use this interface, but the interface is not documented, and the C-only implementation deviates from it (the return value of init is different). The result is that threadpool-ms-io fails an assert when run on a system using the C-only implementation. I documented the interface and fixed the C-only quirk.
* Fix nonuniform distribution of mono_rand_try_get_uint32
mono_rand_try_get_uint32 returns a value in a range min..max inclusive. Due to a math error the ‘max’ value will be returned only one out of every 2^32-1 calls to the function. This is currently harmless because the only current callers of this function (in threadpool-ms-io) will run fine even if their max value is never returned, but it could become a problem later.
mono_rand_try_get_uint32 returns a value in a range min..max
inclusive. Due to a math error the ‘max’ value will be returned only
one out of every 2^32-1 calls to the function. This is currently
harmless because the only current callers of this function (in
threadpool-ms-io) will run fine even if their max value is never
returned, but it could become a problem later.
mono-rand.c defines a function interface and provides three
implementations (Windows, modern UNIX, base C standard). The clients
of this file (RNGCryptoServiceProvider.cs, threadpool-ms-io.c) appear
to be consistent in how they use this interface, but the interface is
not documented, and the C-only implementation deviates from it (the
return value of init is different). The result is that
threadpool-ms-io fails an assert when run on a system using the C-only
implementation. I documented the interface and fixed the C-only quirk.
We were seeing red builds on Jenkins because the NUnit xml was malformed when something bad happened
during the test_op_il_seq_point tests and Jenkins couldn't parse it.
To fix this, write the results into a temp file and only rename to .xml at the end when everything worked.
Additionally, fixed a small typo in cleaning the .so files.
Emulation used to happen at emitting time (method_to_ir). Now it is done after the copy propagation pass, where we propagate immediates and can do strength reduction on some of these ops. Because the call to the native function might imply an inlined wrapper which compiles more IL instructions, we need to run the decomposition pass again.
Mimic the behaviour of its counterpart, mono_op_to_op_imm, since crashing limits the usage of the function and it is the responsability of the upper layer.
By using the referencesource one, we remove a buggy part of the Process class. It will now simply use Stream.{Begin/End}Read, and not a custom implementation that introduces its own bugs.
[bcl] Deduplicate the SocketResponder test helper class.
A number of fixes were made to the version in System but these fixes were never applied to the System.Web.Services version. Merge the two and place the class in the test-helpers directory to avoid this sort of maintenance problem.
A number of fixes were made to the version in System but these fixes were never
applied to the System.Web.Services version. Merge the two and place the class
in the test-helpers directory to avoid this sort of maintenance problem.
We previously followed the spec semantics for these which meant weaker memory
barriers than MS.NET. However, since we've been importing large amounts of
code from the reference sources, it makes sense to switch these methods to
the MS.NET semantics as we don't generally audit the reference source code for
compatibility with our (spec-compliant) memory model. It's safe to assume that
most MS.NET code is written with the assumption of strong memory barriers in
these methods.
This reverts commit b3fa096e5e.
The Abort () call is problematic on many platforms and is no longer necessary
as we properly close the listening socket since 1103abf383.
Conflicts:
mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SocketResponder.cs
mcs/class/System/Test/System.Net/SocketResponder.cs
Before we only checked if IntPtr.Size == 8, but this returns false for a 32bit Mono running on a 64bit OS.
Added an icall that gets the correct value from the runtime instead.
Note: this currently only whitelists x86_64, aarch64 and ppc64 as 64-bit platforms.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=37414
This is used to Xamarin.iOS/Mac to wrap threadpool work in an NSAutoreleasePool.
Also open up corlib's internals to Xamarin.iOS/Mac so that the linker
doesn't have to be involved when accessing internal API.
The second member of struct timespec is actually called tv_nsec
(nanoseconds), not tv_usec (microseconds); this was likely
confused with struct timeval, where the second member is in fact
called tv_usec.
We were seeing persistent hangs in the threadpool-exceptions5.exe test on the Jenkins ARM machines.
Tracing the execution showed the following exceptions:
```
[0x7f65e3284700:] EXCEPTION handling: System.Threading.ThreadAbortException:
[0x7f65e3284700:] EXCEPTION handling: System.Exception: From OnCBFinished
[0x7f65e3284700:] EXCEPTION handling: System.ArgumentNullException: Value cannot be null. <-- from CultureInfo.CreateSpecificCulture()
Parameter name: name
[0x7f65e3284700:] EXCEPTION handling: System.Threading.ThreadAbortException:
exception inside UnhandledException handler:
... program hangs here ...
```
It turns out that the machines don't have the LANG/LC_ALL env vars set, resulting in a null string returned
from get_current_locale_name(). The code then tries to construct a locale from that and throws an ANE which is
normally catched and turned into the InvariantCulture.
However, in the threadpool-exceptions5 test the first time a CultureInfo is created is in the OnUnhandledException
event handler when calling ToString(). This means that an exception is thrown while we are in the unhandled exception
handler and the runtime apparently just stops there (despite the exception actually being catched, probably because of
the thread abort) so we never get to signaling the monitor object -> we hang in Main().
The fix is to not rely on catching the ArgumentNullException when we get a null locale, which is a better approach anyway.
To easily reproduce the issue before the fix, use the following (on Linux only, we don't use LANG for locale on OSX):
```
~/dev/mono/mono/tests$ LANG=C MONO_PATH=../../mcs/class/lib/net_4_x/ ../mini/mono-sgen --trace=N:nothing threadpool-exceptions5.exe
```
Note: If you pass an invalid LANG=foo, the hang is still there as we throw a CultureNotFoundException and hit the same issue.
As the behavior looks like a runtime bug to me I filed https://bugzilla.xamarin.com/show_bug.cgi?id=37547
Setting the priority before starting a Thread doesn't work right now as there's no handle to the native
thread at that point (the current implementation doesn't store the priority, it just tries setting it
on the native thread) so the test would remember the default 'Normal' priority instead of 'BelowNormal',
causing the test to fail later on.
Added an assert to verify that the thread priority can be set before starting and disable the test for now.
Note: variable names 'before' and 'after' were switched in the test, fixed those as well.
This adds supprot to the getline.cs library to provide popup windows with
completion results. There is a new public string property surfaced,
HeuristicsMode, that if set to "csharp" will trigger the completion window
independently of the "tab" character, based on the user input.
This mode triggers completion after the "." character is entered, and will
continue to trigger it as long as you type, or you backspace and the completion
succeeds. The heuristic also ignores scenarios like "1.2", so there is no
compeltion provided after entering numbers by default.
Perhaps we can later introduce a "OnKeyEntered" command that users could
use to provide their own heuristics to control whether to popup the window
or not.
- fixes#37305
- resource name can be general string and using it as path
might throw
System.ArgumentException: Illegal characters in path.
- it would be possible to check for the path's invalid characters in
the resource name. that would cause crossplatform issues
though.
various platforms have different invalid charactes sets for path
names. for example using assembly built on mac with embedded
linker blacklisting xml file, which's name contains characters in
its filename which are invalid on windows. so the windows built
app using that assembly would fail mysteriously, because the
important parts wouldn't be preserved.
thus we use just string comparison
mono is executed using the SCHED_RR policy, we will map POSIX priorities
to .NET priorities. Under this policy a thread running under this policy
which uses the SetPriority API will have its priority remapped and a
call to pthread_setschedparam() made to change its priority.
The following code fragment may be used to run a mono application
without requiring all root privileges other than the CAP_SYS_NICE
capability which enables priority manipulation:
void
runMonoRT(const char *const name, const int policy, char **argv)
{
const pid_t me = getpid();
struct sched_param param;
param.sched_priority = sched_get_priority_min(policy);
if (sched_setscheduler(me, policy, ¶m) == -1)
fprintf(stderr, "sched_setscheduler(getpid(), %s, { %d }): %s.\n",
name, param.sched_priority, strerror(errno));
else
execvp("mono", argv);
}
int
main(int argc, char **argv)
{
uid_t user;
cap_value_t root_caps[2] = { CAP_SYS_NICE, CAP_SETUID };
cap_value_t user_caps[1] = { CAP_SYS_NICE };
cap_t capabilities;
/* Get real user ID. */
user = getuid();
/* Get full root privileges. Normally being effectively root
* (see man 7 credentials, User and Group Identifiers, for explanation
* for effective versus real identity) is enough, but some security
* modules restrict actions by processes that are only effectively root.
* To make sure we don't hit those problems, we switch to root fully. */
if (setresuid(0, 0, 0)) {
fprintf(stderr, "Cannot switch to root: %s.\n", strerror(errno));
return 1;
}
/* Create an empty set of capabilities. */
capabilities = cap_init();
/* Capabilities have three subsets:
* INHERITABLE: Capabilities permitted after an execv()
* EFFECTIVE: Currently effective capabilities
* PERMITTED: Limiting set for the two above.
* See man 7 capabilities for details, Thread Capability Sets.
*
* We need the following capabilities:
* CAP_SYS_NICE For nice(2), setpriority(2),
* sched_setscheduler(2), sched_setparam(2),
* sched_setaffinity(2), etc.
* CAP_SETUID For setuid(), setresuid()
* in the last two subsets. We do not need to retain any capabilities
* over an exec().
*/
if (cap_set_flag(capabilities, CAP_PERMITTED, sizeof root_caps / sizeof root_caps[0], root_caps, CAP_SET) ||
cap_set_flag(capabilities, CAP_EFFECTIVE, sizeof root_caps / sizeof root_caps[0], root_caps, CAP_SET)) {
fprintf(stderr, "Cannot manipulate capability data structure as root: %s.\n", strerror(errno));
return 1;
}
/* Above, we just manipulated the data structure describing the flags,
* not the capabilities themselves. So, set those capabilities now. */
if (cap_set_proc(capabilities)) {
fprintf(stderr, "Cannot set capabilities as root: %s.\n", strerror(errno));
return 1;
}
/* We wish to retain the capabilities across the identity change,
* so we need to tell the kernel. */
if (prctl(PR_SET_KEEPCAPS, 1L)) {
fprintf(stderr, "Cannot keep capabilities after dropping privileges: %s.\n", strerror(errno));
return 1;
}
/* Drop extra privileges (aside from capabilities) by switching
* to the original real user. */
if (setresuid(user, user, user)) {
fprintf(stderr, "Cannot drop root privileges: %s.\n", strerror(errno));
return 1;
}
/* We can still switch to a different user due to having the CAP_SETUID
* capability. Let's clear the capability set, except for the CAP_SYS_NICE
* in the permitted and effective sets. */
if (cap_clear(capabilities)) {
fprintf(stderr, "Cannot clear capability data structure: %s.\n", strerror(errno));
return 1;
}
if (cap_set_flag(capabilities, CAP_PERMITTED, sizeof user_caps / sizeof user_caps[0], user_caps, CAP_SET) ||
cap_set_flag(capabilities, CAP_EFFECTIVE, sizeof user_caps / sizeof user_caps[0], user_caps, CAP_SET)) {
fprintf(stderr, "Cannot manipulate capability data structure as user: %s.\n", strerror(errno));
return 1;
}
/* Apply modified capabilities. */
if (cap_set_proc(capabilities)) {
fprintf(stderr, "Cannot set capabilities as user: %s.\n", strerror(errno));
return 1;
}
/*
* Now we have just the normal user privileges,
* plus user_caps.
*/
runMonoRT("SCHED_RR", SCHED_RR, argv);
return 0;
}
Fix a NullReferenceException in monop when printing a type name in a
namespace somewhere below System while working on a class which does not
have a namespace.
You must now add the -api-style parameter when running mdoc update for a set of classic or unified assemblies.
This was added in order to properly support types and members that exist only in one or the other set.
Previously, there was an assumption that all types and members would be reflected in both classic and
unified versions of an assembly.
Since we allocate los objects in page_size chunks, we randomly slide the objects within this space to have them start at different offsets. This improves caching behavior, especially when traversing multiple los objects at the same time.
When we concurrently drain the gray stack, we check to see if there are any blocks that need evacuation. If there aren't, we can drain the gray stack using functions that don't check evacuation related block information. As we do with the serial collector.
We were sometimes seeing the following failure on Jenkins on OSX:
```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.AcceptBlockingStatus : System.Net.Sockets.SocketException : Operation on non-blocking socket would block
at System.Net.Sockets.Socket.Accept () [0x00033] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/System.Net.Sockets/Socket.cs:896
at MonoTests.System.Net.Sockets.SocketTest.BlockingConnect (Boolean block) [0x0003e] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:129
at MonoTests.System.Net.Sockets.SocketTest.AcceptBlockingStatus () [0x0001e] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:147
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) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```
In non-blocking mode accept() is specified to return this error when no client connection is available right now.
It looks like on OSX we don't immediately get that connection.
To fix this issue, we try to accept in a loop for 100ms and only fail when we don't get a connection in this time.
While serializing operations with XmlSerializerFormatAttribute,
attributes xmlns:xsi and xmlns:xsd were not added to the message body.
XmlBodyWriter now adds the missing attributes.
Fixes#34413.
The CreateEncryptor_KeyNull and CreateDecryptor_KeyNull tests tried to verify the previous Mono
behavior of throwing a CryptographicException when a null key is passed to the methods [1].
However, with the move to referencesource this no longer happens since when a null key is passed
a random one is generated instead [2].
The existing tests passed out of pure luck because a different CryptographicException is thrown later on:
```
System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
at System.Security.Cryptography.RijndaelManagedTransform.DecryptData (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, System.Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) [0x007b5] in /Users/alexander/dev/mono/external/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs:751
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) [0x000bb] in /Users/alexander/dev/mono/external/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs:336
at MonoTests.System.Security.Cryptography.RijndaelManagedTest.CreateDecryptor_KeyNull () [0x00066] in /Users/alexander/dev/mono/mcs/class/corlib/Test/System.Security.Cryptography/RijndaelManagedTest.cs:233
```
Unfortunately, sometimes it happens with the random key that this exception *doesn't* get thrown as the padding is valid, which makes the test randomly fail on Jenkins.
Deleting those tests is the simplest fix.
[1] https://github.com/mono/mono/blob/mono-4.0.0-branch/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs#L107
[2] https://github.com/mono/referencesource/blob/33edf60ec4d35aba11850872777c8b3a484ca484/mscorlib/system/security/cryptography/rijndaelmanaged.cs#L66
We sometimes see the following exception in the ServiceModel tests:
```
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException (ExceptionResource resource) [0x00000] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/throwhelper.cs:99
at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00016] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/collections/generic/list.cs:1180
at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x00050] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/collections/generic/list.cs:1174
at System.Linq.Enumerable.FirstOrDefault[TSource] (IEnumerable`1 source, System.Func`2 predicate) [0x00041] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/System.Core/System/Linq/Enumerable.cs:960
at System.ServiceModel.Channels.Http.HttpListenerManager.TryDequeueRequest (System.ServiceModel.Dispatcher.ChannelDispatcher channel, TimeSpan timeout, System.ServiceModel.Channels.Http.HttpContextInfo& context) [0x00016] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpListenerManager.cs:93
at System.ServiceModel.Channels.Http.HttpListenerManager.TryDequeueRequest (System.ServiceModel.Dispatcher.ChannelDispatcher channel, TimeSpan timeout, System.ServiceModel.Channels.Http.HttpContextInfo& context) [0x000ab] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpListenerManager.cs:104
at System.ServiceModel.Channels.Http.HttpReplyChannel.TryReceiveRequest (TimeSpan timeout, System.ServiceModel.Channels.RequestContext& context) [0x00003] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpReplyChannel.cs:154
at System.ServiceModel.Channels.ReplyChannelBase+<BeginTryReceiveRequest>c__AnonStorey0.<>m__0 (TimeSpan tout, System.ServiceModel.Channels.RequestContext& ctx) [0x00056] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System.ServiceModel/System.ServiceModel.Channels/ReplyChannelBase.cs:129
```
I managed to repro this consistently on the debian-7-x64-1 Jenkins machine by running the test in a loop with the following code for about 15mins:
while [ $? -eq 0 ]; do make check FIXTURE=System.ServiceModel.Dispatcher; done
The problem happens when RegisterListenerCommon/UnregisterListenerCommon is invoked through HttpChannelListener.OnOpen/OnAbort/OnClose which modifies the 'Entries' collection on another thread.
The fix is to add locking around the collection accesses.
This works by using the imt entries in the vtable to store 'imt thunks', which in llvm-only mode, are C functions
which receive an info structure and the imt method and return the real method which needs to be called. Thus
interface calls are compiled into two calls: one to the imt thunk, and one to the method address returned by
the thunk.
We were sometimes seeing the following test failure on Jenkins:
```
Test Case Failures:
1) MonoTests.System.Web.UI.WebControls.WizardStepBaseTest.WizardStepBase_Theme : System.IO.IOException : Sharing violation on path /var/folders/wm/jvn0yl0d39q9sm9glcrhdrmw0000gn/T/tmp672264ba.tmp/App_Themes/Theme1/WizardTest.skin
at System.IO.File.SetLastWriteTime (System.String path, DateTime lastWriteTime) [0x00029] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.IO/File.cs:474
at MonoTests.SystemWeb.Framework.WebTest.CopyBinary (System.Byte[] sourceArray, System.String targetUrl) [0x00098] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs:364
at MonoTests.SystemWeb.Framework.WebTest.CopyResource (System.Type type, System.String resourceName, System.String targetUrl) [0x00059] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs:307
at MonoTests.System.Web.UI.WebControls.WizardStepBaseTest.WizardStepBase_Theme () [0x00000] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs:311
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) [0x00038] in /Users/builder/jenkins/workspace/test-mono-mainline/label/osx-i386/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```
This happens because System.Web.UI.WebControls/ThemeTest.cs copies the WizardTest.skin file to the same App_Themes/Theme1 path in its setup method.
Since we're not interested in any particular theme in WizardStepBase_Theme we fix this by just using a different theme name (WizardStepBase instead of Theme1) so the two test fixtures don't clash.
scripts/babysitter stdout logging improvements
Always print stdout log statements, even when all babysitter features
are turned off, even when the test suite does not support the protocol.
The babysitter script was failing to act as a GNU timeout replacement
because it was delivering signals to the spawned process only, whereas
GNU timeout would create a process group. This lead to a problem where
timeout kills by the babysitter would leave children of the spawned
process still running. To fix this, the babysitter script now follows
the exact steps that GNU timeout does (or as close as is possible in
Python). An attempt at a Windows process-group implementation is also
included, but I have not tested it.
Also changed the 'retry_support' key to 'babysitter_protocol' in the
JSON logs, because it was pointed out the old key was misleading (it
is true even when retries are deactivated).
- Using “iteration” for # of retries instead of ambiguous “passes”
- More clearly document what environment keys are for in-script
- Remove CRASH_RESUME key, make setting always true
- Print explicit human-readable messages for stdout log
The shim/bridge between Mono and the RS implementation of
XmlObjectSerializer, DataContractSerializer, etc. did not properly
invoke the constructor required by ISerializable, as it completely
omitted passing the populated SerializationInfo object.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=37171
We were seeing the following unhandled exception on Jenkins:
````
Unhandled exceptions:
1) MonoTests.System.ServiceModel.OperationContextTest.Current : System.NullReferenceException: Object reference not set to an instance of an object
at System.ServiceModel.Channels.NetTcp.TcpReplyChannel.OnClose (TimeSpan timeout) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels.NetTcp/TcpReplyChannel.cs:141
at System.ServiceModel.Channels.CommunicationObject.Close (TimeSpan timeout) [0x0001c] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:140
at System.ServiceModel.Channels.CommunicationObject.Close () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:131
at System.ServiceModel.Dispatcher.ListenerLoopManager.TryReceiveRequestDone (IAsyncResult result) [0x00027] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs:583
```
This happens because multiple threads can call OnClose() and so `client` can be null.
Fixed this by taking code from HttpReplyChannel.OnClose which handled this already and also fixed the race condition there (the checks need to happen under a lock).
[symbolicate] Make sure MONO_PATH is quoted
Without it we saw a " ./../../class/lib/net_4_x: Is a directory" error in the cygwin build.
@monojenkins merge
Before this commit string value starting or ending with this char was malformed because Trim removed also part of string value
Also fixed recent regression from 42c0a94445 which failed to split arguments if doubleQuote was inside singleQuoute
This was applied for the x86 build in 398c7fc21f.
Moved the check so that it applies to the x64 MSVC build as well.
We were hitting the same assert in mono_vfree() on Jenkins and this fixes it.
For local handles in coop suspend configuartions we need the idea of a
"critical region": a situation when transitioning from GC
Unsafe (running) to GC Safe (blocking) mode constitutes a bug. In
checked builds, we'd like to assert when that happens.
This PR adds MONO_PREPARE_GC_CRITICAL_REGION,
MONO_FINISH_GC_CRITICAL_REGION and MONO_REQ_GC_NOT_CRITICAL.
In regular build, these are nops. In checked build, they use a new
thread-local flag to prevent transitions from running to blocking.
I see two problems with our current automated PR tests:
- Many false negatives— PR tests often fail due to recurring failures
unrelated to the PR
- Information about what failed is awkward to retrieve, scattered in
multiple places
This commit adds a Python script, `scripts/babysitter`. Currently our
Jenkins test suites are each run wrapped with the `timeout` command.
The babysitter acts as a drop-in replacement for GNU timeout but adds
the following features:
- Logs machine readable output about each test suite (as
line-delimited json)
- If the test suite uses NUnit, can detect if a test case failed or
crashed (terminated mono in mid-test), and retry unsuccessful tests
(up to a limit).
The reasoning here is that tests which fail inconsistently are
currently most likely due to one of our outstanding recurring failures
rather than the change made in the PR. Therefore, if a failing test
succeeds on retry, the PR itself is probably valid (although the
failure should be logged and looked at).
In addition to the script itself, changes to NUnit were required in
order to support the retry feature and allow fine-grained logging for
NUnit suites.
Major TODOs:
- Add retry support for our non-NUnit-based test suites
- Save the XML files NUnit produces (since reruns stomp XMLs from
previous runs)
- Add some kind of sensible feature for dealing with timeouts
which uses gsharedvt out wrappers. We invoke the wrappers, and the
wrappers invoke the methods themselves. The advantage of this approach is
that the set of possible signatures for gsharedvt out wrappers is small,
so the set of runtime invoke wrappers needed to invoke them is also small,
thus only a small number of them need to be generated.
Not yet enabled.
System.Environment.SpecialFolder.CommonApplicationData returns /usr/share on OS X 10.11, which is now not a very good place to put things :) This patch changes this folder to /usr/local/share.
This change is released under the MIT license.
This is implemented by generating two wrappers for each concrete signature found in the assembly:
* an 'in' wrapper translates from the normal to the gsharedvt signature
* an 'out' wrapper translates from the gsharedvt to the normal signature
The wrappers take an extra argument, which points to a function descriptor, which is an <addr, arg> pair. They
make a call to ADDR which ARG as an extra argument. ADDR/ARG is either a gsharedvt method with an rgctx
argument, or another gsharedvt wrapper with a function descriptor argument.
All calls made out of gsharedvt methods with a variable signature use the gsharedvt calling convention. If the
callee is also gsharedvt, no wrapper is needed. If the callee is not gsharedvt, the call goes thought
a gsharedvt out wrapper.
Calls made from normal methods to gsharedvt methods go though a gsharedvt in wrapper.
* mini-generic-sharing.c (mini_get_gsharedvt_in_sig_wrapper): New function to generate gsharedvt in
wrappers as IL code.
(mini_get_gsharedvt_out_sig_wrapper): Ditto for out wrappers.
* method-to-ir.c (emit_llvmonly_calli): New helper function to make a call to a function descriptor.
(mono_method_to_ir): Make some indirect calls to MONO_RGCTX_INFO entries using function descriptors.
* aot-compiler.c (compile_method): Generate gsharedvt wrappers for the signatures used by the method.
* aot-runtime.c (decode_method_ref_with_target): Decode gsharedvt wrappers.
* jit-icalls.c (resolve_vcall): Rewrite this so it can handle gsharedvt as well.
(resolve_iface_call): Ditto.
(mono_init_delegate): Ditto.
(mono_init_delegate_virtual): Ditto.
* mini-trampolines.c (mini_create_llvmonly_ftndesc): New helper function to create a function descriptor.
(mini_add_method_wrappers_llvmonly): New helper function to add gsharedvt in/out wrappers, similar
to mini_add_method_trampolines ().
* mini-generic-sharing.c (mini_get_gsharedvt_wrapper): Return the newly added wrappers in llvmonly mode.
(class_type_info): Insert gsharedvt wrappers if needed. Some MONO_RGCTX_INFO types will now resolve to
function descriptors instead of function addresses.
(instantiate_info): Ditto.
Add mono_signature_full_name () helper function.
* debug-helpers.c (mono_signature_full_name): New helper function to stringify a signature, including
its return types as well.
Add beginnings for support for gsharedvt in llvmonly mode. Gsharedvt methods use a calling convention
where everything is passed and returned by ref, even normal types. I.e.
public int foo<T> (T t, int i);
becomes:
void foo (int *vret, T* t_addr, int *i_addr);
Not enabled yet.
* mini-llvm.c: Implement support for gsharedvt.
* ssa.c (mono_ssa_remove_gsharedvt): Same as mono_ssa_remove (), but only remove the
OP_VPHI nodes referencing gsharedvt variables, since they cannot be handled by the
llvm backend.
* mini-llvm.c (mono_llvm_create_vars): New backend function, similar to mono_arch_create_vars ().
* decompose.c (mono_decompose_vtype_opts): Decompose more opcodes in llvm mode so
opcodes using gsharedvt variables don't reach the llvm backend. Some, like OP_LDADDR and
vcalls, still do.
* method-to-ir.c (mono_allocate_gsharedvt_vars): New function to allocate gsharedvt locals,
extracted from mono_spill_global_vars () so it can be used in llvm mode too.
**The Scenario**: `mono-api-info` and `mono-api-html`, together, are a
useful way to track API changes over time, specifically to check for
accidental API breakage:
# Have a "known good" assembly version;
# keep reference/assembly.xml in version control
$ mono-api-info assembly.dll > reference/assembly.xml
# ...then on every new build, check for breakage:
$ mono-api-info assembly.dll > new-assembly.xml
$ mono-api-html reference/assembly.xml new-assembly.xml > assembly-diff.html
$ if grep '<p>Removed' assembly-diff.html > /dev/null ; then \
echo "ABI BREAK IN assembly.dll" ; \
cat assembly-diff.html ; \
fi
This is a very nice workflow, and has been used in Xamarin.Android to
track accidental API breakage for some time.
**The problem** with the above workflow are *implicit* references:
`mono-api-info` will happily look for dependencies in the same
directory as `assembly`, but it will *also* look for assembly
references in various system-specific directories, which is fine...
...until it *isn't* fine, e.g. if you have your own version of
mscorlib.dll that you need to use, *not* the system one, as your own
version may have API differences from the system mscorlib.dll which
are "percolated" into `mono-api-info` output. For example, on
"desktop" profiles, System.Attribute implements
System.Runtime.InteropServices._Attribute, and thus *all* custom
attribute types will have _Attribute listed as an implemented
interface. The Xamarin.iOS and Xamarin.Android mscorlib.dll,
meanwhile, does *not* have System.Attribute implementing _Attribute.
Consequently, changing the mscorlib.dll which is used while processing
an assembly will change `mono-api-info` output, resulting in "API
breakage" which doens't actually exist, because the wrong mscorlib.dll
was used to generate the original API description in the first place.
We need a way to control which mscorlib.dll/etc. are used. This can be
done by allowing specification of the assembly search directories, so
that we can "override" the default system-specific directory location.
**The solution**: Add a `mono-api-info -L PATH` option which adds PATH
to the list of directories that `mono-api-info` will search when
resolving assembly references. This allows "overriding" the system
directory location, as PATH will be searched for mscorlib.dll before
the system directory location.
Additionally, add a `mono-api-info -r ASSEMBLY` option, which will
pre-process ASSEMBLY (and all dependencies) and add the directory
which contains ASSEMBLY to the assembly search paths.
These two options are conceptually similar to `mcs -L` and `mcs -r`.
Finally, while adding support for these options, add support for
`mono-api-info --help`, so that we don't need to use only the man page
to get option information.
Because mono_thread_info_safe_suspend_and_run is locking the suspend lock, we cannot enter the blocking state in any of its callee, as that could lead to a deadlock.
The mcs/class/Microsoft.Build.Tasks make check contains a test whose
goal is to verify that Microsoft.Build.Evaluation.Project can run a
MSBuild code fragment which has an assembly reference. The assembly
referenced in the test is System.Drawing. However on many systems
System.Drawing does not work without special setup. The test should
reference a different assembly (I picked System.Runtime.Serialization)
because ensuring System.Drawing is working isn't relevant to the test.
Add the new 4.5.2, 4.6 and 4.6.1 versions to Microsoft.Common.targets so xbuild doesn't print "warning : TargetFrameworkVersion 'v4.6.1' not supported by this toolset".
Additionally I found a bug in the target where "and" was used instead of "or" which means the condition was never true, fixed as well.
icall for Remoting.RealProxy.GetTransparentProxy can sometimes attempt
to load an invalid class which is not previously loaded. Currently,
this leads to an assert failure in mono_class_proxy_vtable which does
not expect to be getting an invalid proxy class as input. Fix is for
the icall to load the class early and raise on failure.
A test is included.
[HttpConnection] Bug fix: HttpListener's "IgnoreWriteExceptions" property value is ignored when "Expect: 100-Continue" header set in request
That problem was discussed previously here: https://github.com/mono/mono/pull/2300
I want to offer alternative solution now.
In case all threads would wait on a Sleep or a Wait, the monitor thread would simply increase the number of max working thread, up to the point it would overflow the number of max worker threads.
OpenLiveWriter's build files break due to incorrectly parsing (".",",") as three arguments: a . and two " instead of two: a . and a ,
This is the error:
OpenLiveWriter/writer.build.targets: error : Error executing task WriteLinesToFile: Error converting Property named 'Lines' with value '#define FILE_VERSION $(BuildVersion.Replace(".",","));#define PRODUCT_VERSION $(BuildVersion)' to type Microsoft.Build.Framework.ITaskItem[]: Method 'Replace(., , )' arguments cannot be evaluated'
This patch ignores , as a separator character if it is inside ""
The problem is connected with "Listener" property of "context" object. It is null in "GetResponseStream" method, when it's called internally from "FinishInitialization" method of "HttpListenerRequest" class. This problem is possible only in situation when we have "Expect: 100-Continue" header from http client.
This change is released under the MIT license.
We didn't catch the regression that is fixed in a780c52749
because the tests didn't check the actual string or that an OOM is raised.
Add a new test for creating a large string (which works on 64bit Mono) to test a similar
codepath.
The "entries" collection in CacheEntryCollection can be modified while we're enumerating it,
which is not allowed. Add locking in FlushItems() to prevent this.
* Add explicit casts for void pointers and enums.
* Rename 'class' to 'klass' and 'this' to 'this_obj'.
* Avoid other C++ keywords by appending an underscore.
* Change MonoSeqPointInfo to avoid empty struct size warnings.
When a generic derived class has an open constructed base type, we have
to apply the type arguments in order to find the correct base definition MethodInfo.
When the base type of a generic type is an open constructed generic
type, GetBaseDefinition() must take the instantiation into account while
traversing the class hierarchy.
We just reverted a patch that prevented the FileSystemWatcher from
opening too many file descriptors (200). That was a band-aid at one
of the spots that opened too many file, as we would exhaust the number
of files, and later abort when some other operation needed files.
The problem is that OSX defaults to 256 file descriptors, and .NET
applications are file descriptor hungry, in fact, many applications
increase their file handled limit before starting.
This patch on OSX will attempt to increase the number of handles
available to 1024 if the number of handles avaialble is less than
that.
The commit that removed the limit was:
2af882232c
And it was closed to fix:
#28693
The .NET delegate removal semantic is a bit unpredictable. For example, the following (d1 + d2 + d3) - (d1 + d3) is going to return the d123 delegate, and not the d2 delegate as we could have guessed. This is because removal will remove the `list' of delegates as a whole, and not the elements in the list.
The previous implementation would then have a different behavior than the one observed on .NET.
Fixes bug #36646
We've seen that error for quite some time:
> `* Assertion at ../../mono/utils/mono-os-mutex.h:71, condition `res != EINVAL' not met`
It looks like there's a race between `finalizer_thread()` and `mono_gc_cleanup()` around
`reference_queue_mutex`. The source of the problem is, `finalizer_thread` could end up
being alive, although `mono_gc_cleanup()` made some effort to kill it and then destroys
`reference_queue_mutex`, while the finalizer thread is still using it in
`reference_queue_proccess_all()`.
> $ MONO_GC_DEBUG=bridge=Bridge MONO_GC_PARAMS=minor=split MONO_ENV_OPTIONS=--gc=sgen MONO_PATH=/home/lewurm/monoperf/mono/mcs/class/lib/net_4_x ../../mono/mini/mono sgen-bridge-major-fragmentation.exe --optimize=all --debug
> [...]
> [12/08/2015 01:49:31] done
> Shutting down finalizer thread timed out.
> * Assertion at gc.c:867, condition `finalizer_thread_exited' not met
>
> Stacktrace:
>
>
> Native stacktrace:
>
>
> Debug info from gdb:
>
> [New LWP 7623]
> [New LWP 7622]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
> 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> Id Target Id Frame
> 3 Thread 0x417ff430 (LWP 7622) "mono" 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> 2 Thread 0x42573430 (LWP 7623) "Finalizer" 0x0021482a in finalizers_with_predicate (predicate=0x1fd121 <object_in_domain_predicate>, user_data=0x37a348, out_array=0x42572c70, out_size=64, hash_table=0x338f68 <major_finalizable_hash>) at sgen-fin-weak-hash.c:581
> * 1 Thread 0x406c4250 (LWP 7620) "mono" 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
>
> Thread 3 (Thread 0x417ff430 (LWP 7622)):
> #0 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1 0x404371d8 in pthread_cond_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2 0x00242266 in mono_os_cond_wait (cond=0x346e98 <work_cond>, mutex=0x346e80 <lock>) at ../../mono/utils/mono-os-mutex.h:105
> #3 0x00242c1a in thread_func (thread_data=0x0) at sgen-thread-pool.c:118
> #4 0x40433fbc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #5 0x405a0b3c in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 2 (Thread 0x42573430 (LWP 7623)):
> #0 0x0021482a in finalizers_with_predicate (predicate=0x1fd121 <object_in_domain_predicate>, user_data=0x37a348, out_array=0x42572c70, out_size=64, hash_table=0x338f68 <major_finalizable_hash>) at sgen-fin-weak-hash.c:581
> #1 0x00214894 in sgen_gather_finalizers_if (predicate=0x1fd121 <object_in_domain_predicate>, user_data=0x37a348, out_array=0x42572c70, out_size=64) at sgen-fin-weak-hash.c:622
> #2 0x001fd16a in mono_gc_finalizers_for_domain (domain=0x37a348, out_array=0x42572c70, out_size=64) at sgen-mono.c:546
> #3 0x001ca2a4 in finalize_domain_objects (req=0x47ba68) at gc.c:678
> #4 0x001ca3b6 in finalizer_thread (unused=0x0) at gc.c:730
> #5 0x001a1392 in start_wrapper_internal (data=0x3b1100) at threads.c:713
> #6 0x001a1430 in start_wrapper (data=0x3b1100) at threads.c:760
> #7 0x0027097a in inner_start_thread (arg=0xbed58de0) at mono-threads-posix.c:92
> #8 0x40433fbc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #9 0x405a0b3c in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
> Thread 1 (Thread 0x406c4250 (LWP 7620)):
> #0 0x4043b5f4 in __libc_do_syscall () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #1 0x4043a396 in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0
> #2 0x000d1b24 in mono_handle_native_sigsegv (signal=6, ctx=0xbed58a80, info=0xbed58a00) at mini-exceptions.c:2235
> #3 0x00112424 in sigabrt_signal_handler (_dummy=6, _info=0xbed58a00, context=0xbed58a80) at mini-posix.c:218
> #4 <signal handler called>
> #5 0x405248e6 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
> #6 0x405330fe in raise () from /lib/arm-linux-gnueabihf/libc.so.6
> #7 0x40535956 in abort () from /lib/arm-linux-gnueabihf/libc.so.6
> #8 0x00277eaa in monoeg_log_default_handler (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, message=0x47bb28 "* Assertion at gc.c:867, condition `finalizer_thread_exited' not met\n", unused_data=0x0) at goutput.c:233
> #9 0x00277dca in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x3089b8 "* Assertion at %s:%d, condition `%s' not met\n", args=...) at goutput.c:113
> #10 0x00277e32 in monoeg_assertion_message (format=0x3089b8 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:133
> #11 0x001ca786 in mono_gc_cleanup () at gc.c:867
> #12 0x001c1d24 in mono_runtime_cleanup (domain=0x37a348) at appdomain.c:356
> #13 0x0001dec0 in mini_cleanup (domain=0x37a348) at mini-runtime.c:3560
> #14 0x000a672c in mono_main (argc=5, argv=0x358098) at driver.c:2065
> #15 0x00017c4e in mono_main_with_options (argc=5, argv=0x358098) at main.c:20
> #16 0x00017c7e in main (argc=4, argv=0xbed591b4) at main.c:53
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
When the nursery collector is starting and we have a concurrent collection in progress we need to save the global card table entries to the mod union card tables. When doing so we were marking all the mod union cards with either 0 or 1, so we could lose a mark if the concurrent collector tries to mark the same card at the same time, since the concurrent collector now runs concurrent even with nursery collections. We fix this by never marking with 0.
The concurrent mark no longer follows references into blocks that are evacuated. The cardtable is marked instead and all the objects will be moved during the finishing pause.
A small powershell command grabs the version number from configure.ac and uses it during winsetup.bat,
this way we don't have to manually keep them in sync.
Our implementation for System.Net.WebRequest takes proxy exclusions
which are in fileglob (*.example.com) format, and passes them to
System.Net.WebProxy as a "bypass list", which expects Regex format.
This means immediate failure if you have an exclusion with a fileglob,
because WebProxy will throw an exception for bad Regex format.
mono_os_sem_wait() used mono_os_sem_timedwait() before it was defined in mono-os-semaphore.h.
Moved the function to fix the cygwin build.
Also added a missing return statement in mono-os-mutex.h that was causing a lot of warnings.
This reverts commit 761a84f867, reversing
changes made to d565a22e16.
Corlib compilation was broken with the PR in so I'm reverting it until it can be worked out.
Unify the tls implementation across platform using a TlsImplementation structure which maps a potential pthread_getspecific implementation to the corresponding fastpaths. Some implementations might require an additional check of the kuser_get_tls kernel helper.
With C6 we introduced a regression
https://bugzilla.xamarin.com/show_bug.cgi?id=36100, which is caused by
the new static serialization code that we wrote to reuse Microsoft's
serializer.
The code uses Invoke on a series of MethodInfos, and this obscures the
actual code that will be invoked at runtime to serialize certain
objects, causing the following exception:
Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_bool_Nullable`1<Decimal> (object,intptr,intptr,intptr)' while running with --aot-only.
This patch makes the simple code work, but a more thorough review of
the code would allow us to remove many of the slow dynamic codepaths
in the serializer.
We opted for that approach to keep the code as similar as possible to the
original.
But the code basically does this:
* Use the XmlFormatGeneratorStatics property InternalSerializeMethod,
whose sole purpose is to delay computing the MethodInfo for the
XmlFormatWriterGenerator's InternalSerialize.
* Use the resulting method in a few places to call the MethodInfo.
The MethodInfo was used because the original code uses Reflection.Emit
to create fast serializers and it needs handles to internal methods,
but our static rewriter does not need it.
We should replace all of those uses, but for now, this patch at least
deals with the 36100 bug.
Discussed this with @lambdageek, we still see some of the tests timeout on Jenkins on the slow armhf/armel workers.
Let's see if bumping the timeouts helps.
As seen in the stacktraces provided in [1],
a thread could modify the Files hashtable
while other thread is enumerating it, so this
can be prevented by using a lock{} in the parts
of the code that access and modify this field.
Patch licensed as MIT/X11.
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=10205
It sometimes fails on Jenkins and google might be doing unwanted things (like redirecting to https),
so we just use example.org instead which hopefully is more stable in that regard.
When collecting candidate properties, look at the generic definition
when throwing away duplicates (hide-by-name-and-signature for properties
should look at generic definition) because inflating method could
conflate distinct signatures to the same one:
class Foo<T,U> {
public T this[T t] { get { return t; } }
public U this[U u] { get { return u; } }
}
The class Foo<int,int> has 2 indexers, not 1. They just happen to have
the same signature because T and U both got replaced by int.
While there were tests included for the [multiassembly option](https://github.com/mono/mono/pull/2127), unfortunately
the tests did not consider starting from an existing repository. So this patch
rectifies the issue by improving a small function to consider the possibility
of a null result. Test that reproduced, and subsequently proves the resolution
is included here.
Add comments, add assert for edge case around signal registration, and
make consistent *always* using atomic get/set for memory shared
between the signal handler and the threads.
* capget is not part of libc (libSystem.dylib) on iOS (or OSX); and
* There's no working Process class to invoke `ping` by itself leading to
[FAIL] DllImportTest.LackOfCapget : System.InvalidOperationException : Process has not been started.
at System.Diagnostics.Process.get_HasExited () [0x00039] in /Users/poupou/git/xamarin/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Diagnostics/Process.cs:184
It's technically possible to implement ping on iOS [1] so the code is
not totally removed from the build (API remains identical to existing).
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=964
/usr/lib/libsqlite3.dylib: 77 symbols
[NOT FOUND] sqlite3_column_database_name
[NOT FOUND] sqlite3_column_database_name16
[NOT FOUND] sqlite3_column_origin_name
[NOT FOUND] sqlite3_column_origin_name16
[NOT FOUND] sqlite3_column_table_name
[NOT FOUND] sqlite3_column_table_name16
[NOT FOUND] sqlite3_key
[NOT FOUND] sqlite3_rekey
note: XI has unit tests that will detect if those symbols are added in a
future version of iOS.
We would have the problem that array->vector != array + sizeof
(MonoArray), which would waste space and also lead to problems in
accessing the array elements.
This patch fixes rule violations found by the first batch of
mempool-reference audit points. The fix is to remove ambiguities in
what image owns or should own any particular generic parameter object.
Previously, there were four options for specifying a
MonoGenericParam’s image:
1. klass/method union in MonoGenericContainer.
2. image field in MonoGenericContainer.
3. image field in MonoGenericParam.
4. No field; “image” passed in to methods in at time of usage.
This patch removes 3 and 4; it preserves the image field from (2), but
merges it into the union from (1). It adds a new field,
“is_anonymous”, to indicate when the image member of the union should
be used. The single source of the “owner" union now always points to
the generic param’s image, directly or indirectly.
A further change is made to support this: Previously, containers were
optional, and the presence or absence of container was incidentally
used to determine whether an object was a MonoGenericParam or a
MonoGenericParamFull. Now, containers are mandatory for all
MonoGenericParams, so a new “is_small_size” bit in the container
tracks this information.
This change opens some sources of risk:
⁃ Code which creates MonoGenericParams now must make sure to
allocate a container early.
⁃ Code that accesses the MonoGenericContainer::owner field
must all be correctly updated to look for is_anonymous or there will
be a crash. (Much of this code would have previously used a NULL
container as the flag for “anonymous”).
⁃ Code that casts MonoGenericParams to MonoGenericParamFull
must use the is_small_size field.
⁃ Some generic containers will now exist with NULL type_params
and 0 type_argc. Code which reads the type param array must either not
receive objects from these containers, or must handle it.
⁃ If code by users of the embedding API exists which somehow
depends on particular behavior related to the now-unused image
argument of mono_class_from_generic_parameter, it will break.
I have audited code around, at least, the first three of these cases
and fixed what problems I found.
- New audit-point macro for atomic writes
- Check imageset list directly (instead of indirectly through image
list)
- Check dynamic images and have special rules for them (for the time
being we will allow dynamic images to point to non-dynamic ones
without auditing, long-term this is a FIXME)
- Print image names out with more detail (image sets get full names)
- Remove some #if CHECKED_BUILDs
- New g_assert_checked asserts for checked builds only
The following general-purpose enums and exception helpers were moved
here from Mono.Security.NewTls.Interface, which is going away.
* Alert, CipherAlgorithmType, CipherSuiteCode, ExchangeAlgorithmType,
HashAlgorithmType, TlsConnectionInfo, TlsException, TlsProtocolCode,
TlsProtocols.
* TlsConnectionInfo has been merged into MonoTlsConnectionInfo.
Note that you may not use 'using' statements for both 'Mono.Security.Interface'
and 'System.Security.Authentication' due to conflicting types. Use a prefix such as
"using MSI = Mono.Security.Interface;" or "using SSA = System.Security.Authentication;"
if you need both namespaces.
(cherry picked from commit af05134433)
Re-introduce Thread.Abort/Suspend/Resume so that we don't have to
create separate PCL profiles.
Instead make them throw a NotSupportedException, and add an
[Obsolete (error: true)] attribute so that these methods can't
be used from source.
There is a race condition in signal.c where a signal-waiting thread
can close the pipe and then the signal handler can try to write to it.
Introduce a locking mechanism to prevent this. Separate mph_int_set
and mph_int_test_and_set to support the lock code.
Switching to blocking should only be done when actually blocking (ex: mutex
lock, sem wait, cond wait, blocking syscalls), and not around a whole
section. This means that blocking can only be a leaf state, and we
should not switch from blocking to blocking mode again.
Most errors and warnings from c# compiler are reported in one line in format "FILE(LINE, COL): warning CS1234: Text".
But some warning span multiple lines:
/tmp/3fb23cc0/634d2022.0.cs(22,29): warning CS0114: `NS.B.F()' hides inherited member `NS.A.F()' ..
/tmp/3fb23cc0/634d2022.0.cs(16,29): (Location of the symbol related to previous warning)
Previously the second line was considered to be an internal compiler error since it doesn't match the error regex.
This seems to be only type of messages that span multiple lines.
This fixes#35980
If a attacker injects invalid content into the "host" header field like
"><script>alert(123)</script>
this content is now html encoded.
This prevents XSS attacks.
This reduce the size of System.dll and also removes some Win32 specific
p/invokes.
They cause native linking issues for tvOS as Xcode 7.1 does not allow
`-u` in bitcode-enabled builds so we have to call directly the symbols
and it must exists at (native) link time.
**Incomplete** (some remains) but enough so we can run LinkSDK and
System.Data unit tests apps (the managed linker can remove the rest)
In response to various customer queries, wondering why various libraries could not be found in our documentation. The libraries being added to the doc set are:
- System.Json
- System.Net.Http
- System.Runtime.Serialization
- System.ServiceModel
- System.XML.Linq
This reduce the size of System.dll and also removes some Win32 specific
p/invokes.
They cause native linking issues for tvOS as Xcode 7.1 does not allow
`-u` in bitcode-enabled builds so we have to call directly the symbols
and it must exists at (native) link time.
This cause native linking issues for tvOS as Xcode 7.1 does not allow
`-u` in bitcode-enabled builds so we have to call directly the symbols
and it must exists at (native) link time.
Xamarin.iOS and Xamarin.Mac uses this enum, and changing the values
causes us to break.
For Xamarin.Mac apps that do not bundle their mono, this would break
when the user updated their system mono.
This makes it easier to force Cygwin-brokered test suite runs to use MSVC builds of Mono, i.e. by overriding MONO_EXECUTABLE to .../msvc/bin/Win32/mono-sgen.exe
Some of the profiler projects are no longer needed since the corresponding pieces were removed.
Update sln to only build required projects by default and update configurations in projects.
Fixes the Win64 build on Jenkins.
If the reader execution in the try block fails, reader will stay null, but we later try to access reader.RecordsAffected. This raises a null reference exception which hides the original exception, making this particularly hard to detect.
Instead of having to use MONO_PREPARE_BLOCKING/MONO_TRY_BLOCKING in the
user code, we do it directly in this new mutex and semaphore coop API.
Using the mono_os_* locking functions should not be the default case, as
that could lead to longer than necessary time to suspend, and even in
certain cases to deadlocks.
Mono create_allocator accesses libgc private *_freelists directly.
These fields have been grouped together into struct
thread_local_freelists in BDWGC v7.
This commit does code refactoring to match the structure of external
GC regarding *_freelists.
* Move GRANULARITY, NFREELISTS (used by *_freelists) out of
GC_Thread_Rep.
* Move ptrfree_freelists, normal_freelists, gcj_freelists from
GC_Thread_Rep to struct thread_local_freelists.
* Add tlfs field (of type struct thread_local_freelists) to
GC_Thread_Rep.
* Update pthread_support.c and boehm-gc.c code accordingly.
Mono-specific libgc functionality has been recently added to BDWGC.
This commit changes API of included Boehm GC to match that of the
external GC.
* Renaming:
- GCEventType -> GC_EventType
- GC_get_restart_signal -> GC_get_thr_restart_signal
- GC_toggleref_register_callback -> GC_set_toggleref_func
- GC_set_finalizer_notify_proc -> GC_set_await_finalize_proc
* Replace global variable with a setter:
- GC_notify_event -> GC_set_on_collection_event() (acquires GC lock)
* Foreign threads registration:
- add GC_allow_register_threads() (no-op for GC v6, called by
mono_gc_base_init)
- add GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY, GC_UNIMPLEMENTED macros
- add struct GC_stack_base
- replace GC_thread_register_foreign(void*) with
GC_register_my_thread(struct GC_stack_base)
- define GC_register_my_thread also for Solaris and Win32
- GC_register_my_thread returns GC_DUPLICATE if already registered
* Toggle-ref callback declaration change:
- add GC_ToggleRefStatus (enum type)
- callback returns GC_ToggleRefStatus instead of int
* Toggle-ref addition status checked:
- GC_toggleref_add return type changed from void to int
- GC_toggleref_add returns GC_SUCCESS or GC_NO_MEMORY
- static ensure_toggleref_capacity() returns FALSE if GC MALLOC failed
- call g_error() if GC_toggleref_add failed
* Conditional public function declaration:
- wrap GC_DllMain declaration into ifdef GC_INSIDE_DLL
- define GC_INSIDE_DLL prior to include gc.h
On OS X and Mobile, the X509Chain will be initialized with all the
certificates from the X509CertificateCollection, but not actually
built.
ServicePointManager.ServerCertificateValidationCallback can use the 'chain' argument
to get all the certificates from the server.
(cherry picked from commit 73e37f0ecf)
This fixes a regression where ServicePointManager.ServerCertificateValidationCallback
was not called when using WebClient.
(cherry picked from commit 5022db1956)
If the SslStreamBase is disposed while a read or write operation is in progress, the asynchronous I/O state is never marked as completed, resulting in synchronous Read/Write calls never returning. To fix this, the internal I/O callbacks should mark the asynchronous operations as completed, possibly with an error, even if the SslStreamBase is disposed.
We were seeing some random test failures on Jenkins with our Dataflow implementation.
Replacing it with Microsoft's CoreFx version fixed those and makes us more compatible.
While we'd ideally not ship this assembly at all with Mono (it doesn't ship with .NET),
we shipped it in the past and as such people might rely on it so we can't remove it.
The CoreFx commit this version was taken is 905a1940bcda0afdca2f14ceb2b0161ebc4d1d02.
* TestDriver.cs Add `TestTimeout` utility to check how much time CI
allocated for the test.
* sgen-domain-unload-2.cs print warning if running low on time.
* sgen-new-threads-dont-join-stw.cs print progress dots and a warning
when running low on time.
* ICertificateValidator.SelectClientCertificate(): return bool, indicating whether
a certificate has been selected or the caller should use its default
implementation (if it has any).
* ICertificateValidator.ValidateCertificate(): new common function for both client
and server certificates; replaces ValidateChain() and ValidateClientCertificate().
* MonoTlsProvider.InvokeSystemCertificateValidator(): return bool, indicating whether
the certificate has been validator or the default system validator should be used.
(cherry picked from commit 42421eec1e)
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=31432
In a few android devices TimeZoneInfo.ParseTZBuffer was failing ito
parse Europe/Moscow with:
at System.ThrowHelper.ThrowKeyNotFoundException ()
at System.Collections.Generic.Dictionary`2[System.Int32,System.String].get_Item (Int32 key)mscorlib/system/collections/generic/dictionary.cs:176
at System.TimeZoneInfo.ParseTimesTypes (System.Byte[] buffer, Int32 index, Int32 count, System.Collections.Generic.Dictionary`2 abbreviations) [0x0002f] in mcs/class/corlib/System/TimeZoneInfo.cs:1293
at System.TimeZoneInfo.ParseTZBuffer (System.String id, System.Byte[] buffer, Int32 length)
It was failing while getting the third index [3] from] from abbrevs.
abbrevs added values were the following:
[0, MMT]
[1, MT]
[2, T]
[4, MST]
[5, ST]
[6, T]
[8, MDST]
[9, DST]
[10, ST]
[11, T]
[13, S]
[15, M]
[17, MSK]
[18, SK]
[19, K]
[21, EET]
[22, ET]
[23, T]
[25, MSD]
[26, SD]
[27, D]
[29, EEST]
[30, EST]
[31, ST]
[32, T]
Index 3 was not added because its values is an empty string, as indexes
with empty values are used in this case we are now adding them to the
abbrevs dictionary.
Fixes#31432
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=31432
Tests TimeZoneInfo.ParseTZBuffer with Europe/Moscow data that thrown
at System.ThrowHelper.ThrowKeyNotFoundException ()
at System.Collections.Generic.Dictionary`2[System.Int32,System.String].get_Item (Int32 key)mscorlib/system/collections/generic/dictionary.cs:176
at System.TimeZoneInfo.ParseTimesTypes (System.Byte[] buffer, Int32 index, Int32 count, System.Collections.Generic.Dictionary`2 abbreviations) [0x0002f] in mcs/class/corlib/System/TimeZoneInfo.cs:1293
at System.TimeZoneInfo.ParseTZBuffer (System.String id, System.Byte[] buffer, Int32 length)
This enables usage of JitHelper.UnsafeEnumCast<> with enums smaller than int.
This changes enables the intrinsic for int conversions of same reg class.
The coreclr-compile-tests would throw a shell error "Argument list too long" on OSX due
to the huge amount of tests passed to make in one go. The same happened for make clean.
We now compile and clean the three sets of coreclr test sources separately to avoid this.
Additionally, bump the coreclr reference and include a new test that was added upstream.
We were seeing random Dataflow tests fail on Jenkins from time to time.
I managed to reproduce the BroadcastBlockTest.CloningTest and WriteOnceBlockTest.CloningTest
fail on my machine by generating CPU load and running those test in a while(true).
Bumping the timeouts from 100ms -> 1s fixed the flakiness for me, so I went ahead and
opportunistically bumped all such small timeouts throughout the testsuite.
The `Sort<TKey, TValue> (TKey [] keys, TValue [] items, IComparer<TKey> comparer)` overload in Array throwed when keys.Length != items.Length.
However, on .NET you can pass in a keys array with fewer elements than in items and it'd sort the elements in items up to that point.
Fixed our implementation by only throwing when keys.Length > items.Length.
This was revealed by the coreclr/tests/src/CoreMangLib/cti/system/array/arraysort12.exe test.
I decided to port the test into our testsuite so we catch regressions earlier.
Roslyn used xunit-style xml by default, we hack the cibuild.sh script to output nunit-style
for now until we get an option upstream.
This allows us to catch those test results in Jenkins.
In addition to fixing the runtime, fix the test suite to correctly detect this problem.
This popped up because, for some reason, those two types have hashcodes that
don't return identity on reference sources.
If we force the finish of the concurrent collection, instead of waiting for the concurrent mark to finish followed by the finishing mark&sweep, we immediately stop the worker thread, change its object operations and drain the remaining gray stack, also following references to the nursery. This way we avoid the cardtable overhead in cases where there are a lot of references from heap to the nursery.
It tried to use CoreCLR but that doesn't work on Jenkins since some of the dependencies are missing there.
We actually want to ensure it's always using Mono so we can catch errors on our side, so we need this
hack until we have an option in the script upstream.
Remove an array idiom which both broke the GCC build (apparently Clang allows some things with variable-length arrays in "gnu99" mode which GCC does not) and wasn't right anyway (there was a typo which caused a read past end of buffer).
We now use our own archive with the few additional pieces that MS added to their copy of
Mono used by Roslyn CI instead of downloading their archive.
Also bump coreclr to get a fix for the GC test that would fail on Jenkins in.
This is intended to be used by MonoTlsProvider implementations; the ChainValidationHelper
now knows about the provider (unless it's invoked directly from user code).
(cherry picked from commit 2dbf0a0ed1)
With this mtouch will show:
> error MT2001: Could not link assemblies. Reason: Failed to process XML description: /work/maccore/master/maccore/tests/link sdk/extra-linker-defs.xml
> Failed to process XML description: /work/maccore/master/maccore/tests/link sdk/extra-linker-defs.xml
> Failed to resolve assembly: 'MonoTouch, Culture=neutral, PublicKeyToken=null'
instead of:
> error MT2002: Failed to resolve assembly: 'MonoTouch, Culture=neutral, PublicKeyToken=null'
which is a lot less helpful.
Mono.Net.Security/LegacySslStream.cs is the only file which should
reference the 'Mono.Security.Protocol.Tls' namespace.
(cherry picked from commit 43307ff086)
This allows us to customize test behavior that is different on Mono on purpose.
Sorting the files provides a much nicer output in the test runner.
Bump CoreCLR to include changes from 20789373370fe8f72dde01ad7ffc0816f618197c
We do not need a 'System.IO.Compression' facade assembly because we
already have a regular assembly with the same name, which contains all
the classes from here - either as actual implementation or as type-forwarders.
(cherry picked from commit fff7805794)
In particular:
- Issues with cref formatting for subtypes.
- Added support for Explicitly implemented members.
- Added support for generic member parameters.
A number of unit tests were added to verify this functionality.
The size of the gc_stackdata buffer was not a multiple of 8 bytes on 64-bits, so sgen_conservatively_pin_objects_from () would address invalid memory on its last iteration, as it progresses down the buffer by pointer size. The function also expects memory references to be aligned.
This is still not a guarantee that we are aligning memory references properly as two misaligns will still give the right size, but we can catch some of them here. Proper sizing is a smaller issue because we could always pad.
The problem happens when a thread is left suspended by mono-threads and sgen tries to suspend it.
The signal mask of sigsuspend call in mono-threads didn't include sgen's suspend signal, making
it impossible for sgen to suspend it.
The fix is to include sgen's suspend signal into mono-threads sigsuspend mask. This way sgen
suspend can nest over mono-thread's.
The opposite is not needed as sgen never leaves threads suspended when it finishes and it holds
the suspend lock the whole time, making it impossible for mono-threads to initiate any suspend operation.
In order to achieve this, when asked to do a major collection, we finish the concurrent collection immediately, regardless if we are explicitely requested or not to wait_to_finish.
On Jenkins we get a "make: execvp: /bin/sh: Argument list too long" error while executing the coreclr-runtest-basic target.
Since the shell doesn't like echoing our (very) big list of CoreCLR tests in one go, we need to split it up into chunks of
100 entries to hopefully avoid that.
This makes serialization consistent with deserialization (where the InnerException is already retrieved as System.Exception explicitly).
Additionally it may allow serializers more options in serializing inner exceptions (i.e. fall back to System.Exception if the specific exception is not serializable itself).
We don't need this here anymore since it moved to System.Runtime.Serialization.dll in
.NET 4.5 and 54f7c82d2b.
This copy is just confusing and not even built anymore, so delete it.
This is currently only supported on iOS and Mac (check 'CertificateValidationHelper.SupportsTrustAnchors')
and will pass a set of trusted root certificates to the OS validation function. Use for self-signed
certificates instead of providing a custom callback.
A bunch of tests were added in the upstream repo, add those to the source listings.
There's a suite of tests in the CoreMangLib folder which are mostly testing corelib,
added a separate target "coreclr-runtest-coremanglib" for it and renamed the existing
target to "coreclr-runtest-basic".
Build and link all cs testcases with the coreclr-testlibrary.dll which enables a
few more tests to run.
The actual validation code now lives in 'SystemCertificateValidator', whereas
'ChainValidationHelper' contains all the glue code which deals with 'ServicePointManager',
user-supplied callbacks, etc.
To do this, set the MONO_TLS_PROVIDER environment variable to either "default",
"newtls", "oldtls" or the full assembly-qualified type name of the MonoTlsProvider
(in this case, the class needs to derive from MonoTlsProvider and have a public
parameterless constructor and it needs to be installed in the GAC).
The idea is to get the address of the top of the stack, so passing a
value is meaninless. This was a typo. It also fixes libtest.c which
used an outdated signature.
This new method lets you create a 'HttpListener' and specify the X509Certificate2 to use
(so you don't have to put it into ~/.config/.mono/httplistener) as well as an optional
'MonoTlsProvider' and optional 'MonoTlsSettings'.
In SslStream.AuthenticateAsServer(), setting 'clientCertificateRequired' to true will ask for a client
certificate and - if the client does not provide one - invoke the 'RemoteCertificateValidationCallback'
with null and 'SslPolicyErrors.RemoteCertificateNotAvailable' - but resume the handshake if this callback
returns true.
The double.Epsilon value represent the smallest value that double is
able to represent. And that is diferent from the machine epsilon, which
is the smallest difference between two double values.
The second is equal to 2 ^ (-52), because there are 52bits to
represent the mantissa in a IEEE 754 double.
The race only happens on Posix with unified suspend.
The chain of event is the following:
- T1 suspend the world (calls `sgen_unified_suspend_stop_world`)
- T2 is async suspended
- T2 execute suspend_signal_handler:
- T2 finish async suspend
- T2->suspend_can_continue is set to FALSE as the thread is detaching
- T2 notify T1 via `mono_threads_notify_initiator_of_suspend`
- T2 is yielded (via the OS scheduler, or forced via a `sleep`)
- T1 returns from `mono_threads_wait_pending_operations`
- T1 does its stuff
- T1 restart the world
- T1 (or any another thread, except for T2) suspend the world (it does not
necessarily uses `sgen_unified_suspend_stop_world`)
- T2 is async suspended: incrementation of T2->suspend_count to 2, but it is
not signalled because it is already in ASYNC_SUSPENDED state
- T2 wakes up (for any reason) and execute compensation <- ERROR: suspend_count != 1
This race can happen because when async suspending, we notify the
suspendor before executing the compensation, in this case for a thread
which is detaching. By simply post-ponning the notification, just after
the compensation, we eliminate this race.
This shaved about 30 seconds off the time until the test-runner started on my machine compared to
passing the tests in the command line directly (we have *lots* of CoreCLR tests).
The test-runner crashed sometimes when running the CoreCLR testsuite with the following exception:
"System.ArgumentException: '', hexadecimal value 0x0F, is an invalid character." when trying to
emit the NUnit xml.
The stacktrace of one of the failing tests contained the character 0x0F which is invalid in XML,
we now filter out those invalid chars.
- this way the following xml will match all the types in the assembly
MyAssembly
<linker>
<assembly fullname="MyAssembly">
<namespace type="*" />
</assembly>
</linker>
before this change it will only match the types defined in main
module and none of the nested types
Some of the tests have both a test.il and test.cs in the same folder, which means we would
generate an .exe with the same name and overwriting one of them.
This is avoided by appending a _il suffix to the IL tests.
CHECKED_METADATA_WRITE_PTR - Use this to assign a pointer when it points from memory hosted by an image or imageset to another.
CHECKED_METADATA_WRITE_PTR_LOCAL - Use this to assign a pointer when it points from memory noted by an image or imageset to itself.
CHECKED_METADATA_WRITE_PTR_EXEMPT - Use this to assign a pointer in memory hosted by an image or imageset, but which the audit feature cannot correctly check at this time (this is the case when an image must contain a pointer to something that is not located in a mempool, such as a constant string). This is so that at least we know where these exceptions to the audits are.
In non-checked mode, each of these is a simple assignment. In checked mode, they walk the graph of references between images to make sure invariants related to ref_count are not violated.
`size_t` is unsigned, so using `-1` by default will always impose a
limit, and make binary protocol file names numbered, which is not
usually what you want or expect.
This would lead to leaked handle, and that would be visible when running
the test suite on Jenkins, with a "Too many open files" exception.
That also reverts the behavior to before 789808b507
This is part of the continued cleanup work for the mempool reference auditing feature. Separating the hashes prevents redundant work when iterating over hashes, something the reference auditor does a lot. External interface to image.c still behaves the same.
The behavior of the WebHttpBinding in case of SecurityMode ==
WebHttpSecurityMode.TransportCredentialOnly must use the http scheme, in
order to allow authentication of the client based on the standard HTTP
headers, like WWW-Authenticate: Scheme realm="" and so on. This behavior
is the default in .net;
We want to use the binary protocol to measure GC pause times in the
benchmarking suite. To make that easier and be able to go back and
(re-)benchmark older versions, we'd like the binary protocol format to
be backwards compatible.
There was still a race for the last processes, where we could not
correctly wait for them to exit, before closing the StreamWriter for
stdout and stderr.
The crash only occurs on Posix platforms.
The assertion error in `mono_threads_begin_global_suspend`
"pending_suspends != 0" arised because of a unproper use of the syscall
abort mechanism.
The signal would have to be send out of a global suspend context, but
in case the call to `mono_threads_pthread_kill` would fail in
`mono_threads_core_abort_syscall`, then we would add a pending
operation, thus increasing the `pending_suspends` counter. But as we
wouldn't call for `mono_threads_wait_pending_operations`, we would never
have a chance to decrement this counter. So next time we would try to
call `mono_threads_begin_global_suspend` we would hit this assertion
error.
The fix is simply to call the abort from inside a global suspend
context, and making sure to wait on pending operations afterwards.
This breaks Linux, because a shutdown will cause a recv/recvfrom on the
remote host to return without an error.
This would trigger in System.Net.Sockets.SocketTest.ConnectedProperty.
mono_threads_prepare_blocking, mono_threads_finish_blocking,
mono_threads_reset_blocking_start, mono_threads_reset_blocking_end all
take a stack pointer argument. Update the native and managed wrappers
to pass it to them.
- Rework in mempool.c: Have USE_MALLOC_FOR_MEMPOOLS work by tweaking existing rather than using an entire different path. Remove unused mempool field “rest”, stop assigning fields “pos” and “end” where unused. Removed unused function mono_mempool_empty. Fix off-by-one bug (>= vs >) in mono_mempool_contains_addr.
- Fix misc bug spotted by Rodrigo in aot-runtime.c: image of MonoGenericParam was always being set to corlib instead of proper image
- Add comments and replace inline constants with named constants in various places
1. Use the System.TypeSpec parser to parse components of the type name,
then call out to native code to apply the modifiers, as before.
2. TypeName and TypeIdentifier abstractions to hide display name / internal name strings
Update ModuleBuilder and TypeBuilder to use TypeIdentifier and TypeName
internally in all places that don't need to talk to native code.
3. Change ModuleBuilder.name_cache from Hashtable to Dictionary<TypeName, TypeBuilder>
This was functionality that changed mid-way through an implementation, and
was never removed. The underlying functionality changed direction and is now
a part of the `mdoc update`, and doesn't work in any way as originally planned ...
so I'm marking it as obsolete, and will completely remove it in a future release.
[merged by rodo from monodroid - the mentioned test is not included here]
Fixes: https://xamarin.desk.com/agent/case/35534
Commit 5ca3cb4b wasn't propertly tested (doh!).
The problem with Aes and AesCryptoServiceProvider is that there's a
cross-assembly dependency: Aes is in mscorlib, while
AesCryptoServiceProvider is in System.Core. The
PreserveCrypto.ProcessSystemCore() method didn't properly handle this
setup.
Fix the linker, and add a test to Hello.
WARNING: The test sucks. In particular, to "test" this fix you need to
run the app and then grep the `adb logcat` output for:
# DownloadDataTaskAsync complete; status=RanToCompletion; exception=
If the status is anything else, or the exception is non-null, it's
busted.
FURTHERMORE, it's only useful in Release apps, not Debug apps.
(No linker in Debug apps.)
The reason for the need to grep is that there's no sane mechanism to
wait until the Task has completed before checking the status of the
Task, and throwing an exception from within the continuation wouldn't
do anything.
FIXME: The real problem is that Task.Wait() blocks forever and never
returns. This needs further investigation.
https://bugzilla.xamarin.com/show_bug.cgi?id=12681
- when more than one "preserve" attribute is set (see IsPreservedAttribute),
make sure we handle all of them and not just last one
- fixes https://bugzilla.xamarin.com/show_bug.cgi?id=19391
- example code which suffered from this issue:
[Preserve(AllMembers=true)]
[DataContract]
public class TestClass
{
...
}
later when a method from this class was queried using the reflection,
it wasn't available as it was linked out
The acceptance-tests folder wasn't getting included in the tarball, adding the folder
to the SUBDIRS in the top-level Makefile.am fixes this. Additionally, EXTRA_DISTFILES
doesn't work outside of mcs/ so rename it to EXTRA_DIST.
Since we don't want a top-level "make check" to recurse into acceptance-tests just yet,
rename the check target to check-full so nothing gets run by default.
This commit integrates the CoreCLR, Roslyn and ms-test-suite (which is Xamarin-internal, but should just print a warning for someone without access).
Running the tests suites can be done with 'make check-coreclr', 'make check-roslyn' and 'make check-ms-test-suite', or all of them with make check in the acceptance-tests folder.
They won't run on a top-level make check though, which is intended until every test suite is fixed.
This uses a custom submodule system that doesn't rely on git submodules (which are annoying when the repo is large and we only need them for tests). Instead we can fetch repositories on demand.
History (before squashing into smaller chunks):
- Rename check-{testsuite} make target to validate-{testsuite}. The former can be easily confused with the "check" target that runs the tests.
- Move acceptance-tests Makefile to automake, so we can avoid hardcoding paths
- Copy System.Console facade to CoreCLR IL test directories. Otherwise most of the IL tests fail as they rely on the System.Console assembly reference.
- Update README.md to mention the tests
- Use $(MAKE) instead of plain make and pass -C instead of cd'ing to directory
- Exit when the repository can't be cloned and print a note about the ms-test-suite repo. The ms-test-suite repo is Xamarin-internal so it'll error out in public.
- Integrate MS CoreCLR runtime tests into Mono's test infrastructure
- Get rid of intermediate msg file and pipe straight to git
- Rename README to CONFIG since we don't store metadata in readme.md anymore
- Fix comparison in versions.mk to be sh compliant. It relied on bashism before.
Build the two libraries Mono.Security.Providers.DotNet and Mono.Security.Providers.NewSystemSource just like
every other class library instead of duplicating the logic into the subfolders.
This also fixes "make dist".
The issue can arise if the Process is going to run faster than the call
between Start and BeginOutputReadLine/BeginErrorReadLine. To increase
the chance of the race happening, insert a Thread.Sleep (1000) between
Start and BeginOutputReadLine/BeginErrorReadLine.
This race exists because the WaitForExit in the background thread in the
Process, will first wait the process to finish, then try to wait for the
output to finish, but it will be null as BeginOutputReadLine has not been
called yet, then try to wait on error (same issue as output), and finally
call the Exited event, which will close the stdout and stderr TextWriter.
The call to BeginOutputReadLine and BeginErrorReadLine will finally happen
(which is still correct as the output and error of the Process has not
been closed yet), then calling the OutputDataReceived and ErrorDataReceived
callbacks which will try to write to the closed stdout and stderr
TextWriter.
Simply enqueuing a ThreadPool work item, which will wait for the process
to exit manually, simply resolve this issue, as we guarantee that the
call to WaitForExit happens after BeginOutputReadLine/BeginErrorReadLine,
and is not racing with it.
Computing the X509Chain is not supported on OS X and iOS because the OS does
not give us access to the root certificates - this would throw an Exception
at runtime.
(cherry picked from commit 44d34a17c1bf305e39bcfc277cc7add48560d899)
(cherry picked from commit 504328ec43d9d917c1f140ecf89f253ab2be39ec)
The original rename in c4aa103e48 was done by accident,
the rest of the codebase still used the old name so disabling AOT didn't actually work.
Renaming this back to the original name and fix a few instances where methods weren't added
in the DISABLE_AOT case.
This allows a `--enable-minmal=aot` build to succeed and actually work.
The problem happens because thread_interrupt runs in the debugger thread (suspend initiator).
thread_interrupt then calls mono_thread_state_init_from_monoctx which collects the state of the current thread
which is definitely not what we wanted.
There used to be some compensation code after calling mono_thread_state_init_from_monoctx to actually init the state properly.
This is why it worked, at all.
Thew problem is that the debugger thread now might not attach at all under some circumstances, which would trigger
mono_thread_state_init_from_monoctx to return FALSE and trip into the assert.
The fix is to simply not use mono_thread_state_init_from_monoctx at all, just copy the state from data. This fix has the
bonus of getting the domain correctly.
Before .NET 4.5 dots were trimmed from the end of uri path segments.
In .NET 4.5 IRI parsing is enabled by default and dot are no longer
trimmed from the end of path segments.
This commit disables dot trimming when Uri.IriParsing is true.
Fixes#29864.
* Removed Mono.Security.Protocol.Tls.ValidationResult, use
Mono.Security.Interface instead. This is an API breaking
change, but you can fix your application by simply adding
the new using directive.
The rationale behind this is to avoid a dependency on the
Mono.Security.Protocol.Tls namespace when building and
related classes when building the new TLS stack.
* Enable ChainValidationHelper in WebConnection, LegacySslStream
and SslStream.
The custom conditionals that were previously required for the
mobile profiles are now gone as ChainValidationHelper already
handles that internally.
* This is an internal API, the public front-end is
Mono.Security.Interface.CertificateValidationHelper.
CertificateValidationHelper can be used to access the system
certificate validator on OS X and iOS; we do not compute the
X509Chain on these platforms as it's not supported by the OS.
(cherry picked from commit 9713f35878dd90fe87423b5052b4f82ddc0b87f0)
This will be removed again laster, but allows us to do a two-step switch
by first switching to the new ChainValidationHelper, then switching to
MonoTlsProvider and friends.
(cherry picked from commit f2e98e82f04dbaa72e48c37d72407000c197fbcb)
When comparing a string with null the other checks in the interpreter for type equality didn't catch this case
and this ultimately resulted in a NotImplementedException in EqualInstruction and NotEqualInstruction.
The fix is to handle the TypeCode.String case in those instructions.
We don't need to do it for CreateLifted() as that method only applies for Nullable<T> types which doesn't make sense for string.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34334
Make sure we always complete the async operations on error and
also send callbacks outside the lock.
(cherry picked from commit 9027f0ad28bf733ebb8ac9964c78c22853ca93c7)
So, I broke this on Android back in https://github.com/mono/mono/commit/d3726dcde9ef373157cd533ce8091cdde89dfa8e.
Turns out signal() is defined inline in Android:
static __inline__ __sighandler_t signal(int s, __sighandler_t f)
{
return bsd_signal(s,f);
}
So we need to hardcode the define in case we're on an Android platform.
Fixes BclTests on Android:
I/mono-stdout( 1200): UnixSignalTest
F/ ( 1200): signal() is not supported by this platform
F/libc ( 1200): Fatal signal 6 (SIGABRT) at 0x000004b0 (code=-6), thread 1215 (Instrumentation)
This fixes a race condition between the calls to Start and
BeginOutputReadLine/BeginErrorReadLine. This was triggered by the fact
that the call to WaitForExit (in StartBackgroundWaitForExit called by
Start_noshell) could be faster that the call to
BeginOutputReadLine/BeginErrorReadLine, leading to a null async_output,
which would make the WaitForExit call not wait for the output to finish.
This could make the call to Exited happen before a call to
OutputDataReceived/ErrorDataReceived.
To trigger this issue more reliably, you can simply add a sleep at the
beginning of AddInput in ProcessAsyncReader.
When switching to Mono.Net.Security.ChainValidationHelper, we will use
X509Certificate2Collection instead of MSX.X509CertificateCollection; keep
both version for the moment.
(cherry picked from commit 1f004d8e7a8391785d4ae8fcb0270f9be9d522c8)
This is a new internal wrapper class defined in
external/referencesource/System/net/System/Net/ServicePointManager.cs
It wraps the RemoteCertificateValidationCallback, capturing the
current ExecutionContext.
(cherry picked from commit c1695a55dc9a55f6b344bfc4c91991bd1f04c046)
Includes everything from Mono.Security.dll.sources except for the
new Mono.Security.Interface APIs, which are built inside System.dll
on mobile.
(cherry picked from commit df1adee67802417381280c097f3f8f17bbd48f66)
The `monotouch_runtime` profile is exclusively used for the monotouch
REPL assemblies used by Xamarin Sketches and Inspector. In those cases,
Console and Environment should behave just the same as in the
`monotouch` profile.
The only real difference between the two profiles should be the presence
of SRE in `monotouch_runtime`.
The new `multiassembly` option lets you run `mdoc update` on assemblies that
contain the same types. This can come into play when you have a set of assemblies
that run on different platforms, with a slightly differing API surface area on
each platform (for example: tvOS, watchOS, iOS); in this case you can maintain
all of the documentation in a single set of XML documents.
With this option enabled, an `AssemblyInfo` node will be added for every assembly
that a type is found in, in addition to every member. While this may seem verbose,
it's really the only way to capture the information about what assemblies a given
type or member can be found in.
Add a new HttpWebRequest.ServerCertificateValidationCallback property
(new .NET 4.5 / 4.6 API, not enabled yet) and read-only internal
ServerCertValidationCallback accessor (defined in the referencesource's
ServicePointManager.cs).
(cherry picked from commit ea9ed03863c730831c6fac393ed4dad3a94fb149)
The new internal constructor allows a per-request MonoTlsProvider and
related MonoTlsSettings; also expose these as new internal properties.
(cherry picked from commit 31988df75077c11ed87c77ab34e5b77b5913a32b)
The old SetCertificates() will be removed when merging the rest of
the work-newtls changes.
(cherry picked from commit 815731f2b7fd2f7384b8e16fcaf33f54d5ab6cb1)
It's an internal API that's used by the referencesource.
(cherry picked from commit 7fbd50ab52fc4cdf2fa9282ecd9d286ac48d9ba8)
(cherry picked from commit eb2f282d6f)
These should be considered internal APIs for the moment, even where the
classes are public (to avoid making internals visible).
(cherry picked from commit bec0257c97)
This picks up the internal 'ServerCertValidationCallback' class,
not the actual ServicePointManager implementation (we can't switch
to that yet).
(cherry picked from commit f5eeb5597a)
These two internal delegates are defined and used by the referencesource's SslStream
implementation; add them to our SslStream.cs version for compatibility.
(cherry picked from commit 0fbda4c3bd)
These should be used instead of MOBILE / MONOTOUCH / MONODROID to select
extern alias directives to make them work independently from the mobile profile.
* MONO_SECURITY_ALIAS: whether or not to use 'extern alias MonoSecurity'.
* MONO_X509_ALIAS: whether or not to use
extern alias PrebuiltSystem;
using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
* MONO_FEATURE_NEW_TLS: ignore, this is not enabled in the default build.
(cherry picked from commit 48b95ec304)
In file included from /Users/joao/Dev/droid/mono/mono/metadata/marshal.c:26:0:
/Users/joao/Dev/droid/mono/mono/metadata/marshal.c: In function 'mono_marshal_get_delegate_invoke_internal':
/Users/joao/Dev/droid/mono/mono/metadata/abi-details.h:29:43: error: 'MONO_OFFSET_MonoDelegate_rgctx' undeclared (first use in this function)
#define MONO_STRUCT_OFFSET(struct,field) (MONO_OFFSET_ ## struct ## _ ## field == -1, G_STRUCT_OFFSET (struct,field))
Roslyn used byref vars whenever possible to store fixed statements. This leads to confusion in
both the full verifier and the JIT built-in one.
Now we skip it in the JIT one and allow it when not in strict mode for the full verifier.
This fixes commit c74c64718d64ecc05ddec21d12313d840842a9c2; these
new internal APIs are required by the referencesource's version of
NetworkStream.
(cherry picked from commit 2905ed96d1)
Linux kernels before 3.9 did not support port reuse.
Added private method System.Net.Sockets.Socket.SupportsPortReuse,
which returns true when the runtime is able to bind to the same address
and port multiple times.
The two known ways to access the environment variables are no longer allowed Apple.
Until something blessed by them is found, we'll provide no way to list all the envvars
of the current process.
This is useful on WatchOS and TvOS as it's the only two platforms that
do not support signal based syscall abort. By calling shutdown, the
blocking syscalls on other threads will be interrupted. All the other
platforms currently support signals, so this will not change anything.
We cannot call Close, as this would let the OS reuse the FD for
something else, and the call to Receive (for example) on another thread
could fail with ENOTSOCK.
Unfortunatly it does not work for UDP based connection, as they are not
stream based, so Shutdown does not have much sense.
A continue statement in a do...while loop was skipping code to read the next line in a connection, causing an infinite loop.
Fixed by refactoring the loop, removing duplicated code.
We have been running into this issue: https://bugzilla.xamarin.com/show_bug.cgi?id=30018 a lot recently, after digging into getaddrinfo a bit we saw that the linked list of addrinfo structs had 1 or more valid ones which can be used and 1 bad one which should just be discarded.
As per RFC2821 section 4.5.2:
- Before sending a line of mail text, the SMTP client checks the
first character of the line. If it is a period, one additional
period is inserted at the beginning of the line.
Fixes [Bug 15153](https://bugzilla.xamarin.com/show_bug.cgi?id=15153) "System.ServiceModel.NetTcpBinding properties are not pre-initialized while they are in .NET causing interoperability problems."
Specifically the `reader_quotas` member of `System.ServiceModel.NetTcpBinding` is not initialized to a new `XmlDictionaryReaderQuotas` object which causes a "NullReferenceException: Object reference not set to an instance of an object." whenever an attempt is made to set any attributes of that property. For example: `using System.ServiceModel; NetTcpBinding binding = new NetTcpBinding(SecurityMode.None); binding.ReaderQuotas.MaxStringContentLength = 8192;` raises "NullReferenceException: Object reference not set to an instance of an object."
2015-06-16 11:44:02 -07:00
2586 changed files with 101440 additions and 500477 deletions
This directory contains acceptance tests, handled by optional non git submodule based submodules. Run the tests via "make check-full" (there are also targets for individual test suites).
The SUBMODULES.json file stores information about the submodules, and make targets are used to check out submodules, check their versions, and update the submodule information.
By convention, submodules repositories are at the same level as the mono repository.
Make targets available:
make check-<module> - Checks whenever <module> is checked out and matches the version in the info file.
make reset-<module> - Clones <module>if neccesary and checks out the revision specified in the info file.
make bump-<module> - Updates the revision stored in the info file for <module>.
make bump-current-<module> - Updates the revision stored in the info file for <module> to the current revision.
make commit-bump-<module> - Same as make bump-<module>, but commits the change.
make commit-bump-current-<module> - Same as make bump-current-<module>, but commits the change.
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
@@ -980,7 +976,7 @@ AC_ARG_WITH(libgc, [ --with-gc=included,none Controls the Boehm GC config, d
AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
@@ -2562,6 +2568,13 @@ if test "x$enable_nacl_gc" = "xyes"; then
AC_ARG_ENABLE(llvm-version-check,[ --enable-llvm-version-check Check that the LLVM matches the version expected by mono], enable_llvm_version_check=$enableval, enable_llvm_version_check=no)
AC_ARG_ENABLE(llvm-runtime,[ --enable-llvm-runtime Enable runtime support for llvmonly code], enable_llvm_runtime=$enableval, enable_llvm_runtime=no)
AC_ARG_WITH(llvm, [ --with-llvm=<llvm prefix> Enable the LLVM back-end], enable_llvm=yes,)
@@ -2608,11 +2622,17 @@ if test "x$enable_llvm" = "xyes"; then
AC_ARG_ENABLE(division-check,[ --enable-division-check Generate manual checks for division errors rather than relying on signals], division_check=$enableval, division_check=no)
@@ -3447,6 +3484,7 @@ AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to b
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=no])
AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=no])
AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=no])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
OPROFILE=no
@@ -3500,6 +3538,29 @@ AC_ARG_WITH(checked_build, [ --with-checked-build=yes|no Enable checked bu
fi
], [with_checked_build=no])
if test x$with_checked_build != xno ; then
DISABLED_CHECKED_BUILD_TEST=none
AC_ARG_ENABLE(checked_build_test, [ --enable-checked-build-test=LIST drop support for LIST checked build tests. LIST is a comma-separated list from: gc, metadata, thread.],
[
for feature in `echo "$enable_checked_build_test" | sed -e "s/,/ /g"`; do
Loaded 100 of 2586 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.