Otherwise parallel invocations might end up stomping on eachother
(these two files are processed in parallel):
Processing /work/maccore/master/maccore/builds/install/mac/xammac/bcl/mscorlib.dll.mdb
Processing /work/maccore/master/maccore/builds/install/mac/net_4_5/bcl/mscorlib.dll.mdb
Unhandled Exception:
System.IO.FileNotFoundException: /var/folders/g9/k5kx4z211ld_lwlbfxv5rq040000gn/T/mscorlib.dll.mdb does not exist
File name: '/var/folders/g9/k5kx4z211ld_lwlbfxv5rq040000gn/T/mscorlib.dll.mdb'
at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0
at Mono.MdbRebase.MdbRebase.RewriteMdbFile (System.String inputFile) [0x00000] in <filename unknown>:0
at Mono.MdbRebase.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: /var/folders/g9/k5kx4z211ld_lwlbfxv5rq040000gn/T/mscorlib.dll.mdb does not exist
File name: '/var/folders/g9/k5kx4z211ld_lwlbfxv5rq040000gn/T/mscorlib.dll.mdb'
at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0
at Mono.MdbRebase.MdbRebase.RewriteMdbFile (System.String inputFile) [0x00000] in <filename unknown>:0
at Mono.MdbRebase.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
The check from [1] is fine when it's done once _or_ with an identical
target. However there's nothing to ensure (if done more than once) that
it's being used to represent the same thing every time.
That makes the code from [1] match methods like:
> System.IObservable`1<TResult> System.Reactive.Linq.IQueryLanguage::Repeat(TResult)
and
> System.IObservable`1<TSource> System.Reactive.Linq.QueryLanguage::Repeat(System.IObservable`1<TSource>)
where `TResult` is different in both checks.
This patch tracks what is used as the generic parameter (on first check)
and make sure it's identical if it's used again in the same signature.
Note: this is a very old bug (i.e. it's always been that way) but recent
changes to mono started to report such issues (a good thing) and, for AOT
compilation on XI, that resulted in MT3001 errors.
[1] https://github.com/mono/mono/blob/mono-3.10.0/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs#L250
* It reduce memory allocations by avoiding the creation of empty
collections (only used to tell us there's a Count of 0);
* It also speed up execution, less object creation/GC time;
* Patch also remove some double-casts (is + as/cast)
mono_get_seq_points takes the domain lock then calls mini_get_shared_method.
mini_get_shared_method then calls into general metadata code that eventually take
the loader lock.
The loader lock has precedence over the domain lock.
Store coverage information in the mlpd file. Extend the mprof-report tool to
give a basic coverage summary.
Conflicts:
mono/profiler/Makefile.am
mono/profiler/proflog.h
XM 2.0 was the first version to ship the mobile (w/unified) and it used
the OS default codepage.
The previous, system mono, profile was already using the OS default
codepage so it make sense for XM to be consistent across profiles (
including the 4.5 subset)
605192528d used UTF8Unmarked for MONOTOUCH
and XAMMAC. However it's initialized differently (than the old UTF8) and
caused unit test regressions in System and System.Net.Http unit tests
This new logic moves the default encoding creation into the products
themselves.
For the helper and writer thread to actually work, we need Mono's threading
subsystem to be initialized (so we can use TLS and hazard pointers). We now
wait with starting these threads until Mono gives us the go-ahead.
This means that a bit more data will be buffered up in the thread-local log
buffers during startup, but it shouldn't really matter in practice.
The exact name (e.g. version) might differ between the original
AssemblyNameReference and the one being used (e.g. PCL).
To make sure we remove unused references we need to resolve
the AssemblyNameReference into AssemblyDefinition and then
continue the sweep based on the _new_ AssemblyNameReference.
This fixes a couple of small issues with the Visual Basic build support:
- The VBC task now respects the $(NoStdLib) MSBuild option.
- The field @(ReferencePath) should be used for References in the VBC
target as it is for the CSC target.
- The CreateVisualBasicManifestResourceNames task is compiled and used
in the same manner as CreateCSharpManifestResourceNames hence it should
be loaded via UsingTask in the same manner as well.
- Include the VisualBasic Portable targets files.
Fixes IsDaylightSavingTime returning false when
SupportsDaylightSavingTime was set to false because TimeZoneInfo was
create with no AdjustmentRules.
Now if TimeZoneInfo uses transitions SupportsDaylightSavingTime will be
set to true regardless of AdjustmentRules.
Security declarations looks very similar to custom attributes - but
they are not (e.g. a different metadata table).
They need to be marked, just like other metadata, by the linker because
they can encode types that won't show up in the type (or assembly)
references.
Ignoring this can create an invalid binary (the kind that even Cecil
can't load back for further processing).
Fixes random/strange hangs/crashes (many native API starts returning
out-of-memory errors when there is plenty of memory available, other
just hang inexplicably) when profiling.
As it turns out, `perf` support crashes/hangs on a lot of Linux
kernels in the wild, and produces no output on some Android devices.
So, given that using a signal + helper thread is more reliable, use
it by default and make `perf` support optional.
The configure flag is now `--enable-perf-events`.
mono_aot_get_method () will not necessarily put methods into the
MonoDomain::jit_code_hash table. But it does return an IP that we
can use to look up the JIT info with mono_jit_info_table_find ().
The main goal of this change is to ensure that all methods have a `TYPE_JIT`
event emitted in the stream before they are referenced in other events. Before
this change, `TYPE_JIT` events could arrive out of order or not be emitted at
all because of generic sharing.
We now use a separate thread for writing log buffers to the output file.
Whenever a method is referenced in a TLS log buffer, we add it to a TLS list of
methods. When we ship the TLS log buffer off to the writer thread, we also send
the TLS list of methods. The writer thread first goes over all the methods and,
if some of them haven't had a `TYPE_JIT` event emitted yet, emits them to a
temporary buffer which is flushed just before flushing the main log buffer.
This approach ensures that `TYPE_JIT` events will *always* come before the
events that reference them.
Bookkeeping of which methods have been emitted to the output stream is done in
a global, concurrent hash table. Before a thread adds a method to its TLS list
of methods, it checks if the method is in the hash table. If it is, we know
that the method has already been emitted to the output stream, so it isn't
added to the list. The writer thread is the only thread that updates the hash
table (which happens when it flushes the temporary method buffer). So,
eventually, all TLS method lists will end up being empty because all methods
have been emitted to the output stream.
Abstract classes can still have subclasses with KnownType attributes, which are allowed in deserialization.
This used to work as the '__type' hint was always honored no matter the type, and broke with https://github.com/mono/mono/commit/71e152accc727089faffa6b4fd6bf58cb62636cf which removed that behavior.
System.Xml was failing to parse DateTime serializations such as
"2000-02-29T23:59:59+13:60".
This is caused by using .NET DateTime and still having the old
System.Xml in branch 4.0
This logic is implemented in .NET by XsdDateTime.
Added fallbacks to .NET XsdDateTime (renamed to XsdDateTime2) when our
parser fails.
The fix is specific to mono 4.0. As in mono master we are already using
.NET System.Xml.
aot-compiler was incorrectly removed from net_4_5_SUBDIRS in ccc2e36bc5, it should still be there in mono-4.0.0-branch (it was moved to net_4_5_PARALLEL_SUBDIRS in 3ceb869495 later on).
Rename the net_4_0 profile which is already only used to trigger copying of reference assemblies
to binary_reference_assemblies and include the 2.0/3.5 files there. This should make it easier
to add more profiles in the future and doesn't clutter the build system as much as making separate
net_2_0 and net_3_5 profiles that do the same.
Conflicts:
mcs/class/Makefile
AdjustmentRule specifies a DST period that starts and ends within a year.
When we have a DST period longer than a year, the generated AdjustmentRule may not be usable.
Thus we fallback to the transitions.
Fixes#24086.
src: https://bugzilla.xamarin.com/show_bug.cgi?id=27864
As of iOS 8.2 Apple updated Sqlite and broke queries that used to work
pre iOS 8.2 like the select command in this test, The pruppose of this
test is to know when apple fixes this. Expected test behaivour is as follows.
* If iOS 8.2+ Test will pass as long as apple does not fix the bug
* If iOS < 8.2 Test will pass as it does work as expected
* If iOS 8.2+ and apple fixed bug 27864 test will fail and we will need to
remove the fail check on lines 105 and 106
CloseConnectionGroup can concurrently call RemoveConnectionGroup and remove a group that has added to removeList.
We now check that the group still exists before removing it.
Fixes#19823.
Filled with Apple. From bug report:
The problem appears to be caused by a bug in mmap on the arm64 ios.
In this test, we request a page and mmap returns successfully, but when trying
to access the mapped memory, the program crashes after the 4097th byte, meaning
that it only maps us 4kb(???). It should be mentioned that on arm64 ios the
page size is 16kb.
The problem was caused with the introduction of the pushless backend. We have to compensate for the arguments being popped by native stdcall callees, to keep param_area from shrinking. Fixes#27597
We need an extra set of quotes around the whole command to properly handle commands
with spaces since internally the command is called through "cmd /c.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=27899.
On arm64, where page size is 16k, if trying to map after the file end mmap doesn't map us the full page but only 4kb. This bug is present on iOS 8.2. As a workaround, we forcefully extend the file to the desired size to make sure than we can map the full page.
https://bugzilla.xamarin.com/show_bug.cgi?id=27667
They're basically the same thing, but v120 has DX10+ capabilities and v120_xp
is DX9 only. Since we're not building against DirectX, the difference is
purely academic - but changing the value to v120_xp means MSVC binaries run
on XP+, not Vista+
(cherry picked from commit 577482e336)
Even though this seems like it's just moving the files around in the project, for some reason it makes a difference to VS.
(cherry picked from commit 220afd9d49)
This is a bit of an hack but it works for now... ideally we should be processing the Unicode command line flags passed by the CRT at startup instead of trying to convert the MBCS string to a wide string.
That was still useful in 2003/2004 but the technical and legal landscape
changed a lot since then. Removing the old, limited key size, cipher
suites also allow removed additional parts of the code that deals with
them.
We used to swallow the error, which is unhelpful.
The reason for that might be because we probe multiple names before giving up but
even then, it's ok log all attempts. It will make troubleshooting easy, even if we
have to go through a lot more log entries.
When a socket has been closed as part of the negotiation, the
SendAlert method would crash when trying to reuse the socket.
Add try/catch around this to prevent this.
Fixes#19334
/Users/builder/data/lanes/monodroid-mavericks-master/7de6731a/source/mono/support/serial.c:25:26: fatal error: linux/serial.h: No such file or directory
#include <linux/serial.h>
The header is only available on Android NDK API level >= 21.
We currently ship a horribly outdated version of EF. This is unnecessary since EF is on NuGet and has an active set of users using it on Unix.
Miguel gave his +1 on the mailing list already.
This changes all bridges to use the _safe variant of sgen_obj_get_descriptor. Bridge processing happens in
the post-scan world, before objects get untagged.
This has been requested by the maintainers of Npgsql a few times already (https://bugzilla.xamarin.com/show_bug.cgi?id=23119) and we should do it for Mono 4.0.
Miguel gave his +1 on the mailing list already.
(some commits occurred while I have been cherry-picking a lot of "they are
in import-system-xml branch but it works with existing sys.xml" stuff.)
work in master
In referencesource, XmlReader.SchemaInfo does not return different instances
for each node at its state but just returns the XmlReader itself (which
implements IXmlSchemaInfo). Hence, if we just set the corresponding
IXmlScemaInfo to each XObject, it results in inconsistent state.
This fixes two regressions in ExtensionsTest (XAttributeFailValidate and
XAttributeThrowExceptionValidate).
With referencesource, XmlWriter for TextWriter buffers the output.
When closing XamlXmlWriter, it does not flush the output, causing
the buffered XmlWriter output discarded in the wild.
MTOM writer didn't expect multiple top-level elements are rejected at
ConformanceLevel.Auto, neiher do against Write[Start/End]Document() with
such elements.
Also Flush is often needed before directly writing to the Stream(Writer).
EOLs handling was also inconsistent between referencesource and old mono.
XML Schema compilation is done in referencesource.
XmlSchemaImporter is based on mono code. Hence this glitch happened.
The following regression is fixed:
1) MonoTests.System.Xml.Serialization.XmlSchemaImporterTests.DefaultTypeTopLevelElementImportsAllComplexTypes : System.InvalidOperationException : 'Root' is missing.
at System.Xml.Serialization.XmlSchemaImporter.ImportTypeMapping (System.Xml.XmlQualifiedName name) [0x0005a] in /svn/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs:453
at MonoTests.System.Xml.Serialization.XmlSchemaImporterTests.DefaultTypeTopLevelElementImportsAllComplexTypes () [0x00039] in /svn/mono/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaImporterTests.cs:1104
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /svn/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
There was some glitch in CP932 encoding and referencesource Encoder
that caused error in Convert(), shown in System.XML tests.
To avoid this, bring back old Encoder as we used before and keep
compatible processing.
It might be buggier, but doesn't regress. We may be able to bring nlp-
based Encodings later too.
If two threads request the same section, which isn't yet cached, both try to insert it into the cache, causing a "Key duplication when adding...". It's neccesary to lock the getter. This solves bugs #5263, #7785, #18303
This generates an XML representation of the check-seq-points target,
as separate tests, which can be easily tracked by anything which
parses NUnit output (e.g. Jenkins or other CI systems). For example,
we are currently regressed on this on ARM.
Creating hardlinks in .NET doesn't have a nice API and using Mono.Unix/Pinvoke doesn't
seem worth the effort at this point since the feature is off by default on msbuild as well.
This is enabled by passing "aot=dump" to the Mono AOT driver and will create a JSON file in the working directory with the name of the assembly.
It's still a work-in-progress and will see improvements in the data dumped as it's needed.
CCLD monodis.exe
../../mono/metadata/.libs/libmonoruntimesgen-static.a(libmonoruntimesgen_static_la-opcodes.o): In function `mono_opcode_name':
/cygdrive/c/projects/mono-817/mono/metadata/opcodes.c:63: multiple definition of `mono_opcode_name'
../mini/.libs/libmonosgen-2.0.dll.a(d001720.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
This change does not involve Windows-specific NLS-based encodings.
We will be still using I18N assemblies until we make more grand design
changes (Xamarin products premise those assemblies).
This also fixes bug #23771 and probably more.
Right now (without this change), Debug.Assert **always** formats its string parameters, even if doing so wouldn't be necessary because the condition is true. This has a huge impact on code that asserts frequently because it assumes that calling Assert(true, ...) is cheap.
.NET implementation is able to get method tokens from other modules.
This was causing a regression on a System.Xml.Xsl.XslTransformTests.Bug487065 while using referencesource's System.Xml implementation.
Custom attributes encoding means it's possible to have a scope that will
point into a PCL facade even if we (just before saving) will resolve all
type references.
Since all other references can be made on the _real_ assembly and that
we do not want to include any facade assembly just for this we need to
resolve those type and update their scope.
This reverts commit c96e58280c.
Getting this to work right with regards to register allocation
is turning out to be more complicated than it seems. Going to
abandon this for now.
CharUnicodeInfo had conversion methods for uppercase/lowercase
conversion, and they are actually used by TextInfo. So moved them.
Then added another icall for "lite" version of internal character table
loader.
The new CharUnicodeInfo depends on "charinfo.nlp" resource file, which
does not exist in referencesource but can be generated by coreclr build
tools (as src/mscorlib/src/System/Globalization/Tables/CharInfo.nlp).
The coreclr rev. that built this specific checkin was c4eb037.
Works around the following compile error:
```/Users/triton/Development/mono/mono/metadata/decimal-ms.h:3:16: error: redefinition of 'struct tagDEC'
typedef struct tagDEC {
^
In file included from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/unknwn.h:37:0,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/objidl.h:477,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/objbase.h:66,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/ole2.h:17,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/wtypes.h:12,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/winscard.h:10,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/windows.h:97,
from /Users/triton/Development/mono/mono/io-layer/io-layer.h:24,
from /Users/triton/Development/mono/mono/metadata/process.h:17,
from /Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/unistd.h:11,
from /Users/triton/Development/mono/mono/metadata/icall.c:27:
/Users/triton/Development/monodroid/builds/toolchains/windows/mxe/usr/i686-w64-mingw32.static/include/wtypes.h:452:16: note: originally defined here
typedef struct tagDEC {
^
```
Design:
- Handle r4 types in the front-end normally like other types.
- Controlled using a 'float32' optimization flag, may become the default in the future.
- new stack type STACK_R4.
- new set of opcodes prefixed by 'R', use the same vregs as 'F' opcodes.
- opcodes which worked with r4 values are used as before, but generate different code
in the back end (OP_R4CONST/OP_LOADR4_MEMBASE/OP_STORER4_MEMBASE_REG, etc.).
The mono-context.h file uses definitions such as mips_fp and mips_sp,
which are defined in <mono/arch/mips/mips-codegen.h>, but this file is
not included, leading to build failures.
This fix is similar to 4437ecea91 (for
ARM).
Signed-off-by: Thomas Petazzoni <[email protected]>
It was caused by a mismatch of the `sig` and `csig` variables when looking the wrapper in the marshalling cache.
This was manifesting as the following crash in all Monodroid programs:
```
#0 mono_type_hash () at /Users/joao/Dev/droid/mono/mono/metadata/metadata.c:1390
#1 0x7512edf4 in mono_signature_hash () at /Users/joao/Dev/droid/mono/mono/metadata/metadata.c:4957
#2 0x75115d18 in signature_pointer_pair_hash () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#3 0x751dca10 in rehash () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#4 0x751dcbe0 in monoeg_g_hash_table_insert_replace () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#5 0x75119570 in mono_mb_create_and_cache_full () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#6 0x75127390 in mono_marshal_get_native_func_wrapper () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#7 0x75127780 in mono_ftnptr_to_delegate () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
```
Originally introduced in https://github.com/mono/mono/pull/1540.
Olson TZ transitions are in UTC, and TryGetTransitionOffset used the TZ standard time.
TryGetTransitionOffset was comparing UTC with TZ standard times thus DST transitions could be obtained some hours before their start.
TryGetTransitionOffset is now changing provided times to UTC before comparing them with the transition times.
Fixes#25050.
This completes the list of methods in decimal-ms.c that are surfaced
to the Decimal class. This change also swaps out the Decimal class
from Mono to the Microsoft implementation.
This has not been tested yet, beyond the compiler being able to read
decimals (it did crash without it).
CoreCLR has two different bits of code for SearchScale, it looks like
one is just old and has not been updated. Moved to the new one, and
updated the code to pass the extra data that is missing from the
former one.
fread() spent a great deal of time locking, and we called malloc() once for
each entry. Replacing fread() with read() plus manual buffering, as well
as replacing malloc() with a static buffer, improves throughput by an
order of magnitude.
This also adds an '--input' option for reading from a stream other than
standard input.
This is a port of the CoreCLR Decimal support to C and to the Mono
coding conventions. In the process of porting the code, I removed a
bunch of COM-isms and some Windows-isms that were just workaround with
compatibility typedefs and replaced it instead with stdint.h data
types as well as Mono assertions.
There are still a few methods missing, and the managed library is not
plugged yet (both constructors likely need to be altered to be managed
proxies to the init method).
- otherwise we assert in sgen allocator
in sgen-gc.h:EMIT_TLS_ACCESS_NEXT_ADDR
thru sgen-alloc.c:create_allocator
- note that it is also disabled for ARM[64] and X86
on android
Despite what the makefiles would have you believe, this was never
actually used when running the test suites. Don't ask me why - my
make-fu isn't good enough. Regardless, it's a bad idea to only
run tests for a specific set of assemblies. If some tests fail or
are unstable, they should be fixed, or disabled and have a bug
filed. Sweeping them under the rug like this is the wrong thing
to do. Incidentally, this commit doesn't add any new failures.
* Removed all old profiles from VALID_PROFILE checks.
* Removed most logic under checks like ifeq (net_2_0), $(PROFILE)) as
it is dead code now that those old profiles are gone.
* Simplified the list of assemblies in mcs/class/Makefile now that we
only have one profile.
* LIBRARY_NEEDS_POSTPROCESSING has been removed as it was only used by
old 1.x assemblies that no longer exist.
* Build logic that sets MONO_PATH now points to mcs/class/lib/net_4_5
instead of mcs/class/lib/net_2_0.
The `make tzi.exe` target had bitrotted, and the
`make android-dump-tzdata` target generated inadvertent/unintentional
errors. Fix the makefile so that things build and run.
mono_marshal_get_native_func_wrapper now uses native_func_wrapper_cache indexed by SignaturePointerPair,
Using SignaturePointerPair index instead of MonoMethod index avoids problems when one native function needs multiple wrappers.
e.g: when the managed code creates delegates for function pointers with parameters that require different marshallings.
This fixes bug 26127.
Due to the removal of the net_2_0 profile, the files in ../System.Web/System.Web.Security aren't included in make dist anymore since they aren't used in System.Web (the classes got moved to System.Web.ApplicationServices.dll in .NET 4).
This breaks the tarball builds, as System.Web.ApplicationServices relies
on those files, so we now include the ReferenceSource equivalents instead.
When searching for a pointer with '--color' or '-c', the field in a
protocol entry that matched will be highlighted; when searching for
multiple pointers, they will be highlighted in different colors
according to their order on the command line. When highlighting more
than six pointers, colors will be reused.
The previous implementation did a ton of reflection and boxing making
it about 4x slower than it should be. This new (native) implementation
simply memcpy ()s the values out of the Enum objects and then does the
bitwise AND.
In addition, the JIT now recognizes this common IL pattern:
<push int or long ptr>
<push int or long>
box MyFlagsEnum
constrained. MyFlagsEnum
callvirt instace bool class [mscorlib] System.Enum::HasFlag (class [mscorlib] System.Enum)
This is generated from C# code such as:
MyFlagsEnum a = ..., b = ...;
a.HasFlag (b);
When the operand types of the `box` and `constrained.` instructions are
the same, we can skip all the slow stuff that HasFlag () normally does
and simply turn the whole thing into this IR:
<this> = loadi4_membase <this_ptr>
<temp> = int_and <this> <flag>
icompare <temp> <flag>
<result> = int_ceq
This is about 60x faster than the old HasFlag () without any JIT support
and about 15x faster than the new HasFlag () native implementation.
Also, added missing argument checks to HasFlag ().
This reverts partially commit 753229c72dd9f2b63beb097700e350164b887c2.
Marshallers are not called for ICalls parameters so the change of ICalls parameters to SafeHandle did not prevents handle reuse.
To prevent handle reuse ICalls are no longer called directly.
Instead we call a method that receives a SafeHandle and wraps the ICall call with safeHandle.DangerousAddRef and safeHandle.DangerousReleaseRef.
This guarantees that the safe handle reference countererence does not reach zero before or while the ICall, thus avoiding the handle beeing released and possibly reused.
By locking `threads_lock` before launching the thread, we guarantee that the thread is not going to remove itself from `threads` before we actually add it to `threads`.
The added file Test/symbolicate.expected contains the value that we expect to find in Test/out/symbolicate.out.
make check now uses Test/symbolicate.expected.
Sequences of OP_IL_SEQ_POINT instructions are now reduced to only the instruction.
This removes about half of the generated sequence point instructions.
This HMAC cipher accepts any key size (1), took from RFC2104, which uses
the full 64 bytes of key since it has a block length of 64 bytes.
(1): https://www.ietf.org/rfc/rfc2104.txt - Chapter 2: Definition of HMAC
Fixes a crash when there are two methods overloaded by arity:
System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.Single[XElement] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00038] in /private/tmp/source-mono-mac-3.10.0-branch/bockbuild-mono-3.10.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.10.0/mcs/class/System.Core/System.Linq/Enumerable.cs:2371
at System.Linq.Enumerable.SingleOrDefault[XElement] (IEnumerable`1 source, System.Func`2 predicate) [0x00007] in /private/tmp/source-mono-mac-3.10.0-branch/bockbuild-mono-3.10.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.10.0/mcs/class/System.Core/System.Linq/Enumerable.cs:2445
at Xamarin.ApiDiff.MemberComparer.Find (IEnumerable`1 target) [0x00019] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/MemberComparer.cs:72
at Xamarin.ApiDiff.MemberComparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x0003c] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/MemberComparer.cs:83
at Xamarin.ApiDiff.MemberComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x000a2] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/MemberComparer.cs:55
at Xamarin.ApiDiff.ClassComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0005b] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/ClassComparer.cs:210
at Xamarin.ApiDiff.Comparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x00093] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/Comparer.cs:80
at Xamarin.ApiDiff.ClassComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x00055] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/ClassComparer.cs:67
at Xamarin.ApiDiff.NamespaceComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0001a] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs:75
at Xamarin.ApiDiff.Comparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x00093] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/Comparer.cs:80
at Xamarin.ApiDiff.NamespaceComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x00055] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs:49
at Xamarin.ApiDiff.AssemblyComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0002b] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs:70
at Xamarin.ApiDiff.Comparer.Compare (IEnumerable`1 source, IEnumerable`1 target) [0x00093] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/Comparer.cs:80
at Xamarin.ApiDiff.AssemblyComparer.Compare () [0x0004a] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs:50
at Xamarin.ApiDiff.Program.Main (System.String[] args) [0x00328] in /Users/builder/data/lanes/macios-mac-master/177810cb/source/mono/mcs/tools/corcompare/mono-api-html/ApiDiff.cs:164
Many fonts, including the default DejaVu Sans, use kerning between
certain character pairs. This resulted in garbled or even invisible
display during typing of strings with a lot of kerning going on. An
attempt is made to retain the current speed-optimized implementation
while using accurate, slower string width measurements when needed.
See https://bugzilla.xamarin.com/show_bug.cgi?id=26478 for details.
This is so we can avoid miscompiling things left and right
when new overloads are added. For example, before this patch,
we miscompiled the new 4-parameter CAS () overload.
Calling mono with flag --compile-all=1 avoids running the code and possible stdout problems and it also compiles every method.
As test_op_il_seq_point.sh now only compiles it is now capable of testing libraries and executables that are expecting parameters.
Failure caused by https://github.com/mono/mono/commit/2f1b464beb14a1b6b6099a03fc332493293bef35.
```
../../../../../mono/mono/utils/mono-proclib.c:104:8: error: use of undeclared identifier 'errno'
if (errno != ENOMEM)
^
../../../../../mono/mono/utils/mono-proclib.c:104:17: error: use of undeclared identifier 'ENOMEM'
if (errno != ENOMEM)
```
This reverts commit 4d3877d23b.
We cannot remove this file as the build logic is expecting it since we override it from mono-extensions.
```System/Guid.cs(42,7): error CS0246: The type or namespace name `Crimson' could not be found. Are you missing an assembly reference?```
It started failing when code from MS referencesource was imported.
I checked on MS.NET and the list of attributes is now the same on Mono
(except an additional __DynamicallyInvokableAttribute on MS.NET).
These are emitted by recognizing Interlocked and Volatile methods. They allow
us to generate more efficient instruction sequences on certain architectures
(e.g. ARM64 which has specialized load-acquire and store-release instructions).
* Barrier semantics is now specified as acquire, release, and sequentially
consistent. This is in line with CIL/.NET semantics and also maps better to
LLVM's fence types.
* Use the mfence instruction for memory barriers on AMD64 as it's smaller
(and presumably also faster).
* We now emit specific barriers when using LLVM instead of always emitting
sequentially consistent barriers.
* Barriers emitted for the CIL volatile prefix instruction are now more
specific instead of always being sequentially consistent.
* Fixed emission of CEE_MONO_MEMORY_BARRIER in SGen's managed allocators. For
some reason (that I haven't had time to look into), mono_mb_emit_op ()
clobbers the barrier kind operand. This meant that in many cases we ended
up not actually emitting any barriers because the switches in the backends
didn't handle the clobbered values. mono_mb_emit_i4 () seems to work.
* Fixed handling of CEE_MONO_MEMORY_BARRIER in mono_method_to_ir (). Since it's
a custom opcode, the opcode is actually 2 bytes long. Another source of
barriers not actually being emitted.
This fixes Monodroid cross build, which broke with https://github.com/mono/mono/commit/adca49cdd28e7c7b0cc65073167c143cc5f52fdd.
Error:
```
/Users/joao/Dev/droid/mono/mono/mini/mini.c:6645:31: note: each undeclared identifier is reported only once for each function it appears in
/Users/joao/Dev/droid/mono/mono/mini/mini.c: In function 'mono_sigsegv_signal_handler':
/Users/joao/Dev/droid/mono/mono/mini/mini.c:6704:31: error: 'SIGSEGV' undeclared (first use in this function)
mono_handle_native_sigsegv (SIGSEGV, ctx, info);
```
At some point we zeroed all the unloaded domain's objects first, and then we cleared
weak links, ephemerons, etc. Because the objects were zeroes, we only had to
check that the vtable was null. Now we do it the other way around: clear weak links,
ephemerons, ..., and then zero objects. Obviously we now need to check for the
object's domain, because their vtables will not be null.
Add #ifdef to ignore code in mono/metadata/mono-route.c if OS=linux
Also remove mono-route.c from msvc/libmonoruntime.vcxproj (Windows)
Add #ifdef to ensure mono/metadata/mono-route.h code is not included
on Linux
Change to using #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
Use sizeof(addr) for maximum length of IP address string, instead of the hard-coded 16.
Should the size of addr ever change it will keep us from disaster in case if shrinking the array length.
Also, do not ignore snprintf return value - check for truncated output and act accordingly if it happens.
Add Tests for System.Net.NetworkInformation/IPInterfacePropertiesTest.cs and System.Net.NetworkInformation/NetworkInterfaceTest.cs
Remove accidental Copyright
add a space before the opening parenthesis, as shown in the coding guidelines.
Indent TestFixture to align with coding style of newer Test classes
Use G_N_ELEMENTS(mib) instead of sizeof(mib) / sizeof(mib[0])
Pinning is done in the worker thread, but reset in the main thread.
The main thread must wait for the worker jobs to finish until it can
reset pinning. We didn't do this before.
When importing a project that contains embedded resources, the id
of those resources must be generated using the path relative
to the project file that includes them, not relative to the
main project file. To fix this problem, we now generate a
Link metadata property for those resources that has the correct
relative path, and later this is used to generate the correct
id for the resource. We also now store a new metadata value
for all items (DefiningProjectFullPath) which contains the
path to the project file that defines the element. This is
used to check if an item was defined in an imported file,
in which case the Link assignment may need to be made.
This fixes bug BXC 20966.
In the TextBoxTest.PasteTest () test case we copy the string "ABCD" to the clipboard.
We then try to paste it again and see if it's the same.
Internally in WinForms, the clipboard data is retrieved via an X11 API that returns
a pointer to the string. In this case, we have a unicode/utf16 string that usually
looks as follows in memory (2 byte per character):
65 'A'
0
-
66 'B'
0
-
67 'C'
0
-
68 'D'
0
-
0 '\0' end of string
0 potential garbage from here on
-
0
0
...
The bug is that we use Marshal.PtrToStringUni (), which reads until the
first null *char* not the first null *byte*.
Imagine if we get the following (happens sometimes):
65 'A'
0
-
66 'B'
0
-
67 'C'
0
-
68 'D'
0
-
0 '\0' end of string
230 <--- garbage, but considered part of a char by PtrToStringUni ()
-
47
56
-
74
43
...
This produces garbage like "ABCD㠯⭊" since PtrToStringUni () reads beyond the original string.
The fix is to use the nitems variable that is returned by the X11 API (it contains the
actual number of bytes in the string) and copy the bytes manually. We already do
the same for the UTF8 case above.
This fixes the TextBoxTest.PasteTest () that intermittently fails on Jenkins.
Fixes#26008
We do not want (transition.DayOfWeek - first) % 7 to be negative.
As (transition.DayOfWeek - first) cannot be lower than -7, adding 7 to it solves the issue.
Little and big endian cases were inverted. It can be seen e.g. from the
reference http://locklessinc.com/articles/locks, where the ticket algorithm
is given for little-endian machines
As a consequence, without this patch, if TryEnter succeeds, it increments
ticket.Value instead of ticket.User, which puts the SpinLock in a corrupted
state, and makes it impossible to release afterwards.
SafeHandle.IsInvalid refer only to the handle value it self. Being true only if the handle is 0 || -1
In all cases, Releasing, Disposing or SetHandleAsInvalid does not change the handle value, so SafeHandle.IsInvalid will remain unchanged.
IsClosed will be true if the handle is released or if SetHandleAsInvalid is called.
The handle will not be released when calling Dispose if SetHandleAsInvalid was called.
The handle is not released at Dispose but when the last ref is removed by DangerousRelease
Some autoconf checks were missing when running on Windows.
Added stub for mono_get_local_interfaces back that was removed in b92e560d3f
for systems like Windows that have neither HAVE_SIOCGIFCONF nor HAVE_GETIFADDRS.
When config PhysicalMemoryLimitPercentage is not set or set to zero MemoryCache.PhysicalMemoryLimit value will depend on the total physical memory available.
Now even if multiple MemoryCacheEntry are added to CacheUsage with the same date time CacheEntryCollection is able to sort them for removal in the same order.
.NET was using this to retrieve the size of an object graph, by using special logic on its GC.
This version of SRef is not doing that, because Mono does not provide that kind of computation.
As the changes that the GC would require to support this are not trivial, SRef returns a wrong size for now.
Known problems:
- CacheMemoryMonitor does not trim the cache when it reaches its memory size limit.
- IMemoryCacheManager.UpdateCacheSize is called with incorrect size.
Performance counter "Available Physical Memory" return the current
amount of ram that is not in use.
This was added to be used by System.Runtime.Caching .NET integration
that relies on the available system memory to resize the cache.
(add a reference to System.Web.Services)
Without this patch we get the following exception after multiple call
to a soap web services:
Error while compiling generated serializer
/tmp/24ee1170/4996ddb2.cs(2519,27) : warning CS1522: Empty switch block
/tmp/24ee1170/4996ddb2.cs(969,29) : error CS0012: The type `System.Web.Services.Protocols.SoapHeader' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Signed-off-by: Frederic Mestayer <[email protected]>
Signed-off-by: Etienne CHAMPETIER <[email protected]>
We had previously used two separate loops for scanning card tables: One
loop that handled blocks where the object slots were larger than a single card,
and one loop where they were smaller. In the large case we would iterate over
the slots, check whether they were occupied, and if so, check their cards. In the
smaller case we would do it the opposite way: Check the card first, then check
the slots in the card.
For some workloads, the large loop resulted in lots of cache misses, because
we were fetching memory all over the blocks instead of just the cards. The small
loop, on the other hand, would sometimes scan objects twice, namely when they
crossed the boundary between two cards, and both cards were marked.
This new unified loop fixes both problems. We always look at the cards first,
and we keep a scan front pointer that prevents scanning objects more than
once.
For objects that were larger than a card we iterated over the objects in a block, rather
than iterate over the cards. To do that we had to load the object headers, which caused
cache misses. The card bits are consecutive, so they'll be in the cache.
The commit addresses race issues between the waiting on the lock semaphore and the release of the lock. The entry count and the owner field are grouped together into the status field. Accesses to it are done using atomic cas operations so threads aren't lost waiting for release on the lock semaphore.
Disable native fastpaths for now, until they are updated to the new implementation.
Without AOT only code size is checked
With AOT native code is checked.
We cannot compare the native code without AOT because some undeterministic data is stored in the middle of the code and there is no easy way of making the native code dumper ignore it.
Comparing native code is only possible with AOT because it is almost deterministic.
A diff of the smallest method changed by OP_IL_SEQ_POINT is now printed to ease problem identification.
That function is no longer needed since nothing calls it.
This was effective dead code for ages as it would only be used by targets
with no ipv6. So, unless you're using Debian Potato, nothing to see here.
By using a single networking abstraction for name resolution we no longer
need to have two code paths, one for struct hostent and one for struct addrinfo. Good riddance.
More specifically.
We now use functions to fetch protocol numbers and not rely on inline ifdefs.
We use the single abstraction over name resolution, which allows us to have a single code
path to convert the native structure into a managed one.
Finally, we moved the polyfill logic for missing functionality to a separate file to make
things easier.
This meant to replace the ifdef hell that is part of the current socket code and to
modernize the sockets code on some targets.
For some reason we still relied on gethostbyname (and variants) in 2015.
Those functions were deprecated circa the KAME project - yes, I'm that old to remember it.
With that in mind, we now rely on getaddrinfo for all sane targets and drop straight to
the lowest common denominator when it's not available, which is gethostbyname/gethostbyname2.
This patch removes support for the glibc gethostbyname2_r extension. Which is not a practical
problem because all linux/android target we can realistically run on have getaddrinfo.
Sorry grampa, no Slackware 8.0 anymore.
This code has a simpler structure of whole file ifdefs as much as possible, which is
a blessing to OOT ports.
In order to track emitted code with vtune you need to :
* pass --enable-vtune=yes to autogen.sh
* have in the LD_LIBRARY_PATH the path to the profiler libraries (ex $(installation_folder)/lib)
* pass argument --profiler=vtune to mono
Seems that on Jenkins, the request to the (non-existing) IP address used in the test returns before the 1s timeout,
causing the test to fail because the cancellation didn't fire.
Lowering the timeout to 1 millisecond should fix this.
I also verified that the test still correctly fails when the commit that fixed the original issue is reverted.
This fixes the case of the System.ObjectDisposedException being thrown
when editing a text cell in a DataGridView control a second time.
The problem is that the static control would be disposed by the code in
DataGridView's EditingControlInternal, but this instance was reused over
and over.
Instead, we now createa new editing control every time that the TextBoxCell
is created.
The investigation for this bug took place here:
https://bugzilla.xamarin.com/show_bug.cgi?id=9653
Fixes also:
https://bugzilla.xamarin.com/show_bug.cgi?id=22297
Removed the old string-based code and use CodeDom APIs for everything.
Implemented parameter support by adding the necessary properties to the generated class.
Fixed bug where the task references weren't passed to the compiler.
This should now work with VB code as well (assuming the compiler is installed).
Build error #1:
libtool: compile: gcc <...> -c mono-context.c -fPIC -DPIC -o .libs/mono-context.o
mono-context.c: In function 'mono_sigctx_to_monoctx':
mono-context.c:435:68: error: 'MONO_SAVED_GREGS' undeclared (first use in this function)
memcpy (&mctx->regs, &UCONTEXT_REG_Rn(uc, 13), sizeof (mgreg_t) * MONO_SAVED_GREGS);
^
mono-context.c:435:68: note: each undeclared identifier is reported only once for each function it appears in
mono-context.c:436:70: error: 'MONO_SAVED_FREGS' undeclared (first use in this function)
memcpy (&mctx->fregs, &UCONTEXT_REG_FPRn(uc, 14), sizeof (double) * MONO_SAVED_FREGS);
^
The MONO_SAVED_GREGS and MONO_SAVED_FREGS macros are defined in mini-ppc.h.
The problem happens because commit 7e056cd346
moved code using them from exceptions-ppc.h (which includes mini-ppc.h) to
mono-context.c (which doesn't), where they're not #included.
So, include mini-ppc.h in mono-context.c (in the existing powerpc ifdef block).
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Build error #2:
Now, it turns out mini-ppc.h doesn't know MonoMethod, MonoMethodSignature, and MonoObject.
So, include object.h (MonoObject), which includes metadata.h (MonoMethod and MonoMethodSignature),
in mini-ppc.h.
libtool: compile: gcc <...> -c mono-context.c -fPIC -DPIC -o .libs/mono-context.o
In file included from mono-context.c:427:0:
../../mono/mini/mini-ppc.h:37:2: error: unknown type name 'MonoMethod'
MonoMethod *method;
^
../../mono/mini/mini-ppc.h:306:31: error: unknown type name 'MonoMethodSignature'
mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
^
../../mono/mini/mini-ppc.h:306:64: error: unknown type name 'MonoMethodSignature'
mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
^
../../mono/mini/mini-ppc.h:312:27: error: unknown type name 'MonoObject'
mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, mgreg_t *int_regs, gdouble *fp_regs, gboolean rethrow) MONO_INTERNAL;
^
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Build error #1:
libtool: compile: gcc <...> -c mono-context.c -fPIC -DPIC -o .libs/mono-context.o
mono-context.c: In function 'mono_sigctx_to_monoctx':
mono-context.c:435:68: error: 'MONO_SAVED_GREGS' undeclared (first use in this function)
memcpy (&mctx->regs, &UCONTEXT_REG_Rn(uc, 13), sizeof (mgreg_t) * MONO_SAVED_GREGS);
^
mono-context.c:435:68: note: each undeclared identifier is reported only once for each function it appears in
mono-context.c:436:70: error: 'MONO_SAVED_FREGS' undeclared (first use in this function)
memcpy (&mctx->fregs, &UCONTEXT_REG_FPRn(uc, 14), sizeof (double) * MONO_SAVED_FREGS);
^
The MONO_SAVED_GREGS and MONO_SAVED_FREGS macros are defined in mini-ppc.h.
The problem happens because commit 7e056cd346
moved code using them from exceptions-ppc.h (which includes mini-ppc.h) to
mono-context.c (which doesn't), where they're not #included.
So, include mini-ppc.h in mono-context.c (in the existing powerpc ifdef block).
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Build error #2:
Now, it turns out mini-ppc.h doesn't know MonoMethod, MonoMethodSignature, and MonoObject.
So, include object.h (MonoObject), which includes metadata.h (MonoMethod and MonoMethodSignature),
in mini-ppc.h.
libtool: compile: gcc <...> -c mono-context.c -fPIC -DPIC -o .libs/mono-context.o
In file included from mono-context.c:427:0:
../../mono/mini/mini-ppc.h:37:2: error: unknown type name 'MonoMethod'
MonoMethod *method;
^
../../mono/mini/mini-ppc.h:306:31: error: unknown type name 'MonoMethodSignature'
mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
^
../../mono/mini/mini-ppc.h:306:64: error: unknown type name 'MonoMethodSignature'
mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
^
../../mono/mini/mini-ppc.h:312:27: error: unknown type name 'MonoObject'
mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, mgreg_t *int_regs, gdouble *fp_regs, gboolean rethrow) MONO_INTERNAL;
^
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
Added methods mono_inst_next, mono_inst_prev, mono_bb_first_inst, mono_bb_last_inst
The added methods do respectively the same as ins->next, ins->prev, bb->code, bb->last_ins but skip the instruction until it matches the specified filter.
* Main use case - JSON.NET serialization of CLR objects containing DateTime fields, GetUtcOffset()=>GetApplicableRule() are the highest Mono methods in the profiler
* The property DateTime.Date access in the foreach is very expensive, this has been moved outside the foreach
* Performance for DateTime.Now passed as a parameter is 10x better than before
* This is the simplest possible change to yield an improvement, it would be better to replace the O(N) loop logic with a binary search - this yields a further 2-3x performance improvement, when master is building I may submit later
Whenever a connection to an FTP server is established, FtpWebRequest
sends an option command to the server to enable UTF8 encoding for the
transfer. So far we've failed to check the request status of that
command and assumed that UTF8 is enabled but *also* failed to actually
use the encoding when sending commands (we had the ASCII encoding
hard-coded). This resulted in failed requests whenever a command named a
file or path which included non-ASCII characters. This patch does two
things:
* checks the status of the UTF8 enabling command and uses UTF8 encoding
only if it succeeded. Otherwise Encoding.Default is used.
* uses the encoding detected above for the command stream.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=24611
[Tests will follow at a later date]
So in Linux the PingTimeOut test was returning TtlExpired and failing the assertion. Since I'm not exactly sure how ping behaves under all platforms, relax the test to only make sure it doesn't succeed.
Reverted the async delegate firing which is how Caching et al. expect FSW events; and properly handle the multicast case.
Also fixing a typo/regression in @2f1a136583c90cae805441e63b94bc4f277bb953
As-is, on non-Mac, Xbuild looks for MSBuildExtensionsPath in the folder specified by --prefix, i.e. /usr/local/mono/xbuild by default (which may not & should not exist).
After manager.Build is called, a "null" empty for TargetFrameworkDirectory is
a string containing only ";" - a "good" value is the target framework
directory with a trailing ";". By testing for string.Empty, we don't actually
test whether the value has been correctly populated (causing all subsequent
failures).
Used the following script to do this:
var d = XDocument.Load ("Strings.resx");
foreach (var j in d.XPathSelectElements ("/root/data")){ var v = j.XPathSelectElement ("value"); Console.WriteLine ("\tpublic const string {0}=\"{1}\";", j.Attribute ("name").Value, v.Value); }
This brings .NET's parameterized terminfo renderer, various fixes and
semantic changes.
The existing implementation of the Console did not have a proper an
implementation of terminfo's parameterized sequences. Instead of
this, a collection of hacks existed to hardcode both light colors and
cursor position. These are now gone, since the parameterized strings
do contain the correct values for this.
The search path for terminfo now picks the most modern location for
terminfo. With the old paths in place.
The lookup for terminfo databases only supported the lookup based on
the first character of a terminal, so for example, for xterm this was
$terminfo_dir/x/xterm, but OSX and maybe other systems now store the
files in $terminfo_dir/78/xterm (where 78 is the hex representation of
'x', the first letter of the terminal name).
The fallback is still in place for other Unix systems.
We no longer use the built-in terminfo databases as the first pick,
instead we try to load the system terminfo database before we use the
built-in versions.
Worth figuring out if we want to remove the two built-in ones (Linux
and xterm) as broken terminfo databases are no longer the norm in Unix
and just keep the ansi one as a database of last resort.
This means that the console actually now gets high colors on MacOS,
not just Linux.
This also fixes the issue with consoles with more than 256 colors. As
reported in bug 18315.
- XNodeWrite.FillXmlns was adding a prefix to the attribute when no prefix was found (prefix==null)
- XNodeWrite.LookupPrefix now returns string.Empty prefix when the namespace is the same as the element.
A string.Empty prefix explicitly states that it has no prefix whereas null states that prefix was not defined.
When LookupPrefix returns null for a namespace it means that a prefix should be generated first for anything that uses the namespace.
That is what XmlSerializationWriter.GetQualifiedName does.
Fixes#24300
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=24947
When an Android user changes the timezone, those TimeZone changes
aren't reflected in Xamarin.Android apps. Part of this is a
Xamarin.Android bug, in which it needs to listen for TimeZone change
notifications and in turn let Mono know that the TimeZone changed.
Xamarin.Android can/will call Thread.CurrentCulture.ClearCachedData()
and Thread.CurrentUICulture.ClearCachedData() when the TimeZone has
changed. This will allow Mono to lookup the TimeZone info again.
At which point we hit two problems within Mono:
1. TimeZoneInfo.AndroidTimeZones.Local is unnecessarily cached.
2. DateTime itself caches the UTC offset for use by DateTime.Now.
TimeZoneInfo.Local is *already* cached, and TimeZoneInfo.Local is
properly cleared by TimeZoneInfo.ClearCachedData() while
TimeZoneInfo.AndroidTimeZones.Local wasn't. Removing the extra
cache allows the TimeZoneInfo to be looked up again.
Which brings us to DateTime.Now: for my simple test case, after
calling CultureInfo.ClearCachedData() the result of
DateTime.Now.ToString() didn't reflect the newly current TimeZone. The
cause for this was DateTime.to_local_time_span_object and
DateTime.last_now, which DateTime.Now uses as a cache for the
TimeZone's UTC offset.
Since these DateTime fields weren't cleared, subsequent DateTime.Now
invocations reported the *previous* TimeZone instead of the current
timezone.
To fix this, add an `internal` DateTime.ClearCachedData() method, and
call DateTime.ClearCachedData() from CultureInfo.ClearCachedData().
We can't dereference an object's VTable before we know that it's not
tagged. In this case, forwarded. The access would be unaligned and
might even fault.
We call `mono_thread_pool_cleanup` twice from `mono_runtime_try_shutdown` and later `mono_domain_finalize`, which meant we tried to destroy the semaphore twice and that caused a crasher.
Fix this by clearing out the semaphore pointer. That way when we try to destroy it again it's already null and execution continues just fine.
There's an unlikely case that Roslyn triggers quite often on Linux: A
thread tries to allocate from the nursery, but it's full. It triggers
a nursery collection, then tries allocating again. Between the
collection and the allocation retry, another thread fills the nursery
so that the retry also fails.
We failed an assertion in this case. Now we always go to the major
heap if it happens.
This bug is not hit when doing managed allocations with SGen because the
managed allocator catches it. It can be triggered with the embedding API, as
well as when the heavy binary protocol is enabled, in which case `bug-17590`
fails.
Previous code subtracted 4 pixels of the height of the text of a
toolstrip button, presumably to leave a margin. However, margins
are handled elsewhere, so we ended up with truncated text.
The intention is to make build failures easy to spot instead of silently upgrading
target framework from 2 to 4 and then fail down the road on e.g type ambiguity
caused by new 4.0 framework types or methods
This is the fix for https://bugzilla.xamarin.com/show_bug.cgi?id=25158
Current implementation does not contain the DateTimeOffsetConverter
in the list of default converters. This cause NotSupportedException
to be thrown when trying to serialize/deserialize DateTimeOffset
values to/from strings.
In .NET Framework implementation this class is added to such a list.
This fixes bug #25086 (Xamarin.Android). Details described there.
To fix the issue, we use #if XAMARIN_ANDROID to avoid that old cygwin-only
code path. (We are not sure if simply removing the old code still works,
so we don't remove that for now.)
In the Windows implementation of the TabControl, Ctrl+PageUp
navigates to the previous tab and Ctrl+PageDown navigates to the
next tab (with both wrapping around). This change implements this
feature in the Mono implementation.
Change-Id: Ib940bd08d5ba641f05ed91c0e789e356e68f72bb
ToKey() ignores the setting parameter when calling RegistryKey.OpenSubKey() and
thus always asks for write permission. If you try to read read-only keys (say
HKLM without admin rights) it will fail with a SecurityException.
* Fixed the FileSystemEventArgs.Name property for all events
* Fixed regression of bug #5747 (and related path normalizing issues) https://bugzilla.xamarin.com/show_bug.cgi?id=5747
* Improved error handling, set hard limit on file descriptors to 200 for now to help isolate issues
* Fixed issues with rapid event Changed+Renamed firing
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=24742
Context: Commit f7fd52ad
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=24958
The logic of Commit f7fd52ad was 'Desktop Mono returns "Local" from
TimeZoneInfo.Local.Id, so surely Xamarin.Android should', predicated
in part on the assumption that whatever Desktop Mono does should be
the same as what Desktop .NET does.
This assumption wasn't verified, and is in fact wrong; Desktop .NET
doesn't return "Local" from TimeZoneInfo.Local.Id, it returns an
actual identifier.
The reason why Desktop Mono returns "Local" is due to implementation
sanity, particularly on OS X: /etc/localtime may be a symlink OR a
copy of the timezone data, and when it's a copy there's no way to
determine the Olson ID for the timezone. Consequently, it may not be
possible to determine the TimeZone ID.
Xamarin.Android doesn't have that problem; it uses the Android
persist.sys.timezone system property value,
falling back to java.util.TimeZone.getDefault().getID() if necessary,
and thus always has access to an Olson ID.
Change TimeZoneInfo.Local.Id on Xamarin.Android to return the Olson ID
instead of "Local", partially reverting Commit f7fd52ad.
When we draw a button with ImageAboveText.ImageAboveText and the
text is too big to fit below the image we have to draw the text over
the image. This should happen from the bottom, not from the top as
the previous implementation did. With the previous code we ended up
having the text at the top of the button under certain conditions.
UriParseComponents.ParseUser was unescaping all escaped chars and when a non valid user info char was encountered it was assuming that those chars were not part of the user info. The chars were not consumed thus the problems while parsing the rest of the input.
UriParseComponents.ParseUser now keeps non valid user info chars escaped.
Due to an incompatibility in the project files and DLL API setup code, we were importing locally defined symbols as DLL. This manifested as a debug heap dialog in VS caused by allocating and freeing memory between two Windows modules (which have their own memory heap).
Fix this by simplifying the DLL defines in MSVC, we are relying on .def files to manually specify the exports anyway.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=24741
Xamarin.Android didn't previously support
TimeZoneInfo.FindSystemTimeZoneById("Local") because of oversight (and
overly nested #if conditionals).
Compare `id` against "Local" *before* doing platform-specific
codepaths so that finding the "Local" TimeZone works as expected on
Xamarin.Android, and merge the `#if MONODROID` with the existing code.
7d1b878fbf altered the behavior of removing rows, breaking
the DataGridViewRowCollectionTest.ClearRows () test
Before the change, this is what happened when the list was cleared
(the number in brackets is the value of the Index property of the DataGridViewRow):
[0] Remove [1] ReIndex [0] Remove [1] ReIndex [0]
[1] --------> [2] --------> [1] ------> [2] -------> [1] ...
[2] [3] [2]
[3]
After the offending commit, ReIndex is only called after the list is cleared, which means
the Index property of the rows is never updated (as there are no items in the list).
The fix is to explicitly set the Index of each row to 0.
This was the end result before the commit anyway, so we can omit the ReIndex call entirely.
Before, the first thing the user saw were instructions for niche platforms like Itanium or Solaris.
Instead, we now just link to the "Compiling Mono" guides for OSX, Linux and Windows on the Mono website.
Additionally, a bunch of instructions were outdated / no longer relevant, updated those.
The "Configuration options" section was moved to the bottom of the readme, it was pretty long and pushed
the other sections into oblivion.
We can't actually use the trick of setting both the pinned and forwarded
bits to indicate cemented objects because the Tarjan bridge requires those
two bits never be set at the same time.
The factor we used previously gave us object sizes in increments that made
some benchmarks use quite a lot more memory than necessary. In particular,
we didn't have a size for 24 byte objects (on 64 bits), just for 16 and 32.
The card scanning code assumed that the size of the block header is less
than the size of a card. If we put the block info into the header and increase
the block size enough, that assumption isn't true anymore, because the
mark bits take up space in proportion to the block size.
The idea here is to first extract all the references within an object
and then to process them, pre-fetching the objects they point to a few
steps ahead.
When the runtime shuts down the last thing the GC usually hears about it
is that the root domain is unloaded. If we don't flush the binary protocol
buffers at that point, we lose entries.
We still have two separate implementations of the scanning code: The optimized
one and the old one. The old one is still needed because it supports the concurrent
collector. For the non-concurrent collector we can now use the optimized
implementation, however.
Fasten is a small tool for optimizing compile-time options:
https://github.com/evincarofautumn/fasten
It does that by parsing source files for numbers that have been marked
as "fastenable", and fiddling around with them. We do this for all
the new optimizations.
We actually implement two separate mark/scan loops: One that doesn't
support evacuation and one that does. We dynamically choose which one
to use. The evacuation-less loop is faster, so we use it whenever we can.
The reason for having a small bitmap was that we could encode the object
size in the descriptor. The main attraction for having object size handy is that
we can quickly check whether an object is in the small object major heap or
in the LOS. We solve this problem by always using complex descriptor types
for large objects, so now we can tell whether an object is small just by looking
at the descriptor type.
To identify more small objects quicker.
Since we now use the runl-length descriptor types to indicate object
size as well, and strings can have any size, we can't use that type
for strings anymore, so we use the complex type which forces us to
look up its size to determine whether it's a small or large object.
We can do the cemented check faster by using the third vtable bit to
tag cemented objects (in addition to the pinned bit). In workloads
that are heavy on cementing (like `lcscbench` or `perimeter`) this
significantly increases performance.
Another experiment: What if we put the whole block info into the block
itself, not just a pointer to it. There's one less indirection we
need to do. On the other hand, many of them will share the same cache
lines. So do the pointers to the block infos, though.
When we scan a small object in the major heap we have to read the
block header of its block. It makes sense to prefetch that as well,
in addition to the object itself.
This is another experiment.
When marking on enqueue, what we need to do is look at the object
we're about to enqueue, to check whether it's a small or large object.
Then, when we dequeue to scan, we look at the object again, so we
essentially fetch each live object header twice.
With mark on dequeue, when we encounter a pointer we always enqueue
it, without even looking at the object. Only when we dequeue do we
figure out whether it's marked yet, and thus whether we need to scan
it.
The basic idea here is to make a loop that combines dequeuing from the
gray queue, scanning and marking/copying/enqueuing, with redundancies
removed and special-casing of the common case.
We make the small bitmap type descriptor only apply to small (as
opposed to LOS) objects so that we can quickly check in that case
whether an object is in the LOS or not without actually looking up its
size.
We disable evacuation and the split nursery because the code doesn't
support them yet.
Without heavy statistics it counts almost no objects, and even with
heavy statistics turned on, it doesn't count everything. SGen has an
accurate counter when heavy statistics are turned on.
In case the test runner returns null we will no longer suffer a NullArgumentException and the collector exceptions will be printed.
The test runner was returning null because of an IOException "Too many open files" on NUnit side.
* Add support for colorizing the HTML output. This can be turned off if desired.
* Some changes are now reported inline (using colors/underline/strikeout)
instead of generating an removed/added pair. This makes the diff
a lot easier to read.
As-is, winsetup.bat replaces config.h with winconfig.h, which is needed for the MSVC compilation - but breaks all further use of cygwin's make (e.g. to build the class library, or run "make install").
This patch introduces a new cygconfig.h as a backup prior to squashing config.h (if it exists, so the runtime can still be built without cygwin ever being used), and makes winconfig.h use it on non-MSVC compilers (i.e. cygwin)
This patch brings .NET's implementation of the RegularExpressions
stack and brings some of the supporting infrastructure required to
build without resource files.
The build commands have been updated with two new defines to assist in
bringing .NET code: MONO (to indicate that the code is being compiled
as part of Mono) and a more granular DISABLE_CAS_USE that is used to
mark regions where Code Access Security is being used in the source
code, as Mono does not actually ship with a working CAS implementation.
A tools thread is one that can access core runtime structures but not touch anything managed (code or heap).
It's intended to enable the profiler to resolve missing backtraces from its helper thread.
THIS IS A HACK.
The right solution would be to not perform this on the profiler at all and simply log IPs and let the decoder
resolve them. But then there's reality and we can't simply break the current format without consequences.
We're taking this hack for now until we can fix the profiler to do something sensible.
Unhelpfully, winconfig.h is used for building eglib, and it includes a hardcoded VERSION definition which needs to match configure.ac - otherwise msvc builds identify themselves as 2.11
MonoPosixHelper fails to build in my testing, due to config.h bailing the
build out if it doesn't think the build platform is XP SP2 or higher.
Adding this define forces that minimum Windows version, allowing mono.sln
to build fully.
For the opcodes sizeof, mkrefany and refanyval the jit
was resolving the operand tokens directly from the image.
In dynamic scenarios where the tokens are stored in the
wrapper data, this triggered TypeLoadExceptions.
This patch uses mini_get_class, as used everywhere else,
to resolve the operand tokens of those opcodes.
Consider spans and absolute sizes in computing PreferredSize for
TableLayoutPanel.
Also fix bug in allocating unused width to SizeType.Absolute columns.
Change-Id: Ic5065b83ced8195d1c5be39087f33b0d632fc9a6
A previous change (885b065e) accidentally calculated the text size
in some places without padding. This resulted in a slightly to small
text rectangle, causing the text to be truncated.
This property uses the new CMD_STACK_FRAME_GET_DOMAIN command
to retrieve and cache the domain in which the stack frame
is executing.
Bump the protocol version to match the runtime.
When cross compiling with gcc, LIBC is defined and
thus never checks the registry for the timezone information.
This change is released under the MIT license.
The underlying problem for bug 7716 [1] was that the Mono C14N XML
canonicalizer was not sorting the XML attributes in the same order as
Microsoft .NET's canonicalizer.
The C14N specification [2] states: "the attributes are sorted
lexicographically by attribute name (based on Unicode character code
points)." This wording suggests that the order of attributes should be
strictly ascending based on Unicode byte value. This commit changes the
attribute sort order to match the specification.
The new tests pass on Windows, fail on Mono before this change, and
succeed on Mono after this change.
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=7716
[2] http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html
When the VirtualListSize changes, the focus_item_index should
be reset (similar to how it currently resets the selected indices).
If the last item in a ListView has focus and it is removed by
an another action on the form (i.e. push a button to remove the
current item), then the focused_item_index is not updated when
the VirtualListSize changes, even though that item doesn't exist
anymore. When the ListView receives focus again, it tries to
invalidate the current focused item which causes an
ArgumentOutOfRangeException.
The previous value was -2, that could introduce comparison issues.
Added flag MONO_SEQ_POINT_FLAG_EXIT_IL that is used to encode the exit IL, this avoids a 4 byte IL offset delta.
This fixes ~30 ppc-specific failures in mono/tests (e.g., appdomain), like this:
wrong maximal instruction length of instruction atomic_add_i4 (expected 20, got 28)
* Assertion: should not be reached at mini-ppc.c:5235
The commit 51c454f6b0 introduced 2 ppc_sync
instructions in OP_ATOMIC_CAS_I4/8 *and* OP_ATOMIC_ADD_NEW_I4/8 (mini-ppc64.c).
Accordingly, commit 83a34c40c6 updated the maxlength
(+8 bytes) of atomic_cas_i4/8 - *but not* atomic_add_new_i4/8 (cpu-ppc64.md).
Recently, commit b784b866da made atomic_add_new_i4/8
exercised (as 'atomic_add_i4/8') - with an incorrect/non-updated 20-byte maxlength,
which should actually be 28.
Thus:
wrong maximal instruction length of instruction atomic_add_i4 (expected 20, got 28)
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
The ELFv2 ABI specifies some particular cases for in-register parameter
passing, return values, float/double structs; e.g.,
- small struct returned via registers (2 doublewords)
- homogeneous float struct returned via registers (8 members)
- small float struct passed/returned via FR registers
- return via multiple registers
Author: Bill Seurer <[email protected]>
Origin: https://launchpad.net/ubuntu/+source/mono/3.2.8+dfsg-4ubuntu2
Changes: Mauricio Faria de Oliveira <[email protected]>
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
After the mechanical exchange of ppc_r11 and ppc_r12 we now can use
ppc_r12 for global calls to hold the callees address without clobbering
r11 (which potentially contains IMT_REG, VTABLE_REG and RGCTX_REG).
We don't need to change all indirect calls, only those potentially reaching
functions containing a TOC setup based on r12 (in particular functions
in shared libs). As the instruction sequence patcher can only deal
with one destination register we also need to make some additional
calls use r12. We probably should convert all calls that currently
use r0 to use r12 if no other conflicts arise but this is enough to build.
Author: Michael Matz <[email protected]>
Origin: https://build.opensuse.org/request/show/225490
Changes: Mauricio Faria de Oliveira <[email protected]>
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
This is a preliminary patch for ppc64le ELFv2 support. That one requires
r12 to hold a functions address at calls to normal (global) C functions.
As is r12 is also used by mini for its IMT_REG, VTABLE_REG and RGCTX_REG
to pass around values to functions outside the normal argument registers
(ugh!), so there's a conflict. This mechanical (by sed) patch simply switches
ppc_r11 and ppc_r12 everywhere, r11 doesn't have any special use in the ABI.
Author: Michael Matz <[email protected]>
Origin: https://build.opensuse.org/request/show/225490
Changes: Mauricio Faria de Oliveira <[email protected]>
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
This adds initial support for ppc64le to the ppc64 port. That is:
* little endian aware (also in strtod),
* and ELFv2 aware (not using function descriptors)
* adjust various block sizes to be multiple of 64k, the default
pagesize on ppc64le. The sources should have used the system function
to ensure alignment on pagesize, so this is just a stop-gap
It also corrects the list of registers for the precise GC, but that isn't
used in mini at all on any architecture currently.
Author: Michael Matz <[email protected]>
Origin: https://build.opensuse.org/request/show/225490
Changes: Mauricio Faria de Oliveira <[email protected]>
Signed-off-by: Mauricio Faria de Oliveira <[email protected]>
MonoSeqPointInfo has now a pointer to a buffer containing encoded sequence points, and to a buffer containing next values.
As there is no longer an array of SeqPoint ready to be read, SeqPointIterator was added.
This line enable the ASP Javascript validators in IE9 and upper. the user agent the IE10 is "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)".
We don't update mark bits atomically, so we can't have two threads
marking at the same time, which means we have to stop the concurrent
collector worker thread while we do work in the main GC thread. That
includes nursery collections, because they also touch mark bits.
Also problematic are mod-union updates. The worker threads can add
global remsets, which they do in the main cardtable. This will conflict
with updating the mod-union table, so having the workers stopped also
applies there.
Before we do all the major heap work in the finish mark pause of a
concurrent collection, we perform a nursery collection, for simplicity's
sake.
The nursery collection left pinned objects in the nursery, without
following their references into the major heap, so the major heap work
had to scan those objects again. There was no special provisioning
for this—major mark would do the pinning again, and we would
automatically end up scanning the objects again.
The way we determine the stack end for the GC thread, however,
had the effect of making pinning non-deterministic. We would
conservatively scan part of the GC thread's stack, which was
subject to change, to pinning again might result in less or more
objects pinned.
The proper solution would be to determine the stack end correctly,
but for now we will just the whole nursery.
As mentioned in commit 789517f8, I'm trying to compare inter-API level
differences in Mono.Android.dll, and want to reduce as much
"meaningless noise" as possible -- changes which don't meaningfully
break API or ABI.
Among those "meaningless" changes are the addition of property setters
to properties. Adding a setter doesn't break API or ABI.
Add a `mono-api-html --ignore-changes-property-setters` option.
--ignore-changes-property-setters:
Ignore the addition of property setters.
If a source property contains a getter and the target property
contains both a getter and a setter, do not flag this as a
change.
As mentioned in commit 789517f8, the intentino of
`mono-api-html --ignore-changes-virtual` is so that when a method is
changed from non-virtual to virtual or override, or from virtual to
override, a "Removed member" message isn't triggered.
However, the previous implementation was too lenient. While *adding*
virtual to the method is fine, *removing* is NOT fine, as that would
be an API breaking change (e.g. all classes which attempt to override
a previously virtual method could no longer do so).
Make the virtual check stricter so that virtual/override to
non-virtual changes are not ignored.
I've been trying to review API diffs in Xamarin.Android between API
levels, but the diffs are "noisy" because Google will change parameter
names at-will, or will change a non-virtual method into a virtual
method, or a virtual method into an override, all of which are
acceptable changes but individually generate a Removed line in
mono-api-html output, and manually removing the *hundreds* of changes
is error-prone.
Add two new option flags to mono-api-html:
--ignore-changes-parameter-names:
Ignore changes in constructor and method parameter names.
If parameter names change between <reference.xml> and
<assembly.xml>, don't report a change for the constructor or
method.
--ignore-changes-virtual:
Ignore changes in "virtual-ness".
If a method or property changes from non-virtual to virtual,
non-virtual to override, or virtual to override, don't report a
change for the member.
We change the function to use the lock/validate pattern. This is both
more scalable and enables us to use the image lock, since the amount of
work done with it held is now trivial.
The function mono_method_inflated_lookup no longer needs the loader lock to be held
as the hashtable is now protected by the imageset lock.
This means that mono_class_inflate_generic_method_full_checked doesn't need to take the
loader lock.
The function mono_method_set_generic_container uses mono_image_property_insert which takes
the image lock and not the loader lock. Adjust the locking comment.
This is used for counters that are defined after runtime initialization. It implies that TYPE_SAMPLE_COUNTERS_DESC can now be emitted at any time, and not only once.
The same counter instance would be returned if we use the "instance" parameter instead of the "counter"
parameter. Also it is the name of the counter that is stored in mono_perfcounter_create (mono-perfcounters.c:1488).
Fix the following bug : shared_data_find_room return twice the same memory region because it was not marked as "in use" by setting the header.ftype value.
This bug is triggered when we want to create a new shared area (for example a new FTYPE_INSTANCE area) while creating another area (for example a new FTYPE_CATEGORY).
The structure of the encoded SharedCounter is as follow :
- compressed data type : 1 byte
- index in the category : 1 byte
- name of the counter : null terminated string
- help of the counter : null terminated string
DataGridView keeps track of the first visible row in first_row_index.
DataGridViewRowCollection will notify DataGridView its about to delete 1 or
more rows via OnRowsPreRemovedInternal(). When this happens, we need to
ensure first_row_index will still fall within the number of rows that
will remain after the row removal.
This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=24372 which I
reported.
This is a jumbo commit that addresses multiple issues with statistical backtrace collection:
1) It's not possible to reliably collect MonoMethod* so we check that they exist before
serializing to the .mlpd file and retrieve in sync context.
2) It was reporting the generic instance MonoMethod* under gsharing. Those methods are
not reported to the profiler since they are never compiled. They would turn out as unknowns.
3) Collecting IL offsets from async context is currently impossible to be done safely, so it's
now disabled. The way we'll do it in the future is by serializing the sequence point table when
JIT'ing.
4) The way we used to collect frames in statistical ignored all frames until the first LMF, which
discards a lot of them under statistical mode. We now properly pass sigcontext and have it been consumed.
In the future we should simply use the callchain mode.
When issuing a Clear() to remove all rows, a ReIndex() was being called for
each row that was being removed. This is extremely inefficient, instead
do a single ReIndex() after all rows have been removed.
Before doing a Clear() of 30k rows was taking 5.8 seconds. With this patch
it now takes 670ms.
This is useful in the case of the benchmarking suite because we are only interested in the counters, and they represent a minimal part of the output file size.
+ Fix NRE when source_file or source_file.Usings is null. This will now return back an empty string or empty List
+ **Note** that we are returning the ToString() value of NamespaceExpression which is the full resolved namespace of "System.Drawing" instead of "Drawing".
+ Add ToString override for NamespaceExpression to return the full resolved name of the namespace.
Before this change, those Last*Time properties returned only based on
seconds (truncated), which could cause inaccurate time comparison.
Consider code like this:
var fileUpdated = DateTime.Now;
...
File.WriteAllText (path, "foobar");
...
if (fileUpdated > new UnixFileInfo (path).LastWriteTime)
OnUpdatedFile (path);
This could always result in raising update event, even if there was
no update after writing.
Last*Time With milliseconds makes it very unlikely to happen.
The XML work in 661430fd1f and bf39f5aec0 changed the whitespace handling, so the mdoc test suite failed.
Refreshing the files makes them identical to what MS.NET produces and fixes the mdoc tests.
If we run out of memory during the nursery collection in the finishing collection pause,
there will be late-pinned objects in the nursery: pinned objects that were not pinned
from conservative roots (or cementing). We need to scan those, too, so in that case
we just walk the nursery and scan all objects.
The two collectors stepped on each other's toes. Specifically, updating the mod union
card table while the worker thread might mark cards in the card table will not work.
The simplest solution for now is to stop the worker thread during concurrent updates
and nursery collections. In the future we can have the thread help with the nursery
collection.
Cementing can happen during a concurrent collection when processing
the cardtable. We use a separate cementing hash during concurrent
collections but we didn't pin objects from there.
Reset of adjustment rules is mandatory when the base offset is changed because the rules are relative to the base offset.
Adjustment rules are now kept until the base offset changes.
- merge fix for https://bugzilla.xamarin.com/show_bug.cgi?id=21578
the MulticastOption's 'private IPAddress local' field was
removed by linker and the app crashed later at runtime.
- when System.Net.Sockets.MulticastOption object
is passed to System.Net.Sockets.Socket.SetSocketOption
and thru it to System.Net.Sockets.Socket.SetSocketOption_internal
it accesses passed object fields
(thru few more native calls).
The current signal profiling code depended on invalid linux behavior of setitimer
allowing multiple threads to register for the same timer. Linux kernel 2.6.12 fixed
this and only the main thread gets the signal. Always.
The correct POSIX behavior happens on OSX/iOS.
On Linux we could use timer_create and SIGEV_THREAD_ID but that would not work on iOS/OSX
since it's specific to it. Given that little detail, I'll leave implementing it as an
exercise to the reader.
The solution, which aims to be as portable as possible, is to use a pair of signals and
have the first one fire the second one against all other threads.
We use a pair of signals since it's not well defined which thread will receive the signal
so detecting this from the signal is non-trivial.
Parameter names are part of the ABI because of C#4 named parameter.
Consequently, they *must* be consistent with .NET, and .NET a
parameter name of "errorInfo", *not* "errorInfoPtr" [0]:
public static Exception GetExceptionForHR(
int errorCode,
IntPtr errorInfo
)
Change the parameter name from `errorCodeInfo` to `errorCode` so that
the parameter name is consistent with .NET.
[0]: http://msdn.microsoft.com/en-us/library/3xade62s(v=vs.100).aspx
Extend functionality of SgenPointerQueue.
The purpose of this commit is to avoid dependency between GC code and the obtaining of the hash from the object's synchronisation field, which might require additional processing.
for reading the input stream.
According to the MSDN docs, if ReadEntityBodyMode returns "Classic" the code should use
the old method to read the input stream (HttpRequestBase.InputStream) which is fully
implemented in mono.
Manually applied patch from martinjt
Add Makefile rules to automagically download the TimeZone database
from the Android target $(ADB_TARGET), and build the tzi.exe app.
$ make android-dump-tzdata ADB_TARGET=-d
# downloads timezone data into ./android/tzdb.
# dumps timezone data into ./android/tzdata
# builds ./tzi.exe
# Show adjustment rules for a given timezone dump
$ mono tzi.exe -i=tzdata/Asia/Amman
Add `tzi.exe -R` option to show the TimeZoneInfo.GetAdjustmentRules()
output for all encountered timezones.
Add `tzi.exe -o=PATH` option to dump the TimeZone data to disk for
interrogation.
Add `tzi.exe -i=PATH` option to read in the specified TimeZone data
file and dump the rules contained therein.
Update usage comments.
Makefile defines GC_WIN32_THREADS as 1 but gc_config_macros was
redefining as defined but with no value.
Signed-off-by: Alex J Lennon <[email protected]>
- Don't subtract room for ellipsis. Ellipsis should be
handled by the renderer so we shouldn't reserve space for it.
Otherwise we end up not getting ellipsis (because the renderer
thinks there is enough space available), or we don't use up the
available space.
- Don't allow text to go below button if we want to show ellipsis.
When a button is pressed the image and the text needs to be rendered one
pixel to the right and to the bottom so that there is some visual
feedback of the button press. Previously this was only the case if
TextImageRelation was set to Overlay.
NUnit breaks when these URI's are treated as UNC paths, so I have no way of
running the tests on Windows without this change to see if it broke anything.
Not all URI tests pass, but the ones that fail seem unrelated to my change.
On Unix, the tests all work, but of course on Unix this is a no-op.
This commit licensed as MIT/X11.
Unless running in on-demand AOT mode, the AOT runtime will look for an AOT cache alongside the assembly (e.g. /usr/lib/mono/4.5/mscorlib.dll.so).
This patch adds a second search path to the non-on-demand AOT loader, /usr/lib/mono/aot-cache/ARCHITECTURE/path/to/assembly.dll.so
This new structure makes it possible to have more than one Mono architecture on a system, sharing assemblies but not sharing AOT caches (for example, i386 and amd64 Mono on the same system, for different needs)
On *nix files are not executable by default where on Windows they
are. This causes problems if installing a NuGet package on *nix that
contains .exe files intended to be used by build tasks. On Windows the
build will invoke these without complaining whereas on *nix the build
will fail with "Native error: cannot find file specified".
On mono, the action that will be taken is to pass the path to the .exe
file to mono as a command-line argument. If this was done in a shell it
would succeed whether or not the .exe file has the executable bit set,
so it seems that this should also succeed within a program.
With thanks to @akoeplinger for help designing the test.
I release this under the MIT license.
Marshal.GetHRForException had a MonoTODO because it needs to set
the errorinfo object so that exceptions get properly passed to
unmanaged code. Since not all managed exceptions have a corresponding
HR value but we might need to get to the original thrown exception
we implement a ManagedErrorInfo helper class that implements the
IErrorInfo interface but also stores the exception.
In GetExceptionForHR we check if the errorinfo we get is a
ManagedErrorInfo. If it is we return the exception stored in there
(if it converts to the same error code), otherwise we construct a new
exception.
Also use additional information provided by IErrorInfo to fill in
exception details.
To make use of IErrorInfo on Linux a suitable implementation has to be
provided, e.g. by including libcom plus adding a mapping from
oleauth32.dll to the shared library that provides the implementation.
This completes mono bug 496138
(https://bugzilla.novell.com/show_bug.cgi?id=496138)
2014-03-13 18:53:57 +01:00
7737 changed files with 73775 additions and 515560 deletions
1. Make sure that you used GNU tar to unpack this package, as
Solaris tar will not unpack this correctly, and you will get strange errors.
2. Make sure that you use the GNU toolchain to build the software.
3. Optional dependencies
* libgdiplus - Required for System.Drawing. This library in turn requires glib and pkg-config
* pkg-config - Available at: http://www.freedesktop.org/Software/pkgconfig
* glib 2.4 - Available at: http://www.gtk.org/
* libzlib - This library and the development headers are required for compression
file support in the 2.0 profile.
4. Mono is required to build Mono. Use a system package or monolite (explained further below)
5. If you have a system Mono (not monolite), you will need to read this: http://mono-project.com/Parallel_Mono_Environments#Setting_up_a_Build_Environment
b. Building the Software
------------------------
If you obtained this package as an officially released tarball,
this is very simple, use configure and make:
`./configure --prefix=/usr/local ; make ; make install`
Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
S/390x, AMD64, ARM and PowerPC systems.
If you obtained this as a snapshot, you will need an existing
Mono installation. To upgrade your installation, unpack both
mono and mcs:
tar xzf mcs-XXXX.tar.gz
tar xzf mono-XXXX.tar.gz
mv mono-XXX mono
mv mcs-XXX mcs
cd mono
./autogen.sh --prefix=/usr/local
make
The Mono build system is silent for most compilation commands.
To enable a more verbose compile (for example, to pinpoint
problems in your makefiles or your system) pass the V=1 flag to make, like this:
` make V=1`
c. Building the software from GIT
---------------------------------
If you are building the software from GIT, make sure that you
have up-to-date mcs and mono sources:
* If you are an anonymous user: `git clone git://github.com/mono/mono.git`
* If you are a Mono contributor with read/write privileges: `git clone [email protected]:mono/mono.git`
Then, go into the mono directory, and configure:
cd mono
./autogen.sh --prefix=/usr/local
make
For people with non-standard installations of the auto* utils and of
pkg-config (common on misconfigured OSX and windows boxes), you could get
an error like this:
./configure: line 19176: syntax error near unexpected token 'PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
This means that you need to set the ACLOCAL_FLAGS environment variable
* Currently this is used with Mono's AOT engine as
Native Client does not support JIT engines yet.
Using Mono
==========
Once you have installed the software, you can run a few programs:
*`mono program.exe` runtime engine
*`mcs program.cs` C# compiler
*`monodis program.exe` CIL Disassembler
See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
for further details.
Directory Roadmap
=================
*`docs/` - Technical documents about the Mono runtime.
*`data/` - Configuration files installed as part of the Mono runtime.
*`mono/` - The core of the Mono Runtime.
*`metadata/` - The object system and metadata reader.
*`mini/` - The Just in Time Compiler.
*`dis/` - CIL executable Disassembler
*`io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
*`cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
*`arch/` - Architecture specific portions.
*`man/` - Manual pages for the various Mono commands and programs.
*`samples/` -Some simple sample programs on uses of the Mono
runtime as an embedded library.
*`scripts/` - Scripts used to invoke Mono and the corresponding program.
*`runtime/` - A directory that contains the Makefiles that link the
mono/ and mcs/ build systems.
*`../olive/`
* If the directory ../olive is present (as an
independent checkout) from the Mono module, that
directory is automatically configured to share the
same prefix than this module gets.
Contributing to Mono
====================
Before submitting changes to Mono, please review the contribution guidelines at http://mono-project.com/Contributing. Please pay particular attention to the [Important Rules](http://mono-project.com/Contributing#Important_Rules) section.
Git submodules maintenance
==========================
Read documentation at http://mono-project.com/Git_Submodule_Maintenance
Maintainer
==========
Mono is maintained by miguel@xamarin.com
Reporting bugs
==============
To submit bug reports, please use Xamarin's Bugzilla:
https://bugzilla.xamarin.com/
Please use the search facility to ensure the same bug hasn't already
been submitted and follow our guidelines on how to make a good bug
AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check'])
AC_ARG_ENABLE(perf-events, [ --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
if test "x$test_perf_events" == "xyes"; then
AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
AC_SUBST(ENABLE_PERF_EVENTS)
fi
AC_MSG_CHECKING([if big-arrays are to be enabled])
AC_ARG_ENABLE(big-arrays, [ --enable-big-arrays Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no)
@@ -2422,6 +2648,9 @@ AC_ARG_WITH(llvm, [ --with-llvm=<llvm prefix> Enable the LLVM back-end], ena
if test "x$enable_llvm" = "xyes"; then
if test "x$with_llvm" != "x"; then
LLVM_CONFIG=$with_llvm/bin/llvm-config
if test x$target_win32 = xyes; then
LLVM_CONFIG=$LLVM_CONFIG.exe
fi
if test ! -x $LLVM_CONFIG; then
AC_MSG_ERROR([LLVM executable $LLVM_CONFIG not found.])
fi
@@ -2439,6 +2668,8 @@ if test "x$enable_llvm" = "xyes"; then
;;
esac
if test "x$target_win32" = "xno"; then
# The output of --cflags seems to include optimizations flags too
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
# LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
@@ -2459,8 +2690,6 @@ if test "x$enable_llvm" = "xyes"; then
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
AC_DEFINE_UNQUOTED(LLVM_MAJOR_VERSION, $major_version, [Major version of LLVM libraries])
AC_DEFINE_UNQUOTED(LLVM_MINOR_VERSION, $minor_version, [Minor version of LLVM libraries])
AC_DEFINE_UNQUOTED(LLVM_VERSION, "$llvm_version", [Full version of LLVM libraties])
File diff suppressed because it is too large.
Load diff
Loaded 100 of 7737 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.