Age | Commit message (Collapse) | Author |
|
We'll need to do this only on failure since the previous step will fail the build on an API diff.
|
|
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
|
|
|
|
Disable a few tests that fail in FullAOT in Docker due to missing IPv6, see https://github.com/mono/mono/issues/20888
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
|
|
GitHub is removing support for unencrypted git soon: https://github.blog/2021-09-01-improving-git-protocol-security-github/
|
|
Co-authored-by: Esme Povirk <esme@codeweavers.com>
|
|
Don't unbox a valuetype `this` if the generic method is a DIM
Fixes https://github.com/dotnet/runtime/issues/58394
Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
|
|
|
|
The missing comma leads to "SET_KEEPALIVE" and "GET_TYPES_FOR_SOURCE_FILES" being merged, breaking both entries. This is very likely unwanted and a bug.
|
|
* Added constructors to OptionSet to allow for Case Insensitive command line arguments. Will be Case Sensitive by default, and can pass StringComparer.OrdinalIgnoreCase to use Case Insensitive which is passed to the base KeyedCollection<string, Option>. Added related unit tests in CaseSensitivityTests.cs.
* Fix code style
* Update Mono.Options xml docs
* Bump api-snapshot submodule
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
|
|
* Update portable executable and import table validation
Update the SectionAlignment and FileAlignment validate to match the
ms docs...
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-windows-specific-fields-image-only
"SectionAlignment
The alignment (in bytes) of sections when they are loaded into memory
It must be greater than or equal to FileAlignment. The default is the
page size for the architecture."
"FileAlignment
The alignment factor (in bytes) that is used to align the raw data of
sections in the image file. The value should be a power of 2 between 512
and 64 K, inclusive. The default is 512. If the SectionAlignment is less
than the architecture's page size, then FileAlignment must match
SectionAlignment."
For the import table use a case insensitive compare for the mscoree.dll
file name.
* Fixing a error message typo...
"Aligmnent" to "Alignment"
|
|
This return statement is dead code and can’t be reached. Remove it.
|
|
|
|
When a callvirt instruction is encountered on a static method, there is
a hard abort/crash. This commit avoids the problem.
|
|
In some cases, it seems like Mono.Profiler.Aot `ProfileWriter` can produce custom profiles that are unable to be read by `ProfileReader` (or `aot-compiler.c`). There are a few reports [here](https://github.com/xamarin/xamarin-android/issues/4602#issuecomment-618201419).
I investigated and found a cause may be the writing of incorrect string length markers in situations where `String.Length` is less than the encoded byte length. In that kind of case, the reader falls out of sync with the record structure and quickly fails. [Here is an example dependency](https://www.fuget.org/packages/AuroraControls.Core/1.2020.520.2/lib/netstandard2.0/Aurora.dll) with members that can produce the issue (I guess the odd characters are caused by obfuscation).
![image](https://user-images.githubusercontent.com/7392704/129899400-086a6e8a-373c-4601-837a-5255e7f93d82.png)
I don't think the change requires a profile format version bump, as the format itself is unchanged.
|
|
Add a new mono_pmip_u that doesn't do the transition.
The intent is that Mono developers in the debugger can call still call
mono_pmip_u if the thread state machine is in a broken state.
|
|
Detected by valgrind.
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
|
|
* Missed this float32 instruction: OP_RMOVE
* Additional float32 fixes
- rmove specification in cpu-s390x.md
- OP_RMOVE implementation in mini-s390x.c
- Correct float instruction lengths
- Disable debug code
|
|
* - Enable full float32 support
- Add instructions for FP operations: abs[f]/ceil[f]/floor[f]/round[f]/sqrt[f]/trunc[f]
- Enable these instructions in mono_arch_emit_inst_for_method()
- Handle return of float32 results
- Correct rounding mode for OP_LCONV_TO_R_UN processing
- Enable MONO_OPT_LINEAR optimizations
- Correct prolog processing of structure returned variable
- Rework OP_LOCALLOC for cases where alloc size > 4k
- Add OP_POPCNTxx support
- Minor typo (missing tab)
* For 17 years I've believed that structures of size 1, 2, 4, or 8 bytes could be returned in a register. TIL this is not the case.
* While we don't return structures in the register we can still optimize so that we
keep the address of the structure in a register so we need to properly load it in
the prolog. Similarly, in the epilog we need to set the return register with that
value.
I would have thought that the SETRET processing would have taken care of this which
it does when we put the address on the stack but for the case when that variable is
kept in a register we don't seem to automatically load the return register.
* My prevous comments wrt mono_arch_emit_epilog were incorrect. There is no need to explicitly
set the register here as it will be done. My interpretation of my test case was incorrect.
|
|
Mark it as an external only API. In the runtime, use `mono_gc_wait_for_bridge_processing_internal`
Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
|
|
* The mono_refcount_inc call in mono_image_storage_trypublish or
mono_image_storage_tryaddref may abort when racing against a
mono_image_storage_dtor that already decremented the refcount.
This race triggered in some cases when building aspnetcore using a Mono-based dotnet host SDK. The problem is that `mono_image_storage_close` runs outside the `mono_images_storage_lock` (and this may be unavoidable due to lock ordering concerns). Therefore, we can have a refcount that was already decremented to zero, but before `mono_image_storage_dtor` finishes removing the object from `images_storage_hash`, a parallel `mono_image_storage_trypublish` may have retrieved it from there. In that case, the `mono_refcount_inc` call will abort.
Fixed by detecting that case via `mono_refcount_tryinc` instead, and simply treating the object as if it had already been removed. It will in time actually get removed, either by the parallel `mono_image_storage_dtor`, or else by the `g_hash_table_insert` in `mono_image_storage_trypublish` (which will safely replace it with the new object, and `mono_image_storage_dtor` will then detect that and skip removal).
Co-authored-by: uweigand <uweigand@users.noreply.github.com>
|
|
* optimize adding unwind info entries by hashtable
* cosmetic
* fix code styling
|
|
https://github.com/dotnet/runtime/commit/3b3099f00add243f7ee453e7fd6975a00a9871ed
|
|
This change is released under the MIT license.
|
|
Related to https://github.com/mono/mono/issues/21009
There are two scenarios:
1. When someone force quits Mono (or just runs `kill -TERM <pid>`), the process can receive the signal on any thread,
2. or - if a thread in the process crashes, but the thread is not attached to the runtime, Mono's signal handlers still run.
The crash reporter assumes that the crashing thread is either attached to the runtime, or at least `mono_thread_info_current` or the JIT TLS data are set for the thread. If the thread is truly foreign and it never interacted with Mono, and it crashes, both of those assumptions are false, but Mono's crash reporter signal handlers still run.
The solution from this PR is: if crash reporting is enabled, start a dedicated thread at process startup that is a "crash report leader" - when a crash happens, the crashing thread (the crash originator) wakes the leader, and the leader collects the crash report. The crash originator does not do any work that requires being attached to the runtime or to the JIT such as iterating over thread IDs or stack walking.
---
* Add a standalone test of crash on a foreign thread
* extra async printfs
* Sketch out crash leader implementation
At process startup, start a separate thread that is attached to the runtime and can collect crash reports. Crashing threads will wake it and wait for it to collect the crash reports
* Start moving responsibilities to the crash leader
* Watch for nil jit_tls data if crash is on a foreign thread
* Start adding a state machine for the crash leader
We need to coordinate the originator and the leader in a few places.
The leader needs to pause to after collecting the thread ids before suspending the non-originator threads, and again while the originator is dumping its own stack.
The originator needs to wait for the leader to collect the thread IDs and to tell it its assigned slot. Then it tells the leader to suspend the others, dumps its own memory, then tell the leader to dump the whole crash report and wait for it to reply when it's done.
* Move remaining summarizer work to the summarizer leader thread
* change some debug printfs
* Successfully summarize a foreign thread crash
* Add test to merp-crash-test.cs
* delete standalone test
* if the crash leader is the originator, collect the report synchronously
either because the crash leader crashed, or because the process got a SIGTERM and it arrived on the crash leader thread
* fixup comments
* turn off crash leader printf debugging
* Don't create leader thread if crash reporting is disabled
* Fix test on win32
* Update mono/tests/libtest.c
* fixup logging and comments around managed stack collection
* Disable the merp dlopen crasher
* Remove crash leader state machine
It's straightline code with two early exits. State machine is overkill
* remove remnants of leader state machine
|
|
classes using DIMs (#21112)
* Don't return null target methods in GetInterfaceMap for abstract classes, or classes using DIMs
If the interface method is reabstracted, and either the found implementation
method is abstract, or the found implementation method is from another
DIM (meaning neither klass nor any of its ancestor classes implemented the
method), then say the target method is null. Otherwise return the found
implementation method, even if it is abstract.
Corresponding dotnet/runtime PR is https://github.com/dotnet/runtime/pull/53972
Fixes https://github.com/dotnet/runtime/issues/53933
* Add method flags accessors; cleanup interface map code
Ported from https://github.com/dotnet/runtime/pull/54271
|
|
|
|
|
|
|
|
Added implementations for `Console.SetWindowSize(int, int)`, `Console.SetBufferSize(int, int)` and associated properties. This is [based on Xterm control sequences](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Miscellaneous) which are supported by a lot of Linux terminals.
The previous API was very hit or miss - e.g. the method `Console.SetWindowSize(int, int)` just does absolutely nothing, while the setter for `Console.WindowWidth` always throws an exception.
The new implementation sends a control sequence if `TERM` starts with "xterm", otherwise throws an exception.
|
|
PrintPreviewControl (#21010)
If a reference to PrintDocument is passed to PrintPreviewControl, and then this control is displayed on the form,
then original PrintController of the PrintDocument will be replaced by previewController and if you call print for PrintController,
then the print page will not be sent to printer.
|
|
it (#21014)
Fix regression introduced in # 20953
If we do not use this typecasting, then NRE will occur in line 910 for MenuStrip with submenu embedded in the form.
|
|
(#21100)
* Fix * Assertion at C:\build\output\Unity-Technologies\mono\mono\mini\debugger-engine.c:1657, condition `is_ok (error)' not met, function:set_set_notification_for_wait_completion_flag, Could not execute the method because the containing type 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[T_REF]', is not fully instantiated. assembly:<unknown assembly> type:<unknown type> member:(null)
* Adding test case.
* Remove unrelated changes.
* Fix test on interpreter.
|
|
|
|
Provide the UCONTEXT macros, which for OpenBSD simply map to sigcontext.
|
|
Avoid Windows socket error code WSAEMSGSIZE when receiving the ping
reply for larger sent payloads.
|
|
posix_fallocate (#21098)
|
|
Addressing 4 issues for GetInterfaceMap and default interface methods
Only methods marked as virtual on on interface should be added to the
interface map. (no static or instance)
If the found target method is ambiguous (a diamond) the target is
null.
If the found target method's class in an interface, then the target
class is the interface class, else it is the class of the RuntimeType
(aka this)
If the found target method is abstract (reabstraction) then the
target is null.
https://github.com/dotnet/runtime/blob/6072e4d/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapConsumer.cs
|
|
We won't switch to C++ in the mono/mono repo.
|
|
Fix for null-pointer bug found with Clang's undefined-behavior-sanitizer using `-fsanitize=null`
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
|
|
|
|
information (#21058)
https://github.com/dotnet/runtime/pull/52632/
|
|
* Import s390x fixes from dotnet runtime
* Add thunking to s390x for calls that will be patched
A problem arose when running with 8 cores and a call was being patched via the mono_arch_patch_callsite API. Because the value being patched may not be on a boundary that the architectures as being "block concurrent" (e.g. pointers need to be aligned on 8 byte boundaries). The opshot of which is that the value may be being updat
ed while another thread is fetching it and if not on a boundary the value could be in an intermediate state resulting in a branch to the wrong place.
This patchset implements thunking so that when a call is emitted the call sequence changes from:
iihf %rx,<hiword of target address>
iilf %rx,<loword of itarget address>
bras %r14,%rx
to:
lgrl %rx,thunk
bras %r14,%rx
thunk: .quad <target address>
Similarly, tailcalls change from:
iihf %r1,<hiword of target address>
iilf %r1,<loword of itarget address>
j %r1
to:
lgrl %r1,thunk
br %r1
In addition, the file support-s390x.h is a hangover and can now be rolled into mini-s390x.h.
* mono/mini/Makefile.am.in:
- Remove support-s390x.h
* mono/mini/exceptions-s390x.c:
- Eliminate a couple of compiler cast warnings
* mono/mini/mini-s390x.c:
- Implement thunking
* mono/mini/mini-s390x.h:
- Incorporate support-s390x.h
* mono/mini/support-s390x.h:
- Delete file
* mono/mini/tramp-s390x.c:
- Thunking changes
* Remove commented out code
|
|
|
|
Accessing the storage account fails now when using plain http.
|
|
Should address https://github.com/mono/mono/issues/21034 when mirrored
The leaked memory was the duplicated strings after the first assembly-specific lookup. If that lookup failed, they were overwritten with the global lookup and never freed.
Co-authored-by: CoffeeFlux <CoffeeFlux@users.noreply.github.com>
|
|
For some reason it recently fails with weird race conditions, let's see if that helps.
|
|
If the method or type containing the icall instruction has a
generic parameter, the resulting signature is "inflated" even if
the generic parameter is not used in the signature. This breaks
some methods in SlimDX, and probably other C++/CLI code.
Co-authored-by: Esme Povirk <esme@codeweavers.com>
|
|
* Disable EventLog tests on Windows if we're not running as admin
* Disable a socket test that doesn't work on Win10
* Fix MetadataResolverTest on Windows in AzDO
There's something running on localhost already that makes the test fail, use a different hostname instead.
* Force ASCII encoding for console-output.cs
* Use different way to compare output of test-console-output
* Fix issue with symlink on PublishTestResults
* Use Unicode encoding in Win32EventLog p/invokes, fixes eventlog tests on Win10
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
|
|
Related to https://github.com/mono/mono/issues/21040 and
https://github.com/dotnet/runtime/issues/48663
On MacOS Big Sur open() is much more likely to throw EINTR - and moreover if
the thread receives a signal while doing an open() even if the signal handler
is marked with SA_RESTART, the open call appears not to restart and to fail
anyway.
So wrap all the calls to open() in retry loops.
|