Compare commits

...
110 Commits
Author SHA1 Message Date
Jo Shields b28db02500 Append .1 to version number 2019-03-14 16:16:58 -04:00
Jo Shields 9c1bfbc543 Include libgdiplus 5.6.1
(cherry picked from commit 5888bf9acc)
2019-03-14 16:15:35 -04:00
Thays Grazia 23b1ea3389 [debugger] Adding a comment to make it clear for the next debuggers. 2019-03-12 09:18:53 +01:00
Thays Grazia e50b4cd55e [debugger] Fixing two crashes while debugging an Android app.
-> Doing stepping into in VSM in some situation the frame saved in TLS is not synchronised with what is really been executed in the main thread. This makes the debugger-agent crashes because it tries to get variable info in some memory that is not available anymore.
	-> To fix it I forced the update of stack when CMD_THREAD_GET_FRAME_INFO is called.

-> Doing step over in Visual Studio for Windows, if you have the threads debugger window enabled, VSW calls frame_commands for each thread that is showed, and if the thread is not really_suspended it tries to get variable info from a memory that is not available anymore because the thread is not suspended yet.
	-> To fix it I don't send variable info of a frame if the thread is not really_suspended and doesn't have an async_state valid.

#Fixes 12843
2019-03-12 09:18:53 +01:00
Aleksey Kliger (λgeek) e7654ee554 Ensure that the module cctor is run before the entry point is executed (#13242) (#13300)
* Ensure that the module cctor is run before the entry point is executed

We need to ensure that any module cctor for the 'main' image
is run *before* we invoke the entry point

This is required in order for tools like Costura
(https://github.com/Fody/Costura) to work properly. These tools inject
a module initializer which sets up event handlers (e.g. AssemblyResolve),
which allows the main method to run properly

For more information about module constructors,
see https://blogs.msdn.microsoft.com/junfeng/2005/11/19/module-initializer-a-k-a-module-constructor/

* Fix module-cctor-entrypoint.il
2019-03-05 11:10:47 -05:00
monojenkins b30f42a734 [interp] compute size of generic valuetype correctly (#13228)
Otherwise we smash the stack.
2019-02-28 16:01:22 -05:00
monojenkins aa36d6c56b [aot] Resolve profile against compiled assembly (#13183)
[2018-12] [aot] Resolve profile against compiled assembly

When trying to use AOT profile in XA for assembly AOT compilation, the
methods from the profile were not compiled.

Context: https://github.com/xamarin/xamarin-android/issues/2504

The problem was, the profile data were not resolved, as there was no
assembly loaded in the domain.

With this fix, the compiled assembly is used to resolve the profile as
well.


Backport of #13148.

/cc @lewurm @radekdoulik
2019-02-25 16:35:43 -05:00
monojenkins a767441359 [2018-12] [aot] abort lookup early when a method isn\u0027t available in AOT image (#13180)
[2018-12] [aot] abort lookup early when a method isn\u0027t available in AOT image

Mixed mode depends on that.  Usually, compile_method of mini takes care
to request only existing methods from the AOT image, but in some cases,
e.g. from a trampoline, AOT runtime is quiered directly.

Contributes to https://github.com/xamarin/xamarin-macios/issues/5618

Backport of #13138.

/cc @lewurm
2019-02-25 14:35:51 -05:00
Bernhard Urban 85eba0bbeb [2018-12] AOT fixes for interp mixed mode (#13171)
[2018-12] AOT fixes for interp mixed mode

Backport of https://github.com/mono/mono/pull/13137 & https://github.com/mono/mono/pull/13139
2019-02-25 07:55:20 -05:00
monojenkins 000f3d992d Bump API snapshot submodule 2019-02-25 13:29:52 +01:00
Martin Baulig 206dea669b Make System.dll internals visible to Mono.Android. 2019-02-25 13:29:52 +01:00
Maxim Lipnin 6ac3f2fa8e use for loop to access item values and avoid InvalidCastException which occurs because VirtualDirectoryMappingCollection enumerator returns key and it's not expected 2019-02-21 15:28:01 +01:00
monojenkins cdc31fc133 [bitcode] round up value type size for slot calculation (#13010)
[2018-12] [bitcode] round up value type size for slot calculation

consider

```csharp
struct S3
{
    public ushort X;
    public ushort Y;
    public ushort Z;
}
```
this would be 3 * 2 = 6 bytes. Structs, however, are passed around as i32
arrays in LLVM IR between functions. Those, if such a struct is passed, are
split to `int32`s depending on the struct's size. The previous calulation was
wrongly reserving one such i32 slot instead of two for `S3` above.

Additionally increase slot size to i64 so that it aligns with a
slightly different ABI on arm64_32.


Fixes https://github.com/mono/mono/issues/8486

@rolfbjarne I've tested it on a arm64_32 device, please confirm that this fixes the issue on your armv7k device as well

Backport of #12992.

/cc @lewurm
2019-02-15 06:55:41 -05:00
monojenkins 305e22710a Fix issue where togglerefs might be incorrectly pinned. (#12934)
Due to current order, process togglerefs and then take current threads
stack could cause a problem where toogleref references might be left
in registers after native code process the list and those reference
would then be put into current thread context, incorrectly pinning the
toggleref, preventing it from being GC:ed. The problem was observed on
Windows (in debug build) running sgen-toggleref.exe runtime test since
the native compile of sgen_process_togglerefs used a register when
walking the list of togglerefs that was then not re-used until the
current threads stack was taken, causing incorrect pinning. This problem
could in theory happen on any platform depending on how sgen_process_togglerefs
would been compiled and what register will be used.

Fix is to take current threads context before walking the togglerefs to make
sure we are not getting managed references into registers as part of managing
the toggleref list in native code.
2019-02-14 10:29:06 -05:00
monojenkins 95b144b64d [2018-12] [sdks] Add mac-{mac32,mac64} targets (#12978)
* [sdks] Add mac-{mac32,mac64} targets

* [sdks] Add configure-* and build-* for CI
2019-02-14 10:28:33 -05:00
monojenkins a2f36516cf [2018-12] [crash] Add more detailed reporting for exceptions (#13001)
* [crash] Add more detailed reporting for exceptions

This bumps the crash reporting file format to version 0.0.3.

* [crash] Fix exception stack walker to consider captured_traces

Previously we were missing these frames from the captured_traces fields
of MonoException and MonoStackTrace.
2019-02-14 10:27:05 -05:00
Alexander Köplinger 6ce1222e7e Mono.Native: Simplify checking for min-version
We don't need to do the replacement sed magic for the compat library,
it should just use whatever is passed in.
2019-02-13 23:24:17 +01:00
Alexander Köplinger 0abce40a05 [corlib] Fix CustomAttributeDataTest.MethodIncludesDllImportAttributeData() on watch/tv
Bitcode requires that the native symbol exists.
Changed the pinvoke to something that exists in libc.
2019-02-13 23:20:30 +01:00
monojenkins b4c300585d [2018-12] [debugger] Reverting part of https://github.com/mono/mono/pull/12114 (#12962)
* [debugger] Reverting part of this commit https://github.com/mono/mono/pull/12114, removing this part the test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter continues working and solve the regressions of 12881. Inserted a new test that reproduces the regression. Fixes #12881

* Changing {

* Changing {

* The interpreted version works different, because of that we can accept this 2 results in this test.
2019-02-12 22:11:23 -05:00
monojenkins f9c349cccb [2018-12] [ios] add crosswatch64_32 target (#12938)
* [ios] add crosswatch64_32 target

* fix gnu triple for wasm
2019-02-12 10:01:59 -05:00
monojenkins d935016dc8 [2018-12] Bump cecil submodule (#12943)
* Bump cecil submodule

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-12 11:59:14 +01:00
Alexander Köplinger 945d9a0547 [ci] Bump bockbuild to get fontconfig download url fix 2019-02-11 16:54:03 +01:00
monojenkins 3c13978565 [2018-12] [interp] Add method to seq_points table after we finish registering it (#12907)
* [interp] Add method to seq_points table after we finish registering it

When adding a breakpoint (mono_de_set_breakpoint) we search in this table for seq_point information for the method. If we find the information we expect that the method is already compiled and has the metadata initialized when actually adding the breakpoint (set_bp_in_method). We were crashing if the jinfo field of the interp method was not yet initialized.

Fixes https://github.com/xamarin/xamarin-macios/issues/5381

* [interp] Move profiler callback when we are actually done

Just in case.
2019-02-11 09:09:06 -05:00
Ludovic Henry a23452cce3 Merge pull request #12928 from monojenkins/backport-pr-12903-to-2018-12
[2018-12] [interp] Fix ldelema
2019-02-11 09:08:30 -05:00
monojenkins cd95c9ef97 [arm/bitcode] mark valuetype returns as such when dealing with pinvokes (#12909)
[2018-12] [arm/bitcode] mark valuetype returns as such when dealing with pinvokes

On armv7 our calling convention happens to be the same as the platform
one. However, when using a armv7 cross compiler to generate bitcode that
targets a different platform (e.g. arm64_32) the calling convention can
be different (e.g. on arm64_32, a return buffer must be passed via r8).
Thus, mark it properly for LLVM so it can generate correct code.



Backport of #12894.

/cc @luhenry @lewurm
2019-02-11 08:45:26 -05:00
Vlad Brezae 22871df38a [interp] Fix ldelema
The ldelema IL instruction provided the element class while the Address intrinsic provided the array class.

Fixes https://github.com/xamarin/xamarin-macios/issues/5363
2019-02-11 09:09:22 +00:00
Alexander Köplinger 820d459d0d [ci] Support building the OSX .pkg on private Jenkins 2019-02-09 20:18:47 +01:00
Ludovic Henry 6ea9123ac3 Merge pull request #12859 from monojenkins/backport-pr-12856-to-2018-12
[2018-12] [Registry] Prevent crash due to background thread facing problems in the file system
2019-02-08 15:44:42 -05:00
monojenkins 27790d42b1 [2018-12] [runtime] Fix mono_pe_file_map logging (#12896)
Since it's being used when the image is created, it actually doesn't need to be signal safe. This restores the previous behavior. 

Backport of #12588.
2019-02-08 19:06:09 +01:00
monojenkins 4f1cd929c4 [aot] interp flag on AOT images only on mscorlib required (#12888)
[2018-12] [aot] interp flag on AOT images only on mscorlib required

/cc @spouliot. This fixes `--interpreter=-all` on Xamarin.iOS.

Backport of #12838.

/cc @lewurm
2019-02-08 12:35:53 -05:00
monojenkins fee0708f99 FIxing crash where a generic enum is passed into get_shared_type. Also added automated test to catch this scenario. (#12847) 2019-02-08 09:28:10 -05:00
monojenkins e0e647bc90 [2018-12] [arm64] encode offset within stack slot for r4 in gsharedvt descriptor (#12884)
Follow up fix for https://github.com/mono/mono/pull/11741

Fixes https://github.com/mono/mono/issues/12831


Backport of #12867.
2019-02-08 12:28:14 +01:00
Alexander Köplinger e9458bd216 [corlib] Disable four tests in TypeTest
TypeTest.MakeGenericType_BadUserType
TypeTest.MakeGenericType_NestedUserDefinedType
TypeTest.MakeGenericType_UserDefinedType
TypeTest.TestMakeGenericType_UserDefinedType_DotNet20SP1

These tests pass when run with the interpreter on xamarin-macios.
They were disabled on master with https://github.com/mono/mono/commit/dc9bc9e0e6462739872117afc59e46fbc780d981
2019-02-08 10:57:28 +01:00
Aleksey Kliger c42c759a61 [sre] Handle null values in MarshalAsAttribute CustomAttributeBuilder
Normally strings are encoded as length-then-utf8 in ECMA-335.  But a null
String is encoded as just the byte 0xFF.

When we make a CustomAttributeBuilder for a MarshalAsAttribute and attach it to
some parameter we first encode the CAB as a byte blob and then decode it in
CAB.get_umarshal into a UnmanagedMarshal attribute.  But the decoding didn't
account for the possibility of null strings.

Fixes https://github.com/mono/mono/issues/12747
2019-02-08 10:57:08 +01:00
monojenkins 22911b0435 [2018-12] [runtime] Use temp folders for merp tests (#12865)
The 2018-10 lane seemed to be failing some tests because the merp-json-valid.exe test left behind the crash log file. I fixed that in this PR, but also move the tests into their separate folders so they can run at the same time safely. 

Backport of #12830.
2019-02-07 23:20:43 +01:00
monojenkins 9ab93cecd3 [2018-12] [ios] pass --enable-monotouch to cross compilers so icall defintions are visible to it (#12835)
This fixes a regression introduced by https://github.com/mono/mono/commit/5187b0bdaaff56936d697b0753dad51e7498991d

The AOT compiler wasn't aware of the icalls since they are guarded by `ENABLE_MONOTOUCH`. Passing `--enable-monotouch` to configure of the AOT compiler enables that define, so it can properly resolve those icalls. However, to avoid `zlib` dependency for the cross compilers, we stub
them out.

Backport of #12834.
2019-02-07 20:26:14 +01:00
Miguel de Icaza ff56d2741a [Registry] Prevent crash due to background thread facing problems in the file system 2019-02-07 17:00:40 +00:00
Alexander Köplinger f79e3fa5e4 [2018-12] [corlib] Remove reflection-based Mono.Native test (#12828)
The managed linker removes the type embedded inside mscorlib and we don't want to whitelist it in linker xml since then it'd be kept for everyone.

Instead move the type to the test assembly and remove the reflection-based tests.
2019-02-06 22:43:54 +01:00
Alexander Köplinger 4f441da82f Extend mono-native minimum version magic to CPPFLAGS/CXXFLAGS
We were only doing the -mmacosx-min-version replacement magic on
CFLAGS and LDFLAGS for mono-native-compat and -unified,
but we need to do the same for CPPFLAGS/CXXFLAGS too.

Fixes an issue where the libraries were targeting the wrong minimum OSX
version when built from xamarin-macios since they pass the minimum version
in CPPFLAGS instead of CFLAGS for OSX.
2019-02-06 12:33:55 +01:00
Alexander Köplinger 72cc4e7187 [spinlock] reduce interations in BCL test
Cherry-picked from f394d7cd8e.
2019-02-06 11:41:57 +01:00
monojenkins 3068b11844 [2018-12] [corlib] Fix GetFrames_AsyncCalls test not to block (#12797)
Backport of #12790.
2019-02-06 11:29:18 +01:00
monojenkins 864ddb2030 [2018-12] [corlib] Do not clone SynchronizationContext in ExecutionContext.Capture (#12778)
* Do not clone SyncronizationContext in EE

* add #if MONO to ref-source file

* use CoreRT's CancellationToken and CancellationTokenSource

* improve test

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-05 13:23:11 +01:00
monojenkins 85498a4b78 [2018-12][runtime] Switch to GC Unsafe in a few more external API functions (#12736)
* [runtime] Switch to GC Unsafe in mono_property_get_value

It's external only, so it should switch from GC Safe to GC Unsafe when called.

Addresses crash in https://github.com/mono/mono/issues/12724

* [runtime] Make mono_image_loaded external only

Also mono_image_loaded_full

Runtime should use mono_image_loaded_internal

* [runtime] Make mono_get_exception_argument_null external only
2019-02-04 16:10:12 +01:00
monojenkins cfbf3eb388 [2018-12] Fix cross compile issue introduced in 5.16 (#12656)
* Fix cross compile issue introduced in 5.16

Fixes #9951

* Update configure.ac

Define HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP in the cross-compilation case also (since we are "assuming yes")
2019-02-04 16:05:53 +01:00
monojenkins 93b9571b3b [arm/ios] workaround for faulty vcmp.f64 insn (#12707)
Fixes https://github.com/mono/mono/issues/11965

Backport of #12704.
2019-02-04 16:05:16 +01:00
Maxim Lipnin 5a15a9ad5b Avoid recursive extracting redundant frames from captured traces. 2019-02-04 13:40:14 +01:00
Lee Culver ae565f2b84 Add back missing stack frames to mono MERP reports
Changeset https://github.com/mono/mono/commit/e1461ebc855977667f71d1804fd96eed2a155aff
introduced a regression where only the topmost frame of managed crashes are reported.

This change adds back the missing stack frames.
2019-02-02 15:17:27 +01:00
monojenkins 399d3b5c7a [2018-12] [Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12723)
* When moving parameters for tailcall, first copy the parameters using ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset. Fixes #11489

* Removing unused variable.
2019-02-01 17:22:42 -02:00
monojenkins b8bf12ef32 [2018-12] [bcl] Fix possible deadlock race in CSharpCodeGenerator (#12728)
`CSharpCodeGenerator` runs a compiler while redirecting its standard error and
standard output streams for further reporting. However, in doing that it fails
to read the standard output data completely and also fails to properly wait for
the standard error output to complete. Depending on environment it may lead to
the process using `CSharpCodeGenerator` hanging while the process has already
exited but there still is data to be read from standard output and standard
error.

This commit changes the code to an implementation of reading standard error and output
that makes sure all the data is read before the process is closed.

The hope is that it may fix some of the timeouts/hangs we see on the
Xamarin.Android build bots as a portion of them hangs in test that use the
code generator.


Backport of #12685.
2019-02-01 19:09:27 +01:00
Bernhard Urban 9172a12bdb Bump corert
Commit list for mono/corert:

* mono/corert@1b7d4a1e4 [Number] make double 0.0 cmp more portable (#30)
* mono/corert@c4ae51646 Update ISOWeek.cs
* mono/corert@7e8bf2382 fix ISOWeek for mcs

Diff: https://github.com/mono/corert/compare/0e5f123f6b1792bf19fe21143a6d668b6ce8f483...1b7d4a1e4bd79305905338827cc41eb8303364f0
2019-02-01 14:19:05 +01:00
monojenkins 3f2f21d1ee [csproj] Update project files 2019-02-01 09:37:43 +01:00
monojenkins c1cd68cfc3 Bump API snapshot submodule 2019-02-01 09:37:43 +01:00
Egor Bogatov a8d2fe02ff Copy refs from CoreFX 2019-02-01 09:37:43 +01:00
Alexander Köplinger 94ac91c060 [bcl] Add Mono.CSharp back to xammac profile
It was removed in https://github.com/mono/mono/commit/96af472795496ad32768d113b1cb42a9d3cdcbcf but xammac does need it still.
2019-01-31 18:19:36 +01:00
Alexander Köplinger fa7a11a92e [System] Skip DefaultValueAttributeTest.Bug_12362() on xammac 4.5 too 2019-01-31 16:57:07 +01:00
Thays Grazia d3313eb682 [Debugger][Backport] Debugger failure when a method is called in watches and any field of the Class has the type of the field different of the value of the field because the assign was done in an unsafe way like this:
Now the datatypes check are not executed only when each field of the class is been checked before the invoke method..
_pinnable = Unsafe.As<Pinnable<T>>(array);
A unit test that reproduces the issue was created either.
Fixes #12374
2019-01-28 23:40:26 +01:00
monojenkins b76f8d8e3e [Android,AOT] Support dumping AOT offsets with Android NDK r17+ (#12454) (#12472)
The latest Android NDK releases no longer ship with per-platform C headers.
Instead they ship with a set of unified headers and require the presence of the
`__ANDROID_API__` macro in order to select the target platform.
The AOT offset dumper doesn't support this new layout and this commit changes
that by adding support for the unified headers (without removing support for the
older NDKs) thus fixing the following error when trying to dump the offsets with
newer NDK:

    Processing triple: aarch64-v8a-linux-android
    Error parsing '[...]/mono/mono/metadata/metadata-cross-helpers.c'
    [...]/mono/mono/metadata/metadata-cross-helpers.c(5,10): fatal: 'stdio.h' file not found
    Error parsing '[...]/mono/mono/mini/mini-cross-helpers.c'
    [...]/mono/mono/mini/mini-cross-helpers.c(7,10): fatal: 'stdio.h' file not found
2019-01-28 16:27:00 -05:00
monojenkins 8aeb850140 [eglib]Fix memory leak in g_find_program_in_path(). #11615. (#12596) 2019-01-24 17:28:24 -05:00
Alexander Kyte e7b29fc36e [2018-12] Native Crash Stability Fix Batch (#12572)
This contains the commits from

#12125
#12126
and
#12518
2019-01-24 11:18:46 +01:00
monojenkins 3f62e2da55 [sgen] Don't trigger concurrent collections if we exceed soft heap limit (#12563)
Concurrent gc (mark / sweep) allows the heap to grow further, which is not what we want if we already exceeded the limit.
2019-01-23 09:56:38 +02:00
Martin Baulig 29a2d7c67e [SslStream]Flatten exceptions in sync SslStream APIs.
The sync APIs `SslStream.AuthenticateAsClient()` and `AuthenticateAsServer()`
should not throw `AggregateException`.

Fixes #9418.
2019-01-22 21:29:42 +01:00
Alexander Kyte 8b07a30c2a Merge pull request #12509 from monojenkins/backport-pr-12053-to-2018-12
[2018-12] [runtime] Add opt-out for AOT file probing with MONO_AOT_MODE_NONE
2019-01-22 12:14:27 -05:00
Martin Baulig a53fee3855 [System]Fix race condition in SystemDependencyProvider.Initialize(). #12538. 2019-01-22 09:49:34 +01:00
monojenkins 9bafe84b75 [System]Correctly dispose inner stream in WebResponseStream. #11928. (#12474) 2019-01-21 23:26:52 +01:00
monojenkins e0a4178a1e [runtime] Don't try (slow) dlopen on android if it doesn't exist (#12515)
[2018-12] [runtime] Don\u0027t try (slow) dlopen on android if it doesn\u0027t exist

On android, the dlopen call will take around 1ms per AOT module we try to load. By not using dlopen with the existence check, we rely on a much slower dlopen check that happens later. I think they support dlopen of non-resolved names. 

This might break a few things if we don't use the full path to dlopen. If it does, we should probably add existence checks at the caller, but this will be an optimization that works everywhere.  

@jonpryor @grendello 

Backport of #12074.

/cc @alexanderkyte
2019-01-21 06:45:48 -05:00
Maxim Lipnin 355089c9b0 [2018-12] Add TypeConverter fallback to DefaultValueAttribute (#12492)
Backport of https://github.com/mono/mono/pull/12412 to 2018-12 branch.

Requires https://github.com/mono/corefx/pull/238

Fixes https://github.com/mono/mono/issues/12362
2019-01-21 11:33:24 +01:00
monojenkins fc440488d3 [ios] enable llvm for watch64_32 runtime (#12499) 2019-01-21 11:12:17 +01:00
Alexander Kyte 797ade46cf [runtime] Fix aot mode double init check 2019-01-18 18:54:04 +00:00
Alexander Kyte 08478fdc93 [runtime] Don't assert when MONO_AOT_MODE_NONE passed to setter 2019-01-18 18:54:04 +00:00
Alexander Kyte 1f1a914e57 [runtime] Don't probe for assemblies when MONO_AOT_MODE_NONE is set 2019-01-18 18:54:04 +00:00
Alexander Kyte 3091648fe7 [runtime] Don't probe aot cache on android 2019-01-17 22:01:27 -05:00
monojenkins 80f9f6e798 [arm64_32] use emulate OPs so it works with bitcode compiled code for armv7k (#12456)
[2018-12] [arm64_32] use emulate OPs so it works with bitcode compiled code for armv7k



Backport of #12443.

/cc @lewurm
2019-01-17 10:35:47 -05:00
Bernhard Urban 10a4623646 [ios] initial watch64_32 support (#11691)
* [ios] initial watch64_32 support

* align iOSSimulatorTemplate with iOSDeviceTemplate
2019-01-17 15:56:30 +01:00
Bernhard Urban 8916e2b505 [sdks] Add a XCODE32_DIR make variable and use it to compile the 32 bit cross compilers. (#12055)
Forward port of #10139

Needed for arm64_32 (#11691): We still need to build AOT compilers that are 32bit, which is only possible with Xcode9. However, arm64_32 needs Xcode10.
2019-01-17 15:56:30 +01:00
Kirill Osenkov 2a73e63c87 Fix https://github.com/mono/mono/issues/12461.
After .NET 4.5 .NET Framework has changed the System.ComponentModel.Composition ReflectionModelServices.IsExportFactoryImportDefinition to not throw.

Updating this to match the .NET Framework behavior.
2019-01-17 12:05:44 +01:00
monojenkins af5c02a22d [Debugger] Fix crash when there is a generic struct with a field that is an enumerator. (#12368) (#12448)
[2018-12] [debugger][backport] Fix crash when there is a generic struct with a field that is an enumerator

Debugger crashes when there is a generic struct with a field that is an enumerator
Example: files.get_Current().Key
A unit test that reproduces this crash was added too.
Fixes #10735

Backport #12368

/cc @thaystg
2019-01-16 13:55:21 -05:00
Zoltan Varga 492231421e [x86] Set the LLVM data layout. 2019-01-16 13:03:32 +01:00
Zoltan Varga f72e1c2713 [arm] Set the LLVM data layout, without it, opt seems to make incorrect optimizations.
Fixes https://github.com/mono/mono/issues/12307.
2019-01-16 13:03:32 +01:00
Bernhard Urban 36de4b20e1 [interp] use interp_lmf wrapper for interp2native on platforms with wonky sigcontext (#12349)
[2018-12] [interp] use interp_lmf wrapper for interp2native on platforms with wonky sigcontext

Backport of https://github.com/mono/mono/pull/12293
2019-01-15 19:45:39 -05:00
monojenkins b1d77a74c2 Bump API snapshot submodule 2019-01-15 22:24:34 +01:00
Maxim Lipnin 59a27c929f Bump corefx 2019-01-15 22:24:34 +01:00
Aleksey Kliger 462bbcbdbc [threads] Use refcounts for coordinating finalization and detaching
Reverts a29ad08d00 (#9914)

The basic problem we want to solve is the following:
  1. All access to InternalThread:state must be protected by the
     InternalThread:synch_cs mutex
  2. We must destroy the mutex when we are done with the thread.
  3. We don't know which happens later - detaching the machine thread or
     finalizing its InternalThread managed object.

The solution is to replace InternalThread:synch_cs by InternalThread:longlived
which is a refcounted struct that holds the synch_cs.  The refcount starts out
at 2 when the thread is attached to the runtime and when we create the managed
InternalThread object that represents it.
Both detaching and finalizing the managed object will decrement the refounct,
and whichever one happens last will be responsible for destroying the mutex.

This addresses https://github.com/mono/mono/issues/11956 which was a race
condition due to the previous attempt to fix this lifetime problem.  The
previous attempt incorrectly used CAS in mono_thread_detach_internal while
continuing to use locking of synch_cs elsewhere. In particular
mono_thread_suspend_all_other_threads could race with
mono_thread_detach_internal: it expects to take the thread lock and test
thread->state and use the thread->suspended event, while detaching deletes
thread->suspended without taking a lock.

As a result we had a concurrency bug: in suspend_all_other_threads it's
possible to see both the old (non-Stopped) value of thread->state and the
new (NULL) value of thread->suspended.  Which leads to crashes.
2019-01-15 11:52:36 -05:00
Alexander Köplinger fb4381bccc [bcl] Embed Source Link information (#12403)
Source Link allows IDEs/debuggers to retrieve a source file from a remote location like GitHub when the local file isn't available.

Specification: https://github.com/dotnet/designs/blob/e55c517a1e7f8dc35b092397058029531209d610/accepted/diagnostics/source-link.md

For now we only embed info about mono, cecil, corefx and corert since that covers 99% of what you usually want to debug and doesn't need fancy logic that reads git submodules and figures out their URLs.

Should enable use cases like https://twitter.com/jlaban/status/1084248087802060801

(cherry picked from commit 311d1952af)
2019-01-15 11:57:40 +01:00
Vlad Brezae 9d550f4e37 [runtime] Fix integer overflow when copying array (#12407)
[2018-12] [runtime] Fix integer overflow when copying array

Fixes https://github.com/mono/mono/issues/12344
2019-01-15 05:05:33 -05:00
monojenkins 515ab83272 [coop] Make sure suspend_count is positive in suspend request states (#12244)
* Fix bug in pulse transition - the suspend count was lost and incorrectly
  swapped to 0.
* finish_async_suspend transition - add assertions that the suspend count is
  positive. Try to catch incorrect states sooner.

Fixes https://github.com/mono/mono/issues/12235
2019-01-11 18:13:12 -02:00
Vlad Brezae 66ef59d2ea [2018-12] Fix interp eh backport (#12371)
* [interp] Fix resuming into interp frame during EH (#12092)

[interp] Fix resuming into interp frame during EH

During EH, we can have the same frame twice on the stack, the original one and when invoking clauses in the same frame from EH. When having a resume state, we need to check if we should catch it in the current frame, or the original.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

* [interp] Fix resuming into interp when finally throws exception (#12328)

We might need to adjust the ip in the same fashion when normally resuming to catch handler.

In the example from the testcase, we have these transitions : ... -> interp_frame -> jit -> eh1 -> interp_frame -> eh2. When eh1 unwinds to call the finally clause from interp_frame it also pops all other lmf entries until there. This means that eh2 thinks it was called directly from the interp_frame (as it would happen with the jit), but in this case there are still the jit frames in the middle. Eh2 doesn't know how to resume over the jit frames, it will just set the resume state to the interp_frame and eh1 will do the resuming over the jitted frames, after run_finally returns gracefully. If the exception were to be handled by frames parent to interp_frame and there are also pushed contexts on the lmf stack, then eh2 could both unwind and resume directly there, skipping eh1 and the jitted frames altogether.
2019-01-11 17:32:11 +01:00
Thays Grazia 93e05d60b4 Backport of #12114 (#12351)
[2018-12][debugger][backport] Fix test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter

Backport of #12114
The problem was in this line:
ss_nested_with_two_args(ss_nested_arg (), ss_nested_arg ());
The first step_into works correctly entering in the ss_nested_arg method, but the second one doesn't work.
The problem was because this flag MONO_SEQ_POINT_FLAG_NONEMPTY_STACK was set, so the debugger don't consider that it was a possible break.
The solution of the issue was create another flag to identify nested calls and ignore the MONO_SEQ_POINT_FLAG_NONEMPTY_STACK.
2 new tests were added to test other nested calls.
2019-01-10 14:25:42 -05:00
Alexander Köplinger 51011bb6f7 [wasm] Fix build when emsdk repo is dirty
We hit the following issue when the upstream repo receives a new commit:

```
16:11:49 error: Your local changes to the following files would be overwritten by merge:
16:11:49     binaryen-tags.txt
16:11:49     emscripten-tags.txt
16:11:49     upstream/lkgr.json
```

To workaround we now clean the emsdk repo before pulling.

(cherry picked from commit 2bb95a4990)
(cherry picked from commit d8c75df45b)
2019-01-09 20:23:47 +01:00
Kenneth Pouncey 3eec6fe288 [wasm][ci] Bump jsvu
(cherry picked from commit cb16759b8a)
2019-01-09 20:22:04 +01:00
monojenkins 836a9ab3a8 [Android] Fix build with NDK r18 (#12295)
[2018-12] [Android] Fix build with NDK r18

Xamarin.Android is looking to switch to using the latest Android NDK, r18.
However, there are a few build issues in Mono and BTLS which need to be
addressed before that happens.

  * BTLS fails to build some ARM assembly sources with NDK r18's clang.
    https://github.com/mono/boringssl/pull/12 fixes this issue

  * BTLS uses obsolete Android cmake toolchain file.
    Add a configure option to set alternative toolchain file.

  * NDK r18 minimu supported API level is 16.
    This commit makes the API level configurable and sets the minimum platform
    to API 16

  * NDK r18 makes changes to declaration of `mmap` which break Mono build.
    Detect NDK version in `mono-compiler.h` and act accordingly (do not
    redeclare `mmap`)

  * NDK r18 doesn't have `cpp` and SDKs build assumes it's present.
    Detect whether `cpp` is present and, if not, use `compiler -E` instead.

  * NDK r18 uses unified headers exclusively and requires __ANDROID_API__ to be
    set in order to present the correct set of native APIs.
    SDKs now define the macro when the `ANDROID_NEW_NDK` Make variable is set to
    anything else than `no`.



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->


Backport of #11016.

/cc @lewurm @grendello
2019-01-08 09:19:51 -05:00
monojenkins d6e3dea218 [2018-12] Move ENABLE_GSS conditional into System; fixes #12263. (#12315)
Backport of #12303.
2019-01-08 14:36:44 +01:00
Alexander Kyte 01729dd2df [2018-12] [merp] Batch of fixes (#12097)
* [crash] Early exit if callbacks not set

* [runtime] Make sure lldb/gdb dump happens when MERP fails

* [crash] Create supervisor thread for crash dumper

* [runtime] Add waitpid to probed-for libc functions

* [crash] Add crash reporter logger

* [crash] Disable mono-merp when disabling crash reporting

* [crash] Switch merp dumper to no-allocate file writer

- Pass merp directory to backend (optional)
- Adds tests that needed the named change

* [crash] Make mono-state use non-allocating format strings

* [crash] Add json formatting validators to mono/tests

* [crash] Make crash-sending icalls use const strings

* [crash] Use fork+exec for merp

* [crash] Throw exception when unable to contact merp

* [crash] Disable merp-json-valid test on non-OSX

* [runtime] Remove duplicate merp invoke line

* [crash] Fix mono-state writer trailing comma

* Revert "Add PathHelpers.cs to EXTRA_DIST to fix tarball build"

This reverts commit 55d683a1f0.

* [crash] Fix comma mismatch in json writer
2019-01-07 14:28:24 -02:00
Alexis Christoforides b574e0739e [tests] Remove an invalid assertion on System.IO.DriveInfo
All fixed drives are not guaranteed to be ready
2019-01-07 08:22:18 -05:00
monojenkins 36b5e090fd [2018-12] Display AM/PM for ko-KR culture (#12281)
Fixes https://github.com/mono/mono/issues/11317
(I guess I need to update culture-info-tables.h via make but it doesn't work on Windows, I have to switch to macOS).

Backport of #11327.

/cc @marek-safar @EgorBo
2019-01-07 10:20:51 +01:00
monojenkins 4201c5b8c8 [2018-12] [Network] Fix CVE 2018-8292 on Mac OS X. (#12155)
* [Network] Fix CVE 2018-8292 on Mac OS X.

This commit ensures that CVE 2018-8292 is fixed by not setting
auto-redirect in the first request done by CFNetwork. CFNetwork has the
same bug, but we can work around it by performing the first request,
checking the response and, if it is a rediret, follow it without the
Authorization headers.

* No need to close the obc, it can be reused.

* Small typo.

* Fix error while chaging the request :/

* Minor style changes.
2019-01-04 10:00:16 -05:00
Alexander Köplinger 33840d4210 Bump bockbuild for VSTS #737323 fix to GtkNSView.
Backport of https://github.com/mono/mono/pull/11972
2018-12-21 16:30:53 +01:00
monojenkins 7440551046 System.Windows.Forms: Fix incorrect layout for table layout nested in flow layout (#12169)
Fixes issue #8922. The flow layout code specifies `int.MaxValue` as width in `GetPreferredSize` call, which the table layout didn't handle properly and tried to use all the available space.

Relevant WinForms open source code that implements the same behavior:
https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms/src/System/Windows/Forms/Layout/FlowLayout.cs#L183-L188

https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.cs#L700-L702
2018-12-21 15:40:35 +01:00
monojenkins f6c07b0e29 [2018-12] Bump msbuild to track xplat-master (#12112)
Backport of #12071.
2018-12-21 15:03:07 +01:00
monojenkins 1d685be15f [2018-12] Bump to latest SQLite for Mac bundle (#12160)
Bump Mac bundle from SQLite 3.9.2 to 3.26.0

Backport of #12118.
2018-12-20 16:11:38 +01:00
monojenkins 1d1d2eb91d Fix IndexOutOfRangeException in MethodInfo.ReturnParameter.IsDefined(type) (#12105)
Fixes #12069.
Backport of #12090.
2018-12-20 13:33:36 +01:00
Ankit Jain c27b0f4843 [MacSDK] Bump NuGet to 4.8.1 2018-12-19 14:03:10 +01:00
Alexander Köplinger 3097b851b1 [acceptance-tests] Add a generated file to .gitignore
(cherry picked from commit ee3afd3103)
2018-12-06 17:20:30 +01:00
Alexander Köplinger 7e27ac7205 [ci] Replace plus with uri-encoded version in build url reported to Helix
(cherry picked from commit e031ff4425)
2018-12-06 14:01:56 +01:00
Calvin Buckley 6e39d1a1da Fix PowerPC regression caused by tracing changes (#11907)
2b029b3df4 broke ppc JIT tracing by
moving it into mini and changing the arguments. Since the mini IR
emitter handles tracing now, rip out the tracing code from the JIT.

(Looks like SPARC will need a similar change, but someone needs to
love SPARC first.)

(cherry picked from commit 4af055c794)
2018-12-05 15:49:51 +01:00
Mikhail Pilin dc619d85d2 Fix race condition in XmlCharType.Instance (#11814)
(cherry picked from commit 2be08fc551)
2018-12-05 02:16:47 +01:00
Neale Ferguson fdbd1fe54e Fix order of parameter processing. Note the offsets appear different to the size of the variables being passed but s390x will align parameters on 64-bit boundaries which is why the gbooleans appear to be treated as gulongs. (#11912)
Fix order of parameter processing. 

New parameter addition was put in wrong spot in the parameter list. Also the offsets on the stack were incorrect as 32-bit values are placed in 64-bit aligned slots on s390x. Therefore, even though these are gbooleans the appear to be treated as gulongs.



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->


(cherry picked from commit 18fdc10cc1)
2018-12-05 02:15:11 +01:00
Alexander Köplinger 55d683a1f0 Add PathHelpers.cs to EXTRA_DIST to fix tarball build
(cherry picked from commit feb342ae4f)
2018-12-04 22:28:57 +01:00
Kenneth Pouncey 79b6297dcb [ci] Re-Enable V8 tests on wasm (#11929)
-  Found latest V8 version: v7.3.16.  Works

Resolves: https://github.com/mono/mono/issues/11908
(cherry picked from commit 8c32d109a0)
2018-12-04 16:18:25 +01:00
Jo Shields 1de400df6c Merge pull request #11910 from directhex/2018-12
<!-- Thank you for your Pull Request!
2018-12-03 15:02:59 -05:00
Jo Shields 4114d0e625 Bump version to 5.22 2018-12-03 13:51:45 -05:00
195 changed files with 10275 additions and 3742 deletions

No files matched your search

+1
View File
@@ -4,3 +4,4 @@ Makefile
*.dll
*.mdb
coreclr-testlist.txt
microbench-perf.sh
+1 -1
View File
@@ -120,7 +120,7 @@ for PARAM; do
done
if test x$has_ext_mod = xtrue; then
pushd ../mono-extensions/scripts
pushd $top_srcdir../mono-extensions/scripts
sh ./prepare-repo.sh $ext_mod_args || exit 1
popd
else
+4 -2
View File
@@ -3366,8 +3366,10 @@ Global
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|wasm.ActiveCfg = Release|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|winaot.ActiveCfg = Debug|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|winaot.ActiveCfg = Release|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|xammac.ActiveCfg = Debug|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|xammac.ActiveCfg = Release|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|xammac.ActiveCfg = Debug|xammac
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|xammac.Build.0 = Debug|xammac
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|xammac.ActiveCfg = Release|xammac
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|xammac.Build.0 = Release|xammac
{767CAD15-F8B5-4EAC-8B3D-4EF75F768015}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{767CAD15-F8B5-4EAC-8B3D-4EF75F768015}.Debug|net_4_x.Build.0 = Debug|net_4_x
{767CAD15-F8B5-4EAC-8B3D-4EF75F768015}.Release|net_4_x.ActiveCfg = Release|net_4_x
+132 -66
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [5.21.0],
AC_INIT(mono, [5.22.1],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
@@ -48,7 +48,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# There is no ordering of corlib versions, no old or new,
# the runtime expects an exact match.
#
MONO_CORLIB_VERSION=7A6EDC32-7F43-403B-8F6F-53AB0AD74819
MONO_CORLIB_VERSION=72AAF33F-CAFE-477B-9F74-C7ADBB6E28F2
#
# Put a quoted #define in config.h.
@@ -543,6 +543,8 @@ AC_PROG_LD_GNU
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h copyfile.h)
AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h)
AC_CHECK_HEADER(unistd.h, [HAVE_UNISTD_H=1], [HAVE_UNISTD_H=0])
AC_SUBST(HAVE_UNISTD_H)
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
[], [], [#include <stddef.h>
#include <sys/socket.h>
@@ -599,6 +601,7 @@ AC_CHECK_HEADERS(linux/magic.h)
if test x$platform_android = xyes; then
AC_CHECK_HEADERS(machine/endian.h sys/endian.h)
AC_CHECK_HEADERS(android/legacy_signal_inlines.h, [have_android_signal_inlines=yes], [have_android_signal_inlines=no])
AC_CHECK_HEADERS(android/ndk-version.h)
# Make sure SIGRT{MIN,MAX} work - they will fail to work with unified headers if building for
# API level < 21 *and* android/legacy_signal_inlines.h doesn't declare (and define) the required
@@ -608,7 +611,8 @@ if test x$platform_android = xyes; then
if test x$have_android_signal_inlines = xyes; then
AC_MSG_CHECKING([Whether Android SIGRTMIN/SGRTMAX macros are valid])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([#include <android/legacy_signal_inlines.h>],[
AC_LANG_PROGRAM([#include <signal.h>
#include <android/legacy_signal_inlines.h>],[
int i;
for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
}
@@ -2907,6 +2911,7 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(setpgid)
AC_CHECK_FUNCS(system)
AC_CHECK_FUNCS(fork execv execve)
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(accept4)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(mkdtemp)
@@ -3280,6 +3285,9 @@ if test x$host_win32 = xno; then
AC_MSG_CHECKING(for shm_open that works well enough with mmap)
if test "x$ac_cv_func_shm_open" = "xno" -o "x$ac_cv_func_shm_open_working_with_mmap" = "xno" ; then
AC_MSG_RESULT(no)
elif test "x$cross_compiling" = "xyes"; then
AC_MSG_RESULT(cross compiling, assuming yes)
AC_DEFINE(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP, 1, [shm_open that works well enough with mmap])
else
AC_TRY_RUN([
#include <sys/mman.h>
@@ -4107,6 +4115,14 @@ case "$host" in
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
;;
aarch64-*darwin*ilp32)
TARGET=ARM6432
arch_target=arm64
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
# assuming no other target other than watchOS is using aarch64*darwin triple
TARGET_SYS=WATCHOS
;;
aarch64-*)
# https://lkml.org/lkml/2012/7/15/133
TARGET=ARM64
@@ -4216,8 +4232,10 @@ if test "x$host" != "x$target"; then
CPPFLAGS="$CPPFLAGS"
target_win32=no
;;
aarch64*-linux-*)
TARGET=ARM64;
aarch64*darwin*_ilp32)
TARGET=ARM6432;
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
AC_DEFINE(TARGET_WATCHOS, 1, [...])
;;
aarch64-*)
TARGET=ARM64
@@ -4270,7 +4288,7 @@ ARM)
arch_target=arm
ACCESS_UNALIGNED="no"
;;
ARM64)
ARM64|ARM6432)
AC_DEFINE(TARGET_ARM64, 1, [...])
arch_target=arm64
;;
@@ -4413,7 +4431,7 @@ fi
dnl Use GCC atomic ops if they work on the target.
if test x$GCC = "xyes"; then
case $TARGET in
X86 | AMD64 | ARM | ARM64 | POWERPC | POWERPC64 | MIPS | S390X | SPARC | SPARC64 | RISCV32 | RISCV64)
X86 | AMD64 | ARM | ARM64 | ARM6432 | POWERPC | POWERPC64 | MIPS | S390X | SPARC | SPARC64 | RISCV32 | RISCV64)
AC_DEFINE(USE_GCC_ATOMIC_OPS, 1, [...])
;;
esac
@@ -4426,7 +4444,7 @@ if test "x$target_mach" = "xyes"; then
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
BTLS_SUPPORTED=no
elif test "x$TARGET" = "xARM" -o "x$TARGET" = "xARM64"; then
elif test "x$TARGET" = "xARM" -o "x$TARGET" = "xARM64" -o "x$TARGET" = "xARM6432"; then
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
@@ -4640,6 +4658,7 @@ AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(fork execv execve)
AC_CHECK_FUNCS(waitpid)
AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
@@ -4663,8 +4682,6 @@ elif test x$target_ios = xno; then
AC_CHECK_FUNCS(strndup getpwuid_r)
fi
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
AC_SEARCH_LIBS(sqrtf, m)
# nanosleep may not be part of libc, also search it in other libraries
@@ -5247,7 +5264,7 @@ dnl **********************
dnl *** checked builds ***
dnl **********************
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types],[
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types, crash_reporting],[
if test x$enable_checked_build != x ; then
AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
@@ -5261,6 +5278,7 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
eval "mono_checked_build_test_enable_metadata='yes'"
eval "mono_checked_build_test_enable_thread='yes'"
eval "mono_checked_build_test_enable_private_types='yes'"
eval "mono_checked_build_test_enable_crash_reporting='yes'"
fi
if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
@@ -5278,10 +5296,20 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
if test "x$mono_checked_build_test_enable_private_types" = "xyes"; then
AC_DEFINE(ENABLE_CHECKED_BUILD_PRIVATE_TYPES, 1, [Enable private types checked build])
fi
if test "x$mono_checked_build_test_enable_crash_reporting" = "xyes"; then
# Required
with_overridable_allocators=yes
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
AC_DEFINE(ENABLE_CHECKED_BUILD_CRASH_REPORTING, 1, [Enable private types checked build])
fi
], [])
dnl End of checked builds
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
AC_CHECK_HEADER([malloc.h],
[AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
[Define to 1 if you have /usr/include/malloc.h.])],,)
@@ -5314,6 +5342,26 @@ dnl **************
AC_ARG_ENABLE(btls, [ --disable-btls Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
AC_ARG_ENABLE(btls-lib, [ --disable-btls-lib Disable building the BTLS native library], enable_btls_lib=$enableval, enable_btls_lib=$BTLS_SUPPORTED)
AC_ARG_WITH(btls_android_ndk, [ --with-btls-android-ndk Android NDK for BoringTls])
AC_ARG_WITH(btls_android_api, [ --with-btls-android-api Android NDK API level for BTLS build])
AC_ARG_WITH(btls_android_cmake_toolchain, [ --with-btls-android-cmake-toolchain Path to the cmake toolchain file for Android])
AC_ARG_WITH(btls_android_ndk_asm_workaround, [ --with-btls-android-ndk-asm-workaround Work around a problem with NDK r18+ clang compiler when compiling some AES assembly for ARM])
if test "x$with_btls_android_api" = "x" ; then
case "$BTLS_PLATFORM" in
android-armv5)
with_btls_android_api=16" ;;
android-armv6)
with_btls_android_api=16" ;;
android-armv7)
with_btls_android_api=16 ;;
android-v8a)
with_btls_android_api=21 ;;
android-x86)
with_btls_android_api=16 ;;
android-x64)
with_btls_android_api=21 ;;
esac
fi
if test "x$enable_btls" = "xno"; then
enable_btls_lib=no
@@ -5390,22 +5438,22 @@ if test "x$enable_btls" = "xyes"; then
esac
;;
android-armv5)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-armv6)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-armv7)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-v8a)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=21"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-x86)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-x64)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=21"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
riscv32)
btls_arch=riscv32
@@ -5418,8 +5466,16 @@ if test "x$enable_btls" = "xyes"; then
esac
if test "x$platform_android" = "xyes"; then
if test "x$with_btls_android_cmake_toolchain" = "x"; then
with_btls_android_cmake_toolchain="$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
fi
if test "x$with_btls_android_ndk_asm_workaround" != "x"; then
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DENABLE_NDK_ARM_WORKAROUND=ON"
fi
btls_android=yes
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$with_btls_android_cmake_toolchain"
if test "x$with_btls_android_ndk" != "x"; then
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
else
@@ -5467,7 +5523,7 @@ AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
AM_CONDITIONAL(POWERPC64, test x$TARGET = xPOWERPC64)
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
AM_CONDITIONAL(ARM64, test x$TARGET = xARM64)
AM_CONDITIONAL(ARM64, test x$TARGET = xARM64 -o x$TARGET = xARM6432)
AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
AM_CONDITIONAL([RISCV], [test x$TARGET = xRISCV32 -o x$TARGET = xRISCV64])
AM_CONDITIONAL([RISCV32], [test x$TARGET = xRISCV32])
@@ -5756,54 +5812,59 @@ fi
# crypto primitives that we're using as part of System.Security.Cryptography.Apple.
#
# On Desktop, we can check at runtime whether the OS version is recent enough and switch
# implementation accordingly. We build a single `libmono_native` shared library.
# implementation accordingly. We build a single `libmono-native` shared library.
#
# However, on Mobile we cannot have any undefined symbols as this would break Bitcode.
#
# During the mobile build, we are called with `CC` containing an explicit minium version flag,
# During the mobile build, we are called with `CFLAGS` containing an explicit minium version flag,
# which is eiter `-mmacosx-version-min=`, `-mios-simulator-version-min=` or `-miphoneos-version-min=`
# depending on platform.
#
# We build two versions of the shared library:
# - `libmono_native_compat` is built with whichever minimum version is passed to us via `CC`.
# - `libmono_native_unifed` is built with the minimum version set to macOS 10.12+ / iOS 10+.
# - `libmono-native-compat` is built with whichever minimum version is passed to us via `CFLAGS`.
# - `libmono-native-unifed` is built with the minimum version set to macOS 10.12+ / iOS 10+.
#
# For testing purpuses, there is a function called `mono_native_get_platform_type ()`
# (see mono/native/mono-native-platform.c), which returns a `MonoNativePlatformType` enum value.
# There is also `Mono.MonoNativePlatform.GetPlatformType ()` (see mcs/class/System/Mono/MonoNativePlatform.cs).
# There is also `Mono.MonoNativePlatform.GetPlatformType ()` (see mcs/class/corlib/Test/Mono/MonoNativePlatform.cs).
#
# This can be called by automated tests both to ensure that the library has been correctly installed and also
# to verify that it's the correct version of it.
#
AC_MSG_CHECKING([Mono.Native support])
sed_version_pattern='[[0-9]]\{1,2\}\(\.[[0-9]]\{1,2\}\)'
if test x$target_osx = xyes; then
sed_remove_mac_version_pattern="s/-mmacosx-version-min=$sed_version_pattern//g"
grep_find_mac_version_pattern="-mmacosx-version-min=$sed_version_pattern"
mono_native_compat_version=`echo $CC | grep -o -e $grep_find_mac_version_pattern`
MONO_NATIVE_CC=`echo $CC | sed -e $sed_remove_mac_version_pattern`
MONO_NATIVE_CXX=`echo $CXX | sed -e $sed_remove_mac_version_pattern`
MONO_NATIVE_CPPFLAGS=`echo $CPPFLAGS | sed -e $sed_remove_mac_version_pattern`
MONO_NATIVE_CFLAGS=`echo $CFLAGS | sed -e $sed_remove_mac_version_pattern`
MONO_NATIVE_CXXFLAGS=`echo $CXXFLAGS | sed -e $sed_remove_mac_version_pattern`
MONO_NATIVE_LDFLAGS=`echo $LDFLAGS | sed -e $sed_remove_mac_version_pattern`
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS=$LDFLAGS
mono_native=yes
MONO_NATIVE_PLATFORM=macos
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_MACOS"
AC_MSG_CHECKING([Mono.Native support])
AC_MSG_RESULT(macos)
AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer],
[!(MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)])
if test x$mono_native_compat = xyes; then
mono_native_compat=yes
mono_native_text="Mac OSX (compat+unified)"
MONO_NATIVE_COMPAT_CFLAGS="$CFLAGS $mono_native_compat_version"
MONO_NATIVE_COMPAT_LDFLAGS="$LDFLAGS $mono_native_compat_version"
MONO_NATIVE_UNIFIED_CFLAGS="$MONO_NATIVE_CFLAGS -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_LDFLAGS="$MONO_NATIVE_LDFLAGS -mmacosx-version-min=10.12"
mono_native_text="Mac OSX (compat + unified v10.12)"
MONO_NATIVE_COMPAT_CCASFLAGS=$MONO_NATIVE_CCASFLAGS
MONO_NATIVE_COMPAT_CPPFLAGS=$MONO_NATIVE_CPPFLAGS
MONO_NATIVE_COMPAT_CXXFLAGS=$MONO_NATIVE_CXXFLAGS
MONO_NATIVE_COMPAT_CFLAGS=$MONO_NATIVE_CFLAGS
MONO_NATIVE_COMPAT_LDFLAGS=$MONO_NATIVE_LDFLAGS
sed_remove_mac_version_pattern="s/-mmacosx-version-min=$sed_version_pattern//g"
MONO_NATIVE_UNIFIED_CCASFLAGS="`echo $CCASFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_CPPFLAGS="`echo $CPPFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_CXXFLAGS="`echo $CXXFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_CFLAGS="`echo $CFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_LDFLAGS="`echo $LDFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
else
mono_native_compat=no
mono_native_text="Mac OSX"
@@ -5855,16 +5916,8 @@ elif test x$mono_native_platform_ios = xyes; then
])
])
AC_MSG_CHECKING([Mono.Native support])
AC_MSG_RESULT([$mono_native_ios_target])
AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer], [!($mono_native_compat_check)])
sed_remove_ios_version_pattern="s/-m\(.*\)-version-min=$sed_version_pattern//g"
grep_find_ios_version_pattern="-m$mono_native_ios_target-version-min=$sed_version_pattern"
mono_native_compat_version=`echo $CC | grep -o -e $grep_find_ios_version_pattern`
if test x$with_bitcode = xyes; then
mono_native_ldflags="-framework CoreFoundation -framework Foundation -no-undefined -fatal_warnings"
MONO_NATIVE_LIBADD="../mini/$LIBMONO_LA"
@@ -5876,19 +5929,28 @@ elif test x$mono_native_platform_ios = xyes; then
mono_native_ldflags="$mono_native_ldflags -framework GSS"
fi
MONO_NATIVE_CC=`echo $CC | sed -e $sed_remove_ios_version_pattern`
MONO_NATIVE_CXX=`echo $CXX | sed -e $sed_remove_ios_version_pattern`
MONO_NATIVE_CPPFLAGS=`echo $CPPFLAGS | sed -e $sed_remove_ios_version_pattern`
MONO_NATIVE_CXXFLAGS=`echo $CXXFLAGS | sed -e $sed_remove_ios_version_pattern`
MONO_NATIVE_CFLAGS=`echo $CFLAGS | sed -e $sed_remove_ios_version_pattern`
MONO_NATIVE_LDFLAGS=`echo $LDFLAGS $mono_native_ldflags | sed -e $sed_remove_ios_version_pattern`
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS="$LDFLAGS $mono_native_ldflags"
if test x$mono_native_compat = xyes; then
mono_native_text="$mono_native_text (compat+unified)"
MONO_NATIVE_COMPAT_CFLAGS="$CFLAGS $mono_native_compat_version"
MONO_NATIVE_COMPAT_LDFLAGS="$LDFLAGS $mono_native_compat_version"
MONO_NATIVE_UNIFIED_CFLAGS="$MONO_NATIVE_CFLAGS -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_LDFLAGS="$MONO_NATIVE_LDFLAGS -m$mono_native_ios_target-version-min=$mono_native_unified_version"
mono_native_text="$mono_native_text (compat + unified v$mono_native_unified_version)"
MONO_NATIVE_COMPAT_CCASFLAGS=$MONO_NATIVE_CCASFLAGS
MONO_NATIVE_COMPAT_CPPFLAGS=$MONO_NATIVE_CPPFLAGS
MONO_NATIVE_COMPAT_CXXFLAGS=$MONO_NATIVE_CXXFLAGS
MONO_NATIVE_COMPAT_CFLAGS=$MONO_NATIVE_CFLAGS
MONO_NATIVE_COMPAT_LDFLAGS=$MONO_NATIVE_LDFLAGS
sed_remove_ios_version_pattern="s/-m\(.*\)-version-min=$sed_version_pattern//g"
MONO_NATIVE_UNIFIED_CCASFLAGS="`echo $CCASFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_CPPFLAGS="`echo $CPPFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_CXXFLAGS="`echo $CXXFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_CFLAGS="`echo $CFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_LDFLAGS="`echo $LDFLAGS $mono_native_ldflags | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
fi
mono_native=yes
@@ -5897,6 +5959,7 @@ elif test x$host_linux = xyes; then
mono_native_text="Linux"
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
@@ -5905,14 +5968,13 @@ elif test x$host_linux = xyes; then
mono_native=yes
mono_native_compat=no
MONO_NATIVE_PLATFORM=linux
AC_MSG_CHECKING([Mono.Native support])
AC_MSG_RESULT(linux)
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_LINUX"
elif case $host_os in aix*|os400*) true;; *) false;; esac; then
mono_native_text="AIX"
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
@@ -5921,17 +5983,14 @@ elif case $host_os in aix*|os400*) true;; *) false;; esac; then
mono_native=yes
mono_native_compat=no
MONO_NATIVE_PLATFORM=aix
AC_MSG_CHECKING([Mono.Native support])
AC_MSG_RESULT(aix)
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_AIX"
else
mono_native=no
mono_native_text="no"
AC_MSG_CHECKING([Mono.Native support])
AC_MSG_RESULT(no)
fi
AC_MSG_RESULT($mono_native_text)
if test x$mono_native_compat = xyes; then
MONO_NATIVE_LIBRARY_NAME=libmono-native-compat
else
@@ -5941,8 +6000,15 @@ fi
AC_SUBST(MONO_NATIVE_PLATFORM)
AC_SUBST(MONO_NATIVE_CC)
AC_SUBST(MONO_NATIVE_CXX)
AC_SUBST(MONO_NATIVE_CCASFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CCASFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CCASFLAGS)
AC_SUBST(MONO_NATIVE_CPPFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CPPFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CPPFLAGS)
AC_SUBST(MONO_NATIVE_CXXFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CXXFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CXXFLAGS)
AC_SUBST(MONO_NATIVE_CFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CFLAGS)
+1 -1
+1 -1
+1 -1
+1 -1
+5 -1
View File
@@ -2,7 +2,7 @@ thisdir = build
SUBDIRS =
include ../build/rules.make
BUILT_FILES = common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs
BUILT_FILES = common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs common/sourcelink.json
all-local install-local test-local run-test-local csproj-local run-test-ondotnet-local uninstall-local doc-update-local: $(BUILT_FILES)
@:
@@ -18,6 +18,9 @@ common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs: common/Cons
test -n '$(MONO_CORLIB_VERSION)'
sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
common/sourcelink.json: common/sourcelink.json.in $(wildcard config.make) | $(topdir)/class/lib/$(PROFILE_DIRECTORY)
sed -e 's,@mono_topdir@,$(shell cd $(topdir)/.. && pwd),' -e 's,@mono_commit_hash@,$(shell cd $(topdir)/.. && git rev-parse HEAD),' -e 's,@corefx_commit_hash@,$(shell cd $(topdir)/../external/corefx && git rev-parse HEAD),' -e 's,@corert_commit_hash@,$(shell cd $(topdir)/../external/corert && git rev-parse HEAD),' -e 's,@cecil_commit_hash@,$(shell cd $(topdir)/../external/cecil && git rev-parse HEAD),' $< > $@
PLATFORMS = macos linux win32 unix
PROFILES = \
build \
@@ -28,6 +31,7 @@ PROFILES = \
COMMON_SRCS = \
Consts.cs.in \
sourcelink.json.in \
Locale.cs \
MonoTODOAttribute.cs \
basic-profile-check.cs \
+1
View File
@@ -1 +1,2 @@
/Consts.cs
/sourcelink.json
+8
View File
@@ -0,0 +1,8 @@
{
"documents": {
"@mono_topdir@/external/corefx/*": "https://raw.githubusercontent.com/mono/corefx/@corefx_commit_hash@/*",
"@mono_topdir@/external/corert/*": "https://raw.githubusercontent.com/mono/corert/@corert_commit_hash@/*",
"@mono_topdir@/external/cecil/*": "https://raw.githubusercontent.com/mono/cecil/@cecil_commit_hash@/*",
"@mono_topdir@/*": "https://raw.githubusercontent.com/mono/mono/@mono_commit_hash@/*"
}
}
+5
View File
@@ -72,6 +72,11 @@ endif
endif
endif
# add sourcelink information if we're building a portable PDB
ifneq (, $(findstring debug:portable, $(PROFILE_MCS_FLAGS)))
LIB_MCS_FLAGS += -sourcelink:$(topdir)/build/common/sourcelink.json
endif
the_libdir = $(the_libdir_base)$(intermediate)
ifdef LIBRARY_USE_INTERMEDIATE_FILE
@@ -98,6 +98,7 @@
<!--End of common files-->
<!-- @ALL_SOURCES@ -->
<ItemGroup>
<ProjectReference Include="../../System/System.csproj" />
<ProjectReference Include="../../corlib/corlib.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
@@ -12,7 +12,7 @@ LIBRARY = System.Drawing.Common.dll
KEYFILE = ../../Open.snk
LIBRARY_SNK = $(KEYFILE)
SIGN_FLAGS = /delaysign /nowarn:1616,1699
LIB_REFS =
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
ifdef false # we'll enable this at a later point
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -104,7 +104,8 @@ testing_aot_hybrid_dirs_parallel := $(testing_aot_full_dirs_parallel)
xammac_dirs_parallel := \
$(mobile_common_dirs_parallel) \
Mono.CompilerServices.SymbolWriter
Mono.CompilerServices.SymbolWriter \
Mono.CSharp
monodroid_dirs_parallel := \
$(mobile_common_dirs_parallel) \
+8
View File
@@ -80,6 +80,11 @@
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-testing_aot_full</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;IOS_REFLECTION;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../class/lib/xammac</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<OutputPath>./../../class/lib/xammac_net_4_5</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac_net_4_5</IntermediateOutputPath>
@@ -131,6 +136,9 @@
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
<Compile Include="testing_aot_full-parser.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'xammac' ">
<Compile Include="xammac-parser.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<Compile Include="xammac_net_4_5-parser.cs" />
</ItemGroup>
+1
View File
@@ -185,6 +185,7 @@
<Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\CryptoService.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Disposable.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Empty.cs" />
<Compile Include="..\..\..\external\cecil\Mono\MergeSort.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Type.cs" />
<Compile Include="..\..\..\external\cecil\ProjectInfo.cs" />
<Compile Include="Consts.cs" />
+1 -1
View File
@@ -34,7 +34,7 @@ $(test_output_dir)/dtest-excfilter.exe: Test/dtest-excfilter.il | $(test_output_
$(ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
$(test_output_dir)/dtest-app.exe: Test/dtest-app.cs $(TEST_HELPERS_SOURCES) | $(test_output_dir)
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -sourcelink:Test/sourcelink.json -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Runtime.CompilerServices.Unsafe.dll -sourcelink:Test/sourcelink.json -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
TEST_HELPERS_SOURCES = \
../test-helpers/NetworkHelpers.cs \
@@ -85,6 +85,31 @@ public class Tests2 {
}
}
public struct TestEnumeratorInsideGenericStruct<TKey, TValue>
{
private KeyValuePair<TKey, TValue> _bucket;
private Position _currentPosition;
internal TestEnumeratorInsideGenericStruct(KeyValuePair<TKey, TValue> bucket)
{
_bucket = bucket;
_currentPosition = Position.BeforeFirst;
}
public KeyValuePair<TKey, TValue> Current
{
get
{
if (_currentPosition == Position.BeforeFirst)
return _bucket;
return _bucket;
}
}
private enum Position
{
BeforeFirst
}
}
public struct AStruct : ITest2 {
public int i;
public string s;
@@ -166,6 +191,19 @@ public class GClass<T> {
}
}
public struct MySpan<T> {
internal class Pinnable<J> {
public J Data;
}
Pinnable<T> _pinnable;
public MySpan(T[] array) {
_pinnable = Unsafe.As<Pinnable<T>>(array);
}
public override string ToString() {
return "abc";
}
}
public struct GStruct<T> {
public T i;
@@ -389,9 +427,27 @@ public class Tests : TestsBase, ITest2
new Tests ().invoke_abort ();
new Tests ().evaluate_method ();
Bug59649 ();
field_with_unsafe_cast_value();
inspect_enumerator_in_generic_struct();
if_property_stepping();
return 3;
}
private class TestClass {
private string oneLineProperty = "";
public string OneLineProperty {
get { return oneLineProperty; }
set { oneLineProperty = value; }
}
}
public static void if_property_stepping() {
var test = new TestClass();
if (test.OneLineProperty == "someInvalidValue6049e709-7271-41a1-bc0a-f1f1b80d4125")
return;
Console.Write("");
}
public static void local_reflect () {
//Breakpoint line below, and reflect someField via ObjectMirror;
LocalReflectClass.RunMe ();
@@ -470,6 +526,8 @@ public class Tests : TestsBase, ITest2
ss_fp_clobber ();
ss_no_frames ();
ss_await ();
ss_nested_with_three_args_wrapper();
ss_nested_twice_with_two_args_wrapper();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
@@ -569,6 +627,15 @@ public class Tests : TestsBase, ITest2
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void field_with_unsafe_cast_value() {
var arr = new char[3];
arr[0] = 'a';
arr[1] = 'b';
arr[2] = 'c';
MySpan<char> bytes = new MySpan<char>(arr);
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested () {
ss_nested_1 (ss_nested_2 ());
@@ -581,16 +648,53 @@ public class Tests : TestsBase, ITest2
ss_nested_with_two_args(ss_nested_arg (), ss_nested_arg ());
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_with_three_args_wrapper () {
ss_nested_with_three_args(ss_nested_arg1 (), ss_nested_arg2 (), ss_nested_arg3 ());
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_twice_with_two_args_wrapper () {
ss_nested_with_two_args(ss_nested_arg1 (), ss_nested_with_two_args(ss_nested_arg2 (), ss_nested_arg3 ()));
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void inspect_enumerator_in_generic_struct() {
TestEnumeratorInsideGenericStruct<String, String> generic_struct = new TestEnumeratorInsideGenericStruct<String, String>(new KeyValuePair<string, string>("0", "f1"));
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_with_two_args (int a1, int a2) {
return a1 + a2;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_with_three_args (int a1, int a2, int a3) {
return a1 + a2 + a3;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg1 () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg2 () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg3 () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_1 (int i) {
}
+135 -1
View File
@@ -4481,7 +4481,83 @@ public class DebuggerTests
}
[Test]
[Category("NotWorking")]
public void StepOverOnExitFromArgsAfterStepInMethodParameter2() {
Event e = run_until ("ss_nested_with_three_args_wrapper");
var req = create_step(e);
req.Enable();
e = step_once();
assert_location(e, "ss_nested_with_three_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_with_three_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_with_three_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg3");
}
[Test]
public void StepOverOnExitFromArgsAfterStepInMethodParameter3() {
Event e = run_until ("ss_nested_twice_with_two_args_wrapper");
var req = create_step(e);
req.Enable();
e = step_once();
assert_location(e, "ss_nested_twice_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_twice_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_twice_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg3");
}
[Test]
public void ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter() {
Event e = run_until ("ss_nested_with_two_args_wrapper");
@@ -4507,6 +4583,25 @@ public class DebuggerTests
assert_location(e, "ss_nested_arg");
}
[Test]
public void InspectEnumeratorInGenericStruct() {
//files.myBucket.GetEnumerator().get_Current().Key watching this generates an exception in Debugger
Event e = run_until("inspect_enumerator_in_generic_struct");
var req = create_step(e);
req.Enable();
e = step_once();
e = step_over();
StackFrame frame = e.Thread.GetFrames () [0];
var ginst = frame.Method.GetLocal ("generic_struct");
Value variable = frame.GetValue (ginst);
StructMirror thisObj = (StructMirror)variable;
TypeMirror thisType = thisObj.Type;
variable = thisObj.InvokeMethod(e.Thread, thisType.GetMethod("get_Current"), null);
thisObj = (StructMirror)variable;
thisType = thisObj.Type;
AssertValue ("f1", thisObj["value"]);
}
[Test]
// Uses a fixed port
[Category("NotWorking")]
@@ -4676,5 +4771,44 @@ public class DebuggerTests
AssertValue (1, mirror["i"]);
AssertValue (2.0, mirror["d"]);
}
[Test]
public void FieldWithUnsafeCastValue() {
Event e = run_until("field_with_unsafe_cast_value");
var req = create_step(e);
req.Enable();
e = step_once();
e = step_over();
e = step_over();
e = step_over();
e = step_over();
e = step_over();
var frame = e.Thread.GetFrames () [0];
var ginst = frame.Method.GetLocal ("bytes");
Value variable = frame.GetValue (ginst);
StructMirror thisObj = (StructMirror)variable;
TypeMirror thisType = thisObj.Type;
variable = thisObj.InvokeMethod(e.Thread, thisType.GetMethod("ToString"), null);
AssertValue ("abc", variable);
}
[Test]
public void IfPropertyStepping () {
Event e = run_until ("if_property_stepping");
var req = create_step (e);
req.Enable ();
e = step_once ();
e = step_over ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
Assert.IsTrue ((e as StepEvent).Method.Name == "op_Equality" || (e as StepEvent).Method.Name == "if_property_stepping");
}
} // class DebuggerTests
} // namespace
+5 -1
View File
@@ -8,7 +8,11 @@ KEYFILE = ../mono.pub
LIB_MCS_FLAGS = -nowarn:618
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
TEST_LIB_REFS = nunit.mocks
TEST_LIB_REFS =
ifneq ($(PROFILE),xammac_net_4_5)
TEST_LIB_REFS += nunit.mocks
endif
include ../../build/library.make
+5 -1
View File
@@ -9,6 +9,10 @@ KEYFILE = ../mono.pub
LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
TEST_LIB_REFS = System.Messaging nunit.mocks
TEST_LIB_REFS = System.Messaging
ifneq ($(PROFILE),xammac_net_4_5)
TEST_LIB_REFS += nunit.mocks
endif
include ../../build/library.make
@@ -110,14 +110,6 @@ namespace System.ComponentModel.Composition.ReflectionModel
{
Requires.NotNull(importDefinition, "importDefinition");
ReflectionImportDefinition reflectionImportDefinition = importDefinition as ReflectionImportDefinition;
if (reflectionImportDefinition == null)
{
throw new ArgumentException(
string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()),
"importDefinition");
}
return (importDefinition is IPartCreatorImportDefinition);
}
@@ -0,0 +1,9 @@
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
-6
View File
@@ -29,12 +29,6 @@ ifdef MONO_FEATURE_APPLETLS
LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLETLS
endif
ifdef ENABLE_GSS
ifndef NO_GSS
LIB_MCS_FLAGS += -d:ENABLE_GSS
endif
endif
ifndef PROFILE_DISABLE_BTLS
ifdef HAVE_BTLS
LIB_MCS_FLAGS += -d:MONO_FEATURE_BTLS
+3 -3
View File
@@ -39,7 +39,7 @@
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../class/lib/monotouch</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;MONO_FEATURE_APPLETLS;ENABLE_GSS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;MONO_FEATURE_APPLETLS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
<OutputPath>./../../class/lib/monotouch_watch</OutputPath>
@@ -74,12 +74,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../class/lib/xammac</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;MONO_FEATURE_APPLETLS;ENABLE_GSS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;MONO_FEATURE_APPLETLS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<OutputPath>./../../class/lib/xammac_net_4_5</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac_net_4_5</IntermediateOutputPath>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;NO_SYSTEM_DRAWING_DEPENDENCY;NO_WINFORMS_DEPENDENCY;NO_SYSTEM_WEB_DEPENDENCY;XAMMAC_4_5;XAMARIN_MODERN;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;MONO_FEATURE_APPLETLS;ENABLE_GSS</DefineConstants>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;NO_SYSTEM_DRAWING_DEPENDENCY;NO_WINFORMS_DEPENDENCY;NO_SYSTEM_WEB_DEPENDENCY;XAMMAC_4_5;XAMARIN_MODERN;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;MONO_FEATURE_APPLETLS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
<OutputPath>./../../class/lib/orbis</OutputPath>
+5 -1
View File
@@ -12,7 +12,11 @@ endif
KEYFILE = ../msfinal.pub
LIB_MCS_FLAGS = /resource:System.Messaging/MessageQueue.resx
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
TEST_LIB_REFS = nunit.mocks
TEST_LIB_REFS =
ifneq ($(PROFILE),xammac_net_4_5)
TEST_LIB_REFS += nunit.mocks
endif
EXTRA_DISTFILES = System.Messaging/MessageQueue.resx
+54 -4
View File
@@ -57,13 +57,35 @@ namespace System.Net.Http
public HttpRequestMessage Request;
public CancellationTokenRegistration CancellationTokenRegistration;
public CFContentStream ContentStream;
public bool StreamCanBeDisposed;
public void Close ()
{
CancellationTokenRegistration.Dispose ();
if (ContentStream != null) {
ContentStream.Close ();
}
if (ContentStream != null) {
// The Close method of the CFContentStream blocks as you can see:
// public void Close ()
// {
// data_read_event.WaitOne (); // make sure there's no pending data
//
// data_mutex.WaitOne ();
// data = null;
// this.http_stream.ErrorEvent -= HandleErrorEvent;
// data_mutex.ReleaseMutex ();
//
// data_event.Set ();
// }
// This means. that when we want to ignore the data of the content, which happens
// in the first request of a redirect, if we want to close, ignoring the content
// we will have a deadlock.
// Dispose will clean all the data, without waiting for the read, which by design in the
// CFContentStream, blocks the thread. This happens ONLY after the first request that gets
// a redirect status code. All other cases should call close.
if (StreamCanBeDisposed)
ContentStream.Dispose ();
else
ContentStream.Close ();
}
}
}
@@ -173,6 +195,11 @@ namespace System.Net.Http
}
protected internal override async Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
{
return await SendAsync (request, cancellationToken, true).ConfigureAwait (false);
}
internal async Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken, bool isFirstRequest)
{
sentRequest = true;
@@ -194,7 +221,8 @@ namespace System.Net.Http
}
}
stream.ShouldAutoredirect = allowAutoRedirect;
if (!isFirstRequest && allowAutoRedirect)
stream.ShouldAutoredirect = allowAutoRedirect;
stream.HasBytesAvailableEvent += HandleHasBytesAvailableEvent;
stream.ErrorEvent += HandleErrorEvent;
stream.ClosedEvent += HandleClosedEvent;
@@ -234,9 +262,31 @@ namespace System.Net.Http
CloseStream (stream);
});
if (isFirstRequest) {
var initialRequest = await response.Task;
var status = initialRequest.StatusCode;
if (IsRedirect (status) && allowAutoRedirect) {
bucket.StreamCanBeDisposed = true;
// remove headers in a redirect for Authentication.
request.Headers.Authorization = null;
return await SendAsync (request, cancellationToken, false).ConfigureAwait (false);
}
return initialRequest;
}
return await response.Task;
}
// Decide if we redirect or not, similar to what is done in the managed handler
// https://github.com/mono/mono/blob/eca15996c7163f331c9f2cd0a17b63e8f92b1d55/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs#L5681
static bool IsRedirect (HttpStatusCode status)
{
return status == HttpStatusCode.Ambiguous || // 300
status == HttpStatusCode.Moved || // 301
status == HttpStatusCode.Redirect || // 302
status == HttpStatusCode.RedirectMethod || // 303
status == HttpStatusCode.RedirectKeepVerb; // 307
}
void HandleErrorEvent (object sender, CFStream.StreamEventArgs e)
{
var stream = (CFHTTPStream)sender;
@@ -19,11 +19,13 @@ ifneq ($(PROFILE),monodroid)
ifneq ($(PROFILE),monotouch)
ifneq ($(PROFILE),monotouch_tv)
ifneq ($(PROFILE),monotouch_watch)
ifneq ($(PROFILE),xammac_net_4_5)
XTEST_LIB_REFS += System.Drawing
endif
endif
endif
endif
endif
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Data System.Configuration SMDiagnostics
@@ -0,0 +1,3 @@
System.Runtime.Serialization/Bug666333Test.cs
System.Runtime.Serialization/WsdlHelper.cs
System.Runtime.Serialization/XsdDataContractImporterTest2.cs
@@ -0,0 +1 @@
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
@@ -0,0 +1,10 @@
System/UriTemplateTest.cs
System.ServiceModel/WebHttpBindingTest.cs
System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs
System.ServiceModel.Configuration/WebHttpBindingElementTest.cs
System.ServiceModel.Description/WebHttpBehaviorTest.cs
System.ServiceModel.Description/WebHttpEndpointTest.cs
System.ServiceModel.Description/WebScriptEnablingBehaviorTest.cs
System.ServiceModel.Dispatcher/WebHttpDispatchOperationSelectorTest.cs
System.ServiceModel.Web/WebOperationContextTest.cs
System.ServiceModel.Web/WebServiceHostTest.cs
@@ -0,0 +1,14 @@
System.Web.Services/WebServiceTest.cs
System.Web.Services.Configuration/DiagnosticsElementTest.cs
System.Web.Services.Configuration/ProtocolElementTest.cs
System.Web.Services.Configuration/SoapEnvelopeProcessingElementTest.cs
System.Web.Services.Configuration/SoapExtensionTypeElementTest.cs
System.Web.Services.Configuration/TypeElementTest.cs
System.Web.Services.Configuration/WsdlHelpGeneratorElementTest.cs
System.Web.Services.Configuration/WsiProfilesElementTest.cs
System.Web.Services.Description/ServiceDescriptionImporterTest.cs
System.Web.Services.Description/ServiceDescriptionReflectorTest.cs
System.Web.Services.Description/WebReferenceOptionsTest.cs
System.Web.Services.Description/WebServicesInteroperabilityTest.cs
System.Web.Services.Protocols/LogicalMethodInfoTest.cs
System.Web.Services.Protocols/SoapServerTypeTest.cs
@@ -272,7 +272,8 @@ namespace System.Web.Configuration
{
string path = NormalizeVirtualPath (virtualPath);
foreach (VirtualDirectoryMapping mapping in map.VirtualDirectories) {
for (int j = 0; j < map.VirtualDirectories.Count; j++) {
VirtualDirectoryMapping mapping = map.VirtualDirectories.Get(j);
if (path.StartsWith (mapping.VirtualDirectory)) {
int i = mapping.VirtualDirectory.Length;
if (path.Length == i) {
@@ -483,7 +483,7 @@ namespace System.Windows.Forms.Layout
CalculateColumnWidths (settings, actual_positions, max_colspan, settings.ColumnStyles, auto_size, column_widths, false);
// Calculate available width
int available_width = size.Width - (border_width * (columns + 1));
int available_width = size.Width < Int16.MaxValue ? size.Width - (border_width * (columns + 1)) : 0;
foreach (int width in column_widths)
available_width -= width;
@@ -516,7 +516,7 @@ namespace System.Windows.Forms.Layout
CalculateRowHeights (settings, actual_positions, max_rowspan, settings.RowStyles, auto_size, column_widths, row_heights);
// Calculate available height
int available_height = size.Height - (border_width * (rows + 1));
int available_height = size.Height < Int16.MaxValue ? size.Height - (border_width * (rows + 1)) : 0;
foreach (int height in row_heights)
available_height -= height;
+2
View File
@@ -24,11 +24,13 @@ ifneq ($(PROFILE),monodroid)
ifneq ($(PROFILE),monotouch)
ifneq ($(PROFILE),monotouch_tv)
ifneq ($(PROFILE),monotouch_watch)
ifneq ($(PROFILE),xammac_net_4_5)
XTEST_LIB_REFS += System.Drawing
endif
endif
endif
endif
endif
LIBRARY_WARN_AS_ERROR = yes
@@ -84,5 +84,9 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
#if MONODROID
[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Stack<>))]
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Queue<>))]
+5 -1
View File
@@ -92,9 +92,13 @@ endif
ifndef PROFILE_DISABLE_BTLS
ifdef HAVE_BTLS
LIB_MCS_FLAGS += -d:MONO_FEATURE_BTLS
endif
endif
ifdef ENABLE_GSS
ifndef NO_GSS
LIB_MCS_FLAGS += -d:ENABLE_GSS
endif
endif
@@ -67,7 +67,8 @@ namespace Microsoft.CSharp
mcs.StartInfo.Arguments += BuildArgs (options, fileNames, _provOptions);
var mcsOutMutex = new Mutex ();
var stderr_completed = new ManualResetEvent (false);
var stdout_completed = new ManualResetEvent (false);
/*
string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
if (monoPath != null)
@@ -93,15 +94,19 @@ namespace Microsoft.CSharp
mcs.StartInfo.CreateNoWindow=true;
mcs.StartInfo.UseShellExecute=false;
mcs.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
mcs.StartInfo.RedirectStandardOutput=true;
mcs.StartInfo.RedirectStandardError=true;
mcs.ErrorDataReceived += new DataReceivedEventHandler ((sender, args) => {
if (args.Data != null) {
mcsOutMutex.WaitOne ();
if (args.Data != null)
results.Output.Add (args.Data);
mcsOutMutex.ReleaseMutex ();
}
else
stderr_completed.Set ();
});
mcs.OutputDataReceived += new DataReceivedEventHandler ((sender, args) => {
if (args.Data == null)
stdout_completed.Set ();
});
// Use same text decoder as mcs and not user set values in Console
mcs.StartInfo.StandardOutputEncoding =
@@ -125,8 +130,8 @@ namespace Microsoft.CSharp
results.NativeCompilerReturnValue = mcs.ExitCode;
} finally {
mcs.CancelErrorRead ();
mcs.CancelOutputRead ();
stderr_completed.WaitOne (TimeSpan.FromSeconds (30));
stdout_completed.WaitOne (TimeSpan.FromSeconds (30));
mcs.Close();
}
@@ -178,7 +178,11 @@ namespace Mono.Net.Security
};
var task = ProcessAuthentication (true, options, CancellationToken.None);
task.Wait ();
try {
task.Wait ();
} catch (Exception ex) {
throw HttpWebRequest.FlattenException (ex);
}
}
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
@@ -231,7 +235,11 @@ namespace Mono.Net.Security
};
var task = ProcessAuthentication (true, options, CancellationToken.None);
task.Wait ();
try {
task.Wait ();
} catch (Exception ex) {
throw HttpWebRequest.FlattenException (ex);
}
}
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
@@ -34,6 +34,7 @@ namespace Mono
class SystemDependencyProvider : ISystemDependencyProvider
{
static SystemDependencyProvider instance;
static object syncRoot = new object ();
public static SystemDependencyProvider Instance {
get {
@@ -44,8 +45,12 @@ namespace Mono
internal static void Initialize ()
{
if (instance == null)
Interlocked.CompareExchange (ref instance, new SystemDependencyProvider (), null);
lock (syncRoot) {
if (instance != null)
return;
instance = new SystemDependencyProvider ();
}
}
ISystemCertificateProvider ISystemDependencyProvider.CertificateProvider => CertificateProvider;
@@ -400,6 +400,8 @@ namespace System.Net
WebConnection.Debug ($"{ME} CLOSE #1: read_eof={read_eof} bufferedEntireContent={bufferedEntireContent}");
if (read_eof || bufferedEntireContent) {
disposed = true;
innerStream?.Dispose ();
innerStream = null;
Operation.Finish (true);
} else {
// If we have not read all the contents
+4 -4
View File
@@ -37,12 +37,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../class/lib/monotouch</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;MONO_FEATURE_APPLETLS;ONLY_APPLETLS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;MONO_FEATURE_APPLETLS;ONLY_APPLETLS;ENABLE_GSS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_runtime' ">
<OutputPath>./../../class/lib/monotouch_runtime</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch_runtime</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;MONO_FEATURE_APPLETLS;ONLY_APPLETLS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;MONO_FEATURE_APPLETLS;ONLY_APPLETLS;ENABLE_GSS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
<OutputPath>./../../class/lib/monotouch_watch</OutputPath>
@@ -87,12 +87,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../class/lib/xammac</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;MONO_FEATURE_APPLETLS;FEATURE_COMPILED;ONLY_APPLETLS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;MONO_FEATURE_APPLETLS;FEATURE_COMPILED;ONLY_APPLETLS;ENABLE_GSS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<OutputPath>./../../class/lib/xammac_net_4_5</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac_net_4_5</IntermediateOutputPath>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;NO_SYSTEM_DRAWING_DEPENDENCY;NO_WINFORMS_DEPENDENCY;NO_SYSTEM_WEB_DEPENDENCY;XAMMAC_4_5;XAMARIN_MODERN;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;CODEDOM;MONO_FEATURE_APPLETLS;FEATURE_COMPILED;ONLY_APPLETLS;CONFIGURATION_DEP</DefineConstants>
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;NO_SYSTEM_DRAWING_DEPENDENCY;NO_WINFORMS_DEPENDENCY;NO_SYSTEM_WEB_DEPENDENCY;XAMMAC_4_5;XAMARIN_MODERN;COREFX;CONFIGURATION_2_0;SYSTEM_NET_PRIMITIVES_DLL;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_SECURITY_ALIAS;CODEDOM;MONO_FEATURE_APPLETLS;FEATURE_COMPILED;ONLY_APPLETLS;ENABLE_GSS;CONFIGURATION_DEP</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
<OutputPath>./../../class/lib/orbis</OutputPath>
@@ -26,6 +26,9 @@
using System;
using System.ComponentModel;
#if !MOBILE && !XAMMAC_4_5
using System.Drawing;
#endif
using NUnit.Framework;
namespace MonoTests.System.ComponentModel {
@@ -58,5 +61,21 @@ namespace MonoTests.System.ComponentModel {
Assert.AreEqual (1, dvat.GetHashCode (), "GetHashCode");
}
#if !MOBILE && !XAMMAC_4_5
[DefaultValue (typeof (Color), "Black")]
public Color Bar { get; set; }
// https://github.com/mono/mono/issues/12362
[Test]
public void Bug_12362 ()
{
var prop = typeof (DefaultValueAttributeTest).GetProperty ("Bar");
var attr = (DefaultValueAttribute)prop.GetCustomAttributes (true) [0];
var value = attr.Value;
Assert.IsNotNull (value);
Assert.AreEqual (typeof (Color), value.GetType ());
}
#endif
}
}
@@ -690,7 +690,12 @@ namespace Microsoft.Win32 {
public void DirtyTimeout (object state)
{
Flush ();
try {
Flush ();
} catch {
// This was identified as a crasher under some scenarios
// Internal MS issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/787119
}
}
public void Flush ()
+47 -8
View File
@@ -100,7 +100,7 @@ namespace Mono {
static extern void DisableMicrosoftTelemetry ();
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void EnableMicrosoftTelemetry_internal (IntPtr appBundleID, IntPtr appSignature, IntPtr appVersion, IntPtr merpGUIPath, IntPtr eventType, IntPtr appPath);
static extern void EnableMicrosoftTelemetry_internal (IntPtr appBundleID, IntPtr appSignature, IntPtr appVersion, IntPtr merpGUIPath, IntPtr eventType, IntPtr appPath, IntPtr configDir);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void SendMicrosoftTelemetry_internal (IntPtr payload, ulong portable_hash, ulong unportable_hash);
@@ -147,7 +147,8 @@ namespace Mono {
SendMicrosoftTelemetry (payload_str, portable_hash, unportable_hash);
}
static void EnableMicrosoftTelemetry (string appBundleID_str, string appSignature_str, string appVersion_str, string merpGUIPath_str, string eventType_str, string appPath_str)
// All must be set except for configDir_str
static void EnableMicrosoftTelemetry (string appBundleID_str, string appSignature_str, string appVersion_str, string merpGUIPath_str, string eventType_str, string appPath_str, string configDir_str)
{
if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX)) {
using (var appBundleID_chars = RuntimeMarshal.MarshalString (appBundleID_str))
@@ -156,8 +157,9 @@ namespace Mono {
using (var merpGUIPath_chars = RuntimeMarshal.MarshalString (merpGUIPath_str))
using (var eventType_chars = RuntimeMarshal.MarshalString (eventType_str))
using (var appPath_chars = RuntimeMarshal.MarshalString (appPath_str))
using (var configDir_chars = RuntimeMarshal.MarshalString (configDir_str))
{
EnableMicrosoftTelemetry_internal (appBundleID_chars.Value, appSignature_chars.Value, appVersion_chars.Value, merpGUIPath_chars.Value, eventType_chars.Value, appPath_chars.Value);
EnableMicrosoftTelemetry_internal (appBundleID_chars.Value, appSignature_chars.Value, appVersion_chars.Value, merpGUIPath_chars.Value, eventType_chars.Value, appPath_chars.Value, configDir_chars.Value);
}
} else {
throw new PlatformNotSupportedException("Merp support is currently only supported on OSX.");
@@ -192,16 +194,53 @@ namespace Mono {
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void RegisterReportingForNativeLib_internal (IntPtr modulePathSuffix, IntPtr moduleName);
static extern void EnableCrashReportLog_internal (IntPtr directory);
static void RegisterReportingForNativeLib (string modulePathSuffix_str, string moduleName_str)
static void EnableCrashReportLog (string directory_str)
{
using (var modulePathSuffix_chars = RuntimeMarshal.MarshalString (modulePathSuffix_str))
using (var moduleName_chars = RuntimeMarshal.MarshalString (moduleName_str))
using (var directory_chars = RuntimeMarshal.MarshalString (directory_str))
{
RegisterReportingForNativeLib_internal (modulePathSuffix_chars.Value, moduleName_chars.Value);
EnableCrashReportLog_internal (directory_chars.Value);
}
}
enum CrashReportLogLevel : int {
MonoSummaryNone = 0,
MonoSummarySetup,
MonoSummarySuspendHandshake,
MonoSummaryUnmanagedStacks,
MonoSummaryManagedStacks,
MonoSummaryStateWriter,
MonoSummaryStateWriterDone,
MonoSummaryMerpWriter,
MonoSummaryMerpInvoke,
MonoSummaryCleanup,
MonoSummaryDone,
MonoSummaryDoubleFault
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern int CheckCrashReportLog_internal (IntPtr directory, bool clear);
static CrashReportLogLevel CheckCrashReportLog (string directory_str, bool clear)
{
using (var directory_chars = RuntimeMarshal.MarshalString (directory_str))
{
return (CrashReportLogLevel) CheckCrashReportLog_internal (directory_chars.Value, clear);
}
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void AnnotateMicrosoftTelemetry_internal (IntPtr key, IntPtr val);
static void AnnotateMicrosoftTelemetry (string key, string val)
{
using (var key_chars = RuntimeMarshal.MarshalString (key))
using (var val_chars = RuntimeMarshal.MarshalString (val))
{
AnnotateMicrosoftTelemetry_internal (key_chars.Value, val_chars.Value);
}
}
}
}
@@ -185,8 +185,10 @@ namespace System.Diagnostics {
return frames;
var accum = new List<StackFrame> ();
foreach (var t in captured_traces)
accum.AddRange(t.GetFrames ());
foreach (var t in captured_traces) {
for (int i = 0; i < t.FrameCount; i++)
accum.Add (t.GetFrame (i));
}
accum.AddRange (frames);
return accum.ToArray ();
@@ -303,11 +303,24 @@ namespace System.Reflection.Emit {
return System.Text.Encoding.UTF8.GetString(data, pos, len);
}
internal static string decode_string (byte [] data, int pos, out int rpos)
{
if (data [pos] == 0xff) {
rpos = pos + 1;
return null;
} else {
int len = decode_len (data, pos, out pos);
string s = string_from_bytes (data, pos, len);
pos += len;
rpos = pos;
return s;
}
}
internal string string_arg ()
{
int pos = 2;
int len = decode_len (data, pos, out pos);
return string_from_bytes (data, pos, len);
return decode_string (data, pos, out pos);
}
internal static UnmanagedMarshal get_umarshal (CustomAttributeBuilder customBuilder, bool is_field) {
@@ -335,18 +348,14 @@ namespace System.Reflection.Emit {
int paramType; // What is this ?
/* Skip field/property signature */
pos ++;
int fieldPropSig = (int)data [pos ++];
/* Read type */
paramType = ((int)data [pos++]);
if (paramType == 0x55) {
/* enums, the value is preceeded by the type */
int len2 = decode_len (data, pos, out pos);
string_from_bytes (data, pos, len2);
pos += len2;
decode_string (data, pos, out pos);
}
int len = decode_len (data, pos, out pos);
string named_name = string_from_bytes (data, pos, len);
pos += len;
string named_name = decode_string (data, pos, out pos);
switch (named_name) {
case "ArraySubType":
@@ -375,9 +384,7 @@ namespace System.Reflection.Emit {
pos += 4;
break;
case "SafeArrayUserDefinedSubType":
len = decode_len (data, pos, out pos);
string_from_bytes (data, pos, len);
pos += len;
decode_string (data, pos, out pos);
break;
case "SizeParamIndex":
value = (int)data [pos++];
@@ -386,20 +393,15 @@ namespace System.Reflection.Emit {
hasSize = true;
break;
case "MarshalType":
len = decode_len (data, pos, out pos);
marshalTypeName = string_from_bytes (data, pos, len);
pos += len;
marshalTypeName = decode_string (data, pos, out pos);
break;
case "MarshalTypeRef":
len = decode_len (data, pos, out pos);
marshalTypeName = string_from_bytes (data, pos, len);
marshalTypeRef = Type.GetType (marshalTypeName);
pos += len;
marshalTypeName = decode_string (data, pos, out pos);
if (marshalTypeName != null)
marshalTypeRef = Type.GetType (marshalTypeName);
break;
case "MarshalCookie":
len = decode_len (data, pos, out pos);
marshalCookie = string_from_bytes (data, pos, len);
pos += len;
marshalCookie = decode_string (data, pos, out pos);
break;
default:
throw new Exception ("Unknown MarshalAsAttribute field: " + named_name);
+1 -1
View File
@@ -71,7 +71,7 @@ namespace System.Threading {
internal int _serialized_principal_version;
private IntPtr appdomain_refs;
private int interruption_requested;
private IntPtr synch_cs;
private IntPtr longlived;
internal bool threadpool_thread;
private bool thread_interrupt_requested;
/* These are used from managed code */
@@ -27,7 +27,7 @@ using System;
namespace Mono
{
// Keep in sync with mono/native/mono-native-platform-type.h
// Keep in sync with mono/native/mono-native-platform.h
[Flags]
enum MonoNativePlatformType
{
@@ -30,40 +30,5 @@ namespace MonoTests.Mono
var initialized = MonoNativePlatform.IsInitialized ();
Assert.IsTrue (initialized, "MonoNativePlatform.IsInitialized()");
}
[Test]
public void TestReflectionInitialize ()
{
var asm = typeof (string).Assembly;
var type = asm.GetType ("Mono.MonoNativePlatform");
Assert.IsNotNull (type, "MonoNativePlatform");
var method = type.GetMethod ("Initialize", BindingFlags.Static | BindingFlags.Public);
Assert.IsNotNull (method, "MonoNativePlatform.Initialize");
var method2 = type.GetMethod ("IsInitialized", BindingFlags.Static | BindingFlags.Public);
Assert.IsNotNull (method2, "MonoNativePlatform.IsInitialized");
method.Invoke (null, null);
var result = (bool)method2.Invoke (null, null);
Assert.IsTrue (result, "MonoNativePlatform.IsInitialized()");
}
[Test]
public void TestInternalCounter ()
{
MonoNativePlatform.Initialize ();
var asm = typeof (string).Assembly;
var type = asm.GetType ("Mono.MonoNativePlatform");
Assert.IsNotNull (type, "MonoNativePlatform");
var method = type.GetMethod ("TestInternalCounter", BindingFlags.Static | BindingFlags.NonPublic);
Assert.IsNotNull (method, "MonoNativePlatform.TestInternalCounter");
var result = method.Invoke (null, null);
Assert.That (result, Is.GreaterThan (0), "MonoNativePlatform.TestInternalCounter()");
}
}
}
@@ -12,6 +12,7 @@ using System.Diagnostics;
using System.Reflection;
using NUnit.Framework;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
namespace MonoTests.System.Diagnostics
{
@@ -181,7 +182,7 @@ namespace MonoTests.System.Diagnostics
frame1.GetFileLineNumber (),
"Line number (1)");
Assert.AreEqual (135,
Assert.AreEqual (136,
frame2.GetFileLineNumber (),
"Line number (2)");
@@ -321,7 +322,7 @@ namespace MonoTests.System.Diagnostics
frame1.GetFileLineNumber (),
"Line number (1)");
Assert.AreEqual (271,
Assert.AreEqual (272,
frame2.GetFileLineNumber (),
"Line number (2)");
}
@@ -377,6 +378,49 @@ namespace MonoTests.System.Diagnostics
}
}
[Test]
[Category("NotWasm")]
[Category("MobileNotWorking")]
// https://github.com/mono/mono/issues/12688
public async Task GetFrames_AsyncCalls ()
{
await StartAsyncCalls ();
}
private async Task StartAsyncCalls ()
{
try
{
await AsyncMethod1 ();
}
catch (Exception exception)
{
var stackTrace = new StackTrace (exception, true);
Assert.AreEqual (25, stackTrace.GetFrames ().Length);
}
}
private async Task<int> AsyncMethod1 ()
{
return await AsyncMethod2 ();
}
private async Task<int> AsyncMethod2 ()
{
return await AsyncMethod3 ();
}
private async Task<int> AsyncMethod3 ()
{
return await AsyncMethod4 ();
}
private async Task<int> AsyncMethod4 ()
{
await Task.Delay (10);
throw new Exception ("Test exception thrown!");
}
/// <summary>
/// Tests whether getting method associated with frame works.
/// </summary>
@@ -86,7 +86,6 @@ namespace MonoTests.System.IO
}
if (d.DriveType == DriveType.Fixed) { // just consider fixed drives for now
Assert.True (d.IsReady);
AssertHelper.GreaterOrEqual (d.AvailableFreeSpace, 0);
AssertHelper.GreaterOrEqual (d.TotalFreeSpace, 0);
AssertHelper.GreaterOrEqual (d.TotalSize, 0);
@@ -9,6 +9,7 @@ using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
using System.Runtime.InteropServices;
using NUnit.Framework;
namespace MonoTests.System.Reflection.Emit
@@ -845,6 +846,59 @@ namespace MonoTests.System.Reflection.Emit
assemblyBuilder1.Save ("Repro55681-2a.dll");
}
[DllImport("SomeLib")]
private static extern void MethodForNullStringMarshalAsFields([MarshalAs(UnmanagedType.LPWStr)] string param);
[Test]
public void NullStringMarshalAsFields () {
// Regression test for https://github.com/mono/mono/issues/12747
//
// MarshalAsAttribute goes through
// CustomAttributeBuilder.get_umarshal which tries to
// build an UnmanagedMarshal value by decoding the CAB's data.
//
// The data decoding needs to handle null string (encoded as 0xFF) properly.
var aName = new AssemblyName("Repro12747");
var assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(aName, AssemblyBuilderAccess.RunAndSave, tempDir);
var module = assembly.DefineDynamicModule(aName.Name, aName.Name + ".dll");
var prototypeMethodName = nameof(MethodForNullStringMarshalAsFields);
var someMethod = this.GetType().GetMethod(prototypeMethodName, BindingFlags.Static | BindingFlags.NonPublic);
var typeBuilder = module.DefineType("NewType" + module.ToString(), TypeAttributes.Class | TypeAttributes.Public);
var methodBuilder = typeBuilder.DefineMethod("NewMethod", MethodAttributes.Public | MethodAttributes.HideBySig, typeof(void), new[] { typeof(string) });
var il = methodBuilder.GetILGenerator();
il.Emit(OpCodes.Ret);
var param = someMethod.GetParameters()[0];
var paramBuilder = methodBuilder.DefineParameter(1, param.Attributes, null);
MarshalAsAttribute attr = param.GetCustomAttribute<MarshalAsAttribute>();
var attrCtor = typeof(MarshalAsAttribute).GetConstructor(new[] { typeof(UnmanagedType) });
object[] attrCtorArgs = { attr.Value };
// copy over the fields from the real MarshalAsAttribute on the parameter of "MethodForNullStringMarshalAsFields",
// including the ones that were initialized to null
var srcFields = typeof(MarshalAsAttribute).GetFields(BindingFlags.Public | BindingFlags.Instance);
var fieldArguments = new FieldInfo[srcFields.Length];
var fieldArgumentValues = new object[srcFields.Length];
for(int i = 0; i < srcFields.Length; i++)
{
var field = srcFields[i];
fieldArguments[i] = field;
fieldArgumentValues[i] = field.GetValue(attr);
}
var attrBuilder = new CustomAttributeBuilder(attrCtor, attrCtorArgs, Array.Empty<PropertyInfo>(), Array.Empty<object>(),
fieldArguments, fieldArgumentValues);
// this encodes the CustomAttributeBuilder as a data
// blob and then tries to decode it using
// CustomAttributeBuilder.get_umarshal
paramBuilder.SetCustomAttribute(attrBuilder);
var finalType = typeBuilder.CreateType();
}
}
}
@@ -81,7 +81,7 @@ namespace MonoTests.System.Reflection
public class CustomAttributeDataTest
{
[DllImport ("libc")]
public static extern void pinvoke ();
public static extern int readlink (string path, byte[] buffer, int buflen);
[MarshalAs (UnmanagedType.LPStr)]
[NonSerialized]
@@ -274,7 +274,7 @@ namespace MonoTests.System.Reflection
// https://github.com/mono/mono/issues/10544
public void MethodIncludesDllImportAttributeData ()
{
var mi = typeof (CustomAttributeDataTest).FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.Public, (m, criteria) => m.Name == "pinvoke", null);
var mi = typeof (CustomAttributeDataTest).FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.Public, (m, criteria) => m.Name == "readlink", null);
var data = ((MethodInfo)(mi[0])).CustomAttributes;
Assert.AreEqual (2, data.Count ());
@@ -562,6 +562,15 @@ namespace MonoTests.System.Reflection
var optionalCustomModifiers = parameter.GetOptionalCustomModifiers ();
Assert.AreEqual (new[] { typeof (C), typeof (C), typeof (D), typeof (C) }, optionalCustomModifiers);
}
#endif
#endif
[Test]
public void ReturnParameter_IsDefined_False ()
{
Type type = typeof (object);
MethodInfo method = type.GetMethod ("ToString");
ParameterInfo paramInfo = method.ReturnParameter;
Assert.IsFalse (paramInfo.IsDefined (typeof (Attribute)));
}
}
}
@@ -491,6 +491,35 @@ namespace MonoTests.System.Threading
c1.Dispose ();
}
}
[Test] // https://github.com/mono/mono/issues/12421
public void EnsurePostIsNotCalled ()
{
SynchronizationContext mainContext = SynchronizationContext.Current;
var asc = new AssertSyncContext ();
SynchronizationContext.SetSynchronizationContext (asc);
var ct = new CancellationTokenSource ();
var tcs = new TaskCompletionSource<bool> ();
ct.Token.Register (() => tcs.TrySetCanceled ());
bool taskIsCancelled = false;
Action awaitAction = async () => {
try { await tcs.Task; }
catch (OperationCanceledException) {
taskIsCancelled = true;
}
};
awaitAction ();
ct.Cancel (); // should not trigger SynchronizationContext.Post
Assert.IsTrue (taskIsCancelled);
SynchronizationContext.SetSynchronizationContext (mainContext);
}
class AssertSyncContext : SynchronizationContext
{
public override void Post (SendOrPostCallback d, object state) =>
throw new InvalidOperationException ("SynchronizationContext.Post was not expected.");
}
}
}
@@ -135,7 +135,7 @@ namespace MonoTests.System.Threading
}, 4);
Assert.IsFalse (fail);
}, 200);
}, 5);
}
[Test]
@@ -2667,5 +2667,18 @@ namespace MonoTests.System
Assert.AreEqual (1, res.Day, "#12");
Assert.AreEqual (DateTimeKind.Utc, res.Kind, "#13");
}
[Test] // https://github.com/mono/mono/issues/11317
public void DateTimeKoCulture ()
{
foreach (var culture in new [] { new CultureInfo ("ko"), new CultureInfo ("ko-KR") })
{
var dateTimeAm = new DateTime (2018, 1, 1, 11, 0, 0);
var dateTimePm = new DateTime (2018, 1, 1, 13, 0, 0);
Assert.AreEqual ("오전 11:00:00", dateTimeAm.ToString ("T", culture.DateTimeFormat));
Assert.AreEqual ("오후 1:00:00", dateTimePm.ToString ("T", culture.DateTimeFormat));
}
}
}
}
+76 -54
View File
@@ -405,15 +405,21 @@ namespace MonoTests.System
}
#if !MOBILE
// Ensure that we can convert a stacktrace to a
// telemetry message
//
[Test]
[Category("NotOnWindows")]
public void StacktraceToState ()
void NestedStackTraces (int depth)
{
if (depth == 0)
throw new ArgumentException ("Depth 0 exception");
try {
throw new Exception ("#0");
NestedStackTraces (depth - 1);
} catch (Exception exc) {
throw new Exception (String.Format ("Depth {0} exception, expect nested", depth), exc);
}
}
void StacktraceToStateTest (int depth)
{
try {
NestedStackTraces (depth);
} catch (Exception exc) {
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("ExceptionToState", BindingFlags.NonPublic | BindingFlags.Static);
@@ -424,59 +430,41 @@ namespace MonoTests.System
var portable_hash = output.Item2;
var unportable_hash = output.Item3;
// To see what we're working with
// Console.WriteLine (dump);
Assert.IsTrue (portable_hash != 0, "#1");
Assert.IsTrue (unportable_hash != 0, "#2");
Assert.IsTrue (dump.Length > 0, "#3");
// Console.WriteLine (dump);
// dump should look something like:
// {
// "protocol_version" : "0.0.1",
// "configuration" : {
// "version" : "5.19.0 (managed_telemetry_pipeline/d342c73e320 Wed Aug 15 14:40:40 EDT 2018)",
// "tlc" : "normal",
// "sigsgev" : "altstack",
// "notifications" : "kqueue",
// "architecture" : "amd64",
// "disabled_features" : "none",
// "smallconfig" : "disabled",
// "bigarrays" : "disabled",
// "softdebug" : "enabled",
// "interpreter" : "enabled",
// "llvm_support" : "disabled",
// "suspend" : "hybrid"
// },
// "memory" : {
// "Resident Size" : "40693760",
// "Virtual Size" : "4521312256",
// "minor_gc_time" : "216992",
// "major_gc_time" : "0",
// "minor_gc_count" : "6",
// "major_gc_count" : "0",
// "major_gc_time_concurrent" : "0"
// },
// "threads" : [
// {
// "is_managed" : false,
// "managed_thread_ptr" : "0x0",
// "thread_info_addr" : "0x0",
// "native_thread_id" : "0x0",
// "managed_exception_type" : "System.Exception",
// "managed_frames" : [
// {
// "is_managed" : "true",
// "guid" : "43A03618-E657-44B0-B9FA-F63314A3C1B2",
// "token" : "0x60008da",
// "native_offset" : "0xb2",
// "il_offset" : "0x00000"
// }
// ]
// }
// ]
// }
}
}
// Ensure that we can convert a stacktrace to a
// telemetry message
//
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateBase ()
{
StacktraceToStateTest (0);
}
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateDeeper ()
{
StacktraceToStateTest (2);
}
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateOverflow ()
{
// We set a limit on 15 nested exceptions. Lets check that we're valid
// when exceeding that limit.
StacktraceToStateTest (20);
}
void DumpSingle ()
{
var monoType = Type.GetType ("Mono.Runtime", false);
@@ -507,6 +495,40 @@ namespace MonoTests.System
Assert.IsTrue (dump.Length > 0, "#3");
}
void DumpLogSet ()
{
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("EnableCrashReportLog", BindingFlags.NonPublic | BindingFlags.Static);
convert.Invoke(null, new object[] { "./" });
}
void DumpLogUnset ()
{
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("EnableCrashReportLog", BindingFlags.NonPublic | BindingFlags.Static);
convert.Invoke(null, new object[] { null });
}
void DumpLogCheck ()
{
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("CheckCrashReportLog", BindingFlags.NonPublic | BindingFlags.Static);
var result = convert.Invoke(null, new object[] { "./", true });
var enumType = monoType.Assembly.GetType("Mono.Runtime+CrashReportLogLevel");
var doneEnum = Enum.Parse(enumType, "MonoSummaryDone");
Assert.AreEqual (doneEnum, result, "#DLC1");
}
[Test]
[Category("NotOnWindows")]
public void DumpICallTotalLogged ()
{
DumpLogSet ();
DumpTotal ();
DumpLogUnset ();
DumpLogCheck ();
}
[Test]
[Category("NotOnWindows")]
public void DumpICallSingleOnce ()
+2
View File
@@ -3295,6 +3295,7 @@ namespace MonoTests.System
Assert.AreEqual ("System.Int32", t.FullName);
}
/*
[Test]
#if MONOTOUCH || FULL_AOT_RUNTIME
[ExpectedException (typeof (NotSupportedException))]
@@ -3353,6 +3354,7 @@ namespace MonoTests.System
var g0 = t.GetGenericArguments () [0];
Assert.AreSame (g0, ut, "#1");
}
*/
[Test]
public void MakeGenericType_WrongNumOfArguments ()
+2 -26
View File
@@ -907,6 +907,7 @@
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\CompilerServices\TaskAwaiter.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\ConstrainedExecution\CriticalFinalizerObject.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\InteropServices\SafeBuffer.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Threading\CancellationToken.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Threading\ManualResetEventSlim.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Threading\NativeOverlapped.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Threading\SpinWait.cs" />
@@ -928,6 +929,7 @@
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Reflection\MissingMetadataException.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ReflectionBlockedAttribute.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Threading\CancellationTokenRegistration.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Threading\LockHolder.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Threading\Tasks\DebuggerSupport.Dummy.cs" />
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Threading\Tasks\DebuggerSupport.cs" />
@@ -1237,8 +1239,6 @@
<Compile Include="..\referencesource\mscorlib\system\security\util\tokenizer.cs" />
<Compile Include="..\referencesource\mscorlib\system\sharedstatics.cs" />
<Compile Include="..\referencesource\mscorlib\system\text\encoding.cs" />
<Compile Include="..\referencesource\mscorlib\system\threading\CancellationToken.cs" />
<Compile Include="..\referencesource\mscorlib\system\threading\CancellationTokenSource.cs" />
<Compile Include="..\referencesource\mscorlib\system\threading\SemaphoreSlim.cs" />
<Compile Include="..\referencesource\mscorlib\system\threading\SpinLock.cs" />
<Compile Include="..\referencesource\mscorlib\system\threading\Tasks\AsyncCausalityTracer.cs" />
@@ -2078,8 +2078,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2146,8 +2144,6 @@
<Compile Include="..\referencesource\mscorlib\system\security\cryptography\sha384managed.cs" />
<Compile Include="..\referencesource\mscorlib\system\security\cryptography\sha512managed.cs" />
<Compile Include="..\referencesource\mscorlib\system\security\cryptography\tripledescryptoserviceprovider.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.Cryptography\MD5CryptoServiceProvider.cs" />
<Compile Include="System.Security.Cryptography\RNGCryptoServiceProvider.cs" />
<Compile Include="System.Security.Cryptography\SHA1CryptoServiceProvider.cs" />
@@ -2180,8 +2176,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2217,8 +2211,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2254,8 +2246,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2362,8 +2352,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2400,8 +2388,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2438,8 +2424,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2473,8 +2457,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2507,8 +2489,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2541,8 +2521,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
@@ -2579,8 +2557,6 @@
<Compile Include="Microsoft.Win32\UnixRegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32RegistryApi.cs" />
<Compile Include="Microsoft.Win32\Win32ResultCode.cs" />
<Compile Include="Mono\MonoNativePlatform.cs" />
<Compile Include="Mono\MonoNativePlatformType.cs" />
<Compile Include="System.Security.AccessControl\RegistryAccessRule.cs" />
<Compile Include="System.Security.AccessControl\RegistryAuditRule.cs" />
<Compile Include="System.Security.AccessControl\RegistrySecurity.cs" />
+2 -4
View File
@@ -29,8 +29,6 @@ Mono/CertificateImportFlags.cs
Mono/DependencyInjector.cs
Mono/ISystemCertificateProvider.cs
Mono/ISystemDependencyProvider.cs
Mono/MonoNativePlatform.cs
Mono/MonoNativePlatformType.cs
Mono/Runtime.cs
Mono/RuntimeHandles.cs
Mono/RuntimeMarshal.cs
@@ -1542,8 +1540,8 @@ corefx/BinaryEnums.cs
../../../external/corefx/src/Common/src/CoreLib/System/Threading/ApartmentState.cs
../../../external/corefx/src/Common/src/CoreLib/System/Threading/AsyncLocal.cs
../../../external/corefx/src/Common/src/CoreLib/System/Threading/AutoResetEvent.cs
../referencesource/mscorlib/system/threading/CancellationToken.cs
../referencesource/mscorlib/system/threading/CancellationTokenSource.cs
../../../external/corert/src/System.Private.CoreLib/shared/System/Threading/CancellationToken.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs
../../../external/corefx/src/System.Threading/src/System/Threading/CountdownEvent.cs
../../../external/corefx/src/Common/src/CoreLib/System/Threading/EventResetMode.cs
../referencesource/mscorlib/system/threading/eventwaithandle.cs
+2 -2
View File
@@ -2,8 +2,8 @@ Microsoft.Win32/RegistryKeyTest.cs
Mono/DataConvertTest.cs
../Mono/DataConverter.cs
Mono/NativePlatformTest.cs
../Mono/MonoNativePlatform.cs
../Mono/MonoNativePlatformType.cs
Mono/MonoNativePlatform.cs
Mono/MonoNativePlatformType.cs
System/ActivatorTest.cs
System/AppDomainManagerTest.cs
System/AppDomainSetupTest.cs
@@ -1,4 +1,7 @@
#include mobile_tests.exclude.sources
Mono/NativePlatformTest.cs
Mono/MonoNativePlatform.cs
Mono/MonoNativePlatformType.cs
System.Reflection.Emit/AssemblyBuilderAccessTest.cs
System.Reflection.Emit/AssemblyBuilderTest.cs
System.Reflection.Emit/ConstructorBuilderTest.cs
@@ -1,6 +1,6 @@
Mono/NativePlatformTest.cs
../Mono/MonoNativePlatform.cs
../Mono/MonoNativePlatformType.cs
Mono/MonoNativePlatform.cs
Mono/MonoNativePlatformType.cs
Microsoft.Win32/RegistryKeyTest.cs
System.Diagnostics.Contracts/ContractAssertTest.cs
System.Diagnostics.Contracts/ContractAssumeTest.cs
@@ -6,8 +6,6 @@ corert/ThreadPoolBoundHandle.platformnotsupported.cs
corefx/Interop.GetRandomBytes.Mono.cs
corefx/Mono.SafePasswordHandle.Unix.cs
../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/Microsoft/Win32/SafeHandles/SafePasswordHandle.Unix.cs
Mono/MonoNativePlatform.cs
Mono/MonoNativePlatformType.cs
Microsoft.Win32/IRegistryApi.cs
Microsoft.Win32/Registry.cs
Microsoft.Win32/RegistryKey.cs
@@ -445,23 +445,25 @@ namespace System.Xml {
}
byte[] chProps = new byte[CharPropertiesSize];
s_CharProperties = chProps;
SetProperties( s_Whitespace, fWhitespace );
SetProperties( s_LetterXml4e, fLetter );
SetProperties( s_NCStartName, fNCStartNameSC );
SetProperties( s_NCName, fNCNameSC );
SetProperties( s_CharData, fCharData );
SetProperties( s_NCNameXml4e, fNCNameXml4e );
SetProperties( s_Text, fText );
SetProperties( s_AttrValue, fAttrValue );
SetProperties( chProps, s_Whitespace, fWhitespace );
SetProperties( chProps, s_LetterXml4e, fLetter );
SetProperties( chProps, s_NCStartName, fNCStartNameSC );
SetProperties( chProps, s_NCName, fNCNameSC );
SetProperties( chProps, s_CharData, fCharData );
SetProperties( chProps, s_NCNameXml4e, fNCNameXml4e );
SetProperties( chProps, s_Text, fText );
SetProperties( chProps, s_AttrValue, fAttrValue );
Thread.MemoryBarrier(); // For weak memory models (IA64)
s_CharProperties = chProps;
}
}
private static void SetProperties( string ranges, byte value ) {
private static void SetProperties(byte[] chProps, string ranges, byte value ) {
for ( int p = 0; p < ranges.Length; p += 2 ) {
for ( int i = ranges[p], last = ranges[p + 1]; i <= last; i++ ) {
s_CharProperties[i] |= value;
chProps[i] |= value;
}
}
}
@@ -1557,6 +1557,14 @@ namespace System.ComponentModel
return converter;
}
#if MONO // from https://github.com/dotnet/corefx/pull/31739
// This is called by System.ComponentModel.DefaultValueAttribute via reflection.
private static object ConvertFromInvariantString(Type type, string stringValue)
{
return GetConverter(type).ConvertFromInvariantString(stringValue);
}
#endif
/// <devdoc>
/// Gets the default event for the specified type of component.
/// </devdoc>
@@ -106,7 +106,10 @@ namespace System {
var method = ((MonoMethod)(MethodInfo) member).GetBaseMethod ();
while (true) {
var param = method.GetParametersInternal () [parameter.Position];
var parameters = method.GetParametersInternal ();
if (parameters?.Length == 0 || parameter.Position < 0)
return false;
var param = parameters [parameter.Position];
if (param.IsDefined (attributeType, false))
return true;
@@ -1248,7 +1248,11 @@ namespace System.Threading
{
// capture the sync context
if (0 == (options & CaptureOptions.IgnoreSyncCtx))
#if MONO
syncCtxNew = ecCurrent.SynchronizationContext;
#else
syncCtxNew = (ecCurrent.SynchronizationContext == null) ? null : ecCurrent.SynchronizationContext.CreateCopy();
#endif
#if FEATURE_REMOTING
// copy over the Logical Call Context
@@ -177,6 +177,7 @@
<Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\CryptoService.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Disposable.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Empty.cs" />
<Compile Include="..\..\..\external\cecil\Mono\MergeSort.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Type.cs" />
<Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbReader.cs" />
<Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbWriter.cs" />
+203 -3
View File
@@ -171,6 +171,202 @@ namespace UploadToSentry
{
CodeCollection codebase;
public JObject Format_0_0_3 (string fileName, JObject payload, string hash)
{
var event_id = new JProperty("event_id", Guid.NewGuid().ToString("n"));
var timestamp = new JProperty("timestamp", DateTime.UtcNow.ToString("s", System.Globalization.CultureInfo.InvariantCulture));
var exc_objs = new List<JObject> ();
var thread_objs = new List<JObject> ();
var stackTraces = payload["threads"] as JArray;
var path = Path.GetDirectoryName (fileName); // Best differentiator in-tree for files is where they are run from
foreach (var st in stackTraces) {
var thread_id = st["native_thread_id"]?.ToString();
var unmanaged_frames = new List<JObject>();
var managed_frames = new List<JObject>();
var exceptions = new List<JObject>();
var thread_name = st["thread_name"]?.ToString ();
if (thread_name == null || thread_name?.Length == 0)
thread_name = "Unnamed thread";
var payload_unmanaged_frames = st["unmanaged_frames"] as JArray;
for (int fr=0; payload_unmanaged_frames != null && fr < payload_unmanaged_frames.Count; fr++)
{
var frame = payload_unmanaged_frames [fr] as JObject;
var native_address = frame["native_address"];
var unmanaged_name = frame["unmanaged_name"] != null ? frame["unmanaged_name"].ToString() : "";
var fn_filename = new JProperty("filename", "");
var function = new JProperty("function", unmanaged_name);
var module = new JProperty("module", "mono-sgen");
var vars = new JProperty("vars", new JObject(new JProperty ("native_address", native_address)));
var blob = new JObject(fn_filename, function, module, vars);
unmanaged_frames.Add (blob);
}
var payload_managed_frames = st["managed_frames"] as JArray;
for (int fr = 0; payload_managed_frames != null && fr < payload_managed_frames.Count; fr++)
{
var frame = payload_managed_frames [fr] as JObject;
if (frame["is_managed"] != null && frame["is_managed"].ToString ().ToUpper () == "TRUE")
{
var guid_val = frame["guid"].ToString ();
var token_val = Convert.ToUInt32(frame["token"].ToString (), 16);
var offset_val = Convert.ToUInt32(frame["il_offset"].ToString (), 16);
var output_frame = codebase.Find (guid_val, token_val, offset_val);
if (output_frame == null)
continue;
var guid = new JProperty("guid", guid_val);
var token = new JProperty("token", token_val);
var il_offset = new JProperty("il_offset", offset_val);
output_frame.Add (new JProperty("vars", new JObject(guid, token, il_offset)));
managed_frames.Add(output_frame);
} else {
var native_address = frame["native_address"];
var unmanaged_name = frame["unmanaged_name"] != null ? frame["unmanaged_name"].ToString() : "";
var fn_filename = new JProperty("filename", "mono-sgen");
var function = new JProperty("function", unmanaged_name);
var module = new JProperty("module", "");
var vars = new JProperty("vars", frame);
var blob = new JObject(fn_filename, function, module, vars);
managed_frames.Add (blob);
}
}
var payload_exceptions = st["exceptions"] as JArray;
for (int exc=0; payload_exceptions != null && exc < payload_exceptions.Count; exc++)
{
var exception_obj = payload_exceptions [exc] as JObject;
var exc_managed_frames = new List<JObject>();
var payload_exception_frames = exception_obj ["managed_frames"] as JArray;
for (int fr = 0; payload_exception_frames != null && fr < payload_exception_frames.Count; fr++)
{
var frame = payload_exception_frames [fr] as JObject;
if (frame["is_managed"] != null && frame["is_managed"].ToString ().ToUpper () == "TRUE")
{
var guid_val = frame["guid"].ToString ();
var token_val = Convert.ToUInt32(frame["token"].ToString (), 16);
var offset_val = Convert.ToUInt32(frame["il_offset"].ToString (), 16);
var output_frame = codebase.Find (guid_val, token_val, offset_val);
if (output_frame == null)
continue;
var guid = new JProperty("guid", guid_val);
var token = new JProperty("token", token_val);
var il_offset = new JProperty("il_offset", offset_val);
output_frame.Add (new JProperty("vars", new JObject(guid, token, il_offset)));
exc_managed_frames.Add(output_frame);
} else {
var native_address = frame["native_address"];
var unmanaged_name = frame["unmanaged_name"] != null ? frame["unmanaged_name"].ToString() : "";
var fn_filename = new JProperty("filename", "mono-sgen");
var function = new JProperty("function", unmanaged_name);
var module = new JProperty("module", "");
var vars = new JProperty("vars", frame);
var blob = new JObject(fn_filename, function, module, vars);
exc_managed_frames.Add (blob);
}
}
var type = new JProperty ("type", exception_obj ["type"].ToString ());
var managed_st = new JProperty("frames", new JArray(exc_managed_frames.ToArray()));
var exc_blob = new JObject(type, managed_st);
exceptions.Add (exc_blob);
}
if (unmanaged_frames.Count > 0) {
var unmanaged_st = new JObject(new JProperty("frames", new JArray(unmanaged_frames.ToArray ())));
var id = String.Format ("{0}_unmanaged", st ["native_thread_id"]);
var active = new JProperty ("active", "true");
if (st["crashed"]?.ToString ().ToUpper () == "TRUE") {
var unmanaged_thread = new JObject (active, new JProperty ("crashed", "true"), new JProperty ("name", String.Format ("{0} unmanaged", thread_name)), new JProperty ("id", id));
var unmanaged_exc = new JObject(new JProperty("module", String.Format("{0}_managed_frames", thread_id)),
new JProperty("type", path),
new JProperty("value", ""),
new JProperty("stacktrace", unmanaged_st), new JProperty("thread_id", id));
thread_objs.Add(unmanaged_thread);
exc_objs.Add (unmanaged_exc);
} else {
var unmanaged_thread = new JObject (active, new JProperty ("name", String.Format ("{0} Unmanaged", thread_name)),
new JProperty ("id", id), new JProperty ("stacktrace", unmanaged_st));
thread_objs.Add(unmanaged_thread);
}
}
if (managed_frames.Count > 0) {
var managed_st = new JObject(new JProperty("frames", new JArray(managed_frames.ToArray())));
// If we are the crashing thread, set the exception object to the
// managed stacktrace and the thread object to the managed thread
//
// If we aren't, add the thread + st to
var id = String.Format ("{0}_managed", st["native_thread_id"]);
var active = new JProperty ("active", "true");
if (unmanaged_frames.Count == 0 && st["crashed"]?.ToString ().ToUpper () == "TRUE") {
var managed_thread = new JObject (active, new JProperty ("crashed", "true"), new JProperty ("name", String.Format ("{0} managed", thread_name)), new JProperty ("id", id));
var managed_exc = new JObject(new JProperty("module", String.Format("{0}_managed_frames", thread_id)),
new JProperty("type", path),
new JProperty("value", ""),
new JProperty("stacktrace", managed_st), new JProperty("thread_id", id));
thread_objs.Add(managed_thread);
exc_objs.Add (managed_exc);
} else {
var managed_thread = new JObject (active, new JProperty ("name", String.Format ("{0} managed", thread_name)),
new JProperty ("id", id), new JProperty ("stacktrace", managed_st));
thread_objs.Add(managed_thread);
}
}
bool first_exception = true;
foreach (var exc_input in exceptions) {
// The 0.0.3 managed exception only has one thread, so we want it to be active and set crashed to true.
var active = new JProperty ("active", first_exception ? "true" : "false");
first_exception = false;
var name = "Caught Managed Exception";
var exception_thread = new JObject (active, new JProperty ("crashed", "true"), new JProperty ("name", name), new JProperty ("id", name), new JProperty ("exception", exc_input));
var exception_exc = new JObject(new JProperty("module", name),
new JProperty("type", path),
new JProperty("value", ""),
new JProperty("stacktrace", exc_input ["frames"]));
thread_objs.Add (exception_thread);
exc_objs.Add (exception_exc);
}
}
var exception = new JProperty("exception", new JObject (new JProperty ("values", new JArray(exc_objs.ToArray ()))));
var threads = new JProperty("threads", new JObject (new JProperty ("values", new JArray(thread_objs.ToArray ()))));
// Bake in the whole blob
var embedded = new JProperty("extra", payload);
var fingerprint = new JProperty ("fingerprint", new JArray (new JValue (hash)));
var sentry_message = new JObject (timestamp, event_id, exception, embedded, threads, fingerprint);
return sentry_message;
}
public JObject Format_0_0_2 (string fileName, JObject payload, string hash)
{
var event_id = new JProperty("event_id", Guid.NewGuid().ToString("n"));
@@ -183,7 +379,7 @@ namespace UploadToSentry
var path = Path.GetDirectoryName (fileName); // Best differentiator in-tree for files is where they are run from
for (int i=0; i < stackTraces.Count; i++){
var thread_id = stackTraces[i]["native_thread_id"].ToString();
var thread_id = stackTraces[i]["native_thread_id"]?.ToString();
var unmanaged_frames = new List<JObject>();
var managed_frames = new List<JObject>();
@@ -337,7 +533,9 @@ namespace UploadToSentry
Console.WriteLine("\t-- HTTP POST Success {0}", responseFromServer);
// Clean up the streams.
} catch (WebException ex) {
Console.WriteLine("\t-- HTTP POST Error {0}", ex.Response.Headers [""]);
Console.WriteLine("\t-- HTTP POST Error:", ex.Response.Headers [""]);
for (int i=0; i < ex.Response.Headers.Count; i++)
Console.WriteLine("\t\t {0} : {1}", ex.Response.Headers.Keys [i], ex.Response.Headers [i]);
}
}
@@ -363,7 +561,9 @@ namespace UploadToSentry
var version_string = payload["protocol_version"].ToString();
JObject sentry_message = null;
if (version_string == "0.0.2") {
if (version_string == "0.0.3") {
sentry_message = Format_0_0_3 (filePath, payload, hash);
} else if (version_string == "0.0.2") {
sentry_message = Format_0_0_2 (filePath, payload, hash);
} else {
Console.WriteLine ("ERROR: Crash reporting version mismatch");
+4
View File
@@ -19,6 +19,10 @@
#define G_HAVE_ALLOCA_H
#endif
#if @HAVE_UNISTD_H@ == 1
#define G_HAVE_UNISTD_H
#endif
typedef @GSIZE@ gsize;
typedef @GSSIZE@ gssize;
+7
View File
@@ -120,6 +120,7 @@
#define g_markup_parse_context_parse monoeg_g_markup_parse_context_parse
#define g_memdup monoeg_g_memdup
#define g_mem_set_vtable monoeg_g_mem_set_vtable
#define g_mem_get_vtable monoeg_g_mem_get_vtable
#define g_mkdtemp monoeg_g_mkdtemp
#define g_module_build_path monoeg_g_module_build_path
#define g_module_close monoeg_g_module_close
@@ -132,6 +133,10 @@
#define g_pattern_match_string monoeg_g_pattern_match_string
#define g_pattern_spec_free monoeg_g_pattern_spec_free
#define g_pattern_spec_new monoeg_g_pattern_spec_new
#define g_async_safe_fprintf monoeg_g_async_safe_fprintf
#define g_async_safe_vfprintf monoeg_g_async_safe_vfprintf
#define g_async_safe_printf monoeg_g_async_safe_printf
#define g_async_safe_vprintf monoeg_g_async_safe_vprintf
#define g_print monoeg_g_print
#define g_printf monoeg_g_printf
#define g_printerr monoeg_g_printerr
@@ -268,6 +273,8 @@
#define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
#define g_vasprintf monoeg_g_vasprintf
#define g_win32_getlocale monoeg_g_win32_getlocale
#define g_assertion_disable_global monoeg_assertion_disable_global
#define g_assert_abort monoeg_assert_abort
#define g_assertion_message monoeg_assertion_message
#define g_get_assertion_message monoeg_get_assertion_message
#define g_malloc monoeg_malloc
+51
View File
@@ -54,6 +54,10 @@
#include <malloc.h>
#endif
#ifdef G_HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef offsetof
# define offsetof(s_name,n_name) (size_t)(char *)&(((s_name*)0)->m_name)
#endif
@@ -304,6 +308,7 @@ typedef struct {
} GMemVTable;
void g_mem_set_vtable (GMemVTable* vtable);
void g_mem_get_vtable (GMemVTable* vtable);
struct _GMemChunk {
guint alloc_size;
@@ -762,7 +767,10 @@ const char * g_get_assertion_message (void);
typedef void (*GLogFunc) (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
typedef void (*GPrintFunc) (const gchar *string);
typedef void (*GAbortFunc) (void);
void g_assertion_disable_global (GAbortFunc func);
void g_assert_abort (void);
void g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data);
GLogFunc g_log_set_default_handler (GLogFunc log_func, gpointer user_data);
GPrintFunc g_set_print_handler (GPrintFunc func);
@@ -1119,6 +1127,49 @@ gboolean g_file_test (const gchar *filename, GFileTest test);
gchar *g_mkdtemp (gchar *tmpl);
/*
* Low-level write-based printing functions
*/
static inline gint
g_async_safe_vfprintf (int handle, gchar const *format, va_list args)
{
char print_buff [1024];
print_buff [0] = '\0';
g_vsnprintf (print_buff, sizeof(print_buff), format, args);
int ret = g_write (handle, print_buff, (guint32) strlen (print_buff));
return ret;
}
static inline gint
g_async_safe_fprintf (int handle, gchar const *format, ...)
{
va_list args;
va_start (args, format);
int ret = g_async_safe_vfprintf (handle, format, args);
va_end (args);
return ret;
}
static inline gint
g_async_safe_vprintf (gchar const *format, va_list args)
{
return g_async_safe_vfprintf (1, format, args);
}
static inline gint
g_async_safe_printf (gchar const *format, ...)
{
va_list args;
va_start (args, format);
int ret = g_async_safe_vfprintf (1, format, args);
va_end (args);
return ret;
}
/*
* Pattern matching
*/
+12
View File
@@ -48,12 +48,24 @@ g_mem_set_vtable (GMemVTable* vtable)
sGMemVTable.free = vtable->free ? vtable->free : free;
}
void
g_mem_get_vtable (GMemVTable* vtable)
{
*vtable = sGMemVTable;
}
#define G_FREE_INTERNAL sGMemVTable.free
#define G_REALLOC_INTERNAL sGMemVTable.realloc
#define G_CALLOC_INTERNAL sGMemVTable.calloc
#define G_MALLOC_INTERNAL sGMemVTable.malloc
#else
void
g_mem_get_vtable (GMemVTable* vtable)
{
memset (vtable, 0, sizeof (*vtable));
}
void
g_mem_set_vtable (GMemVTable* vtable)
{
+25 -4
View File
@@ -40,6 +40,23 @@ static GPrintFunc stdout_handler, stderr_handler;
static void default_stdout_handler (const gchar *string);
static void default_stderr_handler (const gchar *string);
static GAbortFunc internal_abort_func;
void
g_assertion_disable_global (GAbortFunc abort_func)
{
internal_abort_func = abort_func;
}
void
g_assert_abort (void)
{
if (internal_abort_func)
internal_abort_func ();
else
abort ();
}
void
g_printv (const gchar *format, va_list args)
{
@@ -122,8 +139,12 @@ g_logv_nofree (const gchar *log_domain, GLogLevelFlags log_level, const gchar *f
{
char *msg;
if (g_vasprintf (&msg, format, args) < 0)
if (internal_abort_func) {
g_async_safe_vprintf (format, args);
return NULL;
} else if (g_vasprintf (&msg, format, args) < 0) {
return NULL;
}
g_logstr (log_domain, log_level, msg);
return msg;
@@ -236,7 +257,7 @@ g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const
{
android_log (to_android_priority (log_level), log_domain, message);
if (log_level & fatal)
abort ();
g_assert_abort ();
}
static void
@@ -277,7 +298,7 @@ g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const
{
asl_log (NULL, NULL, to_asl_priority (log_level), "%s", message);
if (log_level & fatal)
abort ();
g_assert_abort ();
}
static void
@@ -307,7 +328,7 @@ g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const
if (log_level & fatal) {
fflush (stdout);
fflush (stderr);
abort ();
g_assert_abort ();
}
}
+1 -1
View File
@@ -230,7 +230,7 @@ g_find_program_in_path (const gchar *program)
#endif
g_return_val_if_fail (program != NULL, NULL);
x = p = g_strdup (g_getenv ("PATH"));
x = p = g_getenv ("PATH");
if (x == NULL || *x == '\0') {
curdir = g_get_current_dir ();
+2 -1
View File
@@ -20,6 +20,7 @@
#include "cil-coff.h"
#include "metadata-internals.h"
#include "image.h"
#include "image-internals.h"
#include "assembly-internals.h"
#include "domain-internals.h"
#include "appdomain.h"
@@ -132,7 +133,7 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes
/* The process is terminating. */
return TRUE;
file_name = mono_get_module_file_name (hInst);
image = mono_image_loaded (file_name);
image = mono_image_loaded_internal (file_name, FALSE);
if (image)
mono_image_close (image);
File diff suppressed because it is too large. Load diff
+5 -1
View File
@@ -660,7 +660,11 @@ mono_get_exception_argument_internal (const char *type, const char *arg, const c
MonoException*
mono_get_exception_argument_null (const char *arg)
{
return mono_get_exception_argument_internal ("ArgumentNullException", arg, NULL);
MonoException *ex;
MONO_ENTER_GC_UNSAFE;
ex = mono_get_exception_argument_internal ("ArgumentNullException", arg, NULL);
MONO_EXIT_GC_UNSAFE;
return ex;
}
/**
+1 -1
View File
@@ -100,7 +100,7 @@ mono_get_exception_not_implemented (const char *msg);
MONO_API MonoException *
mono_get_exception_not_supported (const char *msg);
MONO_API MonoException*
MONO_API MONO_RT_EXTERNAL_ONLY MonoException*
mono_get_exception_argument_null (const char *arg);
MONO_API MonoException *
+7 -4
View File
@@ -133,17 +133,20 @@ HANDLES(COMPROX_2, "FindProxy", ves_icall_Mono_Interop_ComInteropProxy_FindProxy
ICALL_TYPE(TLS_PROVIDER_FACTORY, "Mono.Net.Security.MonoTlsProviderFactory", TLS_PROVIDER_FACTORY_1)
HANDLES(TLS_PROVIDER_FACTORY_1, "IsBtlsSupported", ves_icall_Mono_TlsProviderFactory_IsBtlsSupported, MonoBoolean, 0, ())
ICALL_TYPE(RUNTIME, "Mono.Runtime", RUNTIME_1)
ICALL_TYPE(RUNTIME, "Mono.Runtime", RUNTIME_20)
HANDLES(RUNTIME_20, "AnnotateMicrosoftTelemetry_internal", ves_icall_Mono_Runtime_AnnotateMicrosoftTelemetry, void, 2, (const_char_ptr, const_char_ptr))
HANDLES(RUNTIME_19, "CheckCrashReportLog_internal", ves_icall_Mono_Runtime_CheckCrashReportingLog, int, 2, (const_char_ptr, MonoBoolean))
HANDLES(RUNTIME_1, "DisableMicrosoftTelemetry", ves_icall_Mono_Runtime_DisableMicrosoftTelemetry, void, 0, ())
HANDLES(RUNTIME_15, "DumpStateSingle_internal", ves_icall_Mono_Runtime_DumpStateSingle, MonoString, 2, (guint64_ref, guint64_ref))
HANDLES(RUNTIME_16, "DumpStateTotal_internal", ves_icall_Mono_Runtime_DumpStateTotal, MonoString, 2, (guint64_ref, guint64_ref))
HANDLES(RUNTIME_2, "EnableMicrosoftTelemetry_internal", ves_icall_Mono_Runtime_EnableMicrosoftTelemetry, void, 6, (char_ptr, char_ptr, char_ptr, char_ptr, char_ptr, char_ptr))
HANDLES(RUNTIME_18, "EnableCrashReportLog_internal", ves_icall_Mono_Runtime_EnableCrashReportingLog, void, 1, (const_char_ptr))
HANDLES(RUNTIME_2, "EnableMicrosoftTelemetry_internal", ves_icall_Mono_Runtime_EnableMicrosoftTelemetry, void, 7, (const_char_ptr, const_char_ptr, const_char_ptr, const_char_ptr, const_char_ptr, const_char_ptr, const_char_ptr))
HANDLES(RUNTIME_3, "ExceptionToState_internal", ves_icall_Mono_Runtime_ExceptionToState, MonoString, 3, (MonoException, guint64_ref, guint64_ref))
HANDLES(RUNTIME_4, "GetDisplayName", ves_icall_Mono_Runtime_GetDisplayName, MonoString, 0, ())
HANDLES(RUNTIME_12, "GetNativeStackTrace", ves_icall_Mono_Runtime_GetNativeStackTrace, MonoString, 1, (MonoException))
ICALL(RUNTIME_17, "RegisterReportingForNativeLib_internal", ves_icall_Mono_Runtime_RegisterReportingForNativeLib)
HANDLES(RUNTIME_13, "SendMicrosoftTelemetry_internal", ves_icall_Mono_Runtime_SendMicrosoftTelemetry, void, 3, (char_ptr, guint64, guint64))
HANDLES(RUNTIME_14, "WriteStateToFile_internal", ves_icall_Mono_Runtime_DumpTelemetry, void, 3, (char_ptr, guint64, guint64))
HANDLES(RUNTIME_13, "SendMicrosoftTelemetry_internal", ves_icall_Mono_Runtime_SendMicrosoftTelemetry, void, 3, (const_char_ptr, guint64, guint64))
HANDLES(RUNTIME_14, "WriteStateToFile_internal", ves_icall_Mono_Runtime_DumpTelemetry, void, 3, (const_char_ptr, guint64, guint64))
ICALL_TYPE(RTCLASS, "Mono.RuntimeClassHandle", RTCLASS_1)
HANDLES(RTCLASS_1, "GetTypeFromClass", ves_icall_Mono_RuntimeClassHandle_GetTypeFromClass, MonoType_ptr, 1, (MonoClass_ptr))
+114 -33
View File
@@ -781,7 +781,7 @@ ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* d
mono_value_copy_array_internal (dest, dest_idx, source_addr, length);
} else {
dest_addr = mono_array_addr_with_size_fast (dest, element_size, dest_idx);
mono_gc_memmove_atomic (dest_addr, source_addr, element_size * length);
mono_gc_memmove_atomic (dest_addr, source_addr, (size_t)element_size * length);
}
} else {
mono_array_memcpy_refs_fast (dest, dest_idx, source, source_idx, length);
@@ -5713,7 +5713,7 @@ ves_icall_Mono_RuntimeMarshal_FreeAssemblyName (MonoAssemblyName *aname, MonoBoo
void
ves_icall_Mono_Runtime_DisableMicrosoftTelemetry (MonoError *error)
{
#ifdef TARGET_OSX
#if defined(TARGET_OSX) && !defined(DISABLE_CRASH_REPORTING)
mono_merp_disable ();
#else
// Icall has platform check in managed too.
@@ -5722,10 +5722,23 @@ ves_icall_Mono_Runtime_DisableMicrosoftTelemetry (MonoError *error)
}
void
ves_icall_Mono_Runtime_EnableMicrosoftTelemetry (char *appBundleID, char *appSignature, char *appVersion, char *merpGUIPath, char *eventType, char *appPath, MonoError *error)
ves_icall_Mono_Runtime_AnnotateMicrosoftTelemetry (const char *key, const char *value, MonoError *error)
{
#ifdef TARGET_OSX
mono_merp_enable (appBundleID, appSignature, appVersion, merpGUIPath, eventType, appPath);
#if defined(TARGET_OSX) && !defined(DISABLE_CRASH_REPORTING)
if (!mono_merp_enabled ())
g_error ("Cannot add attributes to telemetry without enabling subsystem");
mono_merp_add_annotation (key, value);
#else
// Icall has platform check in managed too.
g_assert_not_reached ();
#endif
}
void
ves_icall_Mono_Runtime_EnableMicrosoftTelemetry (const char *appBundleID, const char *appSignature, const char *appVersion, const char *merpGUIPath, const char *eventType, const char *appPath, const char *configDir, MonoError *error)
{
#if defined(TARGET_OSX) && !defined(DISABLE_CRASH_REPORTING)
mono_merp_enable (appBundleID, appSignature, appVersion, merpGUIPath, eventType, appPath, configDir);
mono_get_runtime_callbacks ()->install_state_summarizer ();
#else
@@ -5734,41 +5747,50 @@ ves_icall_Mono_Runtime_EnableMicrosoftTelemetry (char *appBundleID, char *appSig
#endif
}
// Number derived from trials on relevant hardware.
// If it seems large, please confirm it's safe to shrink
// before doing so.
#define MONO_MAX_SUMMARY_LEN_ICALL 500000
MonoStringHandle
ves_icall_Mono_Runtime_ExceptionToState (MonoExceptionHandle exc_handle, guint64 *portable_hash_out, guint64 *unportable_hash_out, MonoError *error)
{
MonoStringHandle result;
#ifndef DISABLE_CRASH_REPORTING
// FIXME: Push handles down into mini/mini-exceptions.c
MonoException *exc = MONO_HANDLE_RAW (exc_handle);
MonoThreadSummary out;
mono_get_eh_callbacks ()->mono_summarize_exception (exc, &out);
if (mono_get_eh_callbacks ()->mono_summarize_exception) {
// FIXME: Push handles down into mini/mini-exceptions.c
MonoException *exc = MONO_HANDLE_RAW (exc_handle);
MonoThreadSummary out;
mono_get_eh_callbacks ()->mono_summarize_exception (exc, &out);
*portable_hash_out = (guint64) out.hashes.offset_free_hash;
*unportable_hash_out = (guint64) out.hashes.offset_rich_hash;
*portable_hash_out = (guint64) out.hashes.offset_free_hash;
*unportable_hash_out = (guint64) out.hashes.offset_rich_hash;
MonoStateWriter writer;
char *scratch = g_new0 (gchar, MONO_MAX_SUMMARY_LEN_ICALL);
mono_state_writer_init (&writer, scratch, MONO_MAX_SUMMARY_LEN_ICALL);
mono_native_state_init (&writer);
gboolean first_thread_added = TRUE;
mono_native_state_add_thread (&writer, &out, NULL, first_thread_added, TRUE);
char *output = mono_native_state_free (&writer, FALSE);
result = mono_string_new_handle (mono_domain_get (), output, error);
g_free (output);
g_free (scratch);
return result;
}
#endif
JsonWriter writer;
mono_json_writer_init (&writer);
mono_native_state_init (&writer);
gboolean first_thread_added = TRUE;
mono_native_state_add_thread (&writer, &out, NULL, first_thread_added, TRUE);
char *output = mono_native_state_free (&writer, FALSE);
result = mono_string_new_handle (mono_domain_get (), output, error);
g_free (output);
#else
*portable_hash_out = 0;
*unportable_hash_out = 0;
result = mono_string_new_handle (mono_domain_get (), "", error);
#endif
return result;
}
void
ves_icall_Mono_Runtime_SendMicrosoftTelemetry (char *payload, guint64 portable_hash, guint64 unportable_hash, MonoError *error)
ves_icall_Mono_Runtime_SendMicrosoftTelemetry (const char *payload, guint64 portable_hash, guint64 unportable_hash, MonoError *error)
{
#ifdef TARGET_OSX
#if defined(TARGET_OSX) && !defined(DISABLE_CRASH_REPORTING)
if (!mono_merp_enabled ())
g_error ("Cannot send telemetry without registering parameters first");
@@ -5782,7 +5804,11 @@ ves_icall_Mono_Runtime_SendMicrosoftTelemetry (char *payload, guint64 portable_h
// Tells mono that we want to send the HANG EXC_TYPE.
const char *signal = "SIGTERM";
mono_merp_invoke (crashed_pid, signal, payload, &hashes);
gboolean success = mono_merp_invoke (crashed_pid, signal, payload, &hashes);
if (!success) {
//g_assert_not_reached ();
mono_error_set_generic_error (error, "System", "Exception", "We were unable to start the Microsoft Error Reporting client.");
}
#else
// Icall has platform check in managed too.
g_assert_not_reached ();
@@ -5790,7 +5816,7 @@ ves_icall_Mono_Runtime_SendMicrosoftTelemetry (char *payload, guint64 portable_h
}
void
ves_icall_Mono_Runtime_DumpTelemetry (char *payload, guint64 portable_hash, guint64 unportable_hash, MonoError *error)
ves_icall_Mono_Runtime_DumpTelemetry (const char *payload, guint64 portable_hash, guint64 unportable_hash, MonoError *error)
{
#ifndef DISABLE_CRASH_REPORTING
MonoStackHash hashes;
@@ -5820,14 +5846,16 @@ ves_icall_Mono_Runtime_DumpStateSingle (guint64 *portable_hash, guint64 *unporta
*portable_hash = (guint64) this_thread.hashes.offset_free_hash;
*unportable_hash = (guint64) this_thread.hashes.offset_rich_hash;
JsonWriter writer;
mono_json_writer_init (&writer);
MonoStateWriter writer;
char *scratch = g_new0 (gchar, MONO_MAX_SUMMARY_LEN_ICALL);
mono_state_writer_init (&writer, scratch, MONO_MAX_SUMMARY_LEN_ICALL);
mono_native_state_init (&writer);
gboolean first_thread_added = TRUE;
mono_native_state_add_thread (&writer, &this_thread, NULL, first_thread_added, TRUE);
char *output = mono_native_state_free (&writer, FALSE);
result = mono_string_new_handle (mono_domain_get (), output, error);
g_free (output);
g_free (scratch);
#else
*portable_hash = 0;
*unportable_hash = 0;
@@ -5842,14 +5870,30 @@ void
ves_icall_Mono_Runtime_RegisterReportingForNativeLib (const char *path_suffix, const char *module_name)
{
#ifndef DISABLE_CRASH_REPORTING
mono_get_eh_callbacks ()->mono_register_native_library (path_suffix, module_name);
if (mono_get_eh_callbacks ()->mono_register_native_library)
mono_get_eh_callbacks ()->mono_register_native_library (path_suffix, module_name);
#endif
}
// Number derived from trials on relevant hardware.
// If it seems large, please confirm it's safe to shrink
// before doing so.
#define MONO_MAX_SUMMARY_LEN_ICALL 500000
void
ves_icall_Mono_Runtime_EnableCrashReportingLog (const char *directory, MonoError *error)
{
#ifndef DISABLE_CRASH_REPORTING
mono_summarize_set_timeline_dir (directory);
#endif
}
int
ves_icall_Mono_Runtime_CheckCrashReportingLog (const char *directory, MonoBoolean clear, MonoError *error)
{
int ret;
#ifndef DISABLE_CRASH_REPORTING
ret = (int) mono_summarize_timeline_read_level (directory, clear != 0);
#else
ret = 0;
#endif
return ret;
}
MonoStringHandle
ves_icall_Mono_Runtime_DumpStateTotal (guint64 *portable_hash, guint64 *unportable_hash, MonoError *error)
@@ -5866,7 +5910,10 @@ ves_icall_Mono_Runtime_DumpStateTotal (guint64 *portable_hash, guint64 *unportab
mono_get_runtime_callbacks ()->install_state_summarizer ();
mono_summarize_timeline_start ();
gboolean success = mono_threads_summarize (ctx, &out, &hashes, TRUE, FALSE, scratch, MONO_MAX_SUMMARY_LEN_ICALL);
mono_summarize_timeline_phase_log (MonoSummaryCleanup);
if (!success)
return mono_string_new_handle (mono_domain_get (), "", error);
@@ -5877,6 +5924,8 @@ ves_icall_Mono_Runtime_DumpStateTotal (guint64 *portable_hash, guint64 *unportab
// out is now a pointer into garbage memory
g_free (scratch);
mono_summarize_timeline_phase_log (MonoSummaryDone);
#else
*portable_hash = 0;
*unportable_hash = 0;
@@ -7323,31 +7372,51 @@ G_EXTERN_C gint32 WriteZStream (gpointer stream, gpointer buffer, gint32 lengt
gpointer
ves_icall_System_IO_Compression_DeflateStreamNative_CreateZStream (gint32 compress, MonoBoolean gzip, gpointer feeder, gpointer data)
{
#ifdef MONO_CROSS_COMPILE
return NULL;
#else
return CreateZStream (compress, gzip, feeder, data);
#endif
}
gint32
ves_icall_System_IO_Compression_DeflateStreamNative_CloseZStream (gpointer stream)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return CloseZStream (stream);
#endif
}
gint32
ves_icall_System_IO_Compression_DeflateStreamNative_Flush (gpointer stream)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return Flush (stream);
#endif
}
gint32
ves_icall_System_IO_Compression_DeflateStreamNative_ReadZStream (gpointer stream, gpointer buffer, gint32 length)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return ReadZStream (stream, buffer, length);
#endif
}
gint32
ves_icall_System_IO_Compression_DeflateStreamNative_WriteZStream (gpointer stream, gpointer buffer, gint32 length)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return WriteZStream (stream, buffer, length);
#endif
}
#endif
@@ -7804,6 +7873,18 @@ ves_icall_System_Runtime_InteropServices_RuntimeInformation_get_RuntimeArchitect
int
ves_icall_Interop_Sys_DoubleToString(double value, char *format, char *buffer, int bufferLength)
{
#if defined(TARGET_ARM)
/* workaround for faulty vcmp.f64 implementation on some 32bit ARM CPUs */
guint64 bits = *(guint64 *) &value;
if (bits == 0x1) { /* 4.9406564584124654E-324 */
g_assert (!strcmp (format, "%.40e"));
return snprintf (buffer, bufferLength, "%s", "4.9406564584124654417656879286822137236506e-324");
} else if (bits == 0x4) { /* 2E-323 */
g_assert (!strcmp (format, "%.40e"));
return snprintf (buffer, bufferLength, "%s", "1.9762625833649861767062751714728854894602e-323");
}
#endif
return snprintf(buffer, bufferLength, format, value);
}
+3
View File
@@ -8,6 +8,9 @@
#include <mono/metadata/image.h>
MonoImage*
mono_image_loaded_internal (const char *name, mono_bool refonly);
MonoImage *
mono_find_image_owner (void *ptr);
+43 -1
View File
@@ -35,6 +35,7 @@
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-io-portability.h>
#include <mono/utils/atomic.h>
#include <mono/utils/mono-proclib.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/object-internals.h>
@@ -42,6 +43,7 @@
#include <mono/metadata/verify-internals.h>
#include <mono/metadata/verify.h>
#include <mono/metadata/image-internals.h>
#include <mono/metadata/w32process-internals.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
@@ -1057,6 +1059,20 @@ pe_image_load_cli_data (MonoImage *image)
return TRUE;
}
static void
mono_image_load_time_date_stamp (MonoImage *image)
{
image->time_date_stamp = 0;
#ifndef HOST_WIN32
if (!image->name)
return;
gunichar2 *uni_name = g_utf8_to_utf16 (image->name, -1, NULL, NULL, NULL);
mono_pe_file_time_date_stamp (uni_name, &image->time_date_stamp);
g_free (uni_name);
#endif
}
void
mono_image_load_names (MonoImage *image)
{
@@ -1375,6 +1391,8 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status,
mono_image_load_names (image);
mono_image_load_time_date_stamp (image);
load_modules (image);
done:
@@ -1461,6 +1479,26 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status,
*/
MonoImage *
mono_image_loaded_full (const char *name, gboolean refonly)
{
MonoImage *result;
MONO_ENTER_GC_UNSAFE;
result = mono_image_loaded_internal (name, refonly);
MONO_EXIT_GC_UNSAFE;
return result;
}
/**
* mono_image_loaded_internal:
* \param name path or assembly name of the image to load
* \param refonly Check with respect to reflection-only loads?
*
* This routine verifies that the given image is loaded.
* It checks either reflection-only loads only, or normal loads only, as specified by parameter.
*
* \returns the loaded \c MonoImage, or NULL on failure.
*/
MonoImage *
mono_image_loaded_internal (const char *name, gboolean refonly)
{
MonoImage *res;
@@ -1482,7 +1520,11 @@ mono_image_loaded_full (const char *name, gboolean refonly)
MonoImage *
mono_image_loaded (const char *name)
{
return mono_image_loaded_full (name, FALSE);
MonoImage *result;
MONO_ENTER_GC_UNSAFE;
result = mono_image_loaded_internal (name, FALSE);
MONO_EXIT_GC_UNSAFE;
return result;
}
typedef struct {
+4 -2
View File
@@ -42,8 +42,10 @@ MONO_API MONO_RT_EXTERNAL_ONLY
MonoImage *mono_image_open_from_data_with_name (char *data, uint32_t data_len, mono_bool need_copy,
MonoImageOpenStatus *status, mono_bool refonly, const char *name);
MONO_API void mono_image_fixup_vtable (MonoImage *image);
MONO_API MonoImage *mono_image_loaded (const char *name);
MONO_API MonoImage *mono_image_loaded_full (const char *name, mono_bool refonly);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoImage *mono_image_loaded (const char *name);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoImage *mono_image_loaded_full (const char *name, mono_bool refonly);
MONO_API MonoImage *mono_image_loaded_by_guid (const char *guid);
MONO_API MonoImage *mono_image_loaded_by_guid_full (const char *guid, mono_bool refonly);
MONO_API void mono_image_init (MonoImage *image);
+1
View File
@@ -276,6 +276,7 @@ struct _MonoImage {
/* The module name reported in the file for this image (could be NULL for a malformed file) */
const char *module_name;
guint32 time_date_stamp;
char *version;
gint16 md_version_major, md_version_minor;
+2 -1
View File
@@ -15,6 +15,7 @@
#include <mono/metadata/appdomain.h>
#include <mono/metadata/image.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/image-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/security.h>
@@ -620,7 +621,7 @@ void mono_invoke_protected_memory_method (MonoArray *data, MonoObject *scope, gb
error_init (error);
if (system_security_assembly == NULL) {
system_security_assembly = mono_image_loaded ("System.Security");
system_security_assembly = mono_image_loaded_internal ("System.Security", FALSE);
if (!system_security_assembly) {
MonoAssemblyOpenRequest req;
mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT);
+16 -2
View File
@@ -469,6 +469,13 @@ typedef struct {
MonoArray *out_args;
} MonoAsyncCall;
typedef struct {
MonoObject obj;
MonoArray *frames;
MonoArray *captured_traces;
MonoBoolean debug_info;
} MonoStackTrace;
typedef struct {
MonoObject obj;
gint32 il_offset;
@@ -498,7 +505,7 @@ struct _MonoInternalThread {
gpointer unused3;
gunichar2 *name;
guint32 name_len;
guint32 state;
guint32 state; /* must be accessed while longlived->synch_cs is locked */
MonoException *abort_exc;
int abort_state_handle;
guint64 tid; /* This is accessed as a gsize in the code (so it can hold a 64bit pointer on systems that need it), but needs to reserve 64 bits of space on all machines as it corresponds to a field in managed code */
@@ -512,7 +519,10 @@ struct _MonoInternalThread {
gpointer appdomain_refs;
/* This is modified using atomic ops, so keep it a gint32 */
gint32 __interruption_requested;
MonoCoopMutex *synch_cs;
/* data that must live as long as this managed object is not finalized
* or as long as the underlying thread is attached, whichever is
* longer */
MonoLongLivedThreadData *longlived;
MonoBoolean threadpool_thread;
MonoBoolean thread_interrupt_requested;
int stack_size;
@@ -719,6 +729,7 @@ typedef struct {
gpointer (*create_ftnptr) (MonoDomain *domain, gpointer addr);
gpointer (*get_addr_from_ftnptr) (gpointer descr);
char* (*get_runtime_build_info) (void);
const char* (*get_runtime_build_version) (void);
gpointer (*get_vtable_trampoline) (MonoVTable *vtable, int slot_index);
gpointer (*get_imt_trampoline) (MonoVTable *vtable, int imt_slot_index);
gboolean (*imt_entry_inited) (MonoVTable *vtable, int imt_slot_index);
@@ -1841,6 +1852,9 @@ mono_unhandled_exception_checked (MonoObjectHandle exc, MonoError *error);
MonoVTable *
mono_class_try_get_vtable (MonoDomain *domain, MonoClass *klass);
gboolean
mono_runtime_run_module_cctor (MonoImage *image, MonoDomain *domain, MonoError *error);
gboolean
mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error);
+38 -20
View File
@@ -383,6 +383,38 @@ unref_type_lock (TypeInitializationLock *lock)
}
}
/**
* mono_runtime_run_module_cctor:
* \param image the image whose module ctor to run
* \param domain the domain to load the module class vtable in
* \param error set on error
* This routine runs the module ctor for \p image, if it hasn't already run
*/
gboolean
mono_runtime_run_module_cctor (MonoImage *image, MonoDomain *domain, MonoError *error) {
MONO_REQ_GC_UNSAFE_MODE;
if (!image->checked_module_cctor) {
mono_image_check_for_module_cctor (image);
if (image->has_module_cctor) {
MonoClass *module_klass;
MonoVTable *module_vtable;
module_klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | 1, error);
if (!module_klass) {
return FALSE;
}
module_vtable = mono_class_vtable_checked (domain, module_klass, error);
if (!module_vtable)
return FALSE;
if (!mono_runtime_class_init_full (module_vtable, error))
return FALSE;
}
}
return TRUE;
}
/**
* mono_runtime_class_init_full:
* \param vtable that neeeds to be initialized
@@ -412,23 +444,8 @@ mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error)
klass = vtable->klass;
MonoImage *klass_image = m_class_get_image (klass);
if (!klass_image->checked_module_cctor) {
mono_image_check_for_module_cctor (klass_image);
if (klass_image->has_module_cctor) {
MonoClass *module_klass;
MonoVTable *module_vtable;
module_klass = mono_class_get_checked (klass_image, MONO_TOKEN_TYPE_DEF | 1, error);
if (!module_klass) {
return FALSE;
}
module_vtable = mono_class_vtable_checked (vtable->domain, module_klass, error);
if (!module_vtable)
return FALSE;
if (!mono_runtime_class_init_full (module_vtable, error))
return FALSE;
}
if (!mono_runtime_run_module_cctor(klass_image, vtable->domain, error)) {
return FALSE;
}
method = mono_class_get_cctor (klass);
if (!method) {
@@ -3898,16 +3915,17 @@ mono_property_set_value_handle (MonoProperty *prop, MonoObjectHandle obj, void *
MonoObject*
mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc)
{
MONO_REQ_GC_UNSAFE_MODE;
MonoObject *val;
MONO_ENTER_GC_UNSAFE;
ERROR_DECL (error);
MonoObject *val = do_runtime_invoke (prop->get, obj, params, exc, error);
val = do_runtime_invoke (prop->get, obj, params, exc, error);
if (exc && *exc == NULL && !mono_error_ok (error)) {
*exc = (MonoObject*) mono_error_convert_to_exception (error);
} else {
mono_error_cleanup (error); /* FIXME don't raise here */
}
MONO_EXIT_GC_UNSAFE;
return val;
}
+1
View File
@@ -11,6 +11,7 @@
#define MONO_SEQ_POINT_FLAG_NONEMPTY_STACK 1
#define MONO_SEQ_POINT_FLAG_EXIT_IL 2
#define MONO_SEQ_POINT_FLAG_NESTED_CALL 4
/* IL offsets used to mark the sequence points belonging to method entry/exit events */
#define METHOD_ENTRY_IL_OFFSET -1
+2 -2
View File
@@ -112,11 +112,11 @@ sgen_client_stop_world (int generation, gboolean serial_collection)
MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED, generation, serial_collection));
update_current_thread_stack (&generation);
/* We start to scan after locks are taking, this ensures we won't be interrupted. */
sgen_process_togglerefs ();
update_current_thread_stack (&generation);
sgen_global_stop_count++;
SGEN_LOG (3, "stopping world n %d from %p %p", sgen_global_stop_count, mono_thread_info_current (), (gpointer) (gsize) mono_native_thread_id_get ());
TV_GETTIME (stop_world_time);
+28 -4
View File
@@ -106,6 +106,20 @@ mono_thread_create_internal_handle (MonoDomain *domain, T func, gpointer arg, Mo
}
#endif
/* Data owned by a MonoInternalThread that must live until both the finalizer
* for MonoInternalThread has run, and the underlying machine thread has
* detached.
*
* Normally a thread is first detached and then the InternalThread object is
* finalized and collected. However during shutdown, when the root domain is
* finalized, all the InternalThread objects are finalized first and the
* machine threads are detached later.
*/
typedef struct {
MonoRefCount ref;
MonoCoopMutex *synch_cs;
} MonoLongLivedThreadData;
void mono_threads_install_cleanup (MonoThreadCleanupFunc func);
ICALL_EXPORT
@@ -542,6 +556,7 @@ mono_set_pending_exception_handle (MonoExceptionHandle exc);
#define MONO_MAX_THREAD_NAME_LEN 140
#define MONO_MAX_SUMMARY_THREADS 32
#define MONO_MAX_SUMMARY_FRAMES 80
#define MONO_MAX_SUMMARY_EXCEPTIONS 15
typedef struct {
gboolean is_managed;
@@ -557,7 +572,9 @@ typedef struct {
// symbolicated string on release builds
const char *name;
#endif
const char *filename;
guint32 image_size;
guint32 time_date_stamp;
} managed_data;
struct {
intptr_t ip;
@@ -568,6 +585,13 @@ typedef struct {
} unmanaged_data;
} MonoFrameSummary;
typedef struct {
MonoClass *managed_exc_type;
int num_managed_frames;
MonoFrameSummary managed_frames [MONO_MAX_SUMMARY_FRAMES];
} MonoExcSummary;
typedef struct {
guint64 offset_free_hash;
guint64 offset_rich_hash;
@@ -589,7 +613,6 @@ typedef struct {
char name [MONO_MAX_THREAD_NAME_LEN];
intptr_t managed_thread_ptr;
intptr_t info_addr;
intptr_t native_thread_id;
@@ -603,12 +626,13 @@ typedef struct {
int num_unmanaged_frames;
MonoFrameSummary unmanaged_frames [MONO_MAX_SUMMARY_FRAMES];
int num_exceptions;
MonoExcSummary exceptions [MONO_MAX_SUMMARY_EXCEPTIONS];
MonoStackHash hashes;
MonoContext *ctx;
MonoContext ctx_mem;
MonoClass *managed_exc_type;
} MonoThreadSummary;
gboolean
Loaded 100 of 195 files, more files were not shown because too many files have changed in this diff. Show more