Age | Commit message (Collapse) | Author |
|
* [corlib] Suppress finalization of underlying console FileStreams
We already suppress the finalization of the CStreamReader and CStreamWriter,
but during shutdown, the underlying FileStream may be finalized which
invalidates its access field which can lead to a crash.
Addresses https://github.com/mono/mono/issues/19005
|
|
|
|
As analysed by @jstedfast and me the only way to get this exception with this callstack below is 2 threads call GetThreads at same time, so while one of them is filling the items in the array, the other one is already trying to use the array with null items.
```
System.NullReferenceException: Object reference not set to an instance of an object
at Mono.Debugging.Soft.SoftDebuggerSession.GetId (Mono.Debugger.Soft.ThreadMirror thread) [0x00000] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:3227
at Mono.Debugging.Soft.SoftDebuggerSession.OnGetThreads (System.Int64 processId) [0x0002c] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:879
at Mono.Debugging.Soft.SoftDebuggerSession.GetThread (Mono.Debugging.Client.ProcessInfo process, Mono.Debugger.Soft.ThreadMirror thread) [0x00008] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:902
at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet (Mono.Debugger.Soft.Event[] es, System.Boolean dequeuing) [0x00501] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:2038
at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet (Mono.Debugger.Soft.EventSet es) [0x0005b] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:1687
at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x0005d] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:1625
```
PR on mono/debugger-libs -> https://github.com/mono/debugger-libs/pull/300
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1070384/
|
|
It should now validate against ICollection or any other type that has a Count property for that matter.
We're still relying on the reference source implementation because corefx strips some types out.
Fixes https://github.com/mono/mono/issues/19022
|
|
(#19074)
PNSE coverage of wasm bcl has shown that only three public members of `System.Net.NetworkInformation.NetworkInterface` class throw `PlatformNotSupportedException`.
Now all public members throw PNSE on WASM.
Relates to https://github.com/mono/mono/issues/18735
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
* [runtime] Use pointer size gchandles
This would enable in the future to use CoreCLR's GC with mono. This doesn't change the current embedding api, but, in the future, we will end up aligning with coreclr on an embedding api that uses pointer sized gchandles.
* [gc] Change format of gchandles to be netcore compatible
On netcore, the GCHandle class assumes the lowest bit to be usable, for perf improvements. Move the responsability to have this bit available down to the GC implementation, since for CoreCLR GC we shouldn't do any shifting above the gc interface.
|
|
Assume, one have colorized `PropertyGrid propertyGrid` control:
```
propertyGrid.CategoryForeColor = Color.Red;
propertyGrid.LineColor = Color.Blue;
```
Before changes proposed by the current PR we get the following image:
![before](https://user-images.githubusercontent.com/12382656/75364102-3391fe80-58cc-11ea-9136-347bcd567731.png)
After:
![after](https://user-images.githubusercontent.com/12382656/75364115-3987df80-58cc-11ea-95d1-20691a4a8467.png)
(item labeled "_Child 2_" is selected by user)
|
|
* Bump linker.
* Bump linker tools framework version
* [csproj] Update project files
Co-authored-by: Marek Safar <marek.safar@gmail.com>
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
Fixes #18926
|
|
|
|
* [corlib] Invoke TypeBuilderInstantiation.MakeGenericType through a delegate created in the TypeBuilder ctor to break a linker dependency between RuntimeType and TypeBuilderInstantiation.
* [corlib] Update linker descriptor.
* UnmanagedMarshal is not used from native code at all.
* AssemblyName is not used from native code at all.
|
|
|
|
This is needed because the required='false' field in
```
<type fullname="System.Reflection.Emit.TypeBuilder" required='false' preserve="fields" feature="sre">
<method name="SetCharSet" feature="sre" />
<!-- reflection.c mono_reflection_call_is_assignable_to () -->
<method name="IsAssignableTo" feature="sre" />
```
Fails to preserve the IsAssignableTo method.
|
|
To fix the issue of enabling embedded pdb everywhere the problem was that when the roslyn tests are compiling sources it creates embedded pdb with source file "", and before enable reading the embedded pdb we don't read this information, and now we read and our StackTrace file written in our corlib doesn't expect a source file "", it's okay if it's NULL but not "".
I could fix in corlib or in mono, I prefer to fix on mono because I don't know if there is any other place that doesn't expect source file "".
|
|
XA/LinkerTests.cs instead (#18952)
The test will be moved to XA's `src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs`
It only works if
```xml
<AndroidHttpClientHandlerType>System.Net.Http.MonoWebRequestHandler, System.Net.Http</AndroidHttpClientHandlerType>
```
is set in `Xamarin.Android.Bcl-Tests.csproj` and we don't want it (other tests expect SocketsHttpHandler to be default one). As an alternative we can add it to the `Xamarin.Android.Bcl-Tests.csproj`'s Linker exceptions but `/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs` is a better place for it.
|
|
* [mcs] Default XmlSerializer stream serialize to UTF8 Encoding
* [bcl] Add XmlSerialize Test to preserve UTF chars in stream
|
|
|
|
The linker can completely link away some assemblies, but the rest of the ninja
build still requires them. Previously they were generated by running csc, but
thats too slow, so generate them using Cecil from wasm-tuner.
|
|
Create it using reflection so it will be always linked out. However if it's set via `XA_HTTP_CLIENT_HANDLER_TYPE` linker will preserve it in a special substep: https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveHttpAndroidClientHandler.cs#L72-L80
I had to make its ctor **public** because Linker instantiate it via `Activator.CreateInstance(string)` ([here](https://github.com/xamarin/xamarin-android/blob/60363ef45cd6994a322adac1b73d4271b0658c1e/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs#L369)). But the whole type remains internal so it's not a real API change.
Fixes issue from https://github.com/mono/mono/pull/18818#issuecomment-585611647
|
|
* Bump linker submodule
* Use -o instead of -out for linker output
The arguments changed in linker.
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
|
|
Libgdiplus will fail when attempting to delete a Graphics object
that has an unreleased HDC. This allows Dispose to succeed in
that case.
This more closely resembles the behavior of corefx.
|
|
* Bring back old HttpHandler for Android
|
|
|
|
|
|
* Bump linker.
* [csproj] Update project files
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
Follow-up to https://github.com/mono/mono/pull/18228 since two parts wasn't enough to fix the size issue on 32bits devices.
We now use three parts.
Fixes https://github.com/mono/mono/issues/18614
|
|
* Use memmove in Buffer.MemoryCopy
* add test case
|
|
Assume we have the following form `MyForm`:
```
using System;
using System.Drawing;
using System.Windows.Forms;
namespace test_TreeView
{
public class MyForm : Form
{
TreeView treeView = new TreeView()
public MyForm()
{
treeView.Nodes.Add("root node");
treeView.Nodes[0].Nodes.Add("first child node");
treeView.BackColor = Color.Gray;
treeView.LineColor = Color.Yellow;
treeView.DrawMode = TreeViewDrawMode.OwnerDrawText;
treeView.DrawNode += treeView_DrawNode;
Controls.Add(treeView);
}
private void treeView_DrawNode(object sender, DrawTreeNodeEventArgs e)
{
var brush = new SolidBrush(Color.FromArgb(100, 255, 0, 0));
e.Graphics.FillRectangle(brush, e.Bounds);
}
}
}
```
The displayed result is
![image](https://user-images.githubusercontent.com/12382656/73263417-92872980-41e1-11ea-8f7c-7cecbb376b60.png)
One can see couple drawing issues:
* White rectangles under each `TreeNode`.
* The area of custom drawing (red rectangles) is shifted with respect to this white rectangles.
Current PR proposes the fix of this issues.
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
* Fix Return handling. Ensure correct ClientSize.
When pressing Return / Enter, ensure any target button is both visible
and enabled.
In CreateHandle(), ensure the ClientSize is correct if set. If not,
update it to make it right. Suspend layout while changing it so that
child controls with anchors other than Top Left are not moved.
* Select active control. PerformLayout after updating for client size.
Select the active control with SendControlFocus to avoid upsetting what
is currently selected.
* Improve Form window decoration adjustment handling
Reverts the incorrect attempted fix contained in previous commits.
Basically, when a property is changed that affects window decorations,
ensure the client size stays the same.
* Use UpdateFormStyles on FormBorderStyle too.
|
|
When the user types a letter or digit, KeySearch looks for and selects
an item starting with that character. However, it should not if
SelectionMode is None.
|
|
* [WinForms] Make `ContextMenuStrip` behavior closer to the reference one
* Bump API snapshot submodule
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
I've implemented a heap of missing RTF and RichTextBox stuff, and also made some improvements or fixes to various aspects of it. I'm sorry this is so big...
To give an overview of the changes, here's a list:
- Removed the RTF Charcode / Charset handling that wasn't actually used, had a lot of missing functionality and was basically reimplementing character encoding handling, and replaced it with ensuring the correct character encoding is being used (changing when needed).
- Improved RTF handling of objects with object results (process the given object result). Sometimes pictures can be like this.
- Improved line wrapping and alignment
- Added or greatly improved support for:
- paragraph spacing
- line spacing
- paragraph indents (left, right, hanging)
- tabstops (left, centre, right, decimal)
- text background colour (like highlighting)
- superscript / subscript
- character offset (vertical)
- text visibility
- Significantly improved RichTextBox RTF generation
- Cache DPI, rather than doing `CreateGraphics()` every time it is needed
- A variety of other fixes and improvements, with a few I can think of relating to:
- caret position
- replacing text
- invalidation and drawing
- when tags are added or deleted
|
|
|
|
If one click on a `ComboBox` the caret does not appear. This is so because `document.PositionCaret` call hides the caret.
|
|
Current versions of the mono return a null pointer as address of the first
element for empty arrays, i.e.
fixed (byte* ptr = new byte[0]) Console.WriteLine (ptr == null);
will print "true". This causes a problem in the UnixEncoding class where it
triggers a check for null pointers. Fix this by allowing null pointers when
the number of elements is zero.
|
|
Whenever mono opens an X11 window, the application opens a tcp socket for controlling the (non-tcp)-connection to X11. This is bad practice, as a tcp socket is not needed.
This pull request cleans the logic, by replacing the tcp socket with a fifo. That way this loopback connection is not visible from outside the .NET application, and all logic surrounding it should remain unchanged.
|
|
The real change here is, in `XplatUIX11.SetWindowPos()`, simply moving the `SendMessage` call to the end instead of earlier. The problem with it earlier is that any change in bounds from any of the bounds-related events (OnLocationChanged / OnMove, OnSizeChanged / OnResize, OnLayout, OnClientSizeChanged) will be overridden. When `SendMessage` is called, `UpdateBounds` is run, and that raises those events as relevant. After those events finish, `SetWindowPos` continues with setting the size of the window to the value originally specified – which is now potentially wrong. So send the message later on.
There is also no point that I can see in writing the values to `hwnd` twice, because as far as I can see the only one that can be changed is `hwnd.ClientRect` (set by `PerformNCCalc`).
|
|
when it is not enabled and visible. (#18541)
Fixes #18506
|
|
* Validate the address that came from IDE using PointerValue. The IDE can send an invalid address and it was crashing mono.
Fixes #18191
Fixes #15612
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
|
|
* Contributing: fix typos
* fixed encoding and other typos
* fixed encoding and spotted other typos
* Update TransformationRules.cs
|
|
|
|
* [mcs] skip "_" when building number
* [mcs] Refactor digit separator feature report
* [mcs] Clean up digit separator code
* [mcs] Throw errors for invalid digit separator usage
* [mcs] Fix hex and bin usage of digit separator tests
* [mcs] Add digit separator usages that throw errors
* [mcs] Update il
|
|
The encoding itself could be null, while encoding_code_page
should always be valid.
|
|
|
|
|
|
charset_stack was never initialised.
|
|
It is not clear if it will fail again or not, but it is not reproducible.
Closes https://github.com/mono/mono/issues/8709
|
|
|
|
(#18480)
* [runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread
This function (and its call to mono_handle_new) was showing up in the
flamegraph for some async-heavy benchmarks
|
|
|