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.
This is an extension for the benefit of the Mono/Java bridge on
MonoDroid. We go through all finalizable objects and report the
strongly connected components of bridge objects and their
connections between each other.
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.
* assembly.c:
* domain.c:
* image.c:
* coree.c: Coree funcionality is now under the
ENABLE_COREE define that is not set by default. The
current code breaks the verification infrastructure.
Fix the way RunningOnMac is detected (use `uname`=="Darwin"), thanks
to Michael Hutchinson.
And use "/Library/Frameworks/Mono.framework/External/pkgconfig" as a
search path for pkg-config files on MacOSX.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs:
Change the order of paths.
* Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources:
Use MS.Build.Tasks/Utilities.cs, for using RunningOnMac .
* Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs:
Look in "/Library/Frameworks/Mono.framework/External/pkgconfig"
for .pc files, on Mac.
* Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs
(RunningOnMac): New.
String hash cache must not be thread-local. Hashes computed for a string once must be shared by
all the threads or different URLs may be generated for the same assembly+resource pair.
UpdatePanel triggers must be initialized not only during the Load event but also when they are
inserted after that point.
Emit location information in error messages for condition parsing
errors.
* Microsoft.Build.BuildEngine/Token.cs: Add position information.
* Microsoft.Build.BuildEngine/ConditionParser.cs: Track api changes.
Improve error messages.
(ExpectToken): Rename to ..
(IsAtToken): .. this, to better reflect its behavior.
* Microsoft.Build.BuildEngine/ConditionTokenizer.cs: Track api
changes and improve error messages.
* Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs: Track api
changes
* mini-exceptions.c (mono_walk_stack): Change the do_il_offset
parameter into unwind_options which is an enum that allows
multiple options to be passed.
* mini-exceptions.c (mono_jit_walk_stack_from_ctx): Ditto.
* mini.h: Introduce MonoUnwindOptions which allow stack
unwinding callers to specify that they don't want precise
method lookup (IOW, no need to deal with gsharing) which
allow those functions to be signal safe.
* mini-exceptions.c (mono_install_handler_block_guard): Ask
mono_walk_stack to perform signal safe unwinding.
Fixes#662741
Add "/Library/Frameworks/Mono.framework/External/xbuild" to
MSBuildExtensionsPath on MacOSX.
From the bug report:
The purpose of this directory is to provide a place for third-party
installers to place extensions where they will not be removed by Mono
upgrades. MonoDevelop patches this into the xbuild MSBuildExtensionsPath
for builds within MD but it would be useful to have it work outside of MD.
We do not create a new string after a quotation, unless the next
character after a closing quote is a space. This allows parsing
the string:
"foo","bar"
As:
foo,bar
This fixes#655896
1# Explicit paths specified without -i nor -o; assuming --only paths...
* MonoCustomAttr.cs (GetBase): For the purpoise of
searching for custom attributes we need to use the
immediate overwritee and not the base definition.
Fixes#662867 and possibly more.
has_references can be set even though the class has no references
registered by the GC. One case is Ephemeron. Now we always go by the
GC descriptor which holds the information relevant to SGen.
This fixes a crash in the 4.0 corlib testsuite.
This function is called from mini-gc.c when a collection is triggered,
which can happen before any managed call is executed by the thread.
At least the allocation of the thread object happens in unmanaged code.
This is needed as the 4.0 profile calls 'al' (which is defaults to 4.0) and not
'al2' and if Mono older than 2.8 is installed on the machine, 'al' coming from it
will fail to work with the current Mono and thus some tests will fail.
The commit should fix the 300+ failing tests on the build bots.
The new test case uses arrays and postpones creation of CacheItemPriorityQueueTestItem and TestCacheItem
instances till the actual test is ran. This reduces complexity of the CacheItemPrioritQueueTest class
constructor and allows the code to run successfully on 32 bit machines.
* mini.h: Introduce a new MonoContext variable to be used
by the interrupt protection code.
* mini-exceptions.c: Use new field.
* mini-trampolines.c: Ditto.
This fixes finally_guard.exe on OSX.
* mini-x86.h: Define MONO_ARCH_MONITOR_ENTER_ADJUSTMENT to
cover the whole stack adjustment add that comes after call.
* mini.c (create_jit_info): Use an ARCH define for how
big the try block adjustment needs to be as x86 is more
spacy than amd64.
WebTest is now a partial class and every code outside System.Web that uses it can copy its own
resources in addition to the common ones by implementing the CopyResourcesLocal partial method.
* reflection.c: The copy versions of type/hash functions
is no longer needed. Just get rid of them which brings
some niceties such such as support for FNPTR.
* class.c (mono_class_implement_interface_slow): If the reflection
type has not been realized, ignore it since can't affort
to do it from here.
Fixes#656262
Remove constants fields, embed the bitmap array after the structure, use
offsets into the bitmap array instead of pointers, encode the callsites
table using i8/i16 if possible.
The following changes were done to specially support OSX:
* MyMusic on OSX is ~/Music
* MyPictures on OSX is ~/Pictures
* Fonts on OSX is ~/Library/Fonts
* Favorites on OSX is ~/Library/Favorites
* ProgramFiles on OSX is /Applications
* InternetCache on OSX is ~/Library/Caches
The documentation has been updated accordingly.
* Actually use the SpecialFolderPathOptions where we need them
-> Create is acknowledged
-> DoNotVerify is ignored, as Mono historically did not throw an
exception on missing directories.
* Rename InternalGetFolderPath to UnixGetFolderPath as this is what it is.
* Fix existing references to the code
* Fix indentation in routine that was never properly formatted (ReadXdgUserDir)
This change allows mscorlib to get the real PlatformID, to split code between
OSX and general Unix. We continue to expose the value 4 (Unix) to usercode
as changing this might break user applications.
When the number format includes several groups make sure that the last (leftmost) one is adjusted
so that its width is not larger than the number of remaining characters.
This is a temporary measure, as we only use 1/10th of Jonathan's
icons and style, but will do while we get Kipunji deployed.
The major benefit is that the native Linux and MacOS Monodoc
clients when using Gecko or WebKit can render something that is not
hideous.
Finalizer chaining is done at compile time, so if you compile
against a lib with no finalizer and then run against one with
a finalizer, you'll end up ignoring the finalizer in the second
lib and it will never be run. Therefore we need to take these
into account.
In order to ensure that monolite actually works you need to ensure that
the corlib in it has the same version as your runtime. Monolite
archives are now versioned monolite-MONO_CORLIB_VERSION-DATE.
Properly reset the abort state of threadpool threads that processed
domain unloading or were running in a domain that was being unloaded.
Thanks go to Kumpera for finding this out.
* mini-exceptions.c (mono_handle_exception_internal_first_pass): Store the
exception object in bp + ei->exvar_offset before invoking an exception
filter. Use mono_debugger_agent_exception_filter().
* debugger-agent.c: Add mono_debugger_agent_exception_filter(); stores
the original context in `tls->filter_ctx' while invoking the filter.
* Mono.Debugger.Soft/Test: Add test cases.
Fixes#657609.
Android uses "ye standard" timezone file format, but instead of using
a directory + file structure as libc uses, they throw everything into
two files, a "zoneinfo.dat" and a "zoneinfo.idx", where "zoneinfo.dat"
is the concatenation of all the TZIF files and "zoneinfo.idx" contains
the timezone names and offsets into "zoneinfo.dat". From the
ZoneInfoDB documentation:
However, to conserve disk space the data for all time zones
are concatenated into a single file, and a second file is
used to indicate the starting position of each time zone
record. A third file indicates the version of the zoneinfo
databse used to generate the data.
TimeZoneInfo.Android.cs is a C# port of the corresponding Android
ZoneInfoDB type so that Mono can use Android's timezone DB.
* MoonIsolatedStorageFile.cs: Return true, instead of throwing a NIE,
for IsEnabled since this is the behavior for Silverlight 3 (i.e. always
enabled) even if the call is new in SL4 (but part of ML3 ;-)
* appdomain.c (unload_thread_main): Call function
bindings cleanup.
* assembly.c (mono_assembly_apply_binding): Dupe the
content of per-domain bindings. Assign a domain_id on
such entries to be possible to track them later.
* assembly.c (mono_assembly_cleanup_domain_bindings):
New function that removes per-domain bindings on
unload.
* metadata-internals.h (MonoAssemblyBindingInfo): Add
domain_id field so it's possible to track if an entry
is appdomain bound.
* marshal.c (emit_struct_conv): Take the native type of
the field to decide what kind of conv to use if field
is of type char.
* marshal.c (mono_pinvoke_is_unicode): Unify auto
and default.
* marshal.c (emit_struct_conv_full): Kill this variant
that doesn't make any sense as structures are marshaled
in the same way regardless of the charset of the method.
* metadata.c (mono_type_to_unmanaged): Handle marshalspec
for char.
Fixes the regression on MD caused by 1f3cfba.
When security trimming is requested for sub-path of a location specified in the config file,
make sure that we match such a request to its parent location.
Based on patch from Mike Morano <[email protected]>, thanks!
Windows socket behaviour seems to be slightly different from
Linux/Mac, and Mono.Debugger.Soft was trying to disconnect a socket
that that doesn't get connected, causing an exception at launch.
For some reason it did check the main debugger socket before trying
to disconnect it, but not the console socket, so only apps with
redirected console output would crash.
Issues include: casts not being properly generated for nullable
types, missing cast when the type of a member does not match
the forced serialization type, and incorrect code generated
for handling [XmlText] members.
When running the tests on the 4.0 profile, the configuration must no longer include
the System.Web.Extensions section declarations as they are merged with machine.config right now.
The type argument list for generic nested types include
all types arguments for the whole declaring type chain.
When generating the C# name of the class, each type
argument has to be assigned to the correct class in
the chain.
Invocations to generated serializers are done through
reflection, so exceptions are masked by TargetInvocationException.
The inner exception has to be rethrown so that the client
code gets the correct exception.
The expression in `if(expr)`, if overly-long and spanning mulitple
lines, should be indented beyond the normal indent so that the
expression is more easily distinguished from the `if` body:
if (expr &&
expr2 &&
expr3)
body;
not:
if (expr &&
expr2 &&
expr3)
body;
Switches Keyboard focus so that it occurs before WM_SETFOCUS is sent.
This means that the wrong keyboard im is selected while process winform events
caused by WM_SETFOCUS.
Attaching patch that changes this so that keyboard im is focused before
WM_SETFOCUS is sent.
Fixes: #557277
Attached Patch allows WinForms controls to get preedit notifications (by
overriding WndProc) when mono is run with MONO_WINFORMS_XIM_STYLE=on-the-spot
mono
Changelog from attach patch:
2009-11-20 Tom Hindle <[email protected]>
* XplatUIStructs.cs: Added user messages WM_XIM_PREEDITSTART,
WM_XIM_PREEDITDONE, WM_XIM_PREEDITDRAW, WM_XIM_PREEDITCARET
* X11Keyboard.cs: Changed preedit callbacks to emit WM_XIM_* messages
* X11Structs.cs: Added XIMFeedbackStruct and XIMFeedback enum.
Here is some sample code which make use of this feature:
/// <summary>
/// Proof on concept implementation of a user defined TextBox that does on-the-spot
/// input method editing.
/// There is a number of know flaws - eg. doesn't end preedit when user moves cursor with mouse.
/// Need to run with MONO_WINFORMS_XIM_STYLE=on-the-spot mono
/// </summary>
public class OnTheSpotTextBox : TextBox, XIM.IPreedit
{
// store text before preedit.
string backup;
#region IPreedit implementation
public int PreeditStart (IntPtr clientData, IntPtr callData)
{
Console.WriteLine ("PreeditStart");
backup = Text;
return 100;
}
public int PreeditDone (IntPtr clientData, IntPtr callData)
{
Clear ();
AppendText (backup);
return 0;
}
public int PreeditDraw (IntPtr clientData, IntPtr callData)
{
XIM.PreeditDrawInfo info = new XIM.PreeditDrawInfo (callData);
Console.WriteLine ("PreeditDraw PreeditDrawInfo {0}", info);
if (info.ChangeLength > 0) {
Clear ();
AppendText (backup);
}
if (info.Caret > 0)
AppendText (info.Text);
return 0;
}
public int PreeditCaret (IntPtr clientData, IntPtr callData)
{
XIM.PreeditCaretInfo info = new XIM.PreeditCaretInfo (clientData);
Console.WriteLine ("PreeditCaret PreeditCaretInfo {0}", info);
return 0;
}
protected override void WndProc (ref Message m)
{
switch (m.Msg) {
case /*WM_USER*/0x400 + 0x1d00:
// WM_XIM_PREEDITSTART
// The WParam value identifies what is occurring.
PreeditStart (m.WParam, m.LParam);
break;
case /*WM_USER*/0x400 + 0x1d01:
// WM_XIM_PREEDITDONE
PreeditDone (m.WParam, m.LParam);
break;
case /*WM_USER*/0x400 + 0x1d02:
// WM_XIM_PREEDITDRAW
PreeditDraw (m.WParam, m.LParam);
break;
case /*WM_USER*/0x400 + 0x1d03:
// WM_XIM_PREEDITCARET
PreeditCaret (m.WParam, m.LParam);
break;
}
base.WndProc (ref m);
}
#endregion
}
Fixes: 641756
This prevents idle methods to be invoked when calling the Clipboard
APIs on X11, which is not the expected behavior.
The description from the bug report is:
Mono X11 Clipboard handling calls UpdateMessageQueue, which has the side affect
of potentially calling Idle handlers.
If any Idle handlers call Clipboard functions, this can cause idle handler
reentry.
See attached test case.
Incidentally removing the reentry check from the idle handler will actually
cause mono to segfault.
I will attach a patch shortly which fixes this by overloading
UpdateMessageQueue to allow Clipboard methods to call a version that doesn't
run idle processing.
Patch from Thomas Goldstein for bug #621475
The IndexOutOfRangeException is apparently a caret position bug. As a
workaround, doing textbox.SelectionStart = 0; before resetting the Text avoids
the bug.
Here's a patch to fix the bug. Basically, it applies the same caret updates
whether the Text is null/empty or not.
I hope I can get away with the minor style updates without having to submit
them as a separate patch...
* security-core-clr.c: call mono_field_get_type_checked to ensure the
field's type is resolved since coreclr checks can occurs before the
"normal" check done by mono. Fix crashes in DRT#8005
* marshal.c (emit_struct_conv): Add _full variant that
takes an extra boolean argument to tell if char is to be
marshaled with one or two bytes.
* marshal.c (emit_marshal_array): Use emit_struct_conv_full
to correctly marshal ansi char arrays.
Multiple threads might be waiting on the lock and the modules get
loaded and initialized multiple times, leading to an error. This patch
fixes it and always returns the right initialization exception, if any,
to the client.
It turns out we iterate over all allocated blocks often enough that
the way we did it for fixed-heap Mark&Sweep (iterating over all blocks
and jumping over the non-allocated ones) slows us down considerably.
So, use the same allocated block list as "regular" Mark&Sweep, which
also unifies the code a bit.
Mature allocation uses the degraded allocation machinery to allocate
objects in the major space. Modifying degraded_mode in those cases
will actually put us into degraded mode which slows us down immensely.
* loader.c: Use new split functions.
* metadata-verify.c (parse_custom_mods): Make sure encoded
type tokens are not zero.
* metadata-verify.c (parse_generic_inst): Ditto.
* metadata-verify.c (parse_type): Ditto.
* metadata-verify.c (mono_verifier_verify_memberref_signature):
Replace this function with a pair that does field or method
verification.
Fixes#656914
** Fixes#456234 - Patch by [email protected]
* OdbcDataReader.cs (GetValue): Handle SQL_NO_TOTAL sanely and
use corresponding Decoder.GetChars instead of Encoding.GetString.
It's possible that the IEnumerable<string> that
OptionSet.ArgumentEnumerator is enumerating may be generated via
'yield return', in which case any method `finally` blocks are moved
into the IDisposable.Dispose() method.
To ensure proper resource cleanup, we need to make sure that Dispose()
is called on the IEnumerator<string>s.
* metadata-verify.c (parse_generic_inst): A ginst
param can have a cmod.
* metadata-verify.c (parse_param): We can have a cmod
after the byref.
* metadata-verify.c (parse_property_signature): A property
signature can have a cmod on the parameters.
Fixes the verifier for #656787
Before sweeping hasn't finished we don't know how many major blocks
are in use, so we delay computing the minor collection allowance until
sweeping is done. In the mean time we use the minimum allowance.
There are several refactorings as well as some hacky workarounds to avoid
wrong saving of names. References should return PositionalParameters, but
in the standalone tests they don't return it, so I have to sort both out.
Enabled xml writer tests as they are working.
Response file support is an "opt-in" feature, performed by adding a
ResponseFileSource to the OptionSet initialization logic:
var p = new OptionSet () {
// normal options here...
new ResponseFileSource (),
};
Response files make use of the new "ArgumentSource" support, which
acts as a low-level argument pre-processor, allowing processing of
arguments _before_ Option processing is performed.
* metadata.c (mono_type_to_unmanaged): Return
the appropriate type for char based on unicode option.
* marshal.c (emit_marshal_array): Calculate char size
based on marshaling preferences.
Fixes#647267
* gc.c: Implement mono_gc_alloc_mature
for boehm and null-gc.
* sgen-gc.c (mono_gc_alloc_mature): Alloc
using the degrated machinery.
* threads.c (create_internal_thread_object):
Alloc using mono_gc_alloc_mature instead of
mono_gc_alloc_pinned_obj as the later requires
explicit freeing and we don't do it.
* threads.c (create_thread_object): Ditto.
* mini-trampolines.c (mono_delegate_trampoline): A ldftn
is only to be promoted to a ldvirtftn if the target method
belongs to an abstract class. This fixes mcs/test/test-283.
* reflection.c (mono_image_create_token): Don't mono_class_init
here as it's not needed and break mcs for cases doing
typeof() over broken types.
Fixes a TLE in #653211
Previously we updated heap boundaries when a new block was allocated,
but no updates were performed for freed blocks, resulting in a
constant increase in the heap boundaries which can lead to unnecessary
work during pinning.
Now we recompute the heap boundaries during the sweep phase at each
major collection.
* man/mprof-report.1, log-profiler.txt: updated the documentation.
* decode.c: added jit report and sample report.
* proflog.h, proflog.c: implemented statistical sampling mode, using
either the mono built-in signal based sampling and the Linux
perforamnce counters perf subsystem. Unmanaged symbols are
currently available for ELF systems implementing dl_iterate_phdr()
or systems implementing dladdr().
Removed tricky GetWrappedValue() while attempting to reduce its use (could
totally remove it out) to identify which parts these readers and writers need
it. Now It is in TypeExtensionMethods. Still needs fix for StaticExtension.
Add another tricky test case: List of Array (not working) which also involves
MarkupExtension.
* mini.c (mini_method_compile): Add a BR to all basic blocks
that fallthru blocks that are out of line.
* branch-opts.c (mono_optimize_branches): Don't eliminate
a BR to the next block if is out of line.
Fixes#318677
* Thread.cs: Move culture data from InternalThread to Thread
and thus completely avoid the whole caching and serialization
nightmare. Even thou this is a cleanup it should speed up
multi-appdomain setups.
* threads.c: Remove culture caching machinery.
* icall-def.h: Ditto.
Fixes#318750 as a byproduct.
* mini-trampolines.c (mono_delegate_trampoline): Handle the
case of a delegate created with ldftn on which the method token
points to an abstract method. This case behaves in the same way
as ldvirtftn.
Fixes#317488
* verify.c (mono_verifier_is_enabled_for_method):
A dynamic method has a different wrapper kind than regular
methods.
* verify.c (mono_verifier_is_method_full_trust): Dynamic
methods can't be handled as fulltrust since they don't
store proper origin for verifying it.
* mini.c (mini_assembly_can_skip_verification): Dynamic
methods have a different wrapper kind than regular
methods.
FIxes#655497 under sandbox.
* icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
CreateDelegate can be called with an abstract method in a
similar fashion to how ldvirtftn works.
Fixes#655741
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes#655847
This writer can process a lot more xaml inputs. It is now unified to
XamlXmlWriter, sharing some internals (already existed in XamlXmlWriter.cs).
Had to disable a few minor tests that used to pass for invalid inputs.
* Delegate.cs (CreateDelegate): Fix visibility and make
sure that we fail to bind to first argument of static
arguments to overloads that don't pass it.
* DelegateTest.cs: Add tests for the previous change.
Fixes#655439
* class.c (mono_class_init): Check instantiations of generic
instances.
* icall.c (ves_icall_Type_MakeGenericType): Ditto.
* verify.c: Add mono_verifier_class_is_valid_generic_instantiation
to the internal API so generic instances can be checked.
Fixes#654136
This is ~identical to commit a3ba2ab7a0,
just applied to the MonoDroid and MonoTouch profiles.
Furthermore, without this patch the MonoDroid & MonoTouch profiles fail to
build, as current versions of mcs (nicely) attempt to verify that the output
assembly name matches the IVT of a referenced assembly, which isn't possible
when System.Xml.dll has an IVT entry for System.ServiceModel.Web.dll which
differs from System.ServiceModel.dll's IVT entry for
System.ServiceModel.Web.dll.
* AssemblyInfo.cs: Remove IVT from System.ServiceModel on Moonlight
profile since SL use a different public key and it is not required
for the limited build provided by SL.
* metadata-verify.c (is_valid_fixed_param): Handle arrays
of types. They can be encoded as 0x1B or 0x50.
* metadata-verify.c (is_valid_cattr_content): Ditto.
Fixes#655159
Notifications of changes were sent using Monitor.Pulse() while the
scheduler thread was in a Monitor.Wait(). The way we handle
Monitor.Wait() internally involves creating an manual-reset event and
waiting on it each time Monitor.Wait() is called.
With this change, one 1 event is created for the lifetime of the
appdomain. These seems to help avoiding contention when there are a lot
of timers in play.
- Rewrote the CacheItem priority queue test generator to generate better code.
- CacheItem in System.Web doesn't have the unused Guid field now (the field is used only for tests)
- Added a huge sequence to CacheItem priority queue tests (10k entries)
It is possible that the user running the ASP.NET application does not
have permission to write to the registry. In this case, the auto
generated keys will be created on every application start.
This was using the *A functiones instead of the *W ones and passing in UTF16.
It was also opening and closing the directory just to check that it was
there and then open it again !?.
Fixes bug #645189.
* System/Uri.cs: Add support for 'safe' unescaping rules
* System/UriParser.cs: Add support for SafeUnescaped in Format. Avoid
escaping the # when adding a fragment at the end of the Uri
* Test/System/UriTest.cs: More test cases for GetComponents wrt
different UriFormat
In certain situations, the type-parameter counting code doesn't
skip tokens properly. In some circumstances, this results in
invalid links (e.g. refing KeyValuePair`1, not KeyValuePair`2),
in others it results in an XSLT error with "!WTF 2".
The problem was we weren't properly checking for nested types.
Sometimes we use wrapper methods or other tricks under the hood,
but we provided to the profiler some inconsistent information,
for example the MonoMethod pointer in enter/leave events could be
different from the one used in reporting jit compilation.
This patch introduces a concept of aliased methods: more
than one MonoMethod pointer could correspond to the same jit info
and as such, more end_jit notifications can happen for the same
compiled code. This also means, in turn, that you can get a
end_jit notification for MonoMethod pointers that weren't reported
in a start_jit event.
This partially reverts the change in 2e0067422b, which doesn't
have an associated bug report anyway (this change instead fixes
the issue with unresolved methods in the log profiler).
* System.Web.Caching/CacheItemPriorityQueue.cs: when the heap is resized, the old heap memory
is cleared.
* System.Web.SessionState_2.0/SessionInProcHandler.cs: the session items collection is cleared
when the InProcSessionItem is destroyed
* System.Web/HttpApplicationState.cs: instantiate SessionObjects and StaticObjects collections
only on demand.
Replaced ReaderWriterLock with ReaderWriterLockSlim.
Removed a few variables which aren't needed.
* System.Web/HttpStaticObjectsCollection.cs: replaced a Hashtable with a Dictionary <string, object>.
The objects dictionary is created on demand only.
remove_wsq() should only clean up the queue when the runtime is shutting down.
In any other case, removing a queue that still contains work items is an error.
The return value of mono_sem_timedwait() with a timeout 0 was incorrect
(0=failure, !0=success instead of 0=success). This worked on
non-Windows platforms because the only call with timeout 0 was
expecting the incorrect return value, but it made the mono threadpool
in Windows fail.
Fixes bug #653928.
* loader.c (find_method_in_class): Properly
handle failure of loading a method.
* loader.c (find_method_in_class): Handle method load
failure. We can't just bail out since working code
depends on working while having broken methods in the
mix.
Fixes#562009
If all the items in the collections were saved to the view state, the collection must call the Clear ()
method in order for the OnClear and OnClearComplete methods to be invoked. Telerik RadComboBox depends
on it to remove dynamically added entries before they are recreated when the view state is loaded by
the control.
* profiler-private.h, profiler.c, profiler.h: added API to
enumerate the roots used during a garbage collection.
* sgen-gc.c: enumerate roots if requested by the profiler.
This version uses an LRU cache to hold the cache items. Priority is not taken into account
when removing the underused entries (with the exception of the CacheItemPriority.NotRemovable
- items with this priority are never purged), they are treated equally.
A separate thread is not used to perform purging, instead the collection happens in the current
requests's thread.
Minor improvements to cache item enumerator and to the CheckDependencies method.
* Cache.cs: cache removes old/least recently used items when the item count exceeds 15000. Items
are removed until they reach the count of 10000.
* SessionInProcHandler.cs: replaced ReaderWriterLock with ReaderWriterLockSlim and added a Dispose
method to the InProcSessionItem type which disposes the associated lock and other resources.
The GC now provides also offset information for each referenced object
in the heap walk API: this info is saved in the profile data now.
Updated the data version for the file format change.
* proflog.c: if the output option is used together with report, the report
is saved to the named file instead of being printed to stdout.
* decode.c: zlib seems to get confused with a non-compressed strem
coming from stdin: disable it in that case...
Also deal with reading 0 bytes from a buffer.
* utils.h, utils.c: added getpid() wrapper.
* decode.c: display the program pid if available.
* proflog.c: added substitutions for the output name, change the default
behaviour to not overwrite a file and allow '-' at the start of the
file name to force overwrite.
* proflog.c: we now unlink the output file before creating it to
prevent possible corruption from multiple processes writing to the
file. Added also extra checks for async events (which shouldn't happen).
* decode.c: fix file offset when using zlib.
When SecurityTrimmingEnabled is set to true for the node, the cached children
collection also depends on the IPrincipal set for the current context.
Fixes bug #641449.
This change was basically for string serialization of XamlTypeName, namely
PropertyDefinition serialization.
Turned out it should be used in a lot of places where IServiceProvider
and ITypeDescriptorContext is expected.
IServiceProvider implementations in XamlWriters are replaced.
When building with Cygwin or a cross-compiler there are at least 4
functions that are not present (inet_ntop, getaddrinfo, getnameinfo and
freeaddringo) so in these cases we just disable IPv6. Note that
Socket.OSSupportsIPv6 will still return true.
When building with VS, IPv6 will be supported without a problem.
* AppDomain.cs: Add internal SetCompatibilitySwitch so it is possible
to set values that will be returned by (public) IsCompatibilitySwitchSet
(needed by Moonlight)
* sgen-gc.c (collect_nursery): If any object was pinned
after initial pinning, sort the queue so build_nursery_fragments
will see the aditional objects.
If pinning due to OOM happened ask for a major collection.
* sgen-gc.c (major_do_collection): Adjust the pin queue if
OOM happened. Here we have to clean discarded entries before
optimizing the queue or we might end with interior pointers
in the mix.
* sgen-gc.c (sgen_collect_major_no_lock): New function so
major collectors can trigger a collection. They can't
use public API since the gc lock is not meant to be reentrant.
* sgen-major-copy-object.h (copy_object_no_checks): Pin
the object if we can't promote it.
* sgen-marksweep.c (alloc_obj): Return null if we fail
to allocate a block for a given freelist size.
* sgen-marksweep.c (major_alloc_degraded): Ditto.
* sgen-marksweep.c (major_copy_or_mark_object): Handle OOM.
* sgen-marksweep.c (major_alloc_small_pinned_obj): If allocation
fails, try a major collection since this is memory requested by
the runtime and it's much harder to handle failure.
* sgen-gc.c (need_major_collection): Add a space_needed
parameter that is checked against the available space
quota.
* sgen-gc.c (alloc_degraded): Adjust call to
need_major_collection. Pass zero as space_needed since
it's won't help to do a major gc if we're already doing
degrated alloc and old gen is full.
* sgen-gc.c (alloc_large_inner): Pass size to
need_major_collection as shrinking major might be needed
to meet the space quota for.
* sgen-gc.c: Simple accounting with no los/major reserve.
* sgen-los.c:
* sgen-marksweep.c: Account for allocation and release of
memory. Fail to allocate if above alloc quota.
Usually WCF requires that each service method is marked with the OperationContract attribute with the exception
of methods decorated with the Web{Get,Invoke}Attribute attributes which are defined in System.ServiceModel.Web.
This patch adds a simple way to extend the ContractDescriptionGenerator in order to provide this functionality
without circular dependency of System.ServiceModel on System.ServiceModel.Web. Several extenders can be registered
with the description generator and they will be invoked in the registration order until any of them returns 'true'.
Extenders are passed a reference to the OperationContract attribute with which the current method is decorated - if
the reference is null, the extender should create a default instance of the attribute so that the description generator
considers the method as one to be included in the contract description.
* profiler-private.h, profiler.c, profiler.h: users can now get a callback
when the name of a thread gets set when MONO_PROFILE_THREADS is enabled.
* threads.c: notify profilers about thread name changes.
* proflog.c, proflog.h: added support for tracking GC handle creation
and destruction. Updated profiler version.
* decode.c: added support for GC handles in the GC report, including
backtraces.
* profiler-private.h, profiler.c, profiler.h: new API to get notiffications
when GC handles are created or destroyed.
* gc.c: notify the profiler on GC handle creation/destruction.
mono_set_lmf () calls *(mono_get_lmf_addr ()) = lmf, but
mono_get_lmf_addr could potentially point to the address we just
g_free'd. Ensure that we clear the settings, before freeing the memory.
On OSX our local system glib might be 32 or 64 bit, and we have
no simple way of testing wether it meeds the needs of the current
built, lets just disable tests by default for now
Adds a call to the Win32 function SetConsoleCtrlHandler for Windows,
which adds the DoWindowsConsoleCancelEvent wrapper for
DoConsoleCancelEvent to the Ctrl-C handler when an event handler is
added, and removes the handler once all event handlers are removed.
* verify.c (mono_generic_param_is_constraint_compatible):
Handle transitive constraints where one type can only satisfy
the constraints required by means of the other types it's
constainted to. For example:
Bar<K> where K : IFace
Foo<T, U> where T : U where U : IFace
Bar<T>
On the above example, T can only satisfy K constraint by means
of the constraints that U has.
The serialization classes provided by the SL toolkit
(System.Runtime.Serialization.dll) don't like having Close called more than
once, so it seems that they don't check their own state and we have to do it
to avoid making repeated Close calls.
* String.cs (LastIndexOf): All all overloads to
be compatible with MS with empty strings.
* String.cs (LastIndexOfAny): Ditto.
* StringTest.cs: Add tests for the above.
Fixes#605340
HttpListenerManagerTable always looked up HttpListerManager instances using the full URI
while it should have disregarded the /operation?parameters part of the request in order
to match the service endpoint's base address.
When HttpWriter requests a byte buffer to send data to the output stream it now uses
a thread-local static buffer pre-allocated to at most 128KB (all threads' buffers should
not exceed 4MB). If a buffer exceeding the static buffer size is requested, a transient
one is allocated.
* decode.c: the --track option can now take more than one object address to track.
Added the --find option to automatically track objects of a given size and/or
type name. When backtrace and heapshot information is present, we can now, for
example, find when and where all the byte[] arrays bigger than a certain size
have been created and which other heap objects reference them.
* metadata-verify.c (is_valid_method_header): The local
token cannot have a zero index.
* metadata.c (mono_metadata_parse_mh_full): Fail if locals
token index is zero.
Fixes#651682
* metadata.c (do_mono_metadata_parse_type): It's possible
that we're decoding a reference to a class that it's currently
been loaded so byval_arg.type will be zero.
* mini-exceptions.c: sometimes an allocation happens at thread startup
where the data structures are not yet setup to allow stack walking.
If we request a stack trace there, we'd crash. To reproduce the crash
without this change, just run xsp with the log profiler with the nocalls
option.
When the occupancy for some block size falls below a certain
threshold the objects in that block size will be evacuated in
the next major collection, resulting in optimal occupancy.
* System.Net/CookieParser.cs: Add more common/shared code
* System.Net/HttpWebResponse.cs: Move out CookieParser class and some
utility methods so they can be shared with Moonlight http client stack
* System.dll.sources:
* mobile_System.dll.sources:
* moonlight_shared_System.dll.sources:
Add new CookieParser.cs to the build
This is the first preview version of the new log profiler.
It is not included in the build yet because it needs some
portability cleanups, see the top of proflog.c for compilation
instructions.
It currently works on Linux x86 (64 bit support may work but it
is untested).
The documentation is included in the log-profiler.txt file.
* Rename mono_jit_walk_stack_from_ctx_in_thread to mono_walk_stack.
* Make the old stack walker use this one.
* Remove the old mono_walk_stack functions.
* System.ServiceModel_test.dll.sources: Add
MsmqTransportSecurityTest.cs,
CustomPolicyConversionContext.cs,
ConnectionOrientedTransportBindingElementTest.cs,
and MsmqBindingElementBaseTest.cs to our test build.
* CustomPolicyConversionContext.cs: New file, containing a dummy
child of PolicyConversionContext.
* MsmqBindingElementBaseTest.cs: New test file.
* ConnectionOrientedTransportBindingElementTest.cs: New test file.
* HttpTransportBindingElementTest.cs: Add IPolicyExportExtension
tests.
Unlike 03c231a585, this isn't needed for
'mdoc-validate', it's instead for "niceness" reasons.
For example, as with f6e4f65b, if we update docs generated by an older
version mdoc, we'll add a <TypeSignature/> for ILAsm. However, the
added <TypeSignature/> is at the end of the file, nowhere near the
existing <TypeSignature/>s, which is...odd. Not bad, per-se, but
"undesirable".
Thus, we order things for consistency during/after updates.
The problem is the intermixing of updating "old" documentation and
wanting the result to pass `mdoc validate`.
For example, mdoc-2.6 will only generate a <MemberSignature/> for C#,
while mdoc-2.8+ will generate two, one for C# and one for ILAsm.
Unfortunately, mdoc will _append_ the new <MemberSignature/> as the
_last_ child within <Member/>; result: 'mdoc validate' gives errors.
Oops.
Thus, we explicitly reorder //Member children so that the ordering
matches the order in monodoc-ecma.xsd.
It appears that on OSX the FPU settings on x86/amd64 are not inherited
to child threads of a process, leading to differences in precision between
the main thread and the sub thread. We now call mono_arch_cpu_init
on every thread on every platform
* metadata.c (do_mono_metadata_parse_type): Fail if
a valuetype is encoded as MONO_TYPE_CLASS and vice-versa.
This can't be done easily in the verifier since it requires
resolving the destination type.
Fixes#650936
* metadata-verify.c (parse_type): Don't allow zero index type
tokens.
* metadata.c (mono_metadata_decode_row): Assert on negative
indexes.
Fixes#560359
2010-11-03 Martin Baulig <[email protected]>
* mono-debug.c (mono_register_symfile_for_assembly): New method.
This is used together with mono_register_bundled_assemblies() and
mono_register_config_for_assembly() to support bundles.
* pedump.c (verify_image_file): Finish initializing the
runtime here since at this point we can safely query
what version the supplied image requires.
Fixes#650916
* mcs/class/corlib/Mono.Security.X509/X509Store.cs:
* mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs:
Replace INSIDE_CORLIB by !NET_2_1 so the new feature is
available to mono/full framework but not where CspParameters
(or file system, or key persistance) might not be possible
This API is currently only implemented for the sgen GC.
It can be used to iterate over all the managed objects in the heap
and it allows to also easily track object references.
* System.Web/System.Web.Handlers/AssemblyResourceLoader.cs: AssemblyResourceLoader/ScriptResourceHandler must
always generate the same URL for every assembly+resource pair, or otherwise the browser would re-fetch
the resource in situations where it is not desired (e.g. during an async request to the server to update
a panel).
The generated URLs are not encrypted using real encryption, just hashed.
In addition, the handler code got modernized a bit.
* System.Web.Extensions/System.Web.UI/ScriptManager.cs: scriptStartupBlock is a 3.5+ thing
* System.Web.Extensions_1.0/Makefile: use the 1.0 Microsoft AJAX library for this compat assembly
* System.Web/System.Web.Util/MachineKeySectionUtils.cs: made GetValidationKey public
The reason for this is applications which still use Sys.Web.Ext 1.0* (note: 1.0 does NOT
mean the assembly is for the 1.x runtime - it's for 2.0). Remapping would cause 1.0* not
to be loaded, instead a 3.5 or 4.0 assembly would be fetched.
* mcs/class/corlib/Mono.Security.X509/X509Store.cs:
* mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs:
Add if !INSIDE_CORLIB around code that use CspParameters
in order to allow compilation to work when bootstraping
the moonlight profile
mcs/class/corlib/Mono.Security.X509/X509Store.cs:
mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs:
mcs/class/corlib/Mono.Security.X509/X509StoreManager.cs:
mcs/class/Mono.Security/Mono.Security.X509/X509StoreManager.cs:
Modified MSX.X509Store to allow importing privateKeys along certificates (by using RSACryptoServiceProvider and KeyPairPersister).
Fixed X509Store to use certificate's hash as CspParameters.KeyContainerName.
mcs/tools/security/certmgr.cs:
Added a new -importKey action to certmgr, which allows importing a PKCS12 contained key into our KeyPair store.
Added a more (verbose) output to certmgr's -list action.
man/certmgr.1:
Updated certmgr man page ti reflect -importKey addition.
mcs/class/corlib/System.Security.Cryptography/CspParameters.cs:
mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs:
Implemented RSACryptoServiceProvider.CspKeyContainerInfo getter
RSACryptoServiceProvider will not take into account CspParameterFlags.UseExistingKey by throwing a CryptographicException if keyset identified by KeyContainerName does not exists.
* Improve the hashing of methods to include generic arguments
* Get rid of can_method_ref_match_method (), use a 'target' argument
to decode_method_ref () instead.
* Bump corlib file format version.
The old Cocoa backend for System.Drawing appears to still work. You must
pass in a NSView.Handle while in the DrawRect method, or with lockFocus
called to prepare the NSGraphicsContext.
* class.c (mono_class_check_vtable_constraints): Only
fetch the class of generic arguments as those are the only
ones we care about. This fixes the case where a generic
arguments has its container as a constraint and we crash
with a stackoverflow.
Telerik controls pass the string "string" as the macKeyModifier parameter to the constructor. Tests show that .NET
accepts such input without throwing an error. The passed string is now converted into a byte array and passed to
the LosFormatter (bool, byte[]) constructor.
When a control is a naming container and an attempt to find a control with non-segmented id (e.g. 'myControl') is made,
the search continues to the control's naming container if pathOffset is 0, that is we're at the start of the search.
XamlMember.IsReadOnly returns false if there is private get accessor.
This is used to filter nonpublic accessors out, so replaced its usage with
!IsWritePublic to check truly read-only members.
This fix also required some changes in markup types (as IsReadOnly value now
differs).
When MapPath is passed a rooted, absolute path which is not in the current application's virtual
root, it should throw an exception. If the path is rooted and within the current application, it
will be mapped as if it was relative to the root.
Nodes are iterated in XamlNodeIterator which is used by XamlObjectReader.
It collects namespace declarations as it does in the reading the objects.
The new code is somewhat better, with less "special" hardcoded rules.
It can be even compiled with .NET (with TypeExtensionMethods).
mono --debug=casts requires fast tls access and the jit tls intrinsic.
We already had support for OP_TLS_GET on darwin/x86, but we did not
expose the "tls offset (pthread_key_t)" from mini to the intrinsic,
instead falling back on the io-layer keys. We now store mono_lmf_addr
in a pthread_key for darwin/x86 so that we can do fast-tls in the jit
and fix this feature. X86 only for now.
r: kumpera
* class.c (mono_class_create_from_typedef): If the type
fails due to a problem with the parent make sure we have
byval_arg and this_arg are setup properly as the whole
runtime requires those two to be setup even for broken
types.
* class.c (mono_class_create_from_typedef): Avoid a loader leak
on parent load.
* class.c (mono_method_signature_checked): Avoid a loader leak
if type parsing fails.
Control.AddedControl will call the new control's LoadRecursive which would trigger its OnLoad
handler. OnLoad must be called only if control hasn't already been loaded.
* MonoMethod.cs: Add new icall for ::Attributes.
* icall.c: New icall to resolve ::Attributes so it can
avoid loading the signature and work around methods with
broken signatures.
Fixes#649527
This patch changes the way we output theme stylesheets to match .NET behavior. Theme
.css files are sorted using an ordinal and case-insensitive comparer and are output
to the page at the top of the <head> element's contents instead of at the end.
Both on Linux and on Windows file paths starting with x:\\, x:// and //server don't have their
paths mapped. On Linux it may have weird (and unexpected for a Windows developer) effects since
we cannot treat those names in any special way - the are valid Unix file names. On Windows things
will work as expected.
* Monitor.cs (TryEnter): Implement v4 overloads that take
a "ref book lookTaken" var. Setting this flag must be done
in the runtime to avoid async exceptions.
* Monitor.cs (Enter): Fix v4 overload to be async exception
safe.
* monitor.c: New icall for the above.
Fixes#649159
* icall.c (ves_icall_MonoType_GetArrayRank): Don't
mono_class_init the class as it's not needed.
* icall.c (ves_icall_Type_make_array_type): Ditto.
Fixes#648833
Use a timer to handle read timeouts and extend reuses to regular
connections, not just chunked. The timer is set to 90s for the first
request and 15s for subsequent requests.
* ILGenerator.cs (TokenGenerator): GetToken now taken an extra
argument create_open_instance if it should encode a gtd as
a generic instance.
* ILGenerator.cs (ILGenerator): Ask TokenGenerator to create
an open instance under all cases but if the opcode is ldtoken.
* ModuleBuilder.cs: Adjust to signature change.
* DynamicMethod.cs: Ditto.
* Environment.cs: Since an icall signature has changed, we
must bump corlib version.
* appdomain.c: Ditto.
* icall.c: Pass the new value forward to
mono_image_create_token.
* reflection.c (mono_image_create_token): Handle create_methodspec
for TypeBuilder and MonoType.
Fixes#649017
* HttpRuntime.cs: disable filesystem watchers on appdomain shutdown and refuse to process
requests while the current AppDomain is unloading
* HttpApplicationFactory.cs: if the current AppDomain is unloading, ignore FileSystemWatcher
notifications
* WebConfigurationManager.cs: work around a deadlock issue when entering a ReaderWriterLockSlim
upgradeable read lock very early during ASP.NET runtime/AppDomain initialization. Every few runs
the attempt would lock up and since adding a section to cache is not a critical operation we can
afford timing the lock out in this case. The lockup is probably due to the fact that RWLS is using
thread local storage to store the current thread's lock status and it may happen that the TLS is
not cleared during thread object finalization (see metadata/threads.c, the start_wrapper function)
To get the same stack trace as in bug #647948, we need to set the
underlying DeflateStream to null and throw the ObjectDisposedException
from this class. Same applies to the NotSupportedException.
* TypeBuilder.cs (GetConstructor): Check if the ctor
declaring type is the right one and the same as type.
* TypeBuilderTest.cs: Add regression test.
Fixes#648391
do canonicalization so we will get the correct charset name, because nl_langinfo (CODESET)
can return different things on different systems. This at least fixes OpenBSD.
namedmutex_prewait was (partially) listing the running processes and
then searching through them. Now we use OpenProcess to verify the owner
of the mutex is still alive.
Fixes bug #648133 (note that you need MONO_ENABLE_SHM for this to work)
After the fix for bug #605092, inserting timers with an equal due time
was failing because searching in the list was also using a reference
comparison. Now, when adding a new timer, we search using just the due
time.
Fixes bug #648130.
* metadata/threads.c: Ensure correct stack pointer initialization on !POSIX.
This fixes some random crashes with embedded, release-optimized binaries on windows.
License: MIT/X11
There were several issues here:
- The IChannelDispatcherBoundListener was defined twice, in two different namespaces, and it caused code in
ChannelDispatcher.Attach not to set its associated listener's ChannelDispatcher property to the correct value.
This, in turn, caused incorrect HttpListenerManagerTable operation, where it would put the "/js" and "/jsdebug"
dispatchers in separate HttpListenerManagers, instead of in the main (base) service's one.
- After fixing the above, it turned out that SvcHttpHandler selected the manager based on the host's base address,
when it should first try to find one whose URL matches the current request exactly.
* class.c: Pass around a list of currently been built vtables
to really avoid going into loop.
* reflection.c: Adjust to extra arguments.
* object.c: Ditto.
* corlib/Mono.Math/BigInteger.cs:
* Mono.Security/Mono.Math/BigInteger.cs:
Remove Montgomery internal inner class since it's buggy, has not
been used for years and confuse some people (seeing ghosts of
CVE-2007-5197)
* mini/exceptions-x86.c: Turn off exception callback filtering on WoW64. This allows managed exceptions to actually work when using 32bit mono on 64bit Windows.
License: MIT/X11
* class.c (collect_implemented_interfaces_aux): Fail if
any of the collected interfaces is broken.
* class.c (mono_class_init): Don't bother initing if the
class is broken. Don't assert on cycles, fail the type
instead.
Fixes#568025
Fixes#605033.
'cause stack overflow is back, mkay?
at System.Diagnostics.TraceImpl.InitOnce () <0x0005b>
at System.Diagnostics.TraceImpl.get_IndentLevel () <0x0000b>
at System.Diagnostics.TraceListenerCollection.InitializeListener (System.Diagnostics.TraceListener) <0x0000f>
at System.Diagnostics.TraceListenerCollection.Add (System.Diagnostics.TraceListener) <0x00017>
at System.Diagnostics.TraceListenerCollection..ctor (bool) <0x0007f>
at System.Diagnostics.TraceListenerCollection..ctor () <0x00013>
at System.Diagnostics.DiagnosticsConfigurationHandler.GetSharedListeners (System.Collections.IDictionary) <0x00083>
at System.Diagnostics.DiagnosticsConfigurationHandler.Create (object,object,System.Xml.XmlNode) <0x003cf>
at System.Configuration.ConfigurationSection.GetRuntimeObject () <0x0033d>
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (string) <0x00041>
at System.Configuration.ConfigurationManager.GetSection (string) <0x00030>
at System.Configuration.ConfigurationSettings.GetConfig (string) <0x0000f>
at System.Diagnostics.DiagnosticsConfiguration.get_Settings () <0x00043>
at System.Diagnostics.TraceImpl.InitOnce () <0x0005b>
Thus, when we're getting the <sharedListeners/> element, we shouldn't call
the TraceListenerCollection default constructor, as that will attempt to add
the DefaultTraceListener (which isn't needed anyway, as the
DefaultTraceListener is explicitly added by TraceImplSettings).
* verify.c (do_newobj): Check if the .ctor signature is
hasthis. Even thou this is not a string 335 requirement
our runtime asserts otherwise.
Fixes#568004
Service is invoked in the context of the System.Web pipeline and closing the response before the final
output stream flush causes the generated response not to ever reach the client. This patch makes sure
the System.Web pipeline takes care of all the response housekeeping.
* class.c (mono_class_setup_vtable): Check generic instances
using mono_class_check_vtable_constraints.
* class (mono_class_check_vtable_constraints): A generic
instance can't have a vtable if one of its generic arguments
has a broken vtable. Otherwise we'll have a realized type
that will go broken once one of its arguments gets initialized.
* object.c (mono_class_create_runtime_vtable): Check generic
instance arguments since creating the rumtime vtable doesn't
require resolving the metadata one.
Fixes#644915
Starting from .NET 4.0, the <supportedRuntime/> 'version' attribute accepts a shorter
runtime version string - v4.0 - in addition to the previously accepted vX.Y.Z format.
On Moonlight, ScriptObject types have custom (de)serialization methods that
need to be called whenever a user object includes properties of that type.
This patch creates a TypeMap subclass (ExternalTypeMap) and exposes a method
that can be called from moon's System.Windows.Browser to register custom
serialization and deserialization methods, keyed by type. These are called
whenever a property is found with a type (or base type) that has custom
methods registered.
For projects targeting TargetFrameworkVersion >= 3.5, automatically
add a reference to System.Core . This can be controlled via two
properties:
$(AddAdditionalExplicitAssemblyReferences) and
$(AdditionalExplicitAssemblyReferences) .
This is used only for projects built with ToolsVersion=4.0 .
* mini-amd64.c (mono_arch_install_handler_block_guard):
Implement this is the same fashion as of x86.
* tramp-amd64.c (mono_arch_create_handler_block_trampoline):
Same as x86 just taking call conv into account.
* mini-amd64.h: Enable guard support.
Android's fork() function does not properly update the
pthread_internal_t->threadid variable to point to the tid of the
fork()'d thread, and instead still points to the pid of zygote.
As a result we need to track the android tid's manually since
gettid() is sane, and use an alternate to pthread_kill on android
Additionally, disable sgen support on android until the same
work has been done there
r: kumpera, vargaz
* class.c (mono_class_is_open_constructed_type): Treat
generic type definition as an open type too. All code that
checks is_open does to make sure the generic instance is
realizable.
* marshal.c (mono_marshal_get_castclass_with_cache):
Use the right parameter for the cache.
* marshal.c (mono_marshal_get_isinst_with_cache): Use
the right parameter for the cache. In the negative case
store the obj_vtable and not the cache address.
SecurityTokenParameters.InitializeSecurityTokenRequirement() needs to become
protected internal, so changed all overrides as well.
Some implementation in WindowsStreamSecurityBindingElement is needed only for
NetTcpBinding implementation.
Had to disable a test in SymmetricSecurityBindingElement that depended on
OneWay support (which is not yet done).
Add GetFrameworkPaths and PrepareForBuild as dependencies for
the ResolveAssemblyReferences target. This is required when it is
invoked directly from MD.
Patch from Michael Hutchinson ([email protected]).
* verify.c (mono_verifier_verify_class): The generic instance
over its parent generic arguments will end up extending a GTD.
The check against not extending a GTD is only valid for not
generic instance types.
All targets that get built are tracked by the engine, to avoid
unnecessary builds of targets. This should be reset on engine.Build,
unless it is explicitly requested *not to* reset it, via BuildFlags.
MSBuild hosts like monodevelop, which use the same logger
for multiple builds, get errors/warnings from older builds.
So, reset them whenever the BuildFinished event is raised.
ILogger.Shutdown () is invoked when the host is about to quit,
according to msdn, so can't use that.
The problem is that Android only exposes Java APIs for ~everything of
consequence, including/especially X509 Certificate validation. Since
we want Mono-based HTTPS support to use the underlying platform
certificates, this requires some amount of Java-using glue. However,
we don't want to pull in a ton of Java glue into System.dll (bleh!),
so we'll instead place the glue into Mono.Android.dll's
Android.Runtime.AndroidEnvironment.TrustEvaluateSsl(), and instead
create a delegate which will invoke TrustEvaluateSsl() when needed.
When disposing a socket that has more than one asynchronous read/write
pending, one of the callbacks could call DisposeAllOnClose() while
another one is waiting on the lock. Once the lock is acquired,
queue.Count will be 0 and Dequeue would fail.
This if fixed now.
Fixes bug #645675.
The Expression Tree interpreter was previously limited to
lambda expression for either an Action or a Func delegate.
This fix removes this limitation. Fixes#645770.
* Makefile: Compile tests with TEST defined (to include System.Web.Util.
MachineKeySectionUtils unit tests)
* System.Web.dll.sources: Move MachineKeySectionUtils.cs from System.
Web.Configuration_2.0 to System.Web.Util
* System.Web_test.dll.sources: Move MachineKeySectionUtilsTest.cs from
System.Web.Configuration_2.0 to System.Web.Util
* System.Web.Configuration_2.0/MachineKeySection.cs: Adjust using
clauses. Uncomment some code. Fix TripleDES versus 3DES for Validation
under NET_4_0. Remove 'private' on fields/methods.
* System.Web.Handlers/AssemblyResourceLoader.cs: Adjust using clauses
* System.Web.Security/MembershipHelper.cs: Adjust using clauses
* System.Web.Security/RolePrincipal.cs: Adjust using clauses
* System.Web.SessionState_2.0/SessionId.cs: Adjust using clauses
* System.Web.UI/LosFormatter.cs: Adjust using clauses.
* System.Web.Util/MachineKeySectionUtils.cs: Moved from System.Web.
Configuration_2.0. Rename namespace and remove 'internal' on type
declaration
* Test/System.Web.Util/MachineKeySectionUtilsTest.cs: Moved from Test/
System.Web.Configuration/MachineKeySectionTest.cs. Add test case for
TripleDES versus 3DES
* System.Web.Configuration_2.0/MachineKeyRegistryStorage.cs:
Remove key length check and generic key generation.
* System.Web.Configuration_2.0/MachineKeySection.cs: Add support for 4.0
ValidationAlgorithm and the use of custom algorithms (validation and
decryption). Allow the use of any, valid, key length (based on the
algorithm). Let each algorithm creates its own key (e.g. special needs,
default length...)
* System.Web.Configuration_2.0/MachineKeySectionUtils.cs: Remove key
generation (from random) code and 192bits key length hack (won't work
with custom algorithms). Add support for new (4.0) algorithms, including
custom ones. Provide uniform/shared code to Encrypt/Decrypt, Sign/Verify
and EncryptSign/VerifyDecrypt using MachineKeySection data.
* System.Web.Configuration_2.0/MachineKeyValidation.cs: Add new (4.0)
values.
* System.Web.Configuration_2.0/MachineKeyValidationConverter.cs: Add
support for new (4.0) algorithms.
* System.Web.Handlers/AssemblyResourceLoader.cs: Use the new common
cryptographic code and base64 the encrypted data.
* System.Web.Security/FormsAuthentication.cs: Use the new common
cryptographic code and base64 the signed and/or encrypted data.
* System.Web.Security/MembershipHelper.cs: Use the new common
cryptographic code - this should be 100% compatible with existing data.
* System.Web.Security/RolePrincipal.cs: Use the new common cryptographic
code.
* System.Web.Security/SqliteMembershipProvider.cs: Adapt code for
internal API change.
* System.Web.UI/LosFormatter.cs: Adapt code for internal API change.
Fix some small behaviro changes wrt NET_4_0
* System.Web.UI/ObjectStateFormatter.cs: Use the new common cryptographic
code.
* System.Web.UI/Page.cs: Remove code that is now unneeded (with the new
common cryptogrraphic code).
* System.Web.Configuration_2.0/MachineKeyCompatibilityMode.cs: New.
* Test/System.Web.Configuration/MachineKeyValidationConverterTest.cs:
Add more, mostly 4.0, test cases.
* Test/System.Web.Security/FormsAuthenticationTest.cs: Add test case to
ensure HashPasswordForStoringInConfigFile is not case sensitive.
* Test/System.Web.UI/LosFormatterTest.cs: Add some rountrip test cases
with the different ctors
* console-io.h, console-null.c, console-unix.c, console-win32.c,
gc.c: instead of executing tons of managed code in signal context,
we wake up the finalizer thread and any complex console-specific
code will be handled there. This can cause a (usually small) delay,
but it's much better than deadlocking.
* loader.c: we don't search the current directory anymore for shared
libraries referenced in DllImport attributes, as it has a slight
security risk. We search in the same directory where the referencing
image was loaded from, instead. Fixes bug# 641915.
IsolatedStorageFile.GetUserStoreForApplication() would previously throw an
IsolatedStorageException because no ApplicationIdentity was provided by the
AppDomain.
We would like to provide this method in a workable fashion to facilitate code
portability with Windows Phone 7, which exposes only this method for saving
files to stable storage.
Thus, skip the ApplicationIdentity and code identity checks for MOBILE
(MonoDroid, MonoTouch) so that IsolatedStorage Just Works.
* verify.c (is_valid_generic_instantiation): A GTD cannot
be used as generic argument. Check for those conditions
even if the argument has no constraints.
Fixes#562771
* marshal.c (mono_marshal_get_virtual_stelemref): Add a custom
wrapper for interface casts.
This was the most frequent array kind left without a fast
stelem.ref wrapper. During testing the only easy target
left was arrays of arrays, but those are so rare that
won't make a different on any workload.
* class.c (mono_class_setup_vtable_general): Inject
the array stelemref method on vectors of reference types.
* class.c (mono_class_init): Properly handle the fact
that arrays have different vtable sizes.
* marshal.c (mono_marshal_get_virtual_stelemref): New
function that returns a better tailored stelemref wrapper
for a given array type.
* method-to-ir.c (mono_method_to_ir): Emit a virtual
call to the new faster stelemref wrapper.
This schema uses 4 wrappers instead of one and puts
it into the vtable of vectors of reference types.
This change improves a synthetic benchmark of an
equal mix of stores as compiling corlib by 25%.
It improves pystones by 3-4%.
* System.Web/System.Web/HttpResponse.cs: Ensure '?' is not encoded as
%3F while redirecting (e.g. aspxerrorpath) since this can cause a loop.
i.e. not found leading to not found...
* System/System/Test/System/UriBuilderTest.cs: Add test to confirm the
right behavior of UriBuilder wrt how it was used by Mono's ASP.NET
workingBlock should be the InputBlockSize and currentBlock the
OutputBlockSize. Allocate currentBlock lazily.
Test contributed by Bassam Tabbara.
Fixes bug #644740.
For ResolveTypeToken, ResolveFieldToken and ResolveMethodToken,
resolve definitions directly and try to instantiate only types
that can be instantiated, such as MemberRef, MethodSpec and TypeSpec.
Also validate the memberref token type for ResolveField and
ResolveMethod when passing them a MemberRef token.
* eglib/src/glib.h:
* eglib/src/gmem.c: Make g_malloc and friends abort in case of failure, like
glib does.
* eglib/src/eglib-remap.h: Remap all allocation functions.
* marshal.c: Add mono_marshal_get_isinst_with_cache
and mono_marshal_get_castclass_with_cache.
* marshal.h: Export those 2 new functions.
* method-to-ir.c: Call those functions instead of their
icall versions. This speeds up non gshared cases by up to 3x
and gshared by up to 2x.
Those wrappers are not inlined since the register allocator
doesn't handle well so the minor speedup is not worth be
significant bloat introduced.
* class-internals.h: Add new kind of rgctx slot.
* method-to-ir.c (handle_castclass): Emit gsharing code
for cast with caching.
* method-to-ir.c (handle_isinst):
* mini-generic-sharing.c: Implement MONO_RGCTX_INFO_CAST_CACHE
slot type. It's a 2 word domain allocated memory block with the
cache on the first word and the vtable on the second.
This design does a single rgctx fetch instead of two. It's
a bit faster and can potentialy save some slots.
* jit-icall.c (mono_object_castclass_with_cache): Check
single entry cache before calling mono_object_isinst.
* jit-icall.c (mono_object_isinst_with_cache): Check
single entry cache before calling mono_object_isinst.
This uses a positive and negative cache as it is used
for type queries quite often.
* jit-icalls.h: Export new icalls.
* mini.c (mini_init): Register new icalls.
* method-to-ir.c: Call into cache aware version of type
test ops for types with variant generic arguments.
This patch replaces direct calls to mono_object_castclass
mono_object_isisnt to functions that check a cache first.
The cache is per managed code callsite so the hit ratio
is very high.
mono_metadata_memberref_is_method: rename to mono_memberref_is_method
and deal with the case where the assembly is dynamic. This prevents
a runtime crash when calling ModuleBuilder.ResolveMemberToken with
a MemberRef token pointing to a field.
mono_reflection_get_token: For FieldBuilders, now reuse the token
computed when the FieldBuilder are instantiated, instead of
re-creating them. This avoids registering field definitions
as MemberRefs.
We were previously relying on the runtime to register the token
for FieldBuilders, but this has issues with fields on generics types
as it would create a MemberRef token instead of a Field token.
* class.c (mono_generic_class_get_class): Don't inflated
nested_in since it's not the expected behavior from managed
land. It's a safety issue as well since the outer type can
have more generic arguments.
* TypeTest.cs: Add regression test.
Fixes#643890
Fixes an issue in Process where "pseudo-handles" for processes with
pids > 16 bits would overflow and start getting treated as normal
handles. This would frequently segfault MonoDevelop on MacOS.
When we are not using SHM we use psuedo handles to return processes from pids,
however we dont guard against pseudo-handles in CloseProcess, which could lead to
calling unref on a fake handle.
In a solution file, a Project might not have a corresponding
EndProject. This seems to be supported by VS, so updating xbuild
to support that too. Updated the regex.
XamlObjectWriter needs stack of content object list so that List can store items correctly with nested state.
XamlXmlReader now outputs Items, and to handle it I needed special reader states.
* sgen-cardtable.c (sgen_card_table_is_range_marked): Use
card_in_range here since this is used for objects that can
start at the middle of a card.
* sgen-cardtable.c (move_cards_to_shadow_table): Properly
copy the tail bytes of an object that spam around the cardtable.
Don't copy more bytes than required.
* sgen-cardtable.c (sgen_cardtable_scan_object): Add extra_idx
variable that tracks the card offset that we're scanning. This
is required when we wrap around.
* sgen-cardtable.c (sgen_cardtable_scan_object): Properly reset
card_base when at wrap around.
* loader.c (mono_lookup_pinvoke_call): Don't assert on bad
row indexes.
* metadata-verify.c (verify_implmap_table): Fix the bounds
check for the module table.
Fix#563956
* MonoGenericClass.cs (.ctor): Only register with the runtime
when the underlying TB is not finished.
* MonoGenericClassTest.cs: Add regression test.
* TypeTest.cs: Fix a test that had a broken assumption.
Fix#642130
* System.Web.Security/FormsAuthentication.cs: Fix typo (MD5->SHA1).
I suspect the later is not used very much by mono users
* Test/System.Web.Security/FormsAuthenticationTest.cs: Small change to
make sure the hash name is not case sensitive
* bugfix:
[asp.net] Part of fix for bug #579837. AuthorizationRule.SerializeElement will not process unmodified elements.
[configuration] Part of fix for bug #579837. CommaDelimitedStringCollection must properly note that it was modified.
* AuthorizationRule.cs: if the configuration save is not Full, SerializeElement checks whether the rule being
serialized is modified. If it isn't, validation and serialization are not performed.
* AuthorizationRuleCollection.cs: there is no element name for the collection.
When one manipulates the collection as an instance of StringCollection, the 'modified' field will not
be set (Add, Remove etc. from the underlying StringCollection type will be used). To work around it
a check has to be performed in IsModified whether the contents of the collection changed. It is done
by comparing string hash codes of the original vs current string.
CommaDelimitedStringCollectionConverter forces string hash code update on the new collection, so that IsModified
works correctly on collections converted from comma-delimited strings.
** Fixes#582732 - Patch by Jeffrey Alvarez <[email protected]>
* DataColumn.cs (Clone): Deep copy the ExtendedProperties
collection.
* XmlSchemaDataImporter.cs: Support import of extended
properties.
* XmlSchemaWriter.cs: Fix exception by writing the extended
properties before simpletype element.
** Fixes#561667
* SqlCommand.cs (Dispose): While Disposing, set connection's
datareader to null so the connection can be reused with another datareader.
When possible, schedule the user callback from unmanaged code. We pass
it from the IO pool to the regular pool after our internal callback is
finished.
If ReleaseResources or Flush (true) were called, a flag is set that causes
any subsequent Flush () calls to fail with an exception.
At the same time, ReleaseResources does not destroy the output stream completely -
it has to remain around to match .NET behavior.
* System.Net.Sockets/Socket_2_1.cs: Fix, by explicitely throwing an NRE,
the checks in [Receive|Send]Async methods - otherwise an exception would
occur later, on another thread and close the socket (leading to other,
unexpected, exceptions)
* Test/System.Net.Sockets/SocketTest.cs: Add parameter validation test
cases for both ReceiveAsync and SendAsync
* System.Net.Sockets/SocketAsyncEventArgs.cs: Move policy restriction
and elevated trust check outside of loop since its value won't change
based on the ipaddress
If creating the xdb.il file fails, disable the mono support for
debugging in gdb. Managed symbol names won't be displayed in stack
traces.
Fixes bug #642625.
* marshal.c (mono_marshal_get_delegate_invoke): Properly
handle a static method that has it's first argument bound.
* marshal.c (mono_marshal_free_inflated_wrappers): Free
from the new hashtable too.
* image.c (mono_image_close_except_pools): Free the new
hash table.
* metadata-internals.h (MonoImage): Add new hashtable
to store the new kind of invoke wrappers.
Fix possible state corruption in the case where Upgradeable wasn't reactivating its read bit after a downgrade and set events accordingly. Fix possible race where a write process wannabe could step in the middle of Upgradeable actually upgrading to write mode.
SvcHttpHandler maintains a mapping of HttpContext to ManualResetEvent. Entries are
removed from the cache in EndHttpRequest. The code makes sure the context exists in
the cache before attempting to access it.
It is possible that some code will still attempt to access the HttpResponse instance
after ReleaseResources got called. This patch prevents NREX in such cases.
Pass the listener as it's own async state so that we avoid potential null derefs in the callback. Also wrap the BeginAccept and EndAccept calls in their own try/catches in case they throw an exception.
The problem is that DispatchRuntime.Type is a service implementation type
that could implement two or more contract interfaces, and it was in random
order how ServiceProxyGenerator picks up the contract type. Now it looks
for correct contract type instead of the service type by exactly looking
for the target contract in the endpoint (dispatcher).
In some embedding scenarios, mscorlib.dll may be present in a non-standard
location (outside of MONO_PATH) or with an alternate filename.
Use the installed assembly preload hooks to search for mscorlib.dll before
falling back to the default lookup strategy.
* System.ServiceModel.Channels/HttpRequestChannel.cs: For Moonlight use
the WebResponse.SupportsHeaders before accessing the Headers collection.
This is needed because (the default) browser stack does not expose the
headers from its responses. Fix bug #642193
The patch removes a small race condition where a boolean flag is set after acquiring a lock to
indicate to code executing in the finally {} block that it should release the lock. The boolean
variable is now removed and the lock is released unconditionally. It carries a potential to
throw an exception when the lock is not held, but it's better than to fail to release it and
lead the application to a deadlock.
* System.Net.Policy/CrossDomainPolicyManager.cs: Use same socket family
as the endpoint when retrieving the policy. Also do not try to create a
policy out of an empty stream (avoid misleading exceptions in logs)
* System.Net.Sockets/SocketAsyncEventArgs.cs: Set the Socket
RemoteEndPoint to our RemoteEndPoint on Connect operation.
* System.Net.Sockets/Socket_2_1.cs: Return the 'candidate' EndPoint
provided by SocketAsyncEventArgs in ConnectAsync (intead of null)
until the connection is completed.
* NamedServiceModelExtensionCollectionElement.cs: minimum length of the Name property value is 0 for 4.0
* ServiceBehaviorElementCollection.cs: added an override of BaseAdd which makes sure that the element being
added has its Name set to String.Empty if the element's name is null
* ServiceHostBase.cs: support for simplified behavior configuration. Refactored behavior addition code to a
separate method. Check whether behavior is not in the collection before adding it.
* method-to-ir.c (mono_method_to_ir): Check for null
on delegate construction so closed-on-null is not allowed
when using the delegate .ctor.
If the delegate been constructed is open-on-target then
the null check must not be applied as the IL pattern is:
ldnull
ldftn void Bla::Foo(int)
newobj Bar (object, native int) // delegate void Bar(Bla,int)
* Form.cs: When setting DialogResult call RaiseCloseEvents
instead of directly setting 'closing', since we need to have our
FormClosing event invoked *before* the form dissapears, so the
user can properly cancel the close operation if desired.
Fixes#631810.
* X11Keyboard.cs: Manually handle the conversion of the string
returned by XLookupString, just as we were already doing for XIM
support - using StringBuilder directly was somehow returning a
corrupt buffer from time to time.
Fixes#639939.
The build fails because of what seems to be a bug in gmcs. The compiler reports that
the StringComparer.OrdinalIgnoreCase property doesn't exist and it does so because
gmcs loads the internal System.Collections.Generic.StringComparer from EqualitComparer.cs instead of the
System.StringComparer one.
The code involved in a delegate BeginInvoke is too heavy and of no use
for socket asynchronous operations. With these changes, we bypass all
that and send the work items directly to the asynchronous IO queue,
improving performance and lowering memory use.
It turns out that Strings need to explicitly use a version that does
implement EqualityComparer<string> since string is an IEquatable.
Do this, and to avoid the reflection mess, cast to object, then cast
to the real type
-ConnectAsync() changed to make security checks for all endpoints before
trying to connect for the first time.
-Use the socket Connect() call instead of repeating the same stuff.
Connect should be splitted in 2 pieces (DNS + Connection attempts).
If you pass the option MESSAGING_NO_WINFORMS=1 to make, System.Messaging will be compiled
without the dependency to System.Windows.Forms. The dependency is needed just by the
System.Messaging.Design.QueuePathDialog class which is both a stub and not used anywhere
by Mono.
-Removed #if NET_2_0
-All the *Async() calls but ConnectAsync() are routed through the
asynch IO threadpool instead of creating a new short-lived thread for
every operation.
-When reusing a SocketAsyncEventArgs only 1 new object, a delegate, is
created.
This affects MonoTouch startup as our dictionaries are a little bit
slow to be created now that we use Dictionary<> hashes for switch
statements.
Some timings:
Using a simple block of if's is twice as slow as the compiler generated
switch statement. But using this tuned code is faster than the
compiler generated code, with a million loops on x86-64:
With "http": .10 vs .51 (first check)
with "https": .16 vs .51 (second check)
with "foo": .22 vs .31 (never found)
with "mailto": .12 vs .51 (last check)
* amd64-codegen.h (amd64_alu_reg_membase_size): Add support
for RIP based addressing.
* cpu-amd64.md: Add card_table_wbarrier.
* mini-amd64.c (mono_arch_output_basic_block): Emit the
new OP.
* mini-amd64.c (mono_arch_emit_exceptions): Handle another
kind of patch-info - GC_CARD_TABLE_ADDR. This is required
because we can neither have 64bits immediates with amd64
or 2 scratch regiters with current regalloc.
* mini-amd64.h: Define MONO_ARCH_HAVE_CARD_TABLE_WBARRIER.
* verify.c (mono_type_is_valid_type_in_context): Handle
types such as VAR and MVAR encoded as CLASS or VALUETYPE.
This encoding is not the canonical one, but works and
must be properly verified.
Fixes#601970
* System.Net/WebRequest_2_1.cs: (Create) Find the prefix that is the
closest match to the specified Uri and use it's associated creator.
(RegisterPrefix) We cannot register 'http[s]:' even if registering
'http[s]' is possible (but does not work as expected) as are the (fully)
valid 'http[s]:/[/]' values.
* System.Net.Policy/CrossDomainPolicyManager.cs: Use InternalHeaders,
instead of Headers, since we always use the browser stack to download
the security policies.
* System.Net/WebClient_2_1.cs: Throw a NotImplementedException from
ResponseHeaders if the response does not support them.
* System.Net/WebResponse_2_1.cs: Make Headers property smart to throw a
NotImplementedException if SupportsHeaders return false. Add a new
InternalHeaders property since the response headers are needed,
internally (e.g. policies), even if not exposed to the outside world.
It appears Microsoft didn't make any changes to the assembly in .NET 4.0 - they simply
changed its version number to 4.0.0.0 and added few assembly attributes.
* socket-io.c|h: Add definition/case for SocketOptionName_HopLimit.
Note that this is already being used by managed code (to set the TTL
value on IPv6 sockets)
* System/Uri.cs: Fix escaping non-ascii host names. Avoid memory
allocations (UTF8.GetBytes) when it is not necessary while escaping.
* Test/System/UriTest2.cs: Add test case where host name is β (beta)
Further discussion suggested that, even if mdoc 2.0 works, it hasn't gotten
widespread testing (as it's been a 4.0 app for months), so it would be
preferable to keep it as a 4.0 app.
However, it still needs to be built under 2.0 so that a --with-profile4=no
build can...build...without errors.
Thus, the compromise: build mdoc twice, once for each profile. This will
ensure that *some* version of mdoc is around when mcs/docs is built.
Unfortunately we can't place mdoc into $(per_profile_dirs), as these are
built before $(net_2_0_dirs) (and thus before monodoc, which needs to be
built before mdoc). Thus the compromise of listing mdoc in *both*
$(net_2_0_dirs) and $(net_4_0_dirs), allowing build dependencies to be met.
We didn't keep the endpoint around for non-blocking connects and later,
when Poll() was called, we didn't have the information. Also 'isbound'
wasn't being set in a few places and UDP sockets needed to be marked as
not connected after a call to Connect() with an Any address.
Removed an old test for Connect(Any) with UDP sockets, since this is
used to disconnect them now.
Fixes bug #640749.
Further discussion suggested that, even if mdoc 2.0 works, it hasn't gotten
widespread testing (as it's been a 4.0 app for months), so it would be
preferable to keep it as a 4.0 app.
However, it still needs to be built under 2.0 so that a --with-profile4=no
build can...build...without errors.
Thus, the compromise: build mdoc twice, once for each profile. This will
ensure that *some* version of mdoc is around when mcs/docs is built.
* System/Uri.cs: A bit more strict when parsing the port number
* Test/System/UriTest2.cs: Add test cases with different, mostly
invalid, ports (e.g. negative, float, too big...)
* System/Uri.cs: Fix host name checks. Delay port check until the host
name is checked (compatibility). Fix exception messages to match the
expected values from the NCL tests.
* Test/System/UriTest2.cs: Add some test cases for host names
Storing the objects in Hashtable causes the GetHashCode() and may be
Equals() methods to be called on the object, which MS does not do.
I'm using a list holding WeakReferences. Not sure if hard references
would be ok.
Fixes bug #640688.
This commit includes unit tests that were run in MS.NET > 2.0.
The old behaviour of MS.NET 1.1 is still included in the patch
as an ONLY_1_1 define, to be backport-friendly to other branches
(but can be removed from now on in next commits, as mono master
doesn't include this profile anymore). Fixes BNC#324144.
* sgen-marksweep.c (mono_sgen_marksweep_init): Enable
cardtable for the parallel collector.
This closes by 50% the gap in binary-tree against the
serial collector.
* TypeDescriptor.cs: Implement AddProviderTransparent and
RemoveProviderTransparent - we only call to the already existing
AddProvider and RemoveProvider methods respectively.
There is no checkfor the SettingProviderAttribute attached to a Settings class.
.NET uses this to replace the default LocalSettingsProvider with your
own SettingsProvider.
The patch adds this feature.
Signed-off-by: Carsten Schlote <[email protected]>
Added missing check for empty strongname. This case is now handled the
same way as a missing strongname.
GetProductName() now correctly uses _Url_ and assembly.EscapedCodeBase
for its output.
Signed-off-by: Carsten Schlote <[email protected]>
The previous implementation creates eventually invalid filenames in a
random fashion on linux, mac, windows by having '/' or '\' chars
in the base64 output. As a result you can't save or retrieve your settings
due to filesystem errors.
This patch changes the output to plain hex values. This is a bit longer
then a base64 string, but also 100% filesystem safe.
Might
Signed-off-by: Carsten Schlote <[email protected]>
* class.c: The typeref table is now lazily verified thanks
to some awesome obfuscators that love to produce junk.
So it has to be checked everytime before usage instead of
at loading time.
* metadata-verify.c: Add mono_verifier_verify_typeref_row
that checks the metadata of a single row. Fix code around
to couple with this new function.
* verify-internals.h: Export it.
* System/Uri.cs: Compute the expected OriginalString when an absolute
URI is merged with a (String or Uri) relative Uri to create a new Uri
instance. Keep original fragment around for ToString
* Test/System/UriTest2.cs: Add test cases for Fragment and Query when
special characters are used. Most of them are not escaped in ToString
* Test/System/UriTest3.cs: Uncomment an Assert that is now fixed.
* System/Uri.cs: An empty username/password is treated differently than
having none, i.e. the '@' character is kept present in the URI
* Test/System/UriTest2.cs: Add test case with an empty UserInfo
* System/Uri.cs: IsUnc returns true for file:/// URI on Windows only.
This makes us closer to Mac-behavior (see NCL tests) since the other
properties, e.g. LocalPath, match this. Also fix some exception text
where the values are checked by some test cases.
* Test/System/UriTest.cs: Adjust some test cases wrt Win32
* Test/System/UriTest2.cs: Adjust a test case wrt Win32
* System/Uri.cs: Fix merging URI where a relative URI contains a ':'
but no valid scheme
* Test/System/UriTest2.cs: Add test cases where some bad (if absolute)
URI are valid when merged (as relative) with an absolute URI
* AssemblyBuilder.cs (GetTypes): Raise ReflectionTypeLoadException
if any type was not finished.
* AssemblyBuilderTest.cs: Add test for GetTypes () and incomplete
TypeBuilders'.
Fixes#640288
* sgen-cardtable.h: Auto detect the need for
SGEN_HAVE_OVERLAPPING_CARDS.
* sgen-cardtable.h: Add CARD_TABLE_BITS and make CARD_COUNT_BITS
depend on it.
* sgen-cardtable.h: Document which and how each tunable affect
runtime of sgen.
* sgen-cardtable.c (sgen_cardtable_scan_object): Use
the card pointer as the loop induction variable so
it's easier handle overlapping cards and overflow.
Move its definition to threads-types.h since it is not public API. Use this
to remove the workaround in thread_cleanup () so the JIT info for threads is
properly cleaned up at shutdown.
* System/Uri.cs: While parsing only escape the path for absolute URI.
Do not unescape relative URI in ToString and avoid calling
AppendQueryAndFragment on them (relative) since both are not parsed as
such.
* Test/System/UriTest2.cs: Add test case to show that a relative URI is
NOT escaped by ToString
* System/Uri.cs: Fix DnsSafeHost for IPv6 addresses, removing the []
brackets and adding, when available, the scope id
* Test/System/UriTest2.cs: Add DnsSafeHost test cases for IPv6 address,
one without scope id, another with a scope id
* System/Uri.cs: Fix parsing the port/host when a ':' is present without
a port number on non-file:// URI
* Test/System/UriTest2.cs: Add test cases where an URI contains a ':'
but is not followed by a port number
* System/UriBuilder.cs: Refactor constructors to share Initialization
methods. Allow a second chance to .ctor(string) to parse an URI by
assuming it's an HTTP URI
* Test/System/UriBuilderTest.cs: Add test case with string URI that do
not provide a scheme - UriBuilder will default them to http:// even if
Uri would not parse them
* System/UriBuilder.cs: Fix Host property to add the missing brackets
on IPv6 address (if missing from input)
* Test/System/UriBuilderTest.cs: Add test cases with incomplete IPv6
addresses. Add test case with a relative Uri used in UriBuilder ctor
* System/UriBuilder.cs: Update UriBuilder.Path once the Uri has been
created using Uri.AbsolutePath
* Test/System/UriBuilderTest.cs: Add test case with path missing the
initial / which shows the UriBuilder.Path property is being updated
after the creation of the Uri instance.
* System/UriBuilder.cs: Update UriBuilder.Host once the Uri has been
created
* Test/System/UriBuilderTest.cs: Add test case with IPv6 host (address)
which shows the UriBuilder.Host property is being updated after the
creation of the Uri instance.
* System/Uri.cs: Add EscapeCommonHexBracketsQuery constant since ? also
needs to be escaped from UriBuilder
* System/UriBuilder.cs: Fix Equals (escaping '?') and UserInfo. Fix NRE
in ctor that was fixed in FX4. Drop NET_2_0 defines.
* Test/System/UriBuilderTest.cs: Drop NET_2_0 defines and add new ones
for NET_4_0. Add more asserts in the test cases that were failing.
* System/Uri.cs (Reduce): Process %2E while reducing a path. Avoid, when
possible, the creation of StringBuilder and replace ArrayList with
generics
* Test/System/UriTest2.cs: Add test case where %2e and %2E are used
* System/Uri.cs: Fix TryCreate overloads wrt NotWorking unit tests
* Test/System/UriTest2.cs: Remove NET_2_0 and ONLY_1_1 defines from tests
* Test/System/UriTest3.cs: Remove NET_2_0 and [Category("NotWorking")]
from tests. Merge MakeRelativeUri_Uri_Null_[MS|Mono] together since the
(reported) issue was fixed in NET_4_0
* System/Uri.cs: Fix 'file' URI since they can't have a query
* Test/System/UriTest2.cs: Add new test case for 'file' URIs and
some asserts on "custom" URI (which do support queries)
The problem is build sanity: it's possible to disable the 4.0 profile
(--with-profile4=no) while not disabling documentation building
(--with-mcs-docs=yes is the default). The result would be a 4.0-less
build, and thus no mdoc, and thus no mdoc to assemble the documentation,
and thus a build break as we attempted to use an app during the build
which didn't exist.
Oops.
mdoc doesn't need to be a 4.0 app anyway...
Instead of creating a new delegate every time that WaitAny is invoked,
reuse the same delegate. We also keep a permanent reference to prevent
this delegate being collected.
Thsi should fix 592981
mono_runtime_cleanup() calls mono_monitor_cleanup(), which frees the
memory associated with monitors. Some of them still have weak links
registered, which leads to a crash when calling mono_domain_free()
later on.
* System/Uri.cs: Fix 'ftp' support, mostly same fixes as 'nntp'
* Test/System/UriTest2.cs: Add new test case for 'ftp' including
dealing with custom port and user/password data.
* System/Uri.cs: Fix 'nntp' support which is close to 'news' (no query)
but still has an Host, Autority, Port...
* Test/System/UriTest2.cs: Add test cases for 'nntp://'
* System/Uri.cs: Make it easier to reuse EscapeString without adding new
boolean parameters. Shortcut parsing for 'news' since it's simpler (no
query, host, authority...) Avoid creating StringBuilder instance when
[un]escape-ing empty strings
* System/UriBuilder.cs: Adjust for EscapeString API change
* System/UriParser.cs: Fix default news port and adjust for EscapeString
API change
* Test/System/UriTest2.cs: Add test case for 'news:' showing the lack
of Query and Port (but support for Fragment) and the escape-ing
differences.
* System/Uri.cs: Keep the cached 'segments' as a List<string> and return
a new array (ToArray) when the Segment propery is called.
* Test/System/UriTest.cs: Add test case to show that the segments cannot
be modified by accessing the elements of the Segment property.
* System/Uri.cs: Reimplement Segment property to reduce copying and
string allocations. Fix case with slashes (separate, not single,
segments)
* Test/System/UriTest2.cs: Add test cases for segments on an URI that
contains a drive letter and (forward) slashes.
For .resx resource files, check files referenced by the resx
file also, to determine whether to resgen it or not.
IsResgenRequired () has been taken from MonoDevelop
(main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs)
Use ProcessStringDictionary in ToolTask for EnvironmentVariables,
as this retains the original case of the keys. Without this
environment vars would all be passed as lowercase!
This was removed in a previous patch by mistake.
This error was found by Gonzalo when he was looking at another problem
when thread IDs overflowed ints.
Currently we use gpointers in the io-layer for the threadid, but we were
only exposing the value as an int32. The good news is that the code is
not really used right now, but could cause problems in the future as we
extend Process.
* class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
(EnvironmentVariables): New.
(ExecuteTool): Merge EnvironmentVariables with
EnvironmentOverride
* class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs
(Resgen.Execute): Use EnvironmentVariables to set MONO_IOMAP=drive .
* class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
(ExecuteTool): When StartProcess returns, the process has already .Start()'ed
If we subscribe to the output events after that, then for processes that
finish executing before we can subscribe, we won't get the output/error
events at all! So, pass the handlers to StartProcess itself, so that
they get added before the process is started.
The embedding code looks at the executable name, and builds the embedding profile
from that, however the default install has a /usr/bin/mono symlink pointing to
/Library/Frameworks/Mono.framework. We now resolve the symlink before allowing
the embedding code to proceed.
(Hopefully) Fixes#592981.
This is esoteric, with no test case, so I can only assume that the cause for
the crash reported in #592981 is that Boehm is collecting the shutting_down
delegate reference while we're still in native code (which sounds more like a
Boehm bug, as it shouldn't be collecting memory while we're in a P/Invoke).
Hopefully making the delegate more explicit and using GC.KeepAlive() will keep
the delegate from being collected by the GC during the P/Invoke call.
* Type.cs (GetTypeCodeImpl): If the type is a TypeBuilder
call into specific code.
* TypeBuilder.cs (GetTypeCodeInternal): New method that
handles enums correctly.
This change is required because calling into the runtime
with incomplete TypeBuilders cause the runtime to crash.
The *StreamChanged event for ProcessWrapper may get parts of
long lines, so process the complete ones that we have (for matching
error/warning), and save rest for processing when the rest of it
is received.
Also, don't ignore empty lines.
* class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
* System/Uri.cs: Fix Segments and username/password (unsupported) on
file:// URI
* Test/System/UriTest.cs: Remove [Category("NotWorking")] from some
tests and add a few additional (helpful) asserts.
* System/Uri.cs: For most scheme a drive letter is converted into an
host name (minus the ':' character)
* Test/System/UriTest2.cs: Add test cases for drives versus hosts
* TypeDescriptor.cs: Implement 4.0 InterfaceType property, which
seems to be a simple dummy and empty class in .Net, internally
used to represent all interfaces.
* verify.c (mono_method_verify): Only skip dead code
after checking for fallthru.
* unverifiable_fallout_of_finally_block.il: Regression
test for fallthru on dead code.
Fixes#597072
* System/Uri.cs: Fix some "bugs" that are not part of FX4 anymore.
Change how Query/Fragment are merged to match FX4 (while keeping it
compatible with buggy FX2 under the NET_2_0 profile)
* Test/System/UriTest.cs: Adjust test cases to work with 4.0. Mark with
NotDotNet two test cases that are Mono/Unix-specific
* Test/System/UriTest2.cs: Add new test cases where a relative Uri is
merged with an absolute Uri (some changes in SL4/FX4 wrt FX2)
* Test/System/UriTest3.cs: Adjust for bugs fixed after FX 2.0.
Android defines a variable called "major" in its headers, lets rename
major -> major_collector to work around the conflict.
Not every architecture/platform has ucontext_t, so lets not strongly
type our contexts to that and let the macros do their job.
sqlmetal.exe is supposed to allow generating source code from a .dbml file:
sqlmetal /code:foo.cs foo.dbml
However, this failed because the DbmlSchema.xsd file couldn't be found (so
that the DBML file could be validated).
Embed the DbmlSchema.xsd file so that the above `sqlmetal` command works.
This makes the new script work correctly with IE, which has a different way of
hooking up of events and cancelling of their bubling. Previously the mouse-over
handler would be called for each and every submenu causing the leaf menus not
to appear. With this fix the handler is called only once.
* threads.c (mono_thread_suspend_all_other_threads): wait_data
must not be malloc'd since it holds managed pointers. Alloc
it on stack since the struct is about 512/1024 bytes long.
* threads.c (mono_thread_manage): Ditto.
* threads.c (mono_threads_request_thread_dump): Ditto.
ConsoleLogger was emitting target names, even if they didn't have
any useful output, which resulted in lots of "Target foo:" in the
output, with no other related msgs.
Target Foo:
Target Bar:
Target Xyz:
Emit project/target/task headers only if they result in a message,
error or warning. This results in much cleaner output.
* sgen-marksweep.c (major_scan_card_table): Rework the small
object size loop to have a single induction variable.
In adition to that, add a fast initial card skip code.
* sgen-cardtable.c (sgen_card_table_get_card_data): Check
if any card is marked and return it.
* sgen-marksweep.c (major_scan_card_table): Don't waste time
scanning a block if no card was marked.
* sgen-cardtable.c (sgen_cardtable_scan_object): Lookup
the card once and then bump over it. This saves a bunch
of stores and opens up for later improvements.
* sgen-marksweep.c (major_scan_card_table): Ditto.
* sgen-cardtable.h: Add new inline function to return the
card scan pointer of a given adddress.
This patch allows a developer to register a fallback for P/Invoke when
embedding Mono. Typically this is done when you statically link all of your
libraries in some embedded systems and you need to dynamically resolve symbol
names.
There is a *sample* API included (but not compiled into Mono itself) called
mono-embed.c that shows a layman use of the API. A full implementation would
mandate sorted tables, and would use a bsearch or a hashtable instead of having
linear searches.
* debugger-agent.c: The end_runtime_invoke guard isn't working
on AMD64 as __builtin_frame_address (1) returns NULL. Disable the
behaviour by default, and make it runtime configurable.
svn path=/branches/mono-2-6/mono/; revision=148421
Simplifies the code a little bit by eliminating the in_quote variable,
but also fixes the rules to follow the requirements from the
"Shell Command Language" specification on the Unix03 site:
http://opengroup.org/onlinepubs/007908775/xcu/chap2.html#tag_001_002
In particular, the interpretation of the backslash inside double quotes
is limited to a handful of characters. Notice that this differs from
the glib implementation which is not correct either.
mono_debug_init is a public embedding interface and calls into
mono_debugger_initialize, which registers a GC root. driver.c calls
mono_gc_base_init before calling mono_debug_init for this reason, but
that's not an option for embedding (as mono_gc_base_init is internal.)
since mono_gc_base_init is idempotent, just add a call to
mono_debug_init (and remove the driver.c call). Document (in sgen-gc
and sgen-gc.h) the fact that although mono_gc_base_init is idempotent,
changing LOCK_INIT to something non-idempotent will break this.
UDP sockets that call Connect() to set a default address for datagrams
sent, can call Connect() again with IPv6Any or Any to 'disconnect'.
Fixes bug #639098.
All blocks are now strictly hierachical which greatly simplifies many
things and fixes many subtle bugs with local names. Removing the block
cross references helps scalling when compiling deeply nested blocks or
large method bodies including linq. Prepared possible dynamic statements
to work with variable declarators.
when running with SGEN, since SGEN writes to those arrays in:
==29095== at 0x6844E5: add_or_remove_disappearing_link (sgen-gc.c:4143)
==29095== by 0x6845F8: mono_gc_register_disappearing_link (sgen-gc.c:4167)
==29095== by 0x67DE35: clear_domain_process_object (sgen-gc.c:1384)
==29095== by 0x67DEA3: clear_domain_process_major_object_callback (sgen-gc.c:1400)
==29095== by 0x6DE2DC: major_iterate_objects (sgen-marksweep.c:692)
==29095== by 0x67E00B: mono_gc_clear_domain (sgen-gc.c:1459)
The problem: ILAsm has 'object' as a keyword alias for System.Object, and
99.99% of the time should use 'object'...except in 'extends' declarations,
where it remains System.Object and not 'object'.
The solution: Have an ILFullMemberFormatter.WithinExtends "flag" which
controls whether we generate System.Object or object.
The problem: this is flaky as hell, and results 'class A:List<object>'
generating:
.class public auto ansi beforefieldinit MyList
extends System.Collections.Generic.List`1<System.Object>
This is wrong, as it should be List`1<object>, not List`1<System.Object>.
(At least, monodis(1) produces List`1<object>...)
So, instead of the craziness that is WithinExtends, just check check for
System.Object as the base type immediately after the 'extends' generation. If
it's System.Object, keep it, otherwise call full.GetName() (and remove the
leading "class " that's generated from GetName).
* verify.c (do_leave): Set the target of leave.
* verify.c (mono_method_verify): Merge the resulting empty
stack of a leave instruction with it's target.
Fixes#633248
* sgen-gc.c: Introduce dummy_use function that forces
the compiler to keep a given value alive until the call
to it.
* sgen-gc.c (mono_gc_wbarrier_set_field): Use dummy_use to
avoid race condition between the store and the barrier.
* sgen-gc.c (mono_gc_wbarrier_set_arrayref): Ditto.
* sgen-gc.c (mono_gc_wbarrier_arrayref_copy): Ditto.
* sgen-gc.c (mono_gc_wbarrier_arrayref_copy): Ditto.
* sgen-gc.c (mono_gc_wbarrier_generic_store): Ditto.
This pattern of usage is the same we do with managed code
write barrier. The race condition is extremely race and
requires the thread to be interrupted in between the store
and the barrier, which is a very tiny narrow window.
* sgen-gc.c (mono_gc_wbarrier_arrayref_copy): Avoid locking
if using cardtables. Even thou the new code looks slower
than a plain memmove, it has the advantage of not taking
locks, which means it's much more scalable.
Array copy under sgen/cardtables was 1.6x slower than with
boehm. With this patch it reduces to 1.54x. The serial
performance speedup is nice, but it is much more helpfull
in multi-threaded workloads.
* sgen-cardtable.c: Move a bunch of stuff to new header.
* sgen-cardtable.h: New header with functions meant to
be inlined.
* sgen-gc.c: Use new header.
* sgen-marksweep.c (major_scan_card_table): Introduce fast
version of some macros that avoid a few indirections.
* sgen-cardtable.c (sgen_cardtable_scan_object): The
source of the cardtable can now be supplied, this is needed
since major blocks can't use regular card checking code here.
* sgen-los.c (los_scan_card_table): Adjust to signature
change in sgen_cardtable_scan_object.
* sgen-marksweep.c (major_scan_card_table): If the block
size is larger than a card it makes more sense to loop
around objects and not cards since objects might be scanned
twice since a card can be shared between two of them.
In such case the cards of a block must be copied to a side
buffer since we are no longer looping one by one. This ia
a problem when two objects share a marked card as the first
can cause it to be left cleared and not have the second one
scanned.
Another advantage of this patch is that it enables partial
scanning of larger array in the major heap.
* sgen-los.c (los_scan_card_table): Move meat of
this function into a separate one.
* sgen-cardtable.c: New function sgen_cardtable_scan_object.
* sgen-gc.h: Add sgen_cardtable_scan_object.
When calling GetLogicalDriveString, icall.c was passing the
length in the wrong units.
GetLogicalDriveString now translates any octal sequence found
into its corresponding byte. Use the UTF16 length
('items_written') instead of the UTF8 input string length
('items_read') when computing the total size.
We're planning on adding IL signature support for <TypeSignature/> and
<MemberSignature/>, so having arrays of MemberFormatters instead of having
single instances of them will make supporting IL output easier.
Windows allows entry point names like "#10" which refer to the Nth
function (n > 1 and less than the highest ordinal value in the .def
file).
Fixes bug #636966.
* ListBox.cs: Invalidate the selection border when horizontally
scrolling - the call to ScrollWindow is not enough, so we need
to update by ourselves the new margin of the selection border by
a quite small offset.
Fixes#512136.
* NotifyIcon.cs: Use SystemColors.Menu to paint the background
of the control, since at least in gnome the menu and the panel
share the back color (unfortunately we can't just leave the rectangle
transparent, as some window managers use a default white).
Fixes#581287.
* TreeView.cs: Create a new method to check that the new valid
for the vertical scroll is in the valid range - this is
specially important when the size of the TreeView can show less
than one element.
Fixes#624915.
(Yet another "Let's help ECMA!" fix...)
For performance reasons, I want to use this workflow:
mdoc x-msitomsx -o slashdocs msidocs --type=A
mdoc update -o docs -i slashdocs/mscorlib.xml mscorlib.dll --type=A
mdoc update-ecma-xml -o CLILibraryTypes.xml --type=A
That is, have a consistent set of --type=TYPEs that are passed between the
three apps. I want to do this because otherwise 'mdoc update' takes
12 minutes to process the assemblies I need; with this approach, it takes
12 seconds.
Unfortunately, 'mdoc update-ecma-xml' needs an index.xml so it can obtain
assembly-level custom attributes, and 'mdoc update --type...' wasn't creating
an index.xml file.
Doh!
Fix: IFF docs/index.xml is NOT present, create a docs/index.xml file which
contains ONLY the types & namespaces that were encountered.
If docs/index.xml IS present, it's unchanged.
This fix allows the above workflow to Just Work, while maintaining the other
"I know this type has been updated, let's not process the entire assembly"
workflow that --type allows.
This prevents an error if you specify a --type=TYPE and TYPE wasn't found
within the assembly you're updating.
I'm adding this so that I can have a single unified types.response file for
all types we're adding for ECMA (which contains types from several assemblies)
without getting an error when running 'mdoc update' against the source
assemblies.
<embeddedLabel/> was skipping the content, resulting in <i>:</i>. Oops.
And since <embeddedLabel/> generates <i/>, validation was failing within
<para/>, so add it.
We also need to update monodoc-ecma.xsd so that multiple <para/>s are valid
within <threadsafe/>; otherwise, we report validation errors on the
'mdoc x-msitomsx' output.
In the original XML, these are sibling elements to <remarks/>, but they need
to be imported as children of <remarks/> as <block/> is the closest matching
element, and <block/> is a child of <remarks/>.
This is so that we can share response files between 'mdoc x-msitomsx',
'mdoc update', and 'mdoc update-ecma-xml', thus ensuring that only
the types we care about are imported and processed.
The 'mdoc x-msitomsx' command converts a Microsoft internal XML dialect into
Microsoft XML Documentation format (e.g. what 'mdoc export-msxdoc' generates).
The 'mdoc x-msitomsx' command is internal, i.e. 'mdoc help' won't list it,
as this format is completely internal to Microsoft (and likely subject to
change without notice); this command only exists to help facilitate the ECMA
standardization process, converting Microsoft's existing (internal)
documentation into a format usable by the ECMA committee.
Another side effect of having the DocumentationImporter abstraction is that
we're no longer limited to importing from either ECMA XML, Microsoft XML, or
both; we can now import from arbitrarily many Microsoft XML sources.
(Arbitrarily many ECMA XML sources likely won't work, at present, since the
ECMA XML file controls type + member enumeration, but I don't think this will
be needed any time soon...)
We were not returning IPv6 addresses if there was no IPv6 configured
interface. Now we will return those addresses if ipv6 is enabled by
configuration.
Fixes bug #636517.
* method-to-ir.c (inline_method): We verify the inlined method
before variables are created for locals since this can assert.
Some check on locals are only done by the IL verifier so it's
not enough to just check if the header decoded fine.
* mini.c (mini_method_verify): Add parameter telling if we
should fail the compile or not.
* mini.c (mono_compile_is_broken): Pass the method explicitly
as it now can be diferent than cfg->method.
* mini.h: Export mono_compile_is_broken instead of
mini_method_verify.
Fixes#560200
* mcs/class/System.Net/System.Net.Policy/ClientAccessPolicy.cs: Do not
throw a NotSupportedException here since it regress some DRT (like 656).
The (hopefully) correct fix (for DRT3001) will be committed inside moon
2ec0ab59fe caused a regression in
Create.Delegate where the overload which doesn't take a firstArgument
could be used to create closed over null delegates while this
overload doesn't allow it.
If we are redirecting to a GET from a POST, the Content-Length header
might have stale data and it will be sent. Some servers, instead of
ignoring it, keep waiting for the data to be sent (for a GET!).
Fixes bug #636219.
If there's a POST/PUT request that gets a NTLM 401, we save the data
and don't send it again until after the challenge phase. Ie, instead of
sending all the data 3 times, we only send it at most twice.
We were usign teh URL, but that might not be unique among several
requests that need to be authenticated using NTLM. This led to
different requests sharing the same authentication session which fails
miserably.
Bug #631315 fixed.
The duplicate-element checking algorithm wasn't restricted to just elements;
consequently, an 'invalid token' exception was generated from XPath because we
were trying to call XmlNode.SelectNodes("#text"), and '#' isn't valid. Oops.
Fixes building gendarme from mono-tools.
ECMA wants to import some Microsoft documentation for use in the next version
of the ECMA standard (hence mdoc-update-ecma-xml).
Unfortunately, Microsoft doesn't use the Microsoft XML Documentation format
for their internal class library documentation. They use some other XML
dialect (which looks similar yet different from "msxdoc").
So to make life easier for ECMA, mdoc-update of needs to support yet another
import format. Yay?
Unfortunately:
- The current import logic uses no abstractions; we have "separate" code
paths when importing msxdoc's vs. ECMA docs. We need a sane abstraction
if we're going to add a third import format.
- Additionally, the ECMA doc import logic is a mass of spaghetti code, as
ECMA import also controls type+member enumeration order.
Start trying to bring some sanity to this by adding a DocumentationEnumerator
abstraction so that some of the XmlReader maintenance for importing/processing
ECMA documentation can be split out.
if test x$cross_compiling$host_win32 = xnoyes; then
AC_MSG_CHECKING(for cygwin glib2-dev package)
if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
AC_MSG_RESULT(found)
AC_MSG_ERROR([Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure.])
else
AC_MSG_RESULT(not found, ok)
fi
AC_MSG_CHECKING(for broken gwin32.h)
glib_include=`$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`
if test -f $glib_include/glib/gwin32.h; then
if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
AC_MSG_RESULT(failed)
hashmark='#'
AC_MSG_ERROR([Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure.])
fi
fi
AC_MSG_RESULT(ok)
fi
AC_ARG_WITH(gc, [ --with-gc=boehm,included,none Controls the Boehm GC config, default=included],[gc=$with_gc],[gc=$gc_default])
# Enable support for fast thread-local storage
@@ -623,17 +602,27 @@ AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage i
AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack (defaults to yes)],[],[with_sigaltstack=yes])
AC_ARG_WITH(static_mono, [ --with-static_mono=yes,no link mono statically to libmono (faster) (defaults to yes)],[],[with_static_mono=yes])
AC_ARG_WITH(shared_mono, [ --with-shared_mono=yes,no build a shared libmono library (defaults to yes)],[],[with_shared_mono=yes])
if test "x$enable_static" = "xno"; then
with_static_mono=no
fi
if test "x$enable_shared" = "xno"; then
with_shared_mono=no
fi
case $host in
*nacl* ) with_shared_mono=yes;;
esac
if test "x$host_win32" = "xyes"; then
# Boehm GC requires the runtime to be in its own dll
with_static_mono=no
fi
AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
@@ -662,23 +651,19 @@ if test x$enable_small_config = xyes; then
AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compilation of system assemblies during the build (on by default on some platforms)], enable_system_aot=$enableval, enable_system_aot=$AOT_SUPPORTED)
AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compilation of system assemblies during the build (on by default on some platforms)], enable_system_aot=$enableval, enable_system_aot=default)
DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
@@ -48,11 +48,12 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#ifNET_2_0
#ifNET_4_0
[assembly: AssemblyVersion("4.84.0.0")]
#elifNET_2_0
[assembly: AssemblyVersion("2.84.0.0")]
#else
// not worrying about the NET_1_0 profile for now.
[assembly: AssemblyVersion("0.84.0.0")]
#error"No profile"
#endif
[assembly: AssemblyDelaySign(true)]
Loaded 100 of 4849 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.