Compare commits

...
51 Commits
Author SHA1 Message Date
monojenkins 3a07bd426d [2018-08] [arm64] Correct exception filter stack frame size (#14769)
[2018-08] [arm64] Correct exception filter stack frame size

Fixes: https://github.com/mono/mono/issues/14170
Fixes: https://github.com/xamarin/xamarin-android/issues/3112

The `call_filter()` function generated by `mono_arch_get_call_filter()`
was overwriting a part of the previous stack frame because it was not
creating a large enough new stack frame for itself.  This had been
working by luck before the switch to building the runtime with Android
NDK r19.

I used a local build of [xamarin/xamarin-android/d16-1@87a80b][0] to
verify that this change resolved both of the issues linked above.  I
also confirmed that I was able to reintroduce the issues in my local
environment by removing the change and rebuilding.

After this change, the generated `call_filter()` function now starts by
reserving sufficient space on the stack to hold a 64-bit value at the
`ctx_offset` location.  The 64-bit `ctx` value is saved to the
`ctx_offset` location (offset 344 in the new stack frame) shortly
afterwards:

    stp	x29, x30, [sp,#-352]!
    mov	x29, sp
    str	x0, [x29,#344]

As expected, the invocation of `call_filter()` now no longer modifies
the top of the previous stack frame.

Top of the stack before `call_filter()`:

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

Top of the stack after `call_filter()` (unchanged):

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

<details>
<summary>Additional background information</summary>

### The original lucky, "good" behavior for [mono/mono/2018-08@725ba2a built with Android NDK r14][1]

 1. The `resume` parameter for `mono_handle_exception_internal()` is
    held in register `w23`.

 2. That register is saved into the current stack frame at offset 20 by
    a `str` instruction:

           0x00000000000bc1bc <+3012>:	str	w23, [sp,#20]

 3. `handle_exception_first_pass()` invokes `call_filter()` via a `blr`
    instruction:

        2279							filtered = call_filter (ctx, ei->data.filter);
           0x00000000000bc60c <+4116>:	add	x9, x22, x24, lsl #6
           0x00000000000bc610 <+4120>:	ldr	x8, [x8,#3120]
           0x00000000000bc614 <+4124>:	ldr	x1, [x9,#112]
           0x00000000000bc618 <+4128>:	add	x0, sp, #0x110
           0x00000000000bc61c <+4132>:	blr	x8

    Before the `blr` instruction, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x0a8b31d8	0x00000071
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

 4. `call_filter()` runs.  This function is generated by
    `mono_arch_get_call_filter()` and starts with:

           stp	x29, x30, [sp,#-336]!
           mov	x29, sp
           str	x0, [x29,#344]

    Note in particular how the first line subtracts 336 from `sp` to
    start a new stack frame, but the third line writes to a position
    that is 344 bytes beyond that, back within the *previous* stack
    frame.

 5. After the invocations of `call_filter()` and
    `handle_exception_first_pass()`, `w23` is restored from the stack:

           0x00000000000bc820 <+4648>:	ldr	w23, [sp,#20]

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

    Notice how `call_filter()` has overwritten bytes 8 through 15 of the
    stack frame.  In this original lucky scenario, this does not affect
    the value restored into register `w23` because that value starts at
    byte 20.

 6. `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000bb960 <+872>:	cbz	w23, 0xbb9c4 <mono_handle_exception_internal+972>

    Since `w23` is `0`, `mono_handle_exception_internal()` correctly
    continues into the `else` branch.

### The bad behavior for [mono/mono/2018-08@725ba2a built with Android NDK r19][2] works slightly differently

 1. As before, the local `resume` parameter starts in register `w23`.
 2. This time, the register is saved into the stack frame at offset 12
    (instead of 20):

           0x00000000000bed7c <+3200>:	str	w23, [sp,#12]

 3. As before, `handle_exception_first_pass()` invokes `call_filter()`
    via a `blr` instruction.

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

 4. `call_filter()` runs as before.  And the first few instructions of
    that function are the same as before:

        stp	x29, x30, [sp,#-336]!
        mov	x29, sp
        str	x0, [x29,#344]

 5. `w23` is again restored from the stack, but this time from offset 12:

           0x00000000000bf2c0 <+4548>:	ldr	w23, [sp,#12]

    The problem is that `call_filter()` has again overwritten bytes 8
    through 15 of the stack frame:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

    So after the `ldr` instruction, `w23` has an incorrect value of
    `0x7f` rather than the correct value `0`.

 6. As before, `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000be430 <+820>:	cbz	w23, 0xbe834 <mono_handle_exception_internal+1848>

    But this time because `w23` is *not* zero, execution continues
    *incorrectly* into the `if` branch rather than the `else` branch.
    The result is that `ji` is set to `0` rather than a valid
    `(MonoJitInfo *)` value.  This incorrect value for `ji` leads to a
    null pointer dereference, as seen in the bug reports.

[0]: https://github.com/xamarin/xamarin-android/tree/xamarin-android-9.3.0.22
[1]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1432/Azure/
[2]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1436/Azure/

</details>

Backport of #14757.

/cc @lambdageek @brendanzagaeski
2019-06-03 14:26:18 -04:00
monojenkins 223ea7ef92 Bump API snapshot submodule 2019-05-10 11:09:54 +02:00
Marek Safar 913c11def5 [Facades] Include missing enums in System.Memory 2019-05-10 11:09:54 +02:00
Thays Grazia 6843da5c57 A deadlock happens when during a process_suspend there is a pending invoke and then when it's calling the invoke there is another call to process_suspend in the same thread. 2019-05-10 10:29:55 +02:00
Ankit Jain 167f04c902 Bump msbuild to track mono-2018-08 (#14396)
* Bump msbuild to track mono-2018-08

* Update nuget version
   (Thanks for @lewing)
2019-05-08 15:04:30 -04:00
Ankit Jain 082e1a2346 Bump msbuild to track mono-2018-08 2019-04-30 18:19:54 +02:00
Alexander Köplinger 18fde9f8c2 Fix Windows MSI build
(cherry picked from commit 8aaf420efe)
2019-04-29 13:53:21 -04:00
Alexander Köplinger ea8ae3e8e0 More Windows MSI fixes
(cherry picked from commit e0326df7c6)
(cherry picked from commit 04dc2f342c)
2019-04-29 13:53:11 -04:00
Alexander Köplinger d1b7bf2c47 Fix Windows MSI build, msbuild is now in Current instead of 15.0
(cherry picked from commit 0ae04b8e80)
2019-04-29 13:52:55 -04:00
monojenkins 3cb36842fc [corlib] Disable four tests in TypeTest (#14213)
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-04-25 11:13:51 +02:00
Zoltan Varga 6c9921e64b [jit] Avoid an assert when gsharedvt enums are boxed.
Fixes https://github.com/mono/mono/issues/13297.
2019-04-24 11:17:17 +02:00
Ankit Jain 4d857ac249 Bump msbuild to track mono-2018-08 (#14068)
To pick up update for the NuGetSdkResolver: https://github.com/mono/msbuild/pull/92
2019-04-17 00:35:05 +02:00
Ankit Jain a2d28226d4 [nuget] Bump to nuget 5.0.0 2019-04-12 08:14:22 +02:00
Ankit Jain 592c75cf1f Bump msbuild to track mono-2018-08-test (#13927)
Bump to get the msbuild 16 update
<!--
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
-->
2019-04-12 08:09:15 +02:00
Zoltan Varga 3f5ec6d95c [jit] Make dlmalloc use mono_valloc so it picks up the MAP_JIT flag on osx.
Fixes https://github.com/mono/mono/issues/13878.
2019-04-11 18:02:31 +02:00
monojenkins bf4e8d2ae1 [debugger-agent] Ignore thread_end event if thread is detached (#13937)
The thread_stopped profiler event can be raised by the thread_info_key_dtor tls
key destructor when the thread is already doesn't have a domain set.  In that
case, don't call process_profiler_event since it cannot handle a thread with
null TLS values.

Addresses https://github.com/xamarin/xamarin-android/issues/2920
with the following stack trace

```
* thread #20, name = 'Filter', stop reason = signal SIGSEGV: invalid address (fault address: 0xbc)
  * frame #0: libmonosgen-2.0.so`mono_class_vtable_checked(domain=0x0000000000000000, klass=0x0000007200230648, error=0x00000071e92f9178) at object.c:1890
    frame #1: libmonosgen-2.0.so`get_current_thread_ptr_for_domain(domain=0x0000000000000000, thread=0x00000071ebfec508) at threads.c:595
    frame #2: libmonosgen-2.0.so`mono_thread_current at threads.c:1939
    frame #3: libmonosgen-2.0.so`process_event(event=<unavailable>, arg=<unavailable>, il_offset=<unavailable>, ctx=<unavailable>, events=<unavailable>, suspend_policy=<unavailable>) at debugger-agent.c:3715
    frame #4: libmonosgen-2.0.so`thread_end [inlined] process_profiler_event(event=EVENT_KIND_THREAD_DEATH, arg=0x00000071ebfec508) at debugger-agent.c:3875
    frame #5: libmonosgen-2.0.so`thread_end(prof=<unavailable>, tid=<unavailable>) at debugger-agent.c:3991
    frame #6: libmonosgen-2.0.so`mono_profiler_raise_thread_stopped(tid=<unavailable>) at profiler-events.h:105
    frame #7: libmonosgen-2.0.so`mono_thread_detach_internal(thread=<unavailable>) at threads.c:979
    frame #8: libmonosgen-2.0.so`thread_detach(info=0x00000071e949a000) at threads.c:3215
    frame #9: libmonosgen-2.0.so`unregister_thread(arg=<unavailable>) at mono-threads.c:544
    frame #10: libmonosgen-2.0.so`thread_info_key_dtor(arg=0x00000071e949a000) at mono-threads.c:774
    frame #11: 0x00000072899c58e8 libc.so`pthread_key_clean_all() + 124
    frame #12: 0x00000072899c5374 libc.so`pthread_exit + 76
    frame #13: 0x00000072899c5264 libc.so`__pthread_start(void*) + 44
    frame #14: 0x000000728996617c libc.so`__start_thread + 72
```
2019-04-09 10:37:47 -04:00
Alexander Köplinger ca30169e75 Bump bockbuild to get GTK fix (#13912) (#13919)
https://github.com/mono/bockbuild/pull/93
2019-04-08 15:57:49 +02:00
Alexander Köplinger 7fb1361513 [MacSDK] Bump bockbuild for fix to #13804 2019-04-08 11:52:41 +02:00
Alexander Kyte f236105056 [2018-08] [merp] Fix image size reported (#13886)
Fixes #13834

Backport of #13847.
2019-04-06 02:03:25 +02:00
Maxim Lipnin 4b020ca06d Fix transition offset logic (#13553)
I'm not sure about the correctness of this workaround but it works on macOS for the repro from https://github.com/mono/mono/issues/9664#issuecomment-472260968

Transition bounds used by time zone info represent some local date-time but actually they are of Unspecified date-time kind. 
When we try to get transition offset we compare some current date-time converted to UTC with appropriate transition bounds.
The fix is to use UTC for both current date-time and transition bounds during comparing.

Fixes https://github.com/mono/mono/issues/9664
2019-04-02 19:22:21 +02:00
Zoltan Varga e475d80db3 [llvm] Fix the computation of size of gshared instances in another place.
Fixes https://github.com/mono/mono/issues/13610.
2019-03-29 13:40:12 +01:00
Aleksey Kliger (λgeek) c87a95ea23 [llvm] Fix the computation of size of gshared instances in emit_args_to_vtype (). (#13675)
Fixes https://github.com/mono/mono/issues/13610.
2019-03-26 14:54:01 -04:00
Bernhard Urban 75282c430b [amd64] use 32bit variant of lea_membase for 32bit operations
Consider
```
 xor %r15, %r15       // %r15 = 0x0
 dec %r15d            // %r15 = 0xffff_ffff
 lea 0x1(%r15), %rdx  // %rdx = 0x1_0000_0000 but should be 0x0
```

instead `lea 0x1(%r15), %edx` should be generated.
2019-03-26 14:51:56 +01:00
Thays Grazia 5756d04e1d [debugger] Adding a comment to make it clear for the next debuggers. 2019-03-22 19:59:07 +01:00
Thays Grazia 484ce49a0b [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-22 19:59:07 +01:00
Thomas Lehner 6a81d1dd5f [System] Fix a race condition in HttpRequestChannel.
Concurrent request completions could cause following exception:

    FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException:
        Index was out of range. Must be non-negative and less than
        the size of the collection.
        Parameter name: index
       at System.Collections.Generic.List`1[T].RemoveAt (System.Int32 index) [0x00009] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Collections.Generic.List`1[T].Remove (T item) [0x0000c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Cleanup () [0x00011] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.set_IsCompleted (System.Boolean value) [0x00034] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Complete (System.Exception ex) [0x0001a] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+<>c__DisplayClass7_1.<BeginProcessRequest>b__0 (System.IAsyncResult r) [0x000bd] in <28c4695205ef47378f5370502b066592>:0

    This stack was captured after some changes in AwaitTaskContinuation.RunOrScheduleAction.
    Unfortunately the current implementation of AwaitTaskContinuation.RunOrScheduleAction re-throws the above
    exception with a wrong stack:

       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageTwo () [0x000a1] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.Finish (System.Boolean bUserDelegateExecuted) [0x00003] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException (System.Exception exception) [0x00029] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.HttpWebRequest+<RunWithTimeoutWorker>d__241`1[T].MoveNext () [0x000e0] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00024] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) [0x0004f] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetResult (TResult result) [0x0003d] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.ServicePointScheduler+<WaitAsync>d__45.MoveNext () [0x000f7] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0

    On an Android Xamarin installation this causes an app crash. Since no user code is active the exception cannot be caught.
2019-03-21 11:28:57 +01:00
Alexander Kyte fdb26b0a44 [merp] Fix anon allocation, use MAP_PRIVATE 2019-03-20 13:57:41 +01:00
Alexander Kyte 82547c4a12 [crash] Fallback to MAP_ANONYMOUS for allocator
This is helpful by allowing the crash reporter to work even while
unable to write to the working directory.
2019-03-19 16:34:56 +01:00
Alexander Köplinger 693806ceda Bump bockbuild for GTK fix 2019-03-19 07:58:33 +01:00
Jo Shields 9cb3348c31 Append .1 to version number 2019-03-14 16:18:00 -04:00
Jo Shields 948b450991 Include libgdiplus 5.6.1
(cherry picked from commit 5888bf9acc)
2019-03-14 16:14:40 -04:00
Alexis Christoforides 60e60904ac [MacSDK] Bump Nuget to 4.8.2 2019-03-12 22:37:15 +01:00
Alexander Köplinger 89d7665e28 [2018-08] Bump bockbuild to get GTK fix (#13329)
See https://github.com/mono/bockbuild/pull/90
2019-03-06 23:36:48 +01:00
Zoltan Varga c47ab60cc4 [llvm] Emit target layout/target triple into bitcode files. (#13327)
Fixes https://github.com/mono/mono/issues/12307 for 2018-08.
2019-03-06 13:38:02 -05:00
monojenkins 7ad1871886 [2018-08] Clean up .o files from System.Native during make dist (#13256)
* Clean up .o files from System.Native during `make dist`

Closes: https://github.com/mono/mono/issues/11501

* Delete more useless binary cruft from `make dist`
2019-03-02 03:02:37 +01:00
Alexander Köplinger 56906e2376 Bump api-snapshot submodule
Gets in the API Diff change for https://github.com/mono/mono/commit/5dd1c19b53dd43ba55b6ea649dc3809b0ae4f057
2019-03-01 21:08:40 +01:00
Alexander Köplinger 6ed7152fc8 [sdks] Use throttle() instead of lock()
The former works in freestyle builds.

(cherry picked from commit 98e0f2697d)
2019-03-01 14:49:30 +01:00
Alexander Köplinger 68aad3b0eb [ci] Use dl.internalx.com when building on private Jenkins
(cherry picked from commit 9d4aa950aa)
2019-02-26 11:21:29 +01:00
Martin Baulig 5dd1c19b53 Make System.dll internals visible to Mono.Android. 2019-02-25 14:14:46 +01:00
Alexander Köplinger 29eb176dd9 Bump bockbuild for GTK fix
See https://github.com/mono/bockbuild/pull/84
2019-02-20 17:30:36 +01:00
Maxim Lipnin 45e519e9df use for loop to access item values and avoid InvalidCastException which occurs because VirtualDirectoryMappingCollection enumerator returns key and it's not expected 2019-02-19 23:12:00 +01:00
Alexander Kyte de14ec6c78 [2018-08] Add more detailed reporting for exceptions (#13012)
* [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-15 11:10:55 -05:00
Alexander Köplinger b041669258 [ci] Bump bockbuild to get fontconfig download url fix 2019-02-11 16:47:52 +01:00
monojenkins d2e33f5f5c [2018-08] [interp] Add method to seq_points table after we finish registering it (#12906)
* [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:00 -05:00
monojenkins 32f1873983 [interp] Fix ldelema (#12930)
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:08:13 -05:00
Alexander Köplinger bbf2394619 [ci] Support building the OSX .pkg on private Jenkins
(cherry picked from commit 7f5125179d)
2019-02-09 20:22:09 +01:00
monojenkins 98810acba1 [runtime] Fix building older runtimes with newer system Mono (#12574)
What was happening was that this was building with a Mono.Cecil from
the build profile, but was trying to load the system Mono.Cecil.

Those versions mismatch when building 2018-08 with a nightly mono that is 5.23.0.

Rather than messing with the MONO_PATH and risking shadowing something
important there, I chose to copy the Mono.Cecil files into this
"lib/build/tmp" directory that we are using for the emitted executable.
It is loaded by the system Mono as the correct Mono.Cecil to use.

This fixes the build.
2019-02-09 00:10:34 +01:00
monojenkins d946a25079 [2018-08] [runtime] Fix mono_pe_file_map logging (#12897)
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-09 00:06:01 +01:00
Ludovic Henry 4d2b7f8b01 Merge pull request #12858 from monojenkins/backport-pr-12856-to-2018-08
[2018-08] [Registry] Prevent crash due to background thread facing problems in the file system
2019-02-08 15:44:49 -05:00
monojenkins 89fe6abeef [arm64] encode offset within stack slot for r4 in gsharedvt descriptor (#12885)
Follow up fix for https://github.com/mono/mono/pull/11741

Fixes https://github.com/mono/mono/issues/12831
2019-02-08 09:30:02 -05:00
Miguel de Icaza 9d21a2bb15 [Registry] Prevent crash due to background thread facing problems in the file system 2019-02-07 16:59:52 +00:00
47 changed files with 606 additions and 230 deletions

No files matched your search

+7
View File
@@ -42,6 +42,13 @@ dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -rf `find $(top_distdir)/external -path '*\.libs'`
rm -rf `find $(top_distdir)/external -path '*\.deps'`
rm -f `find $(top_distdir)/external -path '*\.o'`
rm -f `find $(top_distdir)/external -path '*\.so'`
rm -f `find $(top_distdir)/external -path '*\.lo'`
rm -f `find $(top_distdir)/external -path '*\.Plo'`
rm -f `find $(top_distdir)/external -name '\.dirstamp'`
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
rm -rf "$(top_distdir)/external/linker/linker/Tests"
+1 -1
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [5.18.0],
AC_INIT(mono, [5.18.1],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
@@ -33,8 +33,10 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryManager<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryHandle))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryPool<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.OperationStatus))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ReadOnlySequenceSegment<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ReadOnlySequence<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.StandardFormat))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Binary.BinaryPrimitives))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Utf8Formatter))]
@@ -41,7 +41,8 @@ namespace System.ServiceModel.Channels
{
HttpChannelFactory<IRequestChannel> source;
List<WebRequest> web_requests = new List<WebRequest> ();
object locker = new object();
List<WebRequest> web_requests = new List<WebRequest> (); //synced by locker
// Constructor
@@ -86,7 +87,12 @@ namespace System.ServiceModel.Channels
}
var web_request = (HttpWebRequest) HttpWebRequest.Create (destination);
web_requests.Add (web_request);
lock (locker)
{
web_requests.Add (web_request);
}
result.WebRequest = web_request;
web_request.Method = "POST";
web_request.ContentType = Encoder.ContentType;
@@ -350,9 +356,20 @@ namespace System.ServiceModel.Channels
protected override void OnAbort ()
{
foreach (var web_request in web_requests.ToArray ())
WebRequest[] current_web_requests;
lock (locker)
{
current_web_requests = web_requests.ToArray();
}
foreach (var web_request in current_web_requests)
web_request.Abort ();
web_requests.Clear ();
lock(locker)
{
web_requests.Clear ();
}
}
// Close
@@ -497,7 +514,10 @@ namespace System.ServiceModel.Channels
void Cleanup ()
{
owner.web_requests.Remove (WebRequest);
lock (owner.locker)
{
owner.web_requests.Remove (WebRequest);
}
}
}
}
@@ -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) {
@@ -82,3 +82,7 @@ using System.Runtime.InteropServices;
#if XAMMAC || XAMMAC_4_5
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
#if MONODROID
[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#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 ()
+39 -14
View File
@@ -769,7 +769,7 @@ namespace System
return GetUtcOffset (dateTimeOffset.UtcDateTime, out isDST);
}
private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST)
private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST, bool forOffset = false)
{
isDST = false;
@@ -781,7 +781,7 @@ namespace System
tz = TimeZoneInfo.Local;
bool isTzDst;
var tzOffset = GetUtcOffsetHelper (dateTime, tz, out isTzDst);
var tzOffset = GetUtcOffsetHelper (dateTime, tz, out isTzDst, forOffset);
if (tz == this) {
isDST = isTzDst;
@@ -792,11 +792,11 @@ namespace System
if (!TryAddTicks (dateTime, -tzOffset.Ticks, out utcDateTime, DateTimeKind.Utc))
return BaseUtcOffset;
return GetUtcOffsetHelper (utcDateTime, this, out isDST);
return GetUtcOffsetHelper (utcDateTime, this, out isDST, forOffset);
}
// This is an helper method used by the method above, do not use this on its own.
private static TimeSpan GetUtcOffsetHelper (DateTime dateTime, TimeZoneInfo tz, out bool isDST)
private static TimeSpan GetUtcOffsetHelper (DateTime dateTime, TimeZoneInfo tz, out bool isDST, bool forOffset = false)
{
if (dateTime.Kind == DateTimeKind.Local && tz != TimeZoneInfo.Local)
throw new Exception ();
@@ -807,7 +807,7 @@ namespace System
return TimeSpan.Zero;
TimeSpan offset;
if (tz.TryGetTransitionOffset(dateTime, out offset, out isDST))
if (tz.TryGetTransitionOffset(dateTime, out offset, out isDST, forOffset))
return offset;
if (dateTime.Kind == DateTimeKind.Utc) {
@@ -834,10 +834,12 @@ namespace System
if (tzRule != null && tz.IsInDST (tzRule, dateTime)) {
// Replicate what .NET does when given a time which falls into the hour which is lost when
// DST starts. isDST should always be true but the offset should be BaseUtcOffset without the
// DST starts. isDST should be false and the offset should be BaseUtcOffset without the
// DST delta while in that hour.
isDST = true;
if (forOffset)
isDST = true;
if (tz.IsInDST (tzRule, dstUtcDateTime)) {
isDST = true;
return tz.BaseUtcOffset + tzRule.DaylightDelta;
} else {
return tz.BaseUtcOffset;
@@ -946,7 +948,21 @@ namespace System
public bool IsDaylightSavingTime (DateTimeOffset dateTimeOffset)
{
return IsDaylightSavingTime (dateTimeOffset.DateTime);
var dateTime = dateTimeOffset.DateTime;
if (dateTime.Kind == DateTimeKind.Local && IsInvalidTime (dateTime))
throw new ArgumentException ("dateTime is invalid and Kind is Local");
if (this == TimeZoneInfo.Utc)
return false;
if (!SupportsDaylightSavingTime)
return false;
bool isDst;
GetUtcOffset (dateTime, out isDst, true);
return isDst;
}
internal DaylightTime GetDaylightChanges (int year)
@@ -1183,7 +1199,7 @@ namespace System
return null;
}
private bool TryGetTransitionOffset (DateTime dateTime, out TimeSpan offset,out bool isDst)
private bool TryGetTransitionOffset (DateTime dateTime, out TimeSpan offset, out bool isDst, bool forOffset = false)
{
offset = BaseUtcOffset;
isDst = false;
@@ -1204,13 +1220,22 @@ namespace System
return false;
}
AdjustmentRule current = GetApplicableRule(date);
AdjustmentRule current = GetApplicableRule (date);
if (current != null) {
DateTime tStart = TransitionPoint(current.DaylightTransitionStart, date.Year);
DateTime tEnd = TransitionPoint(current.DaylightTransitionEnd, date.Year);
DateTime tStart = TransitionPoint (current.DaylightTransitionStart, date.Year);
DateTime tEnd = TransitionPoint (current.DaylightTransitionEnd, date.Year);
TryAddTicks (tStart, -BaseUtcOffset.Ticks, out tStart, DateTimeKind.Utc);
TryAddTicks (tEnd, -BaseUtcOffset.Ticks, out tEnd, DateTimeKind.Utc);
if ((date >= tStart) && (date <= tEnd)) {
offset = baseUtcOffset + current.DaylightDelta;
isDst = true;
if (forOffset)
isDst = true;
offset = baseUtcOffset;
if (date >= new DateTime (tStart.Ticks + current.DaylightDelta.Ticks, DateTimeKind.Utc))
{
offset += current.DaylightDelta;
isDst = true;
}
return true;
}
}
+42 -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 {
NestedStackTraces (depth - 1);
} catch (Exception exc) {
throw new Exception (String.Format ("Depth {0} exception, expect nested", depth), exc);
}
}
void StacktraceToStateTest (int depth)
{
try {
throw new Exception ("#0");
NestedStackTraces (depth);
} catch (Exception exc) {
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("ExceptionToState", BindingFlags.NonPublic | BindingFlags.Static);
@@ -424,57 +430,39 @@ 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 ()
@@ -55,6 +55,8 @@ namespace MonoTests.System
return "GTB Standard Time";
case "US/Eastern":
return "Eastern Standard Time";
case "US/Central":
return "Central Standard Time";
case "US/Pacific":
return "Pacific Standard Time";
case "Australia/Sydney":
@@ -385,23 +387,28 @@ namespace MonoTests.System
[Test]
public void TestAthensDST_InDSTDelta ()
{
// In .NET GetUtcOffset() returns the BaseUtcOffset for times within the hour
// lost when DST starts but IsDaylightSavingTime() returns true.
// In .NET/.Net Core GetUtcOffset() returns the BaseUtcOffset for times within the hour
// lost when DST starts and IsDaylightSavingTime() returns false for datetime and true for datetimeoffset
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Europe/Athens"));
var date = new DateTime (2014, 3, 30 , 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
var date = new DateTime (2014, 3, 30 , 2, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 1, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 59, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
@@ -429,17 +436,17 @@ namespace MonoTests.System
try {
var date = new DateTime (2014, 3, 30 , 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 1, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 59, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
@@ -467,6 +474,31 @@ namespace MonoTests.System
dateOffset = new DateTimeOffset (date, offset);
Assert.IsTrue (tzi.IsDaylightSavingTime (dateOffset));
}
// https://github.com/mono/mono/issues/9664
[Test]
public void Bug_9664 ()
{
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
var date = new DateTime (2019, 3, 9, 21, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 2, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 2, 30, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-5, 0, 0), tzi.GetUtcOffset (date));
}
}
[TestFixture]
+2
View File
@@ -3263,6 +3263,7 @@ namespace MonoTests.System
Assert.AreEqual ("System.Int32", t.FullName);
}
/*
[Test]
#if MONOTOUCH || FULL_AOT_RUNTIME
[ExpectedException (typeof (NotSupportedException))]
@@ -3321,6 +3322,7 @@ namespace MonoTests.System
var g0 = t.GetGenericArguments () [0];
Assert.AreSame (g0, ut, "#1");
}
*/
[Test]
public void MakeGenericType_WrongNumOfArguments ()
+1 -1
View File
@@ -36,7 +36,7 @@ DISTFILES = $(ROSLYN_FILES_FOR_MONO) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD) csi-tes
ifeq ($(PROFILE), $(DEFAULT_PROFILE))
TARGET_DIR = $(DESTDIR)$(mono_libdir)/mono/$(FRAMEWORK_VERSION)
MSBUILD_ROSLYN_DIR = $(DESTDIR)$(mono_libdir)/mono/msbuild/15.0/bin/Roslyn
MSBUILD_ROSLYN_DIR = $(DESTDIR)$(mono_libdir)/mono/msbuild/Current/bin/Roslyn
install-local: install-prototypes
$(MKINSTALLDIRS) $(TARGET_DIR)
+23 -3
View File
@@ -5,6 +5,14 @@ include ../../build/rules.make
PROGRAM = cil-stringreplacer.exe
NO_INSTALL = yes
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/Mono.Cecil.dll: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Mono.Cecil.dll $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/.stamp
cp $< $@
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/Mono.Cecil.Mdb.dll: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Mono.Cecil.Mdb.dll $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/.stamp
cp $< $@
LIB_REFS = System
API = $(filter basic build, $(PROFILE))
ifdef API
# It can be run using system .net during boostrap
@@ -12,12 +20,24 @@ TARGET_NET_REFERENCE = v4.6
# Trick to make it work during boostrap where it has to run with system
# assemblies not the ones in lib/basic folder
PROGRAM_USE_INTERMEDIATE_FILE = 1
endif
LIB_REFS = System Mono.Cecil
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/cil-stringreplacer.exe: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/Mono.Cecil.dll
LIB_REFS += tmp/Mono.Cecil
ifdef MCS_MODE
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/cil-stringreplacer.exe: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tmp/Mono.Cecil.Mdb.dll
LIB_REFS += tmp/Mono.Cecil.Mdb
endif # MCS_MODE
else # Not basic/build
LIB_REFS += Mono.Cecil
ifdef MCS_MODE
LIB_REFS += Mono.Cecil.Mdb
endif
endif # MCS_MODE
endif # Not basic/build
include ../../build/executable.make
+6 -6
View File
@@ -25,7 +25,7 @@ PCL5_FX_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETPortable/v5.0
VS_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/VisualStudio
PORTABLE_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/Portable
NUGET_BUILDTASKS_TARGETS_DIR = $(mono_libdir)/mono/xbuild/Microsoft/NuGet
MSBUILD_EXTENSIONS_15_DIR=$(mono_libdir)/mono/xbuild/15.0
MSBUILD_EXTENSIONS_CURRENT_DIR=$(mono_libdir)/mono/xbuild/Current
ifeq (14.0, $(XBUILD_VERSION))
install-extras: install-versioned-files install-global-files
@@ -97,7 +97,7 @@ install-pcl-targets:
done
install-web-targets:
for VERSION in v9.0 v10.0 v11.0 v12.0 v14.0 v15.0; do \
for VERSION in v9.0 v10.0 v11.0 v12.0 v14.0 v15.0 v16.0; do \
$(MKINSTALLDIRS) $(DESTDIR)$(VS_TARGETS_DIR)/$$VERSION/WebApplications; \
$(INSTALL_DATA) targets/Microsoft.WebApplication.targets $(DESTDIR)$(VS_TARGETS_DIR)/$$VERSION/WebApplications; \
done
@@ -106,12 +106,12 @@ NUGET_BUILDTASKS_REPO_DIR=$(topdir)/../external/nuget-buildtasks
install-nuget-targets:
$(MKINSTALLDIRS) $(DESTDIR)$(NUGET_BUILDTASKS_TARGETS_DIR)
$(MKINSTALLDIRS) $(DESTDIR)$(MSBUILD_EXTENSIONS_15_DIR)/Imports/Microsoft.Common.props/ImportBefore
$(MKINSTALLDIRS) $(DESTDIR)$(MSBUILD_EXTENSIONS_15_DIR)/Microsoft.Common.targets/ImportAfter
$(MKINSTALLDIRS) $(DESTDIR)$(MSBUILD_EXTENSIONS_CURRENT_DIR)/Imports/Microsoft.Common.props/ImportBefore
$(MKINSTALLDIRS) $(DESTDIR)$(MSBUILD_EXTENSIONS_CURRENT_DIR)/Microsoft.Common.targets/ImportAfter
$(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets $(DESTDIR)$(NUGET_BUILDTASKS_TARGETS_DIR)
$(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.props $(DESTDIR)$(NUGET_BUILDTASKS_TARGETS_DIR)
$(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props $(DESTDIR)$(MSBUILD_EXTENSIONS_15_DIR)/Imports/Microsoft.Common.props/ImportBefore
$(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets $(DESTDIR)$(MSBUILD_EXTENSIONS_15_DIR)/Microsoft.Common.targets/ImportAfter
$(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props $(DESTDIR)$(MSBUILD_EXTENSIONS_CURRENT_DIR)/Imports/Microsoft.Common.props/ImportBefore
$(INSTALL_DATA) $(NUGET_BUILDTASKS_REPO_DIR)/src/Microsoft.NuGet.Build.Tasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets $(DESTDIR)$(MSBUILD_EXTENSIONS_CURRENT_DIR)/Microsoft.Common.targets/ImportAfter
install-nuget-imports:
ifeq (14.0, $(XBUILD_VERSION))
+6 -3
View File
@@ -450,15 +450,18 @@ typedef union {
} while (0)
#define amd64_lea_membase_body(inst,reg,basereg,disp) \
#define amd64_lea_membase_body(inst,reg,basereg,disp,width) \
do { \
amd64_emit_rex(inst, 8, (reg), 0, (basereg)); \
amd64_emit_rex(inst, width, (reg), 0, (basereg)); \
*(inst)++ = (unsigned char)0x8d; \
amd64_membase_emit ((inst), (reg), (basereg), (disp)); \
} while (0)
#define amd64_lea4_membase(inst,reg,basereg,disp) \
amd64_lea_membase_body((inst), (reg), (basereg), (disp), 4)
#define amd64_lea_membase(inst,reg,basereg,disp) \
amd64_lea_membase_body((inst), (reg), (basereg), (disp))
amd64_lea_membase_body((inst), (reg), (basereg), (disp), 8)
/* Instruction are implicitly 64-bits so don't generate REX for just the size. */
#define amd64_push_reg(inst,reg) \
+7
View File
@@ -412,6 +412,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;
+13 -4
View File
@@ -498,6 +498,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;
@@ -527,8 +528,15 @@ typedef struct {
} MonoFrameSummary;
typedef struct {
intptr_t offset_free_hash;
intptr_t offset_rich_hash;
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;
} MonoStackHash;
typedef struct {
@@ -560,12 +568,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
+22
View File
@@ -806,6 +806,28 @@ class Tests
arr [i] = 1;
return llvm_ldlen_licm (arr);
}
private unsafe static void WritePtr (FooStruct *val, out FooStruct* ptr)
{
ptr = val;
}
public unsafe static int test_0_ldelema_ptr () {
int i;
int len = 10;
FooStruct*[] ptr_array = new FooStruct* [len];
FooStruct str = new FooStruct (3);
for (i = 0; i < len; i++)
WritePtr (&str, out ptr_array [i]);
for (i = 0; i < len; i++) {
if (ptr_array [i]->i != 3)
return i;
}
return 0;
}
}
+1
View File
@@ -336,6 +336,7 @@ x86_push_membase: src1:b len:8
x86_push_obj: src1:b len:40
x86_lea: dest:i src1:i src2:i len:8
x86_lea_membase: dest:i src1:i len:11
amd64_lea_membase: dest:i src1:i len:11
x86_xchg: src1:i src2:i clob:x len:2
x86_fpop: src1:f len:3
x86_seteq_membase: src1:b len:9
+19 -10
View File
@@ -2789,6 +2789,8 @@ try_process_suspend (void *the_tls, MonoContext *ctx)
/* Fastpath during invokes, see in process_suspend () */
if (suspend_count - tls->resume_count == 0)
return FALSE;
if (tls->invoke)
return FALSE;
process_suspend (tls, ctx);
return TRUE;
}
@@ -3232,7 +3234,7 @@ compute_frame_info_from (MonoInternalThread *thread, DebuggerTlsData *tls, MonoT
}
static void
compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls)
compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls, gboolean force_update)
{
ComputeFramesUserData user_data;
GSList *tmp;
@@ -3241,7 +3243,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls)
MonoUnwindOptions opts = (MonoUnwindOptions)(MONO_UNWIND_DEFAULT | MONO_UNWIND_REG_LOCATIONS);
// FIXME: Locking on tls
if (tls->frames && tls->frames_up_to_date)
if (tls->frames && tls->frames_up_to_date && !force_update)
return;
DEBUG_PRINTF (1, "Frames for %p(tid=%lx):\n", thread, (glong)thread->tid);
@@ -3977,13 +3979,17 @@ thread_end (MonoProfiler *prof, uintptr_t tid)
/* We might be called for threads started before we registered the start callback */
if (thread) {
DEBUG_PRINTF (1, "[%p] Thread terminated, obj=%p, tls=%p.\n", (gpointer)tid, thread, tls);
DEBUG_PRINTF (1, "[%p] Thread terminated, obj=%p, tls=%p (domain=%p).\n", (gpointer)tid, thread, tls, (gpointer)mono_domain_get ());
if (mono_thread_internal_is_current (thread) && !mono_native_tls_get_value (debugger_tls_id)
if (mono_thread_internal_is_current (thread) &&
(!mono_native_tls_get_value (debugger_tls_id) ||
!mono_domain_get ())
) {
/*
* This can happen on darwin since we deregister threads using pthread dtors.
* process_profiler_event () and the code it calls cannot handle a null TLS value.
* This can happen on darwin and android since we
* deregister threads using pthread dtors.
* process_profiler_event () and the code it calls
* cannot handle a null TLS value.
*/
return;
}
@@ -4220,7 +4226,7 @@ ss_calculate_framecount (void *the_tls, MonoContext *ctx, gboolean force_use_ctx
if (force_use_ctx || !tls->context.valid)
mono_thread_state_init_from_monoctx (&tls->context, ctx);
compute_frame_info (tls->thread, tls);
compute_frame_info (tls->thread, tls, FALSE);
if (frames)
*frames = (DbgEngineStackFrame**)tls->frames;
if (nframes)
@@ -4780,7 +4786,7 @@ ss_create_init_args (SingleStepReq *ss_req, SingleStepArgs *args)
if (frames && nframes)
frame = frames [0];
} else {
compute_frame_info (ss_req->thread, tls);
compute_frame_info (ss_req->thread, tls, FALSE);
if (tls->frame_count)
frame = tls->frames [0];
@@ -8510,7 +8516,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
mono_loader_unlock ();
g_assert (tls);
compute_frame_info (thread, tls);
compute_frame_info (thread, tls, TRUE); //the last parameter is TRUE to force that the frame info that will be send is synchronised with the debugged thread
buffer_add_int (buf, tls->frame_count);
for (i = 0; i < tls->frame_count; ++i) {
@@ -8564,7 +8570,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
mono_loader_unlock ();
g_assert (tls);
compute_frame_info (thread, tls);
compute_frame_info (thread, tls, FALSE);
if (tls->frame_count == 0 || tls->frames [0]->actual_method != method)
return ERR_INVALID_ARGUMENT;
@@ -8630,6 +8636,9 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
if (i == tls->frame_count)
return ERR_INVALID_FRAMEID;
/* The thread is still running native code, can't get frame variables info */
if (!tls->really_suspended && !tls->async_state.valid)
return ERR_NOT_SUSPENDED;
frame_idx = i;
frame = tls->frames [frame_idx];
+1 -1
View File
@@ -96,7 +96,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
fregs_offset = offset;
offset += num_fregs * 8;
ctx_offset = offset;
ctx_offset += 8;
offset += 8;
frame_size = ALIGN_TO (offset, MONO_ARCH_FRAME_ALIGNMENT);
/*
+14
View File
@@ -1448,6 +1448,20 @@ class Tests
var res = builder.Caller (ref awaiter);
return res == typeof (bool) ? 0 : 1;
}
struct OneThing<T1> {
public T1 Item1;
}
[MethodImpl (MethodImplOptions.NoInlining)]
static T FromResult<T> (T result) {
return result;
}
public static int test_42_llvm_gsharedvt_small_vtype_in_regs () {
var t = FromResult<OneThing<int>>(new OneThing<int> {Item1 = 42});
return t.Item1;
}
}
#if !__MOBILE__
+1 -1
View File
@@ -924,7 +924,7 @@ ves_array_element_address (InterpFrame *frame, MonoClass *required_type, MonoArr
if (frame->ex)
return NULL;
if (needs_typecheck && !mono_class_is_assignable_from_internal (m_class_get_element_class (mono_object_class ((MonoObject *) ao)), m_class_get_element_class (required_type))) {
if (needs_typecheck && !mono_class_is_assignable_from_internal (m_class_get_element_class (mono_object_class ((MonoObject *) ao)), required_type)) {
frame->ex = mono_get_exception_array_type_mismatch ();
FILL_IN_TRACE (frame->ex, frame);
return NULL;
+10 -8
View File
@@ -1622,7 +1622,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
#endif
}
if (op == MINT_LDELEMA || op == MINT_LDELEMA_TC) {
ADD_CODE (td, get_data_item_index (td, target_method->klass));
ADD_CODE (td, get_data_item_index (td, m_class_get_element_class (target_method->klass)));
ADD_CODE (td, 1 + m_class_get_rank (target_method->klass));
}
@@ -2010,10 +2010,6 @@ save_seq_points (TransformData *td, MonoJitInfo *jinfo)
g_byte_array_free (array, TRUE);
mono_domain_lock (domain);
g_hash_table_insert (domain_jit_info (domain)->seq_points, rtm->method, info);
mono_domain_unlock (domain);
jinfo->seq_points = info;
}
@@ -5294,9 +5290,6 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon
return_if_nok (error);
// FIXME: Add a different callback ?
MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
/* Copy changes back */
imethod = real_imethod;
mono_os_mutex_lock (&calc_section);
@@ -5307,7 +5300,16 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon
mono_memory_barrier ();
imethod->transformed = TRUE;
mono_atomic_fetch_add_i32 (&mono_jit_stats.methods_with_interp, 1);
}
mono_os_mutex_unlock (&calc_section);
mono_domain_lock (domain);
if (!g_hash_table_lookup (domain_jit_info (domain)->seq_points, imethod->method))
g_hash_table_insert (domain_jit_info (domain)->seq_points, imethod->method, imethod->jinfo->seq_points);
mono_domain_unlock (domain);
// FIXME: Add a different callback ?
MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
}
+1 -1
View File
@@ -9653,7 +9653,7 @@ calli_end:
break;
}
if (m_class_is_enumtype (klass) && !(val->type == STACK_I8 && TARGET_SIZEOF_VOID_P == 4)) {
if (m_class_is_enumtype (klass) && !mini_is_gsharedvt_klass (klass) && !(val->type == STACK_I8 && TARGET_SIZEOF_VOID_P == 4)) {
/* Can't do this with 64 bit enums on 32 bit since the vtype decomp pass is ran after the long decomp pass */
if (val->opcode == OP_ICONST) {
MONO_INST_NEW (cfg, ins, OP_BOX_ICONST);
+5 -2
View File
@@ -2461,7 +2461,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
mini_emit_memcpy (cfg, load->dreg, 0, src->dreg, 0, size, TARGET_SIZEOF_VOID_P);
if (ainfo->pair_storage [0] == ArgInIReg) {
MONO_INST_NEW (cfg, arg, OP_X86_LEA_MEMBASE);
MONO_INST_NEW (cfg, arg, OP_AMD64_LEA_MEMBASE);
arg->dreg = mono_alloc_ireg (cfg);
arg->sreg1 = load->dreg;
arg->inst_imm = 0;
@@ -3203,7 +3203,7 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb)
* sreg1==dreg restriction. inst_imm > 0 is needed since LEA sign-extends
* its operand to 64 bit.
*/
ins->opcode = OP_X86_LEA_MEMBASE;
ins->opcode = ins->opcode == OP_IADD_IMM ? OP_X86_LEA_MEMBASE : OP_AMD64_LEA_MEMBASE;
ins->inst_basereg = ins->sreg1;
}
break;
@@ -5074,6 +5074,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
amd64_lea_memindex (code, ins->dreg, ins->sreg1, ins->inst_imm, ins->sreg2, ins->backend.shift_amount);
break;
case OP_X86_LEA_MEMBASE:
amd64_lea4_membase (code, ins->dreg, ins->sreg1, ins->inst_imm);
break;
case OP_AMD64_LEA_MEMBASE:
amd64_lea_membase (code, ins->dreg, ins->sreg1, ins->inst_imm);
break;
case OP_X86_XCHG:
+1 -1
View File
@@ -281,7 +281,7 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si
src [0] |= (arg_size << 22);
/* Encode the offset inside the stack slot */
src [0] |= ((ainfo->offset % 8) << 26);
if (ainfo2->storage == ArgOnStack)
if (ainfo2->storage == ArgOnStack || ainfo2->storage == ArgOnStackR4)
dst [0] |= ((ainfo2->offset % 8) << 26);
} else if (ainfo2->storage == ArgOnStack && ainfo2->slot_size != 8) {
/* The caller passes in an address, need to store it into a stack slot */
+88 -17
View File
@@ -905,6 +905,46 @@ mono_exception_walk_trace (MonoException *ex, MonoExceptionFrameWalk func, gpoin
return res;
}
static gboolean
mono_exception_stackframe_obj_walk (MonoStackFrame *captured_frame, MonoExceptionFrameWalk func, gpointer user_data)
{
if (!captured_frame)
return TRUE;
gpointer ip = (gpointer) (captured_frame->method_address + captured_frame->native_offset);
MonoJitInfo *ji = mono_jit_info_table_find_internal (mono_domain_get (), ip, TRUE, TRUE);
// Other domain maybe?
if (!ji)
return FALSE;
MonoMethod *method = jinfo_get_method (ji);
gboolean r = func (method, (gpointer) captured_frame->method_address, captured_frame->native_offset, TRUE, user_data);
if (r)
return TRUE;
return FALSE;
}
static gboolean
mono_exception_stacktrace_obj_walk (MonoStackTrace *st, MonoExceptionFrameWalk func, gpointer user_data)
{
int num_captured = st->captured_traces ? mono_array_length (st->captured_traces) : 0;
for (int i=0; i < num_captured; i++) {
MonoStackTrace *curr_trace = mono_array_get_fast (st->captured_traces, MonoStackTrace *, i);
mono_exception_stacktrace_obj_walk (curr_trace, func, user_data);
}
int num_frames = st->frames ? mono_array_length (st->frames) : 0;
for (int frame = 0; frame < num_frames; frame++) {
gboolean r = mono_exception_stackframe_obj_walk (mono_array_get_fast (st->frames, MonoStackFrame *, frame), func, user_data);
if (r)
return TRUE;
}
return TRUE;
}
gboolean
mono_exception_walk_trace_internal (MonoException *ex, MonoExceptionFrameWalk func, gpointer user_data)
{
@@ -912,13 +952,15 @@ mono_exception_walk_trace_internal (MonoException *ex, MonoExceptionFrameWalk fu
MonoDomain *domain = mono_domain_get ();
MonoArray *ta = ex->trace_ips;
int len, i;
/* Exception is not thrown yet */
if (ta == NULL)
return FALSE;
len = mono_array_length (ta) / TRACE_IP_ENTRY_SIZE;
for (i = 0; i < len; i++) {
int len = mono_array_length (ta) / TRACE_IP_ENTRY_SIZE;
gboolean otherwise_has_traces = len > 0;
for (int i = 0; i < len; i++) {
ExceptionTraceIp trace_ip;
memcpy (&trace_ip, mono_array_addr_fast (ta, ExceptionTraceIp, i), sizeof (ExceptionTraceIp));
@@ -938,15 +980,27 @@ mono_exception_walk_trace_internal (MonoException *ex, MonoExceptionFrameWalk fu
r = func (NULL, ip, 0, FALSE, user_data);
MONO_EXIT_GC_SAFE;
if (r)
return TRUE;
break;
} else {
MonoMethod *method = get_method_from_stack_frame (ji, generic_info);
if (func (method, ji->code_start, (char *) ip - (char *) ji->code_start, TRUE, user_data))
return TRUE;
break;
}
}
return len > 0;
ta = (MonoArray *) ex->captured_traces;
len = ta ? mono_array_length (ta) : 0;
gboolean captured_has_traces = len > 0;
for (int i = 0; i < len; i++) {
MonoStackTrace *captured_trace = mono_array_get_fast (ta, MonoStackTrace *, i);
if (!captured_trace)
break;
mono_exception_stacktrace_obj_walk (captured_trace, func, user_data);
}
return captured_has_traces || otherwise_has_traces;
}
MonoArray *
@@ -1512,7 +1566,7 @@ summarize_frame_internal (MonoMethod *method, gpointer ip, size_t native_offset,
MonoCLIImageInfo *image_info = (MonoCLIImageInfo *)image->image_info;
MonoDotNetHeader *header = &image_info->cli_header;
dest->managed_data.image_size = header->pe.pe_code_size;
dest->managed_data.image_size = header->nt.pe_image_size;
dest->managed_data.time_date_stamp = image->time_date_stamp;
@@ -1583,17 +1637,34 @@ mono_summarize_exception (MonoException *exc, MonoThreadSummary *out)
{
memset (out, 0, sizeof (MonoThreadSummary));
MonoSummarizeUserData data;
memset (&data, 0, sizeof (MonoSummarizeUserData));
data.max_frames = MONO_MAX_SUMMARY_FRAMES;
data.num_frames = 0;
data.frames = out->managed_frames;
data.hashes = &out->hashes;
MonoException *inner_exc = exc;
int exc_index = 0;
mono_exception_walk_trace (exc, summarize_frame_managed_walk, &data);
out->num_managed_frames = data.num_frames;
for (exc_index = 0; exc_index < MONO_MAX_SUMMARY_EXCEPTIONS; exc_index++) {
if (inner_exc == NULL)
break;
out->managed_exc_type = exc->object.vtable->klass;
// Set up state to walk this MonoException's stack
MonoSummarizeUserData data;
memset (&data, 0, sizeof (MonoSummarizeUserData));
data.max_frames = MONO_MAX_SUMMARY_FRAMES;
data.num_frames = 0;
data.frames = out->exceptions [exc_index].managed_frames;
// Accumulate all hashes from all exceptions in traveral order
data.hashes = &out->hashes;
mono_exception_walk_trace (inner_exc, summarize_frame_managed_walk, &data);
// Save per-MonoException info
out->exceptions [exc_index].managed_exc_type = inner_exc->object.vtable->klass;
out->exceptions [exc_index].num_managed_frames = data.num_frames;
// Continue to traverse nesting of exceptions
inner_exc = (MonoException *) inner_exc->inner_ex;
}
out->num_exceptions = exc_index;
}
+19 -7
View File
@@ -2236,12 +2236,14 @@ static void
emit_args_to_vtype (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMValueRef address, LLVMArgInfo *ainfo, LLVMValueRef *args)
{
int j, size, nslots;
MonoClass *klass;
size = mono_class_value_size (mono_class_from_mono_type (t), NULL);
t = mini_get_underlying_type (t);
klass = mono_class_from_mono_type (t);
size = mono_class_value_size (klass, NULL);
if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (t))) {
if (MONO_CLASS_IS_SIMD (ctx->cfg, klass))
address = LLVMBuildBitCast (ctx->builder, address, LLVMPointerType (LLVMInt8Type (), 0), "");
}
if (ainfo->storage == LLVMArgAsFpArgs)
nslots = ainfo->nslots;
@@ -2262,8 +2264,8 @@ emit_args_to_vtype (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMV
switch (ainfo->pair_storage [j]) {
case LLVMArgInIReg: {
part_type = LLVMIntType (part_size * 8);
if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (t))) {
index [0] = LLVMConstInt (LLVMInt32Type (), j * sizeof (gpointer), FALSE);
if (MONO_CLASS_IS_SIMD (ctx->cfg, klass)) {
index [0] = LLVMConstInt (LLVMInt32Type (), j * TARGET_SIZEOF_VOID_P, FALSE);
addr = LLVMBuildGEP (builder, address, index, 1, "");
} else {
daddr = LLVMBuildBitCast (ctx->builder, address, LLVMPointerType (IntPtrType (), 0), "");
@@ -2310,6 +2312,7 @@ emit_vtype_to_args (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMV
int j, size, nslots;
LLVMTypeRef arg_type;
t = mini_get_underlying_type (t);
size = get_vtype_size (t);
if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (t)))
@@ -3021,11 +3024,12 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
case LLVMArgAsIArgs: {
LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex);
int size;
MonoType *t = mini_get_underlying_type (ainfo->type);
/* The argument is received as an array of ints, store it into the real argument */
ctx->addresses [reg] = build_alloca (ctx, ainfo->type);
ctx->addresses [reg] = build_alloca (ctx, t);
size = mono_class_value_size (mono_class_from_mono_type (ainfo->type), NULL);
size = mono_class_value_size (mono_class_from_mono_type (t), NULL);
if (size == 0) {
} else if (size < TARGET_SIZEOF_VOID_P) {
/* The upper bits of the registers might not be valid */
@@ -8617,6 +8621,14 @@ mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix,
add_intrinsics (module->lmodule);
add_types (module);
#ifdef MONO_ARCH_LLVM_TARGET_LAYOUT
LLVMSetDataLayout (module->lmodule, MONO_ARCH_LLVM_TARGET_LAYOUT);
#endif
#ifdef MONO_ARCH_LLVM_TARGET_TRIPLE
LLVMSetTarget (module->lmodule, MONO_ARCH_LLVM_TARGET_TRIPLE);
#endif
#if LLVM_API_VERSION > 100
if (module->emit_dwarf) {
char *dir, *build_info, *s, *cu_name;
+1
View File
@@ -1173,6 +1173,7 @@ MINI_OP(OP_AMD64_AND_MEMBASE_IMM, "amd64_and_membase_imm", NONE, IREG, NO
MINI_OP(OP_AMD64_OR_MEMBASE_IMM, "amd64_or_membase_imm", NONE, IREG, NONE)
MINI_OP(OP_AMD64_XOR_MEMBASE_IMM, "amd64_xor_membase_imm", NONE, IREG, NONE)
MINI_OP(OP_AMD64_MUL_MEMBASE_IMM, "amd64_mul_membase_imm", NONE, IREG, NONE)
MINI_OP(OP_AMD64_LEA_MEMBASE, "amd64_lea_membase", IREG, IREG, NONE)
MINI_OP(OP_AMD64_ADD_REG_MEMBASE, "amd64_add_reg_membase", IREG, IREG, IREG)
MINI_OP(OP_AMD64_SUB_REG_MEMBASE, "amd64_sub_reg_membase", IREG, IREG, IREG)
+1 -1
View File
@@ -624,7 +624,7 @@ typedef struct {
LLVMArgStorage storage;
/*
* Only if storage == ArgValuetypeInReg/LLVMArgAsFpArgs.
* Only if storage == ArgVtypeInReg/LLVMArgAsFpArgs.
* This contains how the parts of the vtype are passed.
*/
LLVMArgStorage pair_storage [8];
+8 -2
View File
@@ -19,6 +19,8 @@
* - the defines below
*/
#include "mono-mmap.h"
#define USE_DL_PREFIX 1
#define USE_LOCKS 1
/* Use mmap for allocating memory */
@@ -1308,14 +1310,18 @@ extern void* sbrk(ptrdiff_t);
#define USE_MMAP_BIT (SIZE_T_ONE)
#ifndef WIN32
#define CALL_MUNMAP(a, s) munmap((a), (s))
//#define CALL_MUNMAP(a, s) munmap((a), (s))
#define CALL_MUNMAP(a, s) mono_vfree((a), (s), MONO_MEM_ACCOUNT_CODE)
#define MMAP_PROT (PROT_READ|PROT_WRITE|PROT_EXEC)
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#endif /* MAP_ANON */
#ifdef MAP_ANONYMOUS
#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS)
#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
//#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
#define CALL_MMAP(s) mono_valloc(NULL, (s), MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC|MONO_MMAP_JIT, MONO_MEM_ACCOUNT_CODE)
#else /* MAP_ANONYMOUS */
/*
Nearly all versions of mmap support MAP_ANONYMOUS, so the following
+8 -7
View File
@@ -23,6 +23,7 @@
#include <utils/mono-mmap.h>
#include <utils/strenc.h>
#include <utils/mono-io-portability.h>
#include <utils/mono-logger-internals.h>
#if defined(_POSIX_VERSION)
#ifdef HAVE_SYS_ERRNO_H
@@ -1021,7 +1022,7 @@ mono_pe_file_map (gunichar2 *filename, gint32 *map_size, void **handle)
filename_ext = mono_unicode_to_external (filename);
if (filename_ext == NULL) {
g_async_safe_printf ("%s: unicode conversion returned NULL", __func__);
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: unicode conversion returned NULL", __func__);
goto exit;
}
@@ -1034,37 +1035,37 @@ mono_pe_file_map (gunichar2 *filename, gint32 *map_size, void **handle)
if (!located_filename) {
errno = saved_errno;
g_async_safe_printf ("%s: Error opening file %s (3): %s", __func__, filename_ext, strerror (errno));
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: Error opening file %s (3): %s", __func__, filename_ext, strerror (errno));
goto error;
}
fd = open (located_filename, O_RDONLY, 0);
if (fd == -1) {
g_async_safe_printf ("%s: Error opening file %s (3): %s", __func__, filename_ext, strerror (errno));
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: Error opening file %s (3): %s", __func__, filename_ext, strerror (errno));
goto error;
}
}
else if (fd == -1) {
g_async_safe_printf ("%s: Error opening file %s (3): %s", __func__, filename_ext, strerror (errno));
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: Error opening file %s (3): %s", __func__, filename_ext, strerror (errno));
goto error;
}
if (fstat (fd, &statbuf) == -1) {
g_async_safe_printf ("%s: Error stat()ing file %s: %s", __func__, filename_ext, strerror (errno));
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: Error stat()ing file %s: %s", __func__, filename_ext, strerror (errno));
goto error;
}
*map_size = statbuf.st_size;
/* Check basic file size */
if (statbuf.st_size < sizeof(IMAGE_DOS_HEADER)) {
g_async_safe_printf ("%s: File %s is too small: %lld", __func__, filename_ext, (long long) statbuf.st_size);
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: File %s is too small: %lld", __func__, filename_ext, (long long) statbuf.st_size);
goto exit;
}
file_map = mono_file_map (statbuf.st_size, MONO_MMAP_READ | MONO_MMAP_PRIVATE, fd, 0, handle);
if (file_map == NULL) {
g_async_safe_printf ("%s: Error mmap()int file %s: %s", __func__, filename_ext, strerror (errno));
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: Error mmap()int file %s: %s", __func__, filename_ext, strerror (errno));
goto error;
}
exit:
+57 -23
View File
@@ -259,15 +259,16 @@ mono_state_alloc_mem (MonoStateMem *mem, long tag, size_t size)
mem->size = size;
mem->handle = g_open (name, O_RDWR | O_CREAT | O_EXCL, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
if (mem->handle < 1)
return FALSE;
if (mem->handle < 1) {
mem->mem = (gpointer *) mmap (0, mem->size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
} else {
lseek (mem->handle, mem->size, SEEK_SET);
g_write (mem->handle, "", 1);
lseek (mem->handle, mem->size, SEEK_SET);
g_write (mem->handle, "", 1);
mem->mem = (gpointer *) mmap (0, mem->size, PROT_READ | PROT_WRITE, MAP_SHARED, mem->handle, 0);
mem->mem = (gpointer *) mmap (0, mem->size, PROT_READ | PROT_WRITE, MAP_SHARED, mem->handle, 0);
}
if (mem->mem == GINT_TO_POINTER (-1))
g_assert_not_reached ();
return FALSE;
return TRUE;
}
@@ -545,14 +546,11 @@ mono_native_state_add_frames (MonoStateWriter *writer, int num_frames, MonoFrame
mono_state_writer_printf(writer, "[\n");
// Where you are: everything works but
// the add_frame method
mono_native_state_add_frame (writer, &frames [0]);
for (int i = 1; i < num_frames; ++i) {
mono_state_writer_printf(writer, ",\n");
mono_native_state_add_frame (writer, &frames [i]);
}
for (int i = 0; i < num_frames; ++i) {
if (i > 0)
mono_state_writer_printf(writer, ",\n");
mono_native_state_add_frame (writer, &frames [i]);
}
mono_state_writer_printf(writer, "\n");
mono_state_writer_indent (writer);
@@ -560,6 +558,45 @@ mono_native_state_add_frames (MonoStateWriter *writer, int num_frames, MonoFrame
mono_state_writer_printf(writer, "]");
}
static void
mono_native_state_add_managed_exc (MonoStateWriter *writer, MonoExcSummary *exc)
{
mono_state_writer_indent (writer);
mono_state_writer_printf(writer, "{\n");
writer->indent++;
assert_has_space (writer);
mono_state_writer_indent (writer);
mono_state_writer_object_key (writer, "type");
mono_state_writer_printf(writer, "\"%s.%s\",\n", m_class_get_name_space (exc->managed_exc_type), m_class_get_name (exc->managed_exc_type));
mono_native_state_add_frames (writer, exc->num_managed_frames, exc->managed_frames, "managed_frames");
mono_state_writer_indent (writer);
writer->indent--;
mono_state_writer_printf(writer, "}\n");
}
static void
mono_native_state_add_managed_excs (MonoStateWriter *writer, int num_excs, MonoExcSummary *excs)
{
mono_state_writer_indent (writer);
mono_state_writer_object_key (writer, "exceptions");
mono_state_writer_printf(writer, "[\n");
for (int i = 0; i < num_excs; ++i) {
if (i > 0)
mono_state_writer_printf(writer, ",\n");
mono_native_state_add_managed_exc (writer, &excs [i]);
}
mono_state_writer_indent (writer);
writer->indent--;
mono_state_writer_printf(writer, "]");
}
void
mono_native_state_add_thread (MonoStateWriter *writer, MonoThreadSummary *thread, MonoContext *ctx, gboolean first_thread, gboolean crashing_thread)
{
@@ -619,19 +656,16 @@ mono_native_state_add_thread (MonoStateWriter *writer, MonoThreadSummary *thread
mono_state_writer_printf(writer, "\"%s\"", thread->name);
}
if (thread->managed_exc_type) {
mono_state_writer_printf(writer, ",\n");
assert_has_space (writer);
mono_state_writer_indent (writer);
mono_state_writer_object_key (writer, "managed_exception_type");
mono_state_writer_printf(writer, "\"%s.%s\"", m_class_get_name_space (thread->managed_exc_type), m_class_get_name (thread->managed_exc_type));
}
if (ctx) {
mono_state_writer_printf(writer, ",\n");
mono_native_state_add_ctx (writer, ctx);
}
if (thread->num_exceptions > 0) {
mono_state_writer_printf(writer, ",\n");
mono_native_state_add_managed_excs (writer, thread->num_exceptions, thread->exceptions);
}
if (thread->num_managed_frames > 0) {
mono_state_writer_printf(writer, ",\n");
mono_native_state_add_frames (writer, thread->num_managed_frames, thread->managed_frames, "managed_frames");
+1 -1
View File
@@ -18,7 +18,7 @@
#include <mono/metadata/threads-types.h>
#include <mono/utils/json.h>
#define MONO_NATIVE_STATE_PROTOCOL_VERSION "0.0.2"
#define MONO_NATIVE_STATE_PROTOCOL_VERSION "0.0.4"
typedef enum {
MonoSummaryNone,
+2 -1
View File
@@ -11,7 +11,8 @@ class FsharpPackage(GitHubTarballPackage):
self.sources.extend(['patches/fsharp-portable-pdb.patch',
'patches/fsharp-string-switchName.patch',
'patches/fsharp-path-overloads.patch',
'patches/fsharp-debug-pinvoke-fix.patch'])
'patches/fsharp-debug-pinvoke-fix.patch',
'patches/fsharp-msbuild-16-0.patch'])
def prep(self):
Package.prep(self)
+2 -2
View File
@@ -1,8 +1,8 @@
GitHubTarballPackage(
'mono',
'libgdiplus',
'5.6',
'f07965ec5fc2b22bfb300d5fef410d25ae472a34',
'5.6.1',
'3506915c865dec746565bbc4a5683d4e53e842b4',
configure='CFLAGS="%{gcc_flags} %{local_gcc_flags} -I/opt/X11/include" ./autogen.sh --prefix="%{package_prefix}"',
override_properties={
'make': 'C_INCLUDE_PATH="" make'})
+3 -4
View File
@@ -3,12 +3,11 @@ import fileinput
class MSBuild (GitHubPackage):
def __init__ (self):
GitHubPackage.__init__ (self, 'mono', 'msbuild', '15', # note: fix scripts/ci/run-test-mac-sdk.sh when bumping the version number
revision = '804bde742bdf9d65c7ceb672a3d5400c0c22e628')
revision = '5b35a69a2e2b09b0ce39616f4639cd1df3d4ccae')
def build (self):
self.sh ('mono --version')
self.sh ('./build.sh -hostType mono -configuration Release -skipTests')
self.sh ('zip msbuild-bin-logs.zip artifacts/Release-MONO/log/*')
self.sh ('./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release --skip_tests')
self.sh ('find artifacts -wholename \'*/log/*\' -type f -exec zip msbuild-bin-logs.zip {} \+')
def install (self):
# use the bootstrap msbuild as the system might not have one available!
+1 -1
View File
@@ -4,7 +4,7 @@ import fileinput
class NuGetBinary (Package):
def __init__(self):
Package.__init__(self, name='NuGet', version='4.8.1', sources=[
Package.__init__(self, name='NuGet', version='5.0.2', sources=[
'https://dist.nuget.org/win-x86-commandline/v%{version}/nuget.exe'])
def build(self):
@@ -0,0 +1,50 @@
diff --git a/mono/config.make.in b/mono/config.make.in
index 3106ab99f..8af247ffd 100644
--- a/mono/config.make.in
+++ b/mono/config.make.in
@@ -148,6 +148,7 @@ install-sdk-lib:
echo " --> $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/"; \
echo " --> $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/"; \
echo " --> $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/"; \
+ echo " --> $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/"; \
\
mkdir -p $(tmpdir); \
mkdir -p $(DESTDIR)$(monodir)/Microsoft\ F#/v4.0/; \
@@ -160,6 +161,7 @@ install-sdk-lib:
mkdir -p $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
mkdir -p $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
mkdir -p $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
+ mkdir -p $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
\
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.Targets $(DESTDIR)$(monodir)/fsharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.Portable.FSharp.Targets $(DESTDIR)$(monodir)/fsharp/; \
@@ -177,6 +179,7 @@ install-sdk-lib:
$(INSTALL_LIB) $(tmpdir)Microsoft.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
$(INSTALL_LIB) $(tmpdir)Microsoft.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(tmpdir)Microsoft.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
+ $(INSTALL_LIB) $(tmpdir)Microsoft.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
\
echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' > $(tmpdir)Microsoft.Portable.FSharp.Targets; \
echo ' <Import Project="$(monodir)/fsharp/Microsoft.Portable.FSharp.Targets" />' >> $(tmpdir)Microsoft.Portable.FSharp.Targets; \
@@ -191,18 +194,21 @@ install-sdk-lib:
$(INSTALL_LIB) $(tmpdir)Microsoft.Portable.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
$(INSTALL_LIB) $(tmpdir)Microsoft.Portable.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(tmpdir)Microsoft.Portable.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
+ $(INSTALL_LIB) $(tmpdir)Microsoft.Portable.FSharp.Targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
\
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.props $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.props $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.props $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.props $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.props $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.props $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
\
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
fi
@if test x-$(outsuffix) = x-net40; then \
if test -e $(outdir)$(NAME).dll; then \
+5 -2
View File
@@ -75,15 +75,17 @@ install()
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/Microsoft* ${REPODIR}/../../tmp/mono/lib/mono/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/msbuild ${REPODIR}/../../tmp/mono/lib/mono/
rm -f ${REPODIR}/../../tmp/mono/lib/mono/msbuild/15.0/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/libhostfxr.dylib
rm -f ${REPODIR}/../../tmp/mono/lib/mono/msbuild/Current/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/libhostfxr.dylib
if [ "$1" = "x64" ]; then
cp ${REPODIR}/hostfxr-x64/hostfxr.dll ${REPODIR}/../../tmp/mono/lib/mono/msbuild/15.0/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/
cp ${REPODIR}/hostfxr-x64/hostfxr.dll ${REPODIR}/../../tmp/mono/lib/mono/msbuild/Current/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/
else
cp ${REPODIR}/hostfxr-x86/hostfxr.dll ${REPODIR}/../../tmp/mono/lib/mono/msbuild/15.0/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/
cp ${REPODIR}/hostfxr-x86/hostfxr.dll ${REPODIR}/../../tmp/mono/lib/mono/msbuild/Current/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/
fi
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/nuget ${REPODIR}/../../tmp/mono/lib/mono/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild-frameworks ${REPODIR}/../../tmp/mono/lib/mono/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/deniedAssembliesList.txt ${REPODIR}/../../tmp/mono/lib/mono/xbuild/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/15.0 ${REPODIR}/../../tmp/mono/lib/mono/xbuild/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Current ${REPODIR}/../../tmp/mono/lib/mono/xbuild/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Microsoft/Microsoft.NET.Build.Extensions ${REPODIR}/../../tmp/mono/lib/mono/xbuild/Microsoft/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Microsoft/NuGet ${REPODIR}/../../tmp/mono/lib/mono/xbuild/Microsoft/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Microsoft/Portable/VisualStudio ${REPODIR}/../../tmp/mono/lib/mono/xbuild/Microsoft/Portable/
@@ -93,6 +95,7 @@ install()
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Microsoft/VisualStudio/v14.0/FSharp ${REPODIR}/../../tmp/mono/lib/mono/xbuild/Microsoft/VisualStudio/v14.0/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/FSharp ${REPODIR}/../../tmp/mono/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/gac/nunit*/2.4.8.0__96d09a1eb7f44a77/*.dll* ${REPODIR}/../../tmp/mono/lib/mono/4.5/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/xbuild/Microsoft/VisualStudio/v16.0/FSharp ${REPODIR}/../../tmp/mono/lib/mono/xbuild/Microsoft/VisualStudio/v16.0/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/4.5/Microsoft.VisualBasic.dll ${REPODIR}/../../tmp/mono/lib/mono/4.5/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/4.5/Mono.Cecil.VB* ${REPODIR}/../../tmp/mono/lib/mono/4.5/
rsync -a --copy-links ${REPODIR}/mono-mac/lib/mono/4.5/Mono.WebServer2.dll ${REPODIR}/../../tmp/mono/lib/mono/4.5/
+13 -6
View File
@@ -1,8 +1,9 @@
def isPrivate = (env.JENKINS_URL ==~ /.*jenkins\.internalx\.com.*/ ? true : false)
def isPr = (env.ghprbPullId && !env.ghprbPullId.empty ? true : false)
def monoBranch = (isPr ? "pr" : env.BRANCH_NAME)
def isReleaseJob = (!isPr && monoBranch ==~ /201\d-\d\d/) // check if we're on a 2017-xx branch, i.e. release
def jobName = (isPr ? "build-package-osx-mono-pullrequest" : "build-package-osx-mono")
def windowsJobName = (isPr ? "build-package-win-mono-pullrequest" : "build-package-win-mono/${monoBranch}")
def jobName = (isPr ? "build-package-osx-mono-pullrequest" : isPrivate ? "build-package-osx-mono-private" : "build-package-osx-mono")
def windowsJobName = (isPr ? "build-package-win-mono-pullrequest" : isPrivate ? "build-package-win-mono-private/${monoBranch}" : "build-package-win-mono/${monoBranch}")
def isWindowsPrBuild = (isPr && env.ghprbCommentBody.contains("@monojenkins build pkg and msi"))
def packageFileName = null
def commitHash = null
@@ -48,13 +49,13 @@ node ("mono-package") {
packageFileName = findFiles (glob: "MonoFramework-MDK-*.pkg")[0].name
}
stage('Upload .pkg to Azure') {
azureUpload(storageCredentialId: "fbd29020e8166fbede5518e038544343",
azureUpload(storageCredentialId: (isPrivate ? "bc6a99d18d7d9ca3f6bf6b19e364d564" : "fbd29020e8166fbede5518e038544343"),
storageType: "blobstorage",
containerName: "${jobName}",
virtualPath: "${monoBranch}/${env.BUILD_NUMBER}/${commitHash}/",
filesPath: "${packageFileName}",
allowAnonymousAccess: true,
pubAccessible: true,
allowAnonymousAccess: (isPrivate ? false : true),
pubAccessible: (isPrivate ? false : true),
doNotWaitForPreviousBuild: true,
uploadArtifactsOnlyIfSuccessful: true)
}
@@ -72,7 +73,8 @@ node ("mono-package") {
echo "Not a release job, skipping signing."
}
def packageUrl = "https://xamjenkinsartifact.azureedge.net/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}"
def downloadHost = (isPrivate ? "dl.internalx.com" : "xamjenkinsartifact.azureedge.net")
def packageUrl = "https://${downloadHost}/${jobName}/${monoBranch}/${env.BUILD_NUMBER}/${commitHash}"
currentBuild.description = "<hr/><h2>DOWNLOAD: <a href=\"${packageUrl}/${packageFileName}\">${packageFileName}</a></h2><hr/>"
if (isReleaseJob) { utils.reportGitHubStatus (isPr ? env.ghprbActualCommit : commitHash, 'artifacts.json', "${packageUrl}/artifacts.json", 'SUCCESS', '') }
@@ -86,6 +88,11 @@ node ("mono-package") {
}
}
if (isPrivate) {
// skip Windows build on private jobs for now
return
}
if (!isPr || isWindowsPrBuild) {
def parameters = [[$class: 'StringParameterValue', name: 'sha1', value: commitHash]]
+34 -24
View File
@@ -3,33 +3,45 @@ properties([/* compressBuildLog() */])
parallel (
"Archive-android-debug-Darwin": {
node ("osx-devices") {
archive ("android", "debug", "Darwin")
throttle(['provisions-android-toolchain']) {
node ("osx-devices") {
archive ("android", "debug", "Darwin")
}
}
},
"Archive-android-release-Darwin": {
node ("osx-devices") {
archive ("android", "release", "Darwin")
throttle(['provisions-android-toolchain']) {
node ("osx-devices") {
archive ("android", "release", "Darwin")
}
}
},
// "Archive-android-debug-Linux": {
// node ("debian-9-amd64multiarchi386-preview") {
// archive ("android", "debug", "Linux",)
// throttle(['provisions-android-toolchain']) {
// node ("debian-9-amd64multiarchi386-preview") {
// archive ("android", "debug", "Linux",)
// }
// }
// },
// "Archive-android-release-Linux": {
// node ("debian-9-amd64multiarchi386-preview") {
// archive ("android", "release", "Linux",)
// throttle(['provisions-android-toolchain']) {
// node ("debian-9-amd64multiarchi386-preview") {
// archive ("android", "release", "Linux",)
// }
// }
// },
"Archive-ios-release-Darwin": {
node ("osx-devices") {
archive ("ios", "release", "Darwin")
throttle(['provisions-ios-toolchain']) {
node ("osx-devices") {
archive ("ios", "release", "Darwin")
}
}
},
"Archive-wasm-release-Linux": {
node ("ubuntu-1804-amd64") {
archive ("wasm", "release", "Linux", "ubuntu-1804-amd64-preview", "npm dotnet-sdk-2.1 nuget")
throttle(['provisions-wasm-toolchain']) {
node ("ubuntu-1804-amd64") {
archive ("wasm", "release", "Linux", "ubuntu-1804-amd64-preview", "npm dotnet-sdk-2.1 nuget")
}
}
}
)
@@ -66,19 +78,17 @@ def archive (product, configuration, platform, chrootname = "", chrootadditional
// build the Archive
timeout (time: 300, unit: 'MINUTES') {
lock ("${product}-${env.NODE_NAME}") {
if (platform == "Darwin") {
def brewpackages = "autoconf automake ccache cmake coreutils gdk-pixbuf gettext glib gnu-sed gnu-tar intltool ios-deploy jpeg libffi libidn2 libpng libtiff libtool libunistring ninja openssl p7zip pcre pkg-config scons wget xz"
sh "brew install ${brewpackages} || brew upgrade ${brewpackages}"
if (platform == "Darwin") {
def brewpackages = "autoconf automake ccache cmake coreutils gdk-pixbuf gettext glib gnu-sed gnu-tar intltool ios-deploy jpeg libffi libidn2 libpng libtiff libtool libunistring ninja openssl p7zip pcre pkg-config scons wget xz mingw-w64 make"
sh "brew install ${brewpackages} || brew upgrade ${brewpackages}"
sh "CI_TAGS=sdks-${product},no-tests,${configuration} scripts/ci/run-jenkins.sh"
} else if (platform == "Linux") {
chroot chrootName: chrootname,
command: "CI_TAGS=sdks-${product},no-tests,${configuration} scripts/ci/run-jenkins.sh",
additionalPackages: "xvfb xauth mono-devel git python wget bc build-essential libtool autoconf automake gettext iputils-ping cmake lsof libkrb5-dev curl p7zip-full ninja-build zip unzip gcc-multilib g++-multilib mingw-w64 binutils-mingw-w64 openjdk-8-jre ${chrootadditionalpackages}"
} else {
throw new Exception("Unknown platform \"${platform}\"")
}
sh "CI_TAGS=sdks-${product},no-tests,${configuration} scripts/ci/run-jenkins.sh"
} else if (platform == "Linux") {
chroot chrootName: chrootname,
command: "CI_TAGS=sdks-${product},no-tests,${configuration} scripts/ci/run-jenkins.sh",
additionalPackages: "xvfb xauth mono-devel git python wget bc build-essential libtool autoconf automake gettext iputils-ping cmake lsof libkrb5-dev curl p7zip-full ninja-build zip unzip gcc-multilib g++-multilib mingw-w64 binutils-mingw-w64 openjdk-8-jre ${chrootadditionalpackages}"
} else {
throw new Exception("Unknown platform \"${platform}\"")
}
}
// move Archive to the workspace root
+2 -2
View File
@@ -7,8 +7,8 @@ export PATH=${MONO_REPO_ROOT}/external/bockbuild/stage/bin:$PATH
# Bundled MSBuild
cd ${MONO_REPO_ROOT}/external/bockbuild/builds/msbuild-15/
${TESTCMD} --label="msbuild-tests" --timeout=180m ./build.sh -hostType mono -configuration Release
zip ${MONO_REPO_ROOT}/msbuild-test-results.zip artifacts/2/Release-MONO/TestResults/*
${TESTCMD} --label="msbuild-tests" --timeout=180m ./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release
zip ${MONO_REPO_ROOT}/msbuild-test-results.zip artifacts/2/TestResults/Release-MONO/* artifacts/2/log/Release-MONO/*.log
# Bundled LLVM
cd ${MONO_REPO_ROOT}/external/bockbuild/builds/mono
+6 -1
View File
@@ -61,6 +61,11 @@ for ver in $MS_EXTN_VERSIONS; do
curl -L https://dotnet.myget.org/F/dotnet-core/api/v2/package/Microsoft.NET.Build.Extensions/${ver} -o nugets/microsoft.net.build.extensions.${ver}.nupkg
done
curl https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.net.build.extensions/2.1.300-preview3-62804-06/microsoft.net.build.extensions.2.1.300-preview3-62804-06.nupkg -o nugets//microsoft.net.build.extensions.2.1.300-preview3-62804-06.nupkg
MS_EXTN_VERSIONS_DOTNETFEED="2.1.300-preview3-62804-06" # https://github.com/dotnet/cli/blob/8c937a0db08e56660aca456ac088f2d0e70735ab/build/DependencyVersions.props
MS_EXTN_VERSIONS_DOTNETFEED="$MS_EXTN_VERSIONS_DOTNETFEED 2.1.600-preview-63821-02" # https://github.com/dotnet/cli/blob/4b9d6502f8061db4a56b730d3d4e65262c72ad5c/build/DependencyVersions.props
for ver in $MS_EXTN_VERSIONS_DOTNETFEED; do
curl https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.net.build.extensions/${ver}/microsoft.net.build.extensions.${ver}.nupkg -o nugets//microsoft.net.build.extensions.${ver}.nupkg
done
touch .download_stamp_file