* socket-io.c (create_object_from_sockaddr): The resulting array size must
be two bytes larger than the sockaddr one since we always serialize the family
kind at the beginning.
This fixes a crash on MD-linux-amd64-mono-sgen-3.0 running unit tests.
Make the all check for exceptions if interrupted, and wait again
with a re-calculated timeout if no exceptions were to be thrown.
This fixes a deadlock in WaitAny, because WaitAny wasn't checking
for exceptions, just re-calculating the timeout. It also makes
the methods behave the same wrt other APC reasons.
* FieldInfo.cs:
* MonoMethod.cs:
* ParameterInfo.cs: Remove silly dep on UnmanagedMarshal to use
MarshalAsAttribute which is what we need in the end.
* icall.c:
* reflection.c: Use the custom attribute type instead of the SRE
one. This allows FULL_AOT_RUNTIME to work with stuff that uses
MarshalAs.
* Provide a more descriptive [Obsolete] message for the legacy API.
* Refuse to send the LM response unless explicitly enabled with
Type3Message.DefaultAuthLevel. The LM response is only actually
checked by old, pre-historic servers and sending it exposes the
user's password to very weak encryption.
* Fix some problems when encoding / decoding problems in Type2Message.
* Type3Message now encodes host and domain name in a case-sensitive
way, fixes the tests.
When reflecting a class which inherits serializable members from a
base class, the members of the base class must be serialized using the
namespace set in the subclass unless a namespace has been explicitly
set in the base class. Before the fix, the members were always
serialized using the namespace of the base class, even when not set
(in which case it was using the default empty namespace).
Fixes bug 8468 - XML serialization problem.
The problem was that we internally use Task.WhenAll inside TaskFactory.ContinueWhenAll to merge the given tasks into one that we can Continue on to run the passed arguments.
However, the behavior of WhenAll is to collect the exceptions that happened on its parent tasks and to set the aggregate on itself which was not catched by our continuation internally, leading to the exception remaining unobserved and escalating to the finalizer thread.
By default, we use NTLMv2 Session if the server supports it
and fall back to LM and NTLM.
The default behavior can be configured with the static
Mono.Security.Protocol.Ntlm.Type3Message.DefaultAuthLevel
property.
To use NTLMv2, you must explicitly set this to
NtlmAuthLevel.NTLMv2_only.
This is similar to the LAN Manager Authentication Level on
Windows (http://msdn.microsoft.com/en-us/library/ms814176.aspx).
*class.c (inflate_generic_type): When inflating (M)VAR we must
check if the replaced type is not void or typedbyref as both can
later lead to all sorts of nasty crashes or memory corruption.
This attribute gives us a horrible debugging experience when the
'Value' of the KeyValuePair is null. By using this attribute, the
user is told that the KeyValuePair itself is null when they inspect
something like 'new KeyValuePair<string, string> (null, null)'.
This is very confusing.
We should just let the ToString method be invoked, which returns a
nicely formatted string. This is also the behaviour observed when
debugging using Visual Studio.
ReadDone() now passes the 'WebConnectionData' instance to GetResponse()
and 'readState' has been moved into 'WebConnectionData'.
Abort() can now reset 'Data' while ReadDone() still uses the old
instance, but learns about the abort request from 'data.ReadState'.
* AuthenticationManager.EnsureModules(): Swap the order of the
modules, putting the strongest ones first.
* WebConnection.CreateTunnel(): Pass the proxy's address to
AuthenticationManager to support CredentialsCache. Only attempt
one single authentication method.
I've done some extensive testing with different squid configurations
(digest only, ntlm only, digest and ntlm, ntlm and digest) and the
.NET runtime only attempts one single authentication method.
If you provide credentials like this:
var proxy = new WebProxy (proxyUrl, false);
proxy.Credentials = new NetworkCredential ("user", "pass", "domain");
then these must match the server's first authentication method.
You can also use a CredentialsCache like this:
var ntlm_cred = new NetworkCredential ("u1", "p1", "d1");
var digest_cred = new NetworkCredential ("u2", "u3", "d2");
var cc = new CredentialCache ();
cc.Add (proxy_uri, "NTLM", ntlm_cred);
cc.Add (proxy_uri, "Digest", digest_cred);
var proxy = new WebProxy (proxy_uri, false);
proxy.Credentials = cc;
In WebConnection.CreateTunnel():
* Support multi "Proxy-Authentication" headers from the server.
* Pass a fake HttpWebRequest with method "CONNECT" to
AuthenticationManager.Authenticate(); the HTTP method is part
of the digest response.
* Add "Proxy-Connection: Keep-Alive".
This reverts commit dc6efdab29. This
patch completely regressed performance for regexes in the same class
as the regexes it fixed. Xamarin bug #6198 details the regressions,
and I've confirmed that reverting this commit fixes the 2 order of
magnitude performance drop (with the patch, the test takes almost 7
seconds, without it, it takes .07 seconds). The bug still needs to be
fixed, but this is not the right fix.
* System.Runtime.Serialization/XsdDataContractImporter:
Check ImportOptions.ReferencedCollectionTypes to determine the proxy type.
* System.ServiceModel.Description/MetadataImporter.cs:
Very simply implementation of the 'State' property.
* System.ServiceModel.Description/DataContractSerializerMessageContractImporter.cs:
Use it here.
* Test/Resources/WSDL: Added some sample .wsdl files for the new tests; adding
these as resources to the test dll.
* Test/System.Runtime.Serialization: Added WsdlHelper.cs,
XsdDataContractImporterTest2.cs and XsdDataContractExportTest2.cs
There is no bug report, the problem has been reported here:
http://stackoverflow.com/questions/12551090/monotouch-wcf-service-reference-cs-errors/12669880
DataContractSerializerMessageContractImporter.IsOperationImported()
did not check the method's return value, so it failed to recognize
methods such as
[OperationContract]
DateTime GetDate ();
as already being imported. This caused the method to be imported with
both the DataContractMessageContractImporterInternal and the
XmlSerializerMessageContractImporterInternal, but the latter does not
resolve type references, see the FIXME in that class.
I also added a new test case for this.
* method-to-ir.c (emit_array_store): We can avoid the type check
on stores to reference arrays as it turns out List<T> is not
covariant to its element type as I previously thought so.
* Array.cs: Add UnsafeLoad and UnsafeStore functions that don't perform bounds check.
The JIT will generate, when possible, direct a load/store. Right now the only case we can't
handle are stores to reference arrays.
Reference arrays are covariant on their element type which means that we must perform a runtime
type check on stores to preserve type safety. Since the type check is usually must more expensive
than the bounds check we simply ignore this for now.
The reasoning behind this decision was that given our initial target are corlib's collections and
they are too covariant to their element types they do need too a runtime type check on stores to ensure
correctness.
This is a partial revertion of master commit #9069d07, which was
backported into mono-2-10 in commit #bfa23f8.
I only reverted the change in line 716, keeping the rest of the
commit in place.
I also added 'async_thread.IsBackground = true'.
These methods could also use some more love; I filed a new bug #6904
about that.
Conflicts:
mcs/class/System/System.Net/WebClient.cs
* Implement "Interchangeable Collections" and Collection Interface Types.
(see http://msdn.microsoft.com/en-us/library/aa347850.aspx)
* Add element type check for arrays.
* Identify custom collection types (must have a public parameterless
constructor and an "Add" method with the correct argument type) and
distinguish them from types which implement one or more of the
collection interfaces without being a custom collection type.
* Add some checks for [CollectionDataContract].
* Added some NUnit tests for that.
It's frequently useful (and accidentally used) to have <c/> within
<returns/> blocks:
<returns>
<c>-1</c> at end of stream; otherwise the number of bytes read.
</returns>
Allow this to validate.
Background:
* Cookie.Port's property setter sets Version to 1, thus forcing strict
RFC 2109 compliance. This is also what the .NET runtime does when
assigning this property.
* When parsing the result of a web request, .NET 4.5 only sets Cookie.Port
when the Set-Cookie: header contains "Version=1".
* Google Chrome does not check cookie ports at all.
For instance:
ServiceHost host = new ServiceHost (typeof (Foo), new Uri ("http://localhost/echo"));
var b = host.AddServiceEndpoint (typeof (Foo), new BasicHttpBinding (), "/b");
should resolve into 'http://localhost/echo/b'.
This allows
HttpRequestMessageProperty request = new HttpRequestMessageProperty ();
request.Headers.Add ("Foo", "Bar");
OperationContext.Current.OutgoingMessageProperties.Add (HttpRequestMessageProperty.Name, request);
The code was already there, but disabled for the NET_2_1 profile.
The problem: Mono for Android 4.2.5 horribly broke SSL support:
http://lists.ximian.com/pipermail/monodroid/2012-September/012213.html
Why? Because of ad89f72f (kinda): As Mono for Android doesn't provide
or use its own set of SSL root certificates (opting instead to just
let Android worry about it), the `chain.Build()` method will ALWAYS
result in SslPolicyErrors.RemoteCertificateChainErrors being returned
from GetErrorsFromChain().
The world before ad89f72f "masked" this because errors & status11 were
always cleared if Android accepted the chain; however, clearing these
out masked other bugs, such as #5706 (in which https://74.125.224.134
is accepted as valid when it can't be valid, by definition).
The fix is to clear out SslPolicyErrors.RemoteCertificateChainErrors
if Android accepts the certificate chain. Any other errors are left
unchanged, thus keeping #5706 fixed.
* Updated the tests to reflect .NET 4.5's new improved behavior.
* Fixed subdomain matching rules.
* Added some very simple sanity checks, such as same origin and
public suffixes.
This is far from perfect, but the tests now pass with .NET 4.5
and this also fixes a Monotouch bug from one of our customers.
TODO:
* Using 'Cookie.Version = 1' (RFC 2109 compliance) apparently got
broken in .NET 4.5; I disabled the corresponding tests / made
them use the default 'Version = 0' where possible.
* Same origin has not been tested for security (it previously
didn't exist at all) and we should probably use the list at
publicsuffix.org; but .NET 4.5 also allows you to set a cookie
.co.uk (haven't tested their web stack, thoug - it's possible
that they have additional checks there).
The problem was triggered in a situation where threads were competing for the write-lock and were using timeout:
- thread t1 takes the lock (state = RwWrite)
- thread t2 tries to take the lock but fails because of t1, it registers it interest (state = RwWrite | RwWait) and goes to sleep
- thread t3 tries to take the lock but failes because of t1 and don't register any interest because t2 did it already (state = RwWrite | RwWait)
- t1 releases the lock, waking up t2 and t3 which race for it with t3 winning the race (state = RwWrite)
- t2 tries to go back to sleep but has overrun its timeout so it exits.
- with t2 exiting, it tries to remove previously registered interest (state = RwWrite - RwWait -> corruption).
We should use the dictionary setter instead of the Add method so that
we do not get an exception if the same Nth order dependency is found
multiple times
XBuild was adding both the primary references and nth-order references
to the ResolvedFiles output variable. This meant that dependent assemblies
were being added to the commandline passed to the compiler which caused
all sorts of issues.
Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=6708 and adds
tests to cover the changes to ensure they are correct.
The directory scanner was failing if the wildcard was the last item
on the path. Fix it, and also fix the excluded items detection to
make sure it checks the full path as well (paths may or may not be
rooted). Add a test for this.
Also, fixed Bugzilla 2239 where the copy task does not
behave the same as msbuild when a file being copied is
ReadOnly. msbuild resets the attributes of the file to
Normal in this case.
Don't depend on Environment.GacPath to figure out the framework
base path ("..../xbuild-frameworks"). This broke on fedora, where
it mapped to $prefix/lib/mono instead of $prefix/lib64/mono .
Which caused framework assemblies to be picked from "lib" instead
of "lib64".
* X509Certificate.cs: Do not throw a CryptographicException for "unknown
hash algorithm" when asked to verify a RSA certificate with dsaSHA1 since
this can happen when a bad/incomplete chain is being tested.
Fixes BCL half of: https://bugzilla.xamarin.com/show_bug.cgi?id=6501
Today I learned that the SSL certificate collection (as held in
X509CertificateCollection) is a potentially unordered sequence of SSL
certificates, which not all versions of Android will validate.
The fix is to use the properly ordered SSL certificate chain (as held
in X509Chain), and have Android validate that.
Sometimes the value the user passes in is converted to an XNode. In
these cases we need to use that XNode when emitting the change events.
Added a test covering this change.
Add tests to ensure the event is correctly emitted and correctly propagated
up the tree for the basic Add and Remove operations. Fixed the implementation
accordingly.
From now on, we will keep a global handle for lookups performed against the "__Internal"
library name. This will prevent multiple P/Invoke calls from calling mono_dl_open with
filename == NULL for each call.
Since Mono never calls mono_dl_close on P/Invoke lookups, this should not pose a problem.
* sgen-gc.c (try_calculate_minor_collection_allowance): For workloads with very high
survival rates the calculated allowance_target can overflow a mword on 32bits systems.
Given this behavior is unspecified and we've been bitten by it, let's take the safe
side and manually saturate it.
Preallocate the 256 different lines we might write to the assembly file
instead of allocating several strings for every line.
With compression mkbundle is about twice as fast now (since compression
speed hasn't changed), without compression it's 5-10x faster, depending
on the number of assemblies to embed.
* Socket_2_1.cs: When closing a socket we need to abort any
pending syscalls to that socket. For most syscalls the kernel
does it for us. But accept/connect on linux requires extra
love.
We previously used Thread.Abort to implement that, but this
is a pretty radical solution with very complicated ramifications.
So instead now we use a new icall cancel_blocking_socket_operation
that makes sure we only abort the syscall and do nothing else.
This reduces the trouble surface a lot given how tricky
Thread.Abort is.
* object.c (mono_message_init): Make sure the static field
we test fo check for initialization is the last to init or
we risk an abort due to others been null.
* System.Net/CookieParser.cs: Replace GetNameValue() with Parse(),
support multiple cookies, errors and "expires=Day, ...".
* Test/System.Net/CookieParserTest.cs: New nunit test suite for that.
What this fixes:
IF you were checking a regex which contained something like "(A|AB)C" and then you
checked something like "ABC" against it, it would fail previously, because its
first trip thru the regex it would match "A" first and short circuit out of the
"or" (|) then next try to match "C" but find "B" and fail. In this case, it should
be obvious that it needs to, after it fails, go back and try "AB" rather than "A"
and that's where this patch comes in.
Brief summary of each change in order that "git diff --staged" is giving them to
me:
This first one summarizes the background of goal of project:
New Function: EmitJumpTest
For when we are evaluating Alternatives (or's) we now want to be able to go back
and try or paths we haven't already tried if and only if we fail. This alternate to
EmitJump instead of jumping to target if we have a match immediately, will
on first attempt do the jump, but later if we have already tried this jump
combination, it will jump to ElseTarget, which is the equivalent of this test
failing on subsequent attempts with the same combination of 'or's passing.
RxCompiler:
EmitJumpTest isn't implemented for RxCompiler because i didn't have sample
code to test it on, so it falls back to a regular jump, nothing changes in
RxCompiler in other words other than having this required fucntion front.
arch.cs:
New OpCode added for JumpTest (see EmitJumpTest above)
compiler.cs:
EmitJumpTest added here for regular compiler, it now takes two arguments (two
items on stack) first was the standard where to jump to address, the second
argument is where to jump to in case where we have already tried this
combination)
interpreter.cs:
JumpTestEntry - What we keep track of to know if we've been here before, for
now i presumed just 'pc' (program counter') and 'ptr' (pointer - where we are)
were enough to tell us if we've been to this particular spot before.
Eval has been moved into Eval_Real
Eval if it gets called with parameters indicating we've already been here
(i.e we're being called recursively) just passes the call directly to eval_real
as-was.
Otherwise eval will loop on eval_real while we fail and haven't tried every
possible path through all the or's. (Note: The special case of where we're
running a 'test' (i.e. checking !(a|b|c) rather than just matching (a|b|c)),
and if we're running a test, we turn off JumpTestTracking while it's in its
recursive section. The reason for this is because while we can rightly check
all the options of (a|ab|abc) first for a then try again with ab then try again
with abc, we cannot do the same for a not (i.e. !(something or something else)
is really (not something AND not somtehing else), and it is not (not something
or not something else))
JumpTestList tracks our current run's JumpTest calls...
TriedCombo's tracks all the combos (all the JumpTestList results) that we've
already tried.
All calls to anything which calls Eval were modified to call eval passing
the optional new parameters that we now need, and remember if we call
eval with those parameters having a value, it will just forward the call
to Eval_Real.
This included modifying TryMatch because it calls Eval.
OpCode.JumpTest handler was added, what it does is first check if we need
to ByPass to jump to 'else' right away, which again happens when we're in
a test recursive call (Checking not, for example).
Next, it will create and populate a new JumpTestEntry with the current values.
It then calls CheckComboMatch() which sees if we match a combo already on file.
If we don't have a Match we jump to the first label (at pc+1) which is the
regular jump call. If we have a match, though, it will jump to the else label
which is now at (pc+2).
CheckComboMatch had to be broken up into two functions because it was going
too deep in terms of nesting. What it does by now should be somewhat understood
it will see if we have a match between our current run and previous runs, and
if we have a match, it returns true. If we don't have a match, it returns
false. I have some doubts about whether this function is 100% correct, there
may remain a bug or two, but it does pass all the "System" unit tests which
includes all the regular expression tests, plus it works for all the tests
in the bug report, so i have little reason to mess with it.
syntax.cs:
Here's where i modified so that when evaluating alternatives ("or"s or "|"s)
we instead call EmitJumpTest rather than just a regular EmitJump.
RegExBugs.cs:
This is the unit test (a bunch in one) which fails on mono without this patch
but succeeds with it
commit 48027ac2bdd9b60d18985ec2537eb188607f8164 1 parent 91c4180d55
This patch was originally submitted under another branch which had a bunch of
unrelated commits in it. I'm hoping if i did this right, these changes stand
alone.
qname in all but several cases (see bug report comments)
- Add separate list for known types to mimic behavior of the .NET
runtime
- Make previous test fixtures public so that the unit tests will be run
- Remove unused private method
- Add unit test for bug 4794
Make XmlCustomFormatter.cs more liberal about the date formats it accepts.
Many third party web services do not format date exactly at 'yyyy-mm-dd'.
The Microsoft implementation is more liberal about accepting other formats
and so the current Mono implementation breaks projects that consume third
party web services when they are ported to Mono.
Based on a patch by Aaron Roydhouse.
If the static constructor of a type has been run, the JIT can perform
some optimizations based on the actual value of static readonly fields.
This isn't possible in AOT mode, since the code won't be ran before compile
time: this option allows to set any number of static readonly fields to
a constant value so that the compiler can perform the same kind of
optimizations.
* sgen-gc.c Add verify-before-allocs and verify-before-collections experimental
options to perform heap verification at the many different points in the app.
This does check all pointers in the heap, so it's much much slower than
the previous option.
If the static constructor of a type has been run, the JIT can perform
some optimizations based on the actual value of static readonly fields.
This isn't possible in AOT mode, since the code won't be ran before compile
time: this option allows to set any number of static readonly fields to
a constant value so that the compiler can perform the same kind of
optimizations.
* mono-cq.c (mono_cq_add_node): Add a store store fence
between the two stores as they can be observed OOO.
* mono-cq.c (mono_cq_create): Use precise roots for head
and tail.
* mono-cq.c: Don't store to managed fields directly, use
MONO_OBJECT_SETREF. Don't memset a block of memory with
roots, use mono_gc_bzero.
This fixes random crashes in my sgen_par_tlab branch.
Hopefully all of them.
* sgen-gc.c (restart_threads_until_none_in_managed_allocator):
When suspending threads, if a given thread was suspended on
a gc unsafe point we restart it until it land on a safe zone.
Since we restart the thread, it might die before we get the chance
to suspend it again, we take this into account except when waiting
for acks. We mistakenly waited for the same number of acks of the
restart step. It could have been reduced if a thread died.
This bug is very very hard to hit as it only happens on linux,
requires that a thread on an unsafe point dies right after been
restarted and it must not be a managed thread as those must take
the GC lock while cleaning up.
This sums up to a mostly theoretical bug that someone might
have observed once in the wild. We're better fixing it now
since further optimization work might make it easier to hit.
* gc.c: If the finalizer thread is delay started
we must ensure that we don't block waiting for finalizers
until it is live.
This is required as the delayed start could happen in
the blocked thread - and deadlock us.
The nullable DateTimeOffset was not properly handled when serialized.
The deserialization changed to work with DateTimeOffset?.
Avoided "i:type" attribute when serializing Nullable type.
The problem occured when one waited for an event with the
cancellation token and the wait was successful but not
immediate. In that case Wait returned false instead of true,
because of wait handle number mismatch. Also the unit test was
added.
Conflicts:
mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs
* gc.c (finalize_domain_objects): When cleaning up a domain, we run two kinds of finalizers,
those that have already been queued and those for objects that remain alive.
A common problem we need to deal is that some finalizers allocate other finalizable objects
when doing seeminly trivial operations such as String.IndexOf - which might require the Thread
object of the finalizer thread to be instantiated.
We handle those new objects by draining the registered finalizers set until none shows up. This fails
if we run the queued finalizers after that.
The order onto which finalizers are run on domain unload is unspecified and the new behavior can
be argued to be more natural.
* sgen-gc.c (mono_gc_clear_domain): It's possible to have a finalizable object
survive mono_domain_finalize and leak into mono_domain_free, so we make sure this
won't crash by removing from the fin hashtable all objects that belong to the
doomed domain.
* class.c (get_implicit_generic_array_interfaces): When computing the interfaces
of Array::InternalEnumerator<T> don't use element_class for array types as we
only want to do that to drop from enum to base type and uint->int.
Fixes#3903.
threadpool.c (async_invoke_thread) :
1) Decrease the thread pool waiting count if the dequeue was successful.
2) Do not call dequeue_or_steal while gc skip thread is true.
The diff noise in Task.cs is just moving WhenAllCore and WhenAnyCore outside of their NET_4_5 region
Conflicts:
mcs/class/corlib/System.Threading.Tasks/Task.cs
mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs
When the 't' parameter was specified, we returned a 304 if the
timestamp matched the assembly timestamp, even if the client
needed the entire body. We were also setting the 304 response
cachebility as public to further mess things up.
Fixes the treeview in the class status pages.
On my (cursed?) MacBook Pro, calling
System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
results in an exception:
System.ArgumentException: length
at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0
at System.Net.NetworkInformation.MacOsNetworkInterface.ImplGetAllNetworkInterfaces () [0x00000] in <filename unknown>:0
at System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces () [0x00000] in <filename unknown>:0
Some printfs later, and we see why:
Array.Copy(array.Length=12, 3, array.Length=0, 0, 0)
Array.Copy(array.Length=12, 4, array.Length=0, 0, 0)
Array.Copy(array.Length=12, 4, array.Length=0, 0, 0)
Array.Copy(array.Length=12, 3, array.Length=6, 0, 6)
Array.Copy(array.Length=12, 3, array.Length=6, 0, 6)
Array.Copy(array.Length=12, 3, array.Length=8, 0, 4)
Array.Copy(array.Length=12, 4, array.Length=6, 0, 6)
Array.Copy(array.Length=12, 8, array.Length=6, 0, 6)
# BOOM!
(Apparently I have 8 interfaces: lo0, gif0, stf0, en0, en1, fw0, p2p0,
and vboxnet0.)
The problem is readily obvious: we're trying to read 6 bytes of data
when only 4 are available, and Array.Copy() complains appropriately.
The fix -- which looks to almost contradict a02076ba -- is to use
`sockaddrdl.sdl_data.Length - sockaddrdl.sdl_nlen` instead of
`sockaddrdl.sdl_data.Length - macAddress.Length` (or sdl_alen).
sdl_nlen is the offset into the source sockaddrdl.sdl_data array, and
in this case sockaddrdl.sdl_alen (the length of the destination
macAddress) isn't the same as sockaddrdl.sdl_nlen, hence the breakage.
* sgen-bridge.c: In additin to the per-class bridge check, restore the
per object one. The per-class one still a major win as it allows clients
to do the more expensive checks upfront.
* aot-compiler.c: If we call a sharable generic method that takes a parameter that
isn't shareable we must include that type or we risk failing at runtime.
Fixes#3735.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=3419
The problem is that OS X defines MAP_ANON but not MAP_ANONYMOUS, AND
MAP_ANON and MAP_ANONYMOUS have the same value. Furthermore,
create-native-map doesn't have any special support for constants with
the same value, so it emits the validation independently.
The result is that the following fails on OS X:
$ csharp -r:Mono.Posix.dll
csharp> int r;
csharp> using Mono.Unix.Native;
csharp> NativeConvert.TryFromMmapFlags(MmapFlags.MAP_ANONYMOUS, out r);
false
csharp> r;
The (hackish) fix is to provide MAP_ANONYMOUS on OS X, thus allowing
the existing validation logic to work as expected.
We have to convert the location of the control to screen coordinates
so that we end up with the correct screen in a multi-monitor setup.
This patch fixes Screen.FromControl, Screen.FromHandle, and
Screen.GetWorkingArea.
Change-Id: I6c4fd65833d012e832d97d610c79abc792e57adf
-Set the correct flags when the domain is not set. This fixes
authentication with an empty or null domain name.
-Allow domain\user and domain/user as the user name and set domain and
user accordingly.
The search code was taking care of hash collision for different objects inside the collection but it didn't handle properly the case where the supplied search key has the same hash than a different object inside the collection.
System.Data.Services.Client uses System.Resources for localization
purposes (even though only one language is provided...). Consequently,
to get _useful_ strings (read: error messages) out of
System.Data.Services.Client, System.Resources needs to be able to find
them, such that the following works:
$ csharp -r:System.Data.Services.Client;
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using System.Resources;
csharp> using System.Data.Services.Client;
csharp> var a = typeof(SendingRequestEventArgs).Assembly;
csharp> var r = new ResourceManager("System.Data.Services.Client", a);
csharp> r.GetString("AtomMaterializer_PropertyNotExpectedEntry");
If `r.GetString()` fails, it'll throw an exception instead of
returning a useful string, which is bad. Unfortunately, it failed.
To fix this, we use `resgen` to compile
Client/System.Data.Services.Client.txt into a .resources file and
compile the .resources file into the assembly with `gmcs -resource:`,
which allows the above `csharp` fragment to work w/o throwing (and
thus allows OData users to get useful, meaningful error messages).
(1) Consider the following example code:
WebClient client=new WebClient();
If you examine the client.Proxy property when running this code in .NET you will see, that the Proxy property reflects the current system proxy settings. However, Mono initializes the Proxy property in OpenRead()
(2) Mono's implementation of the WebClient.Proxy property described in (1) has a disadvantage. To understand that, consider der following example code:
WebClient client=new WebClient();
client.Proxy=null;
Explicitely setting the Proxy property to null ensures that .NET does not use any proxies when calling further methods of the client object. My patch provides exactly this functionality for Mono's WebClient when using the http or ftp protocol. This functionality can be very interesting for a lot of scenarios.
The problem was two folds. First, a parent task wasn't correctly waiting on the inner task continuations that were setup. Second, the way the Task parent field was re-used with a continuation collided with the parenting behavior of AttachedToParent (if the continuation was also created that way), the fix is to have two Task fields to differentiate between the two cases.
The metric for deciding when to trigger a major collection assumes
that there's unlimited memory, so it does, especially since it's
probably buggy and certainly not very smart, sometimes allow too much
allocation to happen. This new option is a way to tell SGen where to
draw the line. Note that memory will still be allocated, it's just
that once the limit is overstepped, major collections happen more
frequently to keep memory usage down.
* class-internals.h (mono_class_has_parent): Convert this macro into
an inline function that guards against non initialized supertypes info.
Fix random breakage all over the place.
* class.c (mono_class_setup_parent): We can't setup supertypes here
since we might be initializing our parent as well, which will cause
the current type to have broken values.
Since we're lazier, we need to check for it in more places.
Fixes bxc #795.
Console.BufferHeight and Console.BufferWidth were returning incorrect values after a terminal window resize on Linux (bug 874). I added CheckWindowDimensions calls to the getters of these properties to ensure that the values are up to date.
Fixes: http://bugzilla.xamarin.com/show_bug.cgi?id=1164
The breakage reported in #1164 was caused by commit 106fdeb4, which
fixed bxc206. The problem is that in fixing bxc206, response messages
of a type having a MessageContractAttribute custom attribute were
changed to have a `void` return type, according to the
MessageDescription's Body.ReturnValue.Type property.
This fix is correct, in that it's what .NET does, but it broke XML
deserialization which expected the "actual" return type to exist, not
`void`.
Case in point: the added IService1.EndJSMGetDatabases() method will
have a MessageDescription with a Body.ReturnValue.Type=typeof(void).
The problem is that deserializing this message will fail:
System.Runtime.Serialization.SerializationException: Deserializing
type 'System.Void'. Expecting state 'EndElement'. Encountered state
'Text' with name '' with namespace ''.
Obviously this is not good. ;-)
The fix is simple: don't use the MessageDescription's ReturnValue if
it's `typeof(void)`.
There are two added wrinkles:
1. Writing a test case for the above.
2. The test case broke with another error: a NRE within
BaseMessagesFormatter.MessageObjectToParts(). This is because
when ContractDescriptionGenerator.GetMessage() sets the
ReturnValue for a response message, it doesn't set
MessagePartDescription.MemberInfo.
BaseMessagesFormatter.MessageObjectToParts(), meanwhile, was
checking the ReturnValue's MemberInfo...which was null.
Add a null check here so that the actual bug can be tested.
For reasons I currently can't explain, the Service1Client test type
appears to support having only one async operation "in flight" at a
time. As a result of this, calling multiple Async methods on the
Service1Client instance, as was done previously, would result in not
all of the event handlers being invoked, and the test timing out
after 60s instead of exiting quickly because all event handlers had
been raised.
I don't understand enough of WCF & this code to say why Service1Client
can have only one async operation in progress at once, but making this
change so that each async operation operates on a separate instance
speeds up the Bug652331_2Test execution from 60s to 5s.
When using PUT as the method to upload a file using WebClient, the file
is uploaded as-is, without the multipart boundaries, headers,...
Fixes bug #2970.
This helps the GC by minimizing the stack area to scan, while at the
same time reducing the chance of false positives when scanning the stack
for managed objects since we know no managed object can live on the
stack above the main function. This improves memory usage for the test
case in #2619 quite much (but that particular bug isn't fixed by this).
* sgen-gc.c: Critical regions only requires proper visibility
on the enter side. On the exit side all we need to make sure is
ordering.
* sgen-gc.c: Allocation don't need to have all stores imediatelly
visible, only properly ordered when it happens.
* mono-memory-model.h: Release semantics must cause the store buffer
to be flushed on x86. Add variants of atomic_store that only provides
sequencing with previous stores.
* sgen-gc.c: The bridge code is split into 3 steps, one done when we collect finalizable objects,
one done before we restart the world and the last right after.
The first step can be executed twice if an overflow major collection happens. We handled this
situation by avoiding duplicates in the registration code.
This works fine except if a registered bridge object is moved by the second collection, which can
happen when defragmentation kicks in.
Instead of fixing those pointers, which is quite tricky, we move hash building to happen in the second
step and discard all elements on the registered bridge array before each collection. Since all bridges
collected by the first collection will be collected again on the second, we can do it.
* mini-generic-sharing.c (mono_class_get_runtime_generic_context_template):
When initializing a new rgctx template, we fill it with its parent
slots.
When the parent is a non generic class extending a generic class,
has multiple templates and, finally, the first template has more
slots that the rest, we would fill more entries than we should
and later cause an assertion when trying to use those extra slots.
To fix that we handle it just like a generic parent class and
count the number of slots each template has.
Fixes bxc #1147.
Fixes DataContractJsonSerializerTest.DeserializeArray() in the NET_2_1
profile, which is also the MonoTouch and Mono for Android base.
The problem is JsonSerializationReader.DeserializeGenericCollection:
Type listType = collectionType.IsArray ? typeof (List<>).MakeGenericType (elementType) : null;
var c = (IEnumerable) TypeMap.CreateInstance (listType ?? collectionType);
// `c` is a List<T>
...
ret = collectionType.IsArray ? ((ArrayList) c).ToArray (elementType) : c;
// yet we cast `c` to an ArrayList?!
This dies with an InvalidCastException on Mono for Android/MonoTouch,
as List<elementType> is not an ArrayList. The solution is to further
separate out the code paths, ensuring that NET_2_1 avoides the cast.
* mini-generic-sharing.c: Add mini_type_is_reference
that returns true for VAR and MVAR if compiling under
gsharing.
* method-to-ir.c: Replace usage of mono_type_is_reference
with mini_type_is_reference.
* mini-gc.c: Ditto.
* mini.c: Ditto.
With the old behavior, the JIT could interpret a (M)VAR
variable and not been a reference type. This is an issue
for sgen as we could forgot to emit some write barriers
or generate the proper stack map.
Clone input collection for ObservableCollection<T>. Fixes#2169
The commit has been modified from a04edc9d to remove the added unit
tests, as these cause merge conflicts with the mono-2-10 branch (as
the mcs/class/System/Test/... tests don't exist in mono-2-10).
The existing code had a special code path for handling nullables that
ignored the DataType component.
This patch splits the nullable test away, allows the specified XmlDataType
to be probed and then performs the standard type lookup mechanism.
This allows this:
[XmlElement ("MyNullableTime", DataType="time", IsNullable=true)]
DateTime? myTime;
To be serialized as a "time" instead of a "datetime".
Fixes bug #329
We can't redirect output from gdb: since gdb will suspend us we won't
be able to read from the pipe we've redirected output to, and we'll
end up deadlocking if gdb outputs a lot of data (see bug #2548).
* sgen-bridge.c:
* sgen-gc.c: After we split bridge processing in two, one step with world stopped and
another with world running, we introduced the following regression:
A minor collection starts and find an young bridge object ready to be processed.
Major heap overflows and a major GC is triggered. The object mentioned above will
remain collectible and will be queued for processing again.
Since we do the first step in finish_gray_stack, it will be done twice in the above
scenario. This will cause an assertion due to duplicate entries in the hashtable.
The solution is to split the step that is performed with world stopped into another two.
One that happens during collections, that can be done multiple times per duty cycle and
another one that is done only once before we restart the world.
This split has the minor advantage of reducing duplicated work for the dfs1 step. Nothing big
as this is one of the fastest steps.
* domain.c: Use mono-tls for the current domain variable.
Sgen depends on this so it has to be lock free and the
io-layer version is not.
Fixes bxc #2326
* sgen-cardtable.c (sgen_card_table_mark_range): The number of
pages to be marked must be correctly calculated to avoid the case
when the in-card offset of the start address is bigger than
of the end address and cause the last card to be skipped.
Fixes#1917
* sgen-gc.c (mark_ephemerons_in_range): All ephemeron arrays
must be scanned during a nursery collection since we ignore
them during remset processing for a good reason.
In the future we should use cardtable information to avoid
scanning the whole thing.
Fixes bxc #1175.
Mono for Android uses Mono 2.10 + smcs to build code, which thus uses
an smcs built against the Mono for Android profile assemblies, which
would thus be built with MONODROID defined. Thus (understandably) dies
at runtime with a DllNotFoundException, as liblog.so can't be found.
Fix smcs.
7e49d08a nee 2763aae9c doesn't build because <fcntl.h> is missing:
mono/utils/mono-proclib.c:517: error: 'O_RDONLY' undeclared (first use in this function
Fix the build.
In Mono for Android, stdout and stderr (file descriptors 1 and 2) are
only visible when debugging within MonoDevelop and/or Visual Studio,
which is rather annoying.
This was changed in Mono for Android 1.9.2, by using Console.SetOut()
and Console.SetError() to send stdout/stderr message to both
stdout/stderr and to the Android Debug Log (`adb logcat`), allowing
e.g. Console.WriteLine() output to be viewed outside of a debugger.
Problem: in order to capture user-generated messages at their earliest
point, Console.SetOut()/etc. must be called at the earliest point in
Mono for Android initialization, even if Console.WriteLine() is never
used. Worse, this adds ~180ms of startup overhead on a Nexus One.
The fix here is to move the std*/logcat duplication logic into
mscorlib.dll, so that we can configure things within the
System.Console static constructor. This moves the initialization
penalty onto users of System.Console (instead of all users).
This makes it possible to build the monotouch profile, since generating the resources
file requires a System.Windows.Forms.dll, which monotouch doesn't have.
* sgen-toggleref.c: GC backed toggleref machinery. This enables
embedders to support toggleref style of external memory management
without hooking up to the host retain/release machinery.
The API export two entry points. The first let the caller register
a callback with sgen that decides the state of a given object, by
probably inspecting its native state. The second allows registration
of objects with the toggleref machinery.
The idea of toggleref is that we keep an external reference to an object
and it can be either a strong or weak reference. We use a weak reference
when the external peer has no interest into the object and a strong otherwise.
When the schema for is not explicitly set for an element, get the default form specified in the schema, and use 'unqualified' if there is no other default. This fixes bug #41.
System.IO.Packaging already had full support for parsing [Content_Types].xml
if it contained both <Override> and <Default> nodes when specifying content
types for files. However we had taken a shortcut before by explicitly writing
the content type of each file using an <Override> attribute for every file. We
now properly write a <Default> element and only use <Override> attributes when
required.
Ensure we can call dispose multiple times without blowing up. Also
ensure that we do not close streams which are passed in by the user.
We should only close streams which are implicitly created by the API.
This is a modification of the patch proposed for bug #1464, which is
now fixed by this commit.
The OperationContext is a [ThreadStatic] variable therefore when a REST call is
made asynchronously the worker thread will not see a context set and will not
expose any data through the context.
A possible solution (which I implemented in the attached patch) is for
ClientRealProxy to set the context in the channel prior to executing the call
(either sync or async). The ClientRuntimeChannel needs to then properly set and
reset the context in the worker thread.
Because WCF operations marked [OperationContract(AsyncPattern = true)] using
IAsyncResult only generate an outgoing call on End<OperationName> the
ClientRuntimeChannel.EndProcess must not reset the context as it's currently
doing. The context can only be reset after calling EndInvoke because the
request will be only generated at this point.
There was apparently no point in the call flow when the reponse message was set
in the context, resulting in WebOperationContext.IncomingResponse always being
null.
After patching WebMessageFormatter to set the response in the context (if
available) the value of WebOperationContext.IncomingResponse was still null. A
bit more investigation showed that IncomingWebResponseContext would construct a
HttpResponseMessageProperty encapsulating the OperationContext at the time the
request was made but before the response was received and cache that object.
That caused the HttpResponseMessageProperty to always have a null value for the
response. The second part of the patch changes this behavior and always creates
a new HttpResponseMessageProperty on GET.
.NET throws a EndpointNotFoundException encapsulating a WebException when a
REST request returns a 404.
The attached patch tests for a 404 and throws the same exception chain thrown
by .NET.
OutgoingWebRequestContext throws a NullReferenceException when making a REST
call. The exception is thrown because there are no Headers in the context.
Attached patch simply tests for null before copying values from Headers.
OutgoingWebRequestContext throws a NullReferenceException when making a REST
call. The exception is thrown because there are no Headers in the context.
Attached patch simply tests for null before copying values from Headers.
System.ServiceModel.Channels.HttpRequestChannel never added the configured
certificate to the HttpWebRequest which prevented client side authentication.
The attached patch does exactly that if a certificate has been configured.
Refactor this method so that it only attempts alternative filenames if
the filename just attempted already exists. This way we will never end
up looping forever being unable to create the required file. Previously
if we opened the maximum allowed files and then called GetTempFileName
we'd loop forever throwing an IOException in the FileStream constructor
every time.
If Flush() was called with final_flush set to true, we were leaking the
unmanaged memory in the output stream (if allocated).
It was "only" an AS leak.
Thanks to Kumpera for the help debugging this.
* sgen-bridge.c: Bridge processing must be split in
two steps because the object scanning step must be done
with world stop and before we copy the finalizable objects
and the ones pointed by them.
* sgen-gc.c (finish_gray_stack): We must process ephemerons
before we check for non track weak refs to make sure we mark
those values whose only root are their keys.
This is what happens when you test on a pre-configured environment that
already worked fine. This depended on a function that was never called
so we ended up probing for paths on NULL (repeating the same process twice)
instead of loading the profiler from the installation directory.
* sgen-brige.c (scc_add_xref): Make sure that the xref
array is kept sorted by doing sorted insertion for single elements
and merging for a pair of lists.
This avoids degenerated cases where performance of the dfs2 step
goes unbound and slows us down significantly.
Fixes bxc #496
When cloning a table we loop over all the columns and clone them, but if a column
contains an expression with a reference to a later column, we'll throw an exception
unless we delay the expression compilation until all the columns have been added
to the new table clone.
So I've split out the expression compilation logic from the Expression property setter,
and now the column Clone method only sets the field. The Clone caller is responsible
for calling CompileExpression on the cloned column after adding all the cloned columns to
the cloned table.
When there is an ongoing operation we can't dispose the internal
worker because it might be used by the IO threadpool.
Fixes Novell bug #691076 and Xamarin bug #766.
* Fixes to the SUBSTRING and TRIM function to allow
a wider range of functions to be passed as
parameters. This fixes xamarin #665
* Fix to the Parser.jay grammar to eliminate the
reduce/reduce conflicts.
* Dropping the string concatenation code and instead
use the existing arithmetic addition operator which
also fixes the concatenation operation in the presence
of null values
* Adds the null literal
With the associated test cases.
io.c (DeleteFile): We can't forbit a file to be deleted just before
it's mask is not u+w. We should just call unlink and let the kernel
figure out permissions.
We are not SAMBA.
We're not in the job of trying to mingle windows and unix permissions
models so we just let the kernel figure it out and translate the appropriate
errno value to UnauthorizedAccessException.
Our tracking references code aimed to transform tracking references
into normal weak references the first time their targets became
unreachable. It was implemented incorrectly though, and is not the
right thing to do in the first place anyway, because tracking
references have to keep tracking if the target is re-registered for
finalization. The incorrect implementation inadvertently handled
re-registration correctly, but it kept the reference intact for one
garbage collection cycle too many.
* sgen-fin-weak-hash.c:
* sgen-gc.c: Bridge objects are used to represent objects
that have references outside of sgen's control. They are
kept around until the embedder figures out it's ok to
collect them.
Until those bridge objects turn externally unreachable,
they must be kept around. Up to now, the expected pattern
was to resurrect them during finalization.
The problem with this approach is that if they hold references
to other finalizable, non-bridge objects those will be finalized
and we will resurrect objects that point to dead ones.
Think of this:
class BridgeObject {
FileStream stream;
}
The bridge object is resurrected on the finalizer and so will
stream, disposing its native handle and been permanently unusable.
The solution is to process brige objects before we do ordinary
finalization. We record all dead bridges and copy/mark them.
We drain the gray queue on the end, which makes sure all other
finalizable objects that transitively reachable are too.
Finally, we introduce a breaking change to the bridge API.
The bridge must set to NULL the first object of all SCC
entries that remain alive. Other entries will be considered
dead and will be subject to regular finalization.
This way, sgen knows when a given bridge object is completely
unreachable and provides adequate finalization semantics to
them and referenced objects.
This fixes bxc #375
* class.c (mono_class_is_variant_compatible): Reject valuetypes
if not the same straight away. This fixes testing IEnumerable<int?>
with IEnumerable<int>.
Fixes bxc #185
The P/Invokes should be Cdecl as the library is compiled with that
calling convention. The delegates passed to native code must also
be marshalled as Cdecl. Fixes BXC #223.
In this day and age of mobile personal computing devices,
we need to periodically check the underlying system
timezone because the device may have crossed a timezone
boundary.
Unhandled exceptions will only set the exitcode if there is no
AppDomain unhandled exception handler. When the exitcode is set,
the TP will exit for unhandled exceptions.
Fixes bug #227.
Under some circumstances new_job was not signaled and the threadpool
threads didn't realized there was a workitem in the queue.
Fixes Xamarin bug #12 and Novell bug #690357.
* aot-compiler.c (arch_emit_imt_thunk): Implement fail tramp
support on arm. This enables variance to work under full-aot.
The code blowout is not really significant as even on non linked
apps the imt thunk overhead is 0.5%.
* mini-exceptions.c (mono_handle_exception_internal_first_pass):
Don't trim the trace list if we find a filter clause from a wrapper.
This makes stacktraces across MRI's work.
Extract trace trimming into a macro to reduce code duplication.
* System.Net.Sockets/Socket_2_1.cs: Ensure RemoteEndPoint is always
available after ConnectAsync (connected or not, allowed or not).
Ensure the Connect event is fired even if denied by policy.
* System.Net.Sockets/Socket_2_1.cs: Fix some moved code (from
SocketAsyncEventArgs.cs) so should the references to RemoteEndPoint
still point to the SocketAsyncEventArgs instance. Fix some moon-unit
test failures
The AC_ARG_ENABLE(boehm, ..., ..., support_boehm=yes) resulted in
support_boehm always being 'yes', even for `--host=arm-linux-androidabi`,
which was not the intention. Using `support_boehm=${support_boehm:-yes}`
generates correct behavior.
Check --host against *-*-linux-android* for Android-specific configure fixes,
and improve **/Makefile.am to simplify Android support:
./configure \
--build=`./config.guess` \
--host=armv5-linux-androideabi \
--target=armv5-linux-androideabi \
--enable-nls=no --with-mcs-docs=no --enable-mcs-build=no \
CC="/path/to/ndk/arm-linux-androideabi-gcc --sysroot=/path/to/sysroot" \
AR="..." AS="..." CPP="..." CXX="..." LD="..." RANLIB="..." STRIP="..."
CFLAGS="-DARM_FPU_NONE=1" CXXFLAGS="-DARM_FPU_NONE=1"
See also Android NDK docs/STANDALONE-TOOLCHAIN.html.
The Android NDK/bionic is "interesting", in that it's lacking header files and
macros normally present on Linux which otherwise break the build (e.g. no
<link.h> which breaks Boehm support). Using --host with an android target
works around the known issues, simplifying the building of libmonosgen-2.0.so
with the Android NDK toolchain.
class.c (mono_class_inflate_generic_method_full_checked): Don't
inflate a method if the provided context won't change it.
This change, in particular, avoid inflating a generic method
of a non-generic class if the context has class only vars.
This fixes#696593 as the above was causing the vtable of
Class3 ending up with an inflated Class1::Method<> that
comes from inflated Class2<object> parent.
Then the parent override pass would collect a non-inflated
Class1::Method<> overide that would then not match the one
on the vtable causing Class3 to have an abstract method on
its vtable and thus failing to load.
Big explanation means tricky change, might break tons of stuff.
This is necessary in situations when managed code pases case-insenstive file name and the
file on disk uses different case. stat(2) would return an error in such situation and, in effect,
the stat structure would get invalid/random values in its fields.
* handles.c (handle_cleanup): When the runtime exit(), not
everything is shutdown and the main thread might be waiting
on other threads to finish. On this case, io-layer cleanup
with assert as a mutex will be in use.
The work-around is to be lenient to busy resources during
shutdown.
SDB now support setting a send/receive timeout on the client's side
of the communication socket. To make this work, the server sends
a special 'keepalive' event when using receive timeouts.
There's a new method VirtualMachine.SetSocketTimeouts() to enable
this feature.
* local-propagation.c (mono_local_deadce): Don't perform
reverse copyprop on simd insert ops. The backend requires
dreg and sreg1 to match.
* mini-x86.c (mono_arch_output_basic_block): Fix insert_r8_slow
for the X element.
Fixes a few bugs due to #691057
A very rare allocation pattern could cause the boehm free list to call
the GC_unmap_gap function, which actually calls down into munmap().
Darwins virtual memory manager will return a KERN_INVALID_ADDRESS
which is translated into a ENOMEM, if mprotect attempts to change
the protection of a range which includes an unallocated page.
We address this by just mmap() back to ANON, instead of actually
unallocating the page.
Non-nullable web service parameters can be made optional by
adding an additional parameter with the same name and a
'Specified' suffix. This was supported when serializing
classes, but not when serializing web service parameters.
This might fix bug 688496.
When trying multiple addresses, the second and sucessive calls to
BeginConnect(IPAddress) will cause an error which we would have to
ignore and then retry. Since this behavior is not documented, we just
close the socket and open a new one for retries is there is already a
pending connect attempt.
Windows/Linux flagged the socket as writable even when connect() has
not been called. On *BSD and OSX, this was not the case and we waited
forever.
Now, for blocking sockets, we make them blocking and call connect()
before adding the socket to the wait pool.
It is part of bugfix 687902.
To get the bug fixed, the new "using" sections in ChannelDispatcher.cs to
explicitly dispose channels. But this causes regression in PerSession-based
tests. So some new session management code is (likely) required as well.
It will also alter "mixed" MaxConcurrentCalls and MaxConcurrentSessions with
correct management code.
It returns a boolean 'false' when the passed string matches (case-insensitively) 'false' or
is empty, returns 'true' otherwise.
All the other types (and a null value) cause it to throw the NotSupportedException.
This fixes bug #667329.
The problem was that ManagedThreadId was created from a per-appdomain
counter, but stored in a per-thread storage, so if two threads could
end up with the same ManagedThreadId if a second appdomain executed
on the second thread first.
If the transfer encoding was set to chunked, we tried to read even when
the response might known to have no content. This led to timeouts.
Fixes bug #686371.
XmlMessagesFormatter will be used in Sys.Xml.Serialization.dll and this
type should not be excluded by !NET_2_1 or !MOONLIGHT. It is not doable
if this class is in BaseMessagesFormatter.cs.
After calling Close () on response you are still allowed to access its
properties. Calling Dispose() causes the usual exception to be thrown
when accessing the properties.
Fixes bug #685368.
* sgen-gc.c (restart_threads_until_none_in_managed_allocator):
On mach we used to simply call thread_suspend/thread_resume
without updating the thread context, which would result in
sgen getting hang.
* sgen-gc.h: Since darwin doesn't use signals to
stop the target threads, we must reserve space for
register in SgenThreadInfo.
* sgen-os-mach.c (mono_sgen_thread_handshake): Don't
alloca inside the loop. Make sure each thread registers
are copied to the right place.
* mach-support-*.c (mono_mach_arch_get_tls_value_from_thread):
This function now receives pthread_t instead of mach_port
as argument, so avoiding an expensive call to
pthread_from_mach_thread_np.
* sgen-os-mach.c (mono_sgen_thread_handshake): Loop over
the registered threads insted of asking the kernel to enumerate
them. Avoid calling pthread_from_mach_thread_np which takes
a lock and is O(n) on the number of threads.
* mono-path.c (mono_path_canonicalize): Properly canonicalize
non UNC paths with an extra backslash. Eg:
c:\foo\\bar was been canonicalized to c:\\foo\bar.
This was breaking assembly loading in some rare cases.
We were not keeping track of allocated/destroyed/alive gchandles in the
log profiler. It only ever reported the number of handles alive at the
end of the profiling run and that was misreported as the output claimed
this was the number of gchandles created.
* tools/xbuild/xbuild/4.0/Microsoft.Common.targets
(GetReferenceAssemblyPaths): Don't look up framework directories
for $(TargetFrameworkMoniker) is $(_TargetFrameworkDirectories) is
already defined. This can be used to override moniker lookups.
* gutf8.c (g_utf16_to_utf8): Increase the input counter
when encountering broken surrogates head or tails to
make sure we don't end in an infinite loop.
It is ok to ignore such calls for two reasons - the cache with duration <= 0 will not
be effective anyway and the @OutputCache directive throws an exception for duration <= 0
The IO threadpool behaves as the regular one now: threads are created
on demand up to the default and then they are throttled based on load
unless Set(Min|Max)Threads is used.
Fix the stack size for threadpool threads when Set(Min|Max)threads is
used.
This implements support for DriveInfo for OSX and Windows.
On OSX we use statfs system call that provides the filesystem
type information that we need. On Linux, we continue to fallback
to mtab parsing
The commit had the good idea but since some values of the enumeration overlap it broke the correct behavior. Instead we now turn off the extra options and use the previous way to check.
that scheduler is ignored if it is in a thread owned by another
scheduler. Tasks should not be locked to the scheduler that
owns the calling thread.
Fix bug where TryExecuteTask does not actually try to execute
the task. Instead, TryExecuteTaskInline is called, which is
abstract. The TpScheduler implementation, the default, then
calls the internal method Task.Execute which then actually
executes the task. The problem with this is that only 3rd
party schedulers, can't actually execute a task, thus making
extending TaskScheduler impossible. (Unless they use some
serious Mono specific reflection hacks as I am now.)
The 'name' attribute is rendered using the static ID of 'aspnetForm' if
the form is in a naming container other than the Page control. Inside Page,
the form's ID is rendered. The attribute is output in .NET 4.0 only if control
rendering compatibility is less than 4.0
handle_cleanup() is called at exit and might try to clean things up
twice, causes a WSANOTUNITIALISED and then a segmentation fault trying
to use a pthread key that has already been freed.
With this, Microsoft.Common.targets will import
$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*
at the beginning of the file and
$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*
at the end of the file.
So, this would import all files from (eg.):
$prefix/lib/mono/xbuild/4.0/Microsoft.Common.targets/ImportBefore/
This can be disabled by setting the bool properties -
$(ImportByWildcardBeforeMicrosoftCommonTargets) and
$(ImportByWildcardAfterMicrosoftCommonTargets).
Emit list of projects in the solution as @(ProjectReference) items
in the generated .sln.proj file. This would be useful for extending
solution builds.
Re-throw any unknown exceptions.
* Project.cs: Log the exception, doing it here also, so that direct
project.Build(..) call failures also get logged.
* Engine.cs: Log the unknown exception only if the build is running.
This allows for the case when Project.Build caught it and ended the
build.
Idle connections that never received any data or had ever been
associated to a listener are properly closed now when the endpoint is
closed or the last listener they used is closed.
Fixes a bunch of tests in System.ServiceModel.
The current loader failed with some Json strings due to the implementation
of the BufferedStreamReader. Removed that implementation completely,
and instead depend on the StreamReader to do the actual BOM detection.
This removes the JavaScriptObjectDeserializer.cs file
Add hooks in the .sln.proj generated from .sln files.
1. It imports
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportBefore\*"
and
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportAfter\*"
This is done only in case of 4.0 projects, as imports with wildcard
is a 4.0 feature.
2. And it imports before.Foo.sln.targets and after.Foo.sln.targets from
the same dir as the .sln file.
With 4.0 profile, <Import ..> can have wildcards. This works correctly
with our multiple MSBuildExtensionsPath also.
If the import references $(MSBuildExtensionsPath) property, then the
each extension path is used to resolve the import, and the search
stop as soon as an import is found.
If such an import uses wildcard, then the search stops at the
extension path in which *atleast one* file got imported.
And the import fails if any invalid project file is encountered.
This commit also heavily refactors the Import code to simplify
in the face of the new features, and improves error detection
and reporting.
ImportTest.cs: Add test for wildcards.
A target 'foo' can have BeforeTargets or AfterTargets attributes,
which list the targets before or after, 'foo' should be run.
This is a 4.0 feature.
* Project.cs (ProcessBeforeAndAfterTargets): New.
* Target.cs: Run the before/after targets in the correct order.
* TargetTest.cs (TestBeforeAndAfterTargets): New.
- The returned XmlReader is positioned at the beginning of the element.
- XmlSyndicationContent.GetReaderAtContent() returns XmlReader that begins
with the "wrapper" which is dummy Atom 1.0 content element.
* class.c (mono_get_unique_iid): Don't store
the iid of generic instances on their GTD image
since they can be unloaded before.
* metadata.c (free_generic_class): Reset the iid
used by interfaces.
Engine.DefaultToolsVersion is used when a project is unable
to determine a suitable ToolsVersion to use. Change this fallback
version to 2.0 . This allows vs2005 (.net 2.0) projects which
don't have ToolsVersion explicitly set, to build. Newer projects
set ToolsVersion by default.
ToolsVersion 4.0 supports targeting arbitrary frameworks defined
by FrameworkList.xml files and referenced by $(TargetFrameworkMoniker),
which is of the format:
Identifier,Version=<version>[,Profile=<profile>]
built as:
$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)[,Profile=$(TargetFrameworkProfile)]
eg. '.NETFramework,Version=v4.0' .
Frameworks are searched for in (order):
1. Paths specified in the environment variable $XBUILD_FRAMEWORK_FOLDERS_PATH
2. /Library/Frameworks/Mono.framework/External/xbuild-frameworks on Mac OSX.
3. MSBuild property $(TargetFrameworkRoot)
4. $prefix/lib/mono/xbuild-frameworks (default location)
.NET frameworks 2.0/3.0/3.5/4.0 have corresponding FrameworkList.xml
files now, which allows projects to target them. Custom frameworks like
MonoDroid can install suitable FrameworkList.xml files, and projects
can target them using the correct $(TargetFrameworkIdentifier) and
$(TargetFrameworkVersion).
Update man page.
* Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
(GetProcessStartInfo): Add missing api. This allows more control
over the execution of the tool.
* Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
(GetAssemblyNameFromFile): Rename to ..
(TryGetAssemblyNameFromFile): .. this, to make it consistent with
the similar method TryGetAssemblyNameFromFullName .
Track api changes.
* Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs:
Track api changes.
Also, fixes bug #668955.
Add new reserved properties $(MSBuildThisFile*).
Unlike the $(MSBuildProjectFile), the *This* properties are evaluated
in the context where they were used. Eg. if such a property was
referenced in a PropertyGroup, then it would refer to the file
containing the that definition, and *not* the main project file.
It applies to items and tasks/targets also.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildChoose.cs:
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs:
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs:
Add DefinedInFileName property.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:
Add a stack to keep track the "current" file, which is used to set
the $(MSBuildThisFile*) properties. Update the properties on
Push/Pop.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs:
Push/Pop the "current" file, when evaluating a property/item/etc.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:
Push/Pop the "current" file, when building. This ensures that the
references in the target definition get evaluated correctly.
* Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs:
Add corresponding test.
The volatiles and durables lists must be copied even if they are empty. The calling code
might still be accessing them via the original transaction (as is the case with Orchard+NHibernate)
This new patch moves the definition of GPid from glib.h to eglib-config.h and
determines the the type of pid_t in configure.
Pach from Hib Eris that fixes bug #670076.
When loading an assembly we were comparing Version(0,0,0,0) with null
and a 0 length PKT with an actual one when those two cases are the
default.
Fixes bug #661461.
* MonoCustomAttrs.cs (GetBase): Special case events
when retrieving the base event to lookup cattrs.
* AttributeTest.cs: Add regression test.
Fixes#662867
* method-to-ir.c (mono_emit_method_call_full): Non virtual
marshal by ref methods with gsharing context must always
be called using indirect calls.
Fixes#665893
Peeking a character as it turns out is a really bad idea as it involves the encoder
to pull characters. If the PeekChar happens to read a byte that is part of a
UTF8 string that needs more characters to process we would end up with the reported
crash.
Atsushi Enomoto tracked this down, and the fix is to use the binaryreader.BaseStream
to directly call into ReadByte and Read without ever probing with PeekChar (). It
is not really possible to use BinaryReader.ReadByte since this one can throw on
end-of-buffer conditions instead of returning -1
* corlib/Mono.Security.X509/X509Store.cs:
* Mono.Security/Mono.Security.X509/X509Store.cs:
Fix key pair persistence to load key pairs from the same location
(machine or user) as the requested certificate. This avoids an
internal exception (on missing local machine directory) that stop
the evaluation of the certificate validity (i.e. no user store
check)
* System/System.Security.Cryptography.X509Certificates/X509Chain.cs:
Ensure that a missing local machine directory does not result in a NRE
while loading CRL (which would fail the certificate being validated)
* Thread.cs (.ctor): Check if maxStackSize is negative
and raise and AOORE. Silently use a saner minimum size
of 128k as mono can't really run with much less than that.
When we get an error from the server before writing an entire
unbuffered response, the server might close the connection leading to
write errors. Ignore those and return the actual HTTP status code from
the original server error.
Updating FromMSBuildPath also fixes a bug on windows.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Utilities.cs:
Move to..
* Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs:
.. this. Also, update FromMSBuildPath from monodevelop.
* Update Engine/* and Tasks/* to track the new api.
Namespaces in nested external schemas have to be validated against
immediately-containing schema. If there is a schema A with urn:x
targetNamespace imports a schema B with urn:y targetNamespace which
in turn includes another schema C, then C must be validated its namespace
against B, not A.
The script now supports an extra cross-compilation directory in which you can unpack the
library and development packages necessary for the build to succeed (glib, zlib etc). Also
supported now is specifying the location at which Mono will be installed on Windows.
Replaced SVN and GIT-SVN version checks with git checks.
When the serializer serializes a Type B which is derived from A, it used to
serialize member M in A as in namespace_of_B, not in namespace_of_A.
This should fix bug #652331.
The file eglib-config.h is generated when running configure.
Distributing eglib-config.h in tarballs causes errors when building
out of the source tree.
* mini-trampolines.c (mono_delegate_trampoline): The ldftn
to ldvtftn conversion must check if the method is abstract,
otherwise it breaks delegate to base classes.
Fixes#666008
* class/System.Web.Services/System.Web.Services.Description/BasicProfileChecker.cs:
Extensions can be XmlElement or ServiceDescriptionFormatExtension.
* class/System.Web.Services/System.Web.Services.Description/ServiceDescription.cs:
(AddExtensionNamespaces): Likewise. Also, ignore namespaces from
XmlElement, as we retain and write them out as-is.
(WriteExtension): Emit the XmlElement as-is.
* class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionTest.cs:
Update to write out the wsdl also.
* gc.c (mono_gc_cleanup): Cleanup all reference
queues after regular finalization.
* reflection.c: The dynamic method ref queue is finalized
by the runtime itself.
* runtime.c: Ditto.
Emit warning for unknown toolsversion only on a build, and
*not* everytime the project file is parsed.
* class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
(GetToolsVersionToUse): Add a 'emitWarning' bool param.
(Build): Call GetToolsVersionToUse () to ensure that a warning is
emitted in case of a unknown tools version.
* mini-x86.c (emit_call): Align call instructions on
3 mod 4 so the address is 4 bytes aligned and can't span
two cache lines. This is required for proper SMP support
as CAS is not atomic across cache lines.
Fixes one of the crashes due to #667921.
* gc.c: A reference queue allows one to queue
callbcks for when objects are collected.
It allows for safe cleanup of objects that can
only be done when it is effectively collected.
The major difference with regular finalization
is that the collector makes sure the object
was collected - and can't be resurrected.
* gc-internal.h: Export entrypoints for the
new API.
When the serializer serializes a Type B which is derived from A, it used to
serialize member M in A as in namespace_of_B, not in namespace_of_A.
This should fix bug #652331.
We were calling the Reset () method after we had initialized the driver
with the new command line arguments, clearing the list of files to execute
before we executed them.
Added support for #! in the csharp repl, and added the print() command to
the InteractiveBase
Add a better way of dealing with -e, without adding hacks to the core that wont work
in the future
We were calling the Reset () method after we had initialized the driver
with the new command line arguments, clearing the list of files to execute
before we executed them.
Added support for #! in the csharp repl, and added the print() command to
the InteractiveBase
* DefaultVirtualDirectory is now more careful when snipping off parts of the path passed to
its constructor. Before removing the file part it checks whether the file indeed exists.
Also sealed the class and made it use generic List instead of ArrayList
* HttpRequest does not normalize mapped paths when converting them to absolute ones. This is
to avoid errors when path like "~/bin/../../file.txt" is passed to MapPath.
* VirtualPathUtility.ToAbsolute overload with normalize parameter really doesn't normalize
the resulting path now.
Modifies ObjectReader so that when it encounters a primitive typed member in
an object stream which has no corresponding member in the app domain, it will
read the value anyway and throw it away. That way it can read the next block
from the stream.
Added a unit test which passes with the changes to ObjectReader.
Fixes bug #641821.
* Only translates between SecurityIdentifier and NTAccount for
well-known accounts.
* NTAccount changed to not upper-case values to match behaviour
observed in Microsoft's .NET (see also unit tests)
* Add unit tests for both classes
* marshal.c (mono_marshal_get_delegate_invoke): If
the target is a static method with first arg bound
and it belongs to a different assembly than the delegate
we might end up with a freed signature in the hashtable.
Fix a moonlight crash.
Also, add new ExpressionEvaluationException class.
Wrap Expression*Exceptions in InvalidProjectFileException with
info about the full condition being evaluated.
* tools/xbuild/xbuild/Microsoft.CSharp.targets: $(CscToolExe)
is set depending on the value of $(TargetFrameworkVersion).
Since, $(TargetFrameworkVersion)'s default value is set
by MS.Common.targets, set $(CscToolExe) *after* importing
MS.Common.targets .
we carefully restore the missing tabs that helped carefully
align the continuation characters in a list of assemblies.
As we align these newline separators, suddenly, a new form
emerges from the chaos, something that gives us the illusion
that this stream of bytes is indeed almost like a dawn of a
new day as we breathe the air in a valley overlooking a beautiful
mountain at the beginning of the spring.
When user has their own global application class (global.asax is present) the assembly produced from it must
be passed as reference to the compiler.
BuildManager.GetType now supports fully-qualified type names for 'typeName' and searches for the type in the
top-level assemblies, the global.asax assembly and in the assemblies specified in as references in web.config.
All of this fixes certain MVC3+Razor applications.
* System.Security.Cryptography/CryptoConfig.cs: Add OID for RIPEMD160
* System.Security.Cryptography/RSACryptoServiceProvider.cs: Update
GetHashNameFromOID to include SHA2-family OIDs. Remove historical
comments about 1.x FX behavior.
* Test/System.Security.Cryptography/CryptoConfigTest.cs: Add test cases
wrt RIPEMD160 OID
* Test/System.Security.Cryptography/RSACryptoServiceProviderTest.cs: Add
test case for SignHash with all FX-provided hash implementations (all
working except RIPEMD160). Remove some NET_2_0/NET_1_1 defines.
* Test/System.Security.Cryptography/RSAPKCS1SignatureFormatterTest.cs:
Remove hacks that were needed for running the tests under FX 1.x. Remove
some NET_2_0/NET_1_1 defines.
Validation is enabled early in the pipeline during request. ValidationUtility makes sure that validation is indeed enabled and
replaces the default form and query string collections with a lazy version which will validate values only when an existing key
is found and requested.
* sgen-gc.c (finish_gray_stack): We must clear
weak refs that don't track resurrection before
processing finalizable objects otherwise we'll
copy/mark them and the weak ref won't be cleared
until after finalization.
Fixes#657408
* verify.c (is_valid_generic_instantiation): Don't
check if any argument is broken during constraint check
as an instance should be valid, but not realizable, even
if it has broken arguments.
Fixes one of the issues with #664612
* Microsoft.Build.BuildEngine.Project.cs (InitializeProperties): Use
evaluatedProperties field instead of EvaluatedProperties property,
to avoid invoking a Reevaluate, since it is already in progress.
Remove the entries for a project from the built targets cache, on
project unload.
* Microsoft.Build.BuildEngine/Engine.cs (ClearBuiltTargetsForProject): New.
* Microsoft.Build.BuildEngine/Project.cs (BuiltTargetKeys): Remove.
(RemoveBuiltTargets): Use Engine.ClearBuiltTargetsForProject .
* Microsoft.Build.BuildEngine/Target.cs: Track api changes.
*
* verify.c: mono_class_is_assignable_from can't handle
IList<GTD<T>> x GTD[] since GTD[] won't have the right
iface slots set. This isn't a problem for the runtime
since GTD[] will never happen as it's an unrealizable type.
Fixes#663815
* verify.c (mono_type_is_valid_type_in_context_full):
The trick of encoding the GTD as an instantiation over its
own arguments is also valid for component types such as GTD[]
GTD[,] and Foo<GTD>.
Both g_int_hash and g_int_equal used the semantics that an
integer is stored directly in the pointer. This is incorrect
as the pointer actually points to a location containing an
integer.
For those wanting the previous (incorrect) implementation,
they should look at g_direct_hash and g_direct_equal.
The default build of libmono-llvm.dylib includes libmono and all its dependencies,
but our statically compiled mono binary does as well. OSX can actually load both
into its process space, and get confused as to which symbol it should call, leading
to non-deterministic crashes. We'll remove all the mono dependencies, and use
-undefined suppress to mitigate this on OSX.
Fixes#663182.
OSX allows multiple framework versions to be installed side-by-side,
and the current version is available through
/Library/Frameworks/Mono.framework/Versions/Current.
However, documentation installed into /L/F/M.f/V/C/lib/monodoc/sources
is specific for that Mono version; upgrade Mono.framework, and the
documentation is "lost," not visible to the newly installed version.
To fix this, we're creating an *unversioned* directory to contain
documentation, which will thus be persistent across Mono.framework
upgrades: /Library/Frameworks/Mono.framework/External/monodoc
This will allow Mono.framework to be upgraded without "losing" the
documentation visible within monodoc.
where $acprefix is the prefix where aclocal has been installed.
This will automatically go into the mcs/ tree and build the
binaries there.
This assumes that you have a working mono installation, and that
there's a C# compiler named 'mcs', and a corresponding IL
runtime called 'mono'. You can use two make variables
EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
can say:
make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
If you don't have a working Mono installation
---------------------------------------------
If you don't have a working Mono installation, an obvious choice
is to install the latest released packages of 'mono' for your
distribution and running `autogen.sh; make; make install` in the
mono module directory.
You can also try a slightly more risky approach: this may not work,
so start from the released tarball as detailed above.
This works by first getting the latest version of the 'monolite'
distribution, which contains just enough to run the 'mcs'
compiler. You do this with:
# Run the following line after ./autogen.sh
make get-monolite-latest
This will download and automatically gunzip and untar the
tarball, and place the files appropriately so that you can then
just run: `make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe`
That will use the files downloaded by 'make get-monolite-latest.
Testing and Installation
------------------------
You can run *(part of)* the mono and mcs test suites with the command: `make check`.
All tests should pass.
If you want more *extensive* tests, including those that test the
class libraries, you need to re-run 'configure' with the
'--enable-nunit-tests' flag, and try: `make -k check`
Expect to find a few test suite failures. As a sanity check, you
can compare the failures you got with
https://wrench.mono-project.com/Wrench/
You can now install mono with: `make install`
You can verify your installation by using the mono-test-install
script, it can diagnose some common problems with Mono's install.
Failure to follow these steps may result in a broken installation.
d. Configuration Options
------------------------
The following are the configuration options that someone
building Mono might want to use:
*`--with-sgen=yes,no` - Generational GC support: Used to enable or disable the
compilation of a Mono runtime with the SGen garbage collector.
* On platforms that support it, after building Mono, you will have
both a mono binary and a mono-sgen binary. Mono uses Boehm, while
mono-sgen uses the Simple Generational GC.
*`--with-gc=[boehm, included, sgen, none]` - Selects the default Boehm garbage
collector engine to use.
* *included*: (*slighty modified Boehm GC*)
This is the default value, and its
the most feature complete, it will allow Mono
to use typed allocations and support the
debugger.
* *boehm*:
This is used to use a system-install Boehm GC,
it is useful to test new features available in
Boehm GC, but we do not recommend that people
use this, as it disables a few features.
* *none*:
Disables the inclusion of a garbage collector.
* This defaults to `included`.
*`--with-tls=__thread,pthread`
* Controls how Mono should access thread local storage,
pthread forces Mono to use the pthread APIs, while
__thread uses compiler-optimized access to it.
* Although __thread is faster, it requires support from
the compiler, kernel and libc. Old Linux systems do
not support with __thread.
* This value is typically pre-configured and there is no
need to set it, unless you are trying to debug a problem.
*`--with-sigaltstack=yes,no`
* **Experimental**: Use at your own risk, it is known to
cause problems with garbage collection and is hard to
reproduce those bugs.
* This controls whether Mono will install a special
signal handler to handle stack overflows. If set to
`yes`, it will turn stack overflows into the
StackOverflowException. Otherwise when a stack
overflow happens, your program will receive a
segmentation fault.
* The configure script will try to detect if your
operating system supports this. Some older Linux
systems do not support this feature, or you might want
to override the auto-detection.
*`--with-static_mono=yes,no`
* This controls whether `mono` should link against a
static library (libmono.a) or a shared library
(libmono.so).
* This defaults to `yes`, and will improve the performance
of the `mono` program.
* This only affects the `mono' binary, the shared
library libmono.so will always be produced for
developers that want to embed the runtime in their
application.
*`--with-xen-opt=yes,no` - Optimize code for Xen virtualization.
* It makes Mono generate code which might be slightly
slower on average systems, but the resulting executable will run
faster under the Xen virtualization system.
* This defaults to `yes`.
*`--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
* This defaults to `no`.
*`--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
and disk footprint at the expense of some capabilities.
* Typically this means that the number of threads that can be created
is limited (256), that the maximum heap size is also reduced (256 MB)
and other such limitations that still make mono useful, but more suitable
to embedded devices (like mobile phones).
* This defaults to `no`.
*`--with-ikvm-native=yes,no` - Controls whether the IKVM JNI interface library is
built or not.
* This is used if you are planning on
using the IKVM Java Virtual machine with Mono.
* This defaults to `yes`.
*`--with-profile4=yes,no` - Whether you want to build the 4.x profile libraries
and runtime.
* This defaults to `yes`.
*`--with-moonlight=yes,no`
* Whether you want to generate the Silverlight/Moonlight
libraries and toolchain in addition to the default
(1.1 and 2.0 APIs).
* This will produce the `smcs` compiler which will reference
the Silverlight modified assemblies (mscorlib.dll,
System.dll, System.Code.dll and System.Xml.Core.dll) and turn
on the LINQ extensions for the compiler.
*`--with-moon-gc=boehm,sgen` - Select the GC to use for Moonlight.
* *boehm*:
Selects the Boehm Garbage Collector, with the same flags
as the regular Mono build. This is the default.
* *sgen*:
Selects the new SGen Garbage Collector, which provides
Generational GC support, using the same flags as the
mono-sgen build.
* This defaults to `boehm`.
*`--with-libgdiplus=installed,sibling,<path>` - Configure where Mono
searches for libgdiplus when running System.Drawing tests.
* It defaults to `installed`, which means that the
library is available to Mono through the regular
system setup.
* `sibling' can be used to specify that a libgdiplus
that resides as a sibling of this directory (mono)
should be used.
* Or you can specify a path to a libgdiplus.
*`--disable-shared-memory`
* Use this option to disable the use of shared memory in
Mono (this is equivalent to setting the MONO_DISABLE_SHM
environment variable, although this removes the feature
completely).
* Disabling the shared memory support will disable certain
features like cross-process named mutexes.
*`--enable-minimal=LIST`
* Use this feature to specify optional runtime
components that you might not want to include. This
is only useful for developers embedding Mono that
require a subset of Mono functionality.
* The list is a comma-separated list of components that
should be removed, these are:
*`aot`:
Disables support for the Ahead of Time compilation.
*`attach`:
Support for the Mono.Management assembly and the
VMAttach API (allowing code to be injected into
a target VM)
*`com`:
Disables COM support.
*`debug`:
Drop debugging support.
*`decimal`:
Disables support for System.Decimal.
*`full_messages`:
By default Mono comes with a full table
of messages for error codes. This feature
turns off uncommon error messages and reduces
the runtime size.
*`generics`:
Generics support. Disabling this will not
allow Mono to run any 2.0 libraries or
code that contains generics.
*`jit`:
Removes the JIT engine from the build, this reduces
the executable size, and requires that all code
executed by the virtual machine be compiled with
Full AOT before execution.
*`large_code`:
Disables support for large assemblies.
*`logging`:
Disables support for debug logging.
*`pinvoke`:
Support for Platform Invocation services,
disabling this will drop support for any
libraries using DllImport.
*`portability`:
Removes support for MONO_IOMAP, the environment
variables for simplifying porting applications that
are case-insensitive and that mix the Unix and Windows path separators.
*`profiler`:
Disables support for the default profiler.
*`reflection_emit`:
Drop System.Reflection.Emit support
*`reflection_emit_save`:
Drop support for saving dynamically created
assemblies (AssemblyBuilderAccess.Save) in
System.Reflection.Emit.
*`shadow_copy`:
Disables support for AppDomain's shadow copies
(you can disable this if you do not plan on
using appdomains).
*`simd`:
Disables support for the Mono.SIMD intrinsics
library.
*`ssa`:
Disables compilation for the SSA optimization
framework, and the various SSA-based optimizations.
*`--enable-llvm`
*`--enable-loadedllvm`
* This enables the use of LLVM as a code generation engine
for Mono. The LLVM code generator and optimizer will be
used instead of Mono's built-in code generator for both
Just in Time and Ahead of Time compilations.
* See the http://www.mono-project.com/Mono_LLVM for the
full details and up-to-date information on this feature.
* You will need to have an LLVM built that Mono can link
against.
* The --enable-loadedllvm variant will make the LLVM backend
into a runtime-loadable module instead of linking it directly
into the main mono binary.
*`--enable-big-arrays` - Enable use of arrays with indexes larger
than Int32.MaxValue.
* By default Mono has the same limitation as .NET on
Win32 and Win64 and limits array indexes to 32-bit
values (even on 64-bit systems).
* In certain scenarios where large arrays are required,
you can pass this flag and Mono will be built to
support 64-bit arrays.
* This is not the default as it breaks the C embedding
ABI that we have exposed through the Mono development
cycle.
*`--enable-parallel-mark`
* Use this option to enable the garbage collector to use
multiple CPUs to do its work. This helps performance
on multi-CPU machines as the work is divided across CPUS.
* This option is not currently the default as we have
not done much testing with Mono.
*`--enable-dtrace`
* On Solaris and MacOS X builds a version of the Mono
runtime that contains DTrace probes and can
participate in the system profiling using DTrace.
*`--disable-dev-random`
* Mono uses /dev/random to obtain good random data for
any source that requires random numbers. If your
system does not support this, you might want to
disable it.
* There are a number of runtime options to control this
also, see the man page.
*`--enable-nacl`
* This configures the Mono compiler to generate code
suitable to be used by Google's Native Client:
http://code.google.com/p/nativeclient/
* Currently this is used with Mono's AOT engine as
Native Client does not support JIT engines yet.
Using Mono
==========
Once you have installed the software, you can run a few programs:
*`mono program.exe` runtime engine
*`mcs program.cs` C# compiler
*`monodis program.exe` CIL Disassembler
See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
for further details.
Directory Roadmap
=================
*`docs/` - Technical documents about the Mono runtime.
*`data/` - Configuration files installed as part of the Mono runtime.
*`mono/` - The core of the Mono Runtime.
*`metadata/` - The object system and metadata reader.
*`mini/` - The Just in Time Compiler.
*`dis/` - CIL executable Disassembler
*`cli/` - Common code for the JIT and the interpreter.
*`io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
*`cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
*`interp/` - Interpreter for CLI executables (obsolete).
*`arch/` - Architecture specific portions.
*`man/` - Manual pages for the various Mono commands and programs.
*`samples/` -Some simple sample programs on uses of the Mono
runtime as an embedded library.
*`scripts/` - Scripts used to invoke Mono and the corresponding program.
*`runtime/` - A directory that contains the Makefiles that link the
mono/ and mcs/ build systems.
*`../olive/`
* If the directory ../olive is present (as an
independent checkout) from the Mono module, that
directory is automatically configured to share the
same prefix than this module gets.
Contributing to Mono
====================
Before submitting changes to Mono, please review the contribution guidelines at http://mono-project.com/Contributing. Please pay particular attention to the [Important Rules](http://mono-project.com/Contributing#Important_Rules) section.
Git submodules maintenance
==========================
Read documentation at http://mono-project.com/Git_Submodule_Maintenance
Maintainer
==========
Mono is maintained by miguel@xamarin.com
Reporting bugs
==============
To submit bug reports, please use Xamarin's Bugzilla:
https://bugzilla.xamarin.com/
Please use the search facility to ensure the same bug hasn't already
been submitted and follow our guidelines on how to make a good bug
You can take the loader lock without holding a domain lock.
You can take the domain load while holding the loader lock
You cannot take the loader lock if only the domain lock is held.
You cannot take a domain lock if the loader lock is held.
You cannot take a domain lock while holding the lock to another domain.
TODO:
We have a few known ok violation. We need a way to whitelist them.
Known ok issues:
ERROR: tried to acquire lock DomainLock at mono_domain_code_reserve_align while holding DomainLock at mono_class_create_runtime_vtable: Hierarchy violation.
This is triggered when building the vtable of a non-root domain and fetching a vtable trampoline for an offset that has not been built. We'll take the root
domain lock while holding the other one.
This is ok since we never allow locking to have in the other direction, IOW, the root-domain lock is one level down from the other domain-locks.
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_class_from_name
WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_image_add_to_name_cache
Both of those happen when filling up the name_cache, as it needs to alloc image memory.
This one is fixable by spliting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriatedly.
# nanosleep may not be part of libc, also search it in other libraries
@@ -192,8 +155,6 @@ if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
G_GINT64_FORMAT='"lld"'
G_GUINT32_FORMAT='"lu"'
G_GINT32_FORMAT='"ld"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
GPOINTER_TO_UINT="((guint)(long) (ptr))"
@@ -203,8 +164,6 @@ elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
GSIZE_FORMAT='"lu"'
G_GUINT64_FORMAT='"lu"'
G_GINT64_FORMAT='"ld"'
G_GUINT32_FORMAT='"u"'
G_GINT32_FORMAT='"d"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
GPOINTER_TO_INT="((gint)(long long) (ptr))"
GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
@@ -214,8 +173,6 @@ elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
GSIZE_FORMAT='"I64u"'
G_GUINT64_FORMAT='"I64u"'
G_GINT64_FORMAT='"I64i"'
G_GUINT32_FORMAT='"I32u"'
G_GINT32_FORMAT='"I32i"'
else
AC_MSG_ERROR([unsupported pointer size])
fi
@@ -248,6 +205,7 @@ if test "x$PKG_CONFIG" != "xno"; then
fi
AM_CONDITIONAL(HAVE_GLIB, $have_glib)
AC_ARG_ENABLE(quiet-build, [ --enable-quiet-build Enable quiet runtime build (on by default)], enable_quiet_build=$enableval, enable_quiet_build=yes)
AC_SUBST(GPOINTER_TO_INT)
AC_SUBST(GPOINTER_TO_UINT)
AC_SUBST(GINT_TO_POINTER)
@@ -256,12 +214,14 @@ AC_SUBST(GSIZE)
AC_SUBST(GSIZE_FORMAT)
AC_SUBST(G_GUINT64_FORMAT)
AC_SUBST(G_GINT64_FORMAT)
AC_SUBST(G_GUINT32_FORMAT)
AC_SUBST(G_GINT32_FORMAT)
if test x$enable_quiet_build = xyes; then
AC_CONFIG_COMMANDS([quiet], [for i in `find src test -name Makefile.in | sed -e 's/Makefile.in/Makefile/g'`; do if test -f $i; then $srcdir/../scripts/patch-quiet.sh $i; fi; done], [shell=$SHELL])
Loaded 100 of 17179 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.