Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/class
AgeCommit message (Collapse)Author
2020-06-18[2020-02] [merp] Add API methods for getting hashcode/reason of last crash ↵monojenkins
(#19978) * [merp] Add API methods for getting hashcode/reason of last crash * Add test * Review feedback and cleanup Co-authored-by: Alexis Christoforides <alexis@thenull.net>
2020-05-25Always include Unicode charinfo, so tar made in csc mode works in mcs mode ↵monojenkins
(#19813) As-is, a tarball created in Roslyn mode is missing the file charinfo.nlp, which mcs needs to build the classlib. Backport of #19807.
2020-04-28Fix if already send error to http client, do not callback. (#19668)monojenkins
Fixed #10435 HttpListener already closes the Response object, closes the HTTP Client connection, and then sets the value of Response.StatusCode again. If so, an ObjectDisposedException is thrown. ``` Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.HttpListenerResponse'. at System.Net.HttpListenerResponse.set_ContentLength64 (System.Int64 value) [0x00013] in <b4473693dd3c4d45883c574a53529fbe>:0 at MonoConsoleApp1.Program.Main (System.String[] args) [0x000f8] in <a66f6d7d417445dc9f89c691941ca70b>:0 at MonoConsoleApp1.Program.<Main> (System.String[] args) [0x0000c] in <a66f6d7d417445dc9f89c691941ca70b>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.HttpListenerResponse'. at System.Net.HttpListenerResponse.set_ContentLength64 (System.Int64 value) [0x00013] in <b4473693dd3c4d45883c574a53529fbe>:0 at MonoConsoleApp1.Program.Main (System.String[] args) [0x000f8] in <a66f6d7d417445dc9f89c691941ca70b>:0 at MonoConsoleApp1.Program.<Main> (System.String[] args) [0x0000c] in <a66f6d7d417445dc9f89c691941ca70b>:0 ``` If an error is sent to the HTTP client while processing a request, it is patched so that the next process is not executed anymore. Backport of #19664.
2020-04-24[System.Runtime.Serialization] Work around `specified cast is not valid` ↵monojenkins
error (#19640) Backport of #19620.
2020-04-09[2020-02][debugger] Bump protocol for multi threaded single step ↵Thays Grazia
implementation (#19437) (#19477) As suggested by jbevain we should bump the protocol to implement this. (#19437) Backport https://github.com/mono/mono/pull/19437/
2020-04-09[2020-02] Add BeginRead/BeginWrite/EndRead/EndWrite overloads back to ↵monojenkins
SslStream (#19476) * Add BeginRead/BeginWrite/EndRead/EndWrite overloads back to SslStream and underlying implementation. Unlike the default implementation in Stream it allows parallel read along with parallel write using the standard TaskToApm pattern (https://github.com/dotnet/runtime/issues/33447). This reverts part of https://github.com/mono/mono/pull/17393 which could lead to deadlocks as reported in https://github.com/mono/mono/issues/18865. * Move the TaskToApm pattern from MobileAuthenticatedStream to SslStream * Bump API snapshot submodule Co-authored-by: Filip Navara <filip.navara@gmail.com>
2020-04-08[2020-02][debugger] Bump protocol for this commit ↵Thays Grazia
https://github.com/mono/mono/pull/19248 (#19318) (#19473) * Bump protocol for this commit https://github.com/mono/mono/pull/19248 as suggested by @vargaz. * Fix coding convention.
2020-04-08[2020-02][debugger] Fix NOT_IMPLEMENTED while debugging. (#19450)Thays Grazia
* Backporting this, and after this I will backport the bump protocol for this PR. * Bump API snapshot submodule Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
2020-03-27[2020- 02][debugger] Implementing step through multithreaded code. (#19343)Thays Grazia
* [debugger] Implementing step through multithreaded code. Backport #19103 * Bump API snapshot submodule Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
2020-03-27Fix suspend_policy that will be sent to debugger-libs, because on ↵Thays Grazia
debugger-libs we want to resume the VM only when it's suspended, but we were sending the wrong suspend_policy in the case of EVENT_KIND_VM_START and mono is started with suspend=y. (#19330) With this fix we can do this PR again: https://github.com/mono/debugger-libs/pull/264/ Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/999375/
2020-03-26[2020-02] [corlib] Suppress finalization of underlying console FileStreams ↵monojenkins
(#19164) * [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. The issue is that during shutdown, the CStreamWriter and its underlying FileStream might be finalized in arbitrary order, so if the FileStream is finalized first, even though it doesn't own the safeHandle, the access check in Write(byte[], int, int) will fail, despite the fact that the underlying call to MonoIO.Write could have succeeded. Addresses https://github.com/mono/mono/issues/19005 Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
2020-03-13[2020-02] [corlib] Capture the ExceptionDispatchInfo when rethrowing from ↵monojenkins
TaskContinuation (#19209) * [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation In `task.GetAwaiter().OnCompleted(action)` if `action` throws, the `TaskContinuation.RunOrScheduleAction method will catch the exception and then call `RuntimeAugments.ReportUnhandledException`. We must not simply throw the exception again - in that case we will lose all the frames leading up to the `catch` in `RunOrScheduleAction`. Instead use ExceptionDispatchInfo to caputure the original throw. Addresses https://github.com/mono/mono/issues/19166 * [test] Add regression test For annoying reasons we can't run this as a simple NUnit test because the exception is unhandled on some arbitrary threadpool worker thread, and those don't show up within an NUnit setup. Additionally because the unhandled exception in the root domain would normally terminate the application, we need to run this in a new appdomain. Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
2020-02-27[2020-02][debugger] Enable reading embedded ppdb (#19049)Thays Grazia
Backport https://github.com/mono/mono/pull/18895
2020-02-22Revert linker change of 5a65a97 (#18993)monojenkins
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. Co-authored-by: Fan Yang <52458914+fanyang-mono@users.noreply.github.com>
2020-02-20Remove TestEnvVarSwitchForInnerHttpHandler test as it should be in ↵monojenkins
XA/LinkerTests.cs instead (#18955) Co-authored-by: Egor Bogatov <egorbo@gmail.com>
2020-02-19[2020-02] [bcl] Default XmlSerializer stream serialize to UTF8 Encoding (#18907)monojenkins
* [mcs] Default XmlSerializer stream serialize to UTF8 Encoding * [bcl] Add XmlSerialize Test to preserve UTF chars in stream
2020-02-18[2020-02] Make MonoWebRequestHandler linker friendly (#18834)monojenkins
* Make MonoWebRequestHandler linker friendly * Make MonoWebRequestHandler's ctor public (to be able to use in Activator.CreateInstance without binding flags) * Remove Console.WriteLine from system.net.http Co-authored-by: Egor Bogatov <egorbo@gmail.com>
2020-02-18Move HttpClientHandlerTests.Android.cs to nunit (#18890)monojenkins
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
2020-02-12[2020-02] Allow users to switch to MonoWebRequestHandler on Android via UI ↵monojenkins
(#18785) * Bring back old HttpHandler for Android Co-authored-by: Egor Bogatov <egorbo@gmail.com>
2020-01-29[corlib] Split corlib xunit tests even more for iOS (#18619)Alexander Köplinger
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
2020-01-28Use memmove in Buffer.MemoryCopy (#18547)Egor Bogatov
* Use memmove in Buffer.MemoryCopy * add test case
2020-01-28[WinForms] Incorrect Tree Nodes drawing at the `OwnerDrawText` mode (#18605)Nikita Voronchev
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>
2020-01-28[Winforms] Form fixes (#18427)Karl
* 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.
2020-01-28Don't select ListBox item if SelectionMode == None (#18492)Karl
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.
2020-01-28[WinForms] Make `ContextMenuStrip` behavior closer to the reference one (#18598)Nikita Voronchev
* [WinForms] Make `ContextMenuStrip` behavior closer to the reference one * Bump API snapshot submodule Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
2020-01-28Merge pull request #18491 from PreferLinux/RTF+Textbox-workAlexander Köplinger
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
2020-01-28[csproj] Update project filesmonojenkins
2020-01-27[WinForms] Display caret while click on ComboBox (#18523)Nikita Voronchev
If one click on a `ComboBox` the caret does not appear. This is so because `document.PositionCaret` call hides the caret.
2020-01-27Fix UnixEncoding.GetBytes() for empty strings (#18520)Steffen Kieß
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.
2020-01-27Fix open port for X11 applications (#18583)felixdoerre
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.
2020-01-27[Winforms] X11 Fix bounds change from within bounds-related events (#18513)Karl
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`).
2020-01-27[WinForms] Fix #18506 ActiveTracker, do not propagate message to control ↵abrevet-dev
when it is not enabled and visible. (#18541) Fixes #18506
2020-01-26[debugger] Access invalid memory address using PointerValue Command. (#18537)Thays Grazia
* 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>
2020-01-25Fix typos (#18585)Maher Jendoubi
* Contributing: fix typos * fixed encoding and other typos * fixed encoding and spotted other typos * Update TransformationRules.cs
2020-01-21Store the current encoding code page, not encodingKarl
The encoding itself could be null, while encoding_code_page should always be valid.
2020-01-21Use correct default encoding.Karl
2020-01-18Calculate DPI before Recalculate.Karl
2020-01-18Fix NullReferenceException when parsing RTF.Karl
charset_stack was never initialised.
2020-01-17[tests] Re-enable profiler test that used to fail (#18471)Vlad Brezae
It is not clear if it will fail again or not, but it is not reproducible. Closes https://github.com/mono/mono/issues/8709
2020-01-17[runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread ↵Aleksey Kliger (λgeek)
(#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
2020-01-14Add normalized .bat files after the .gitattributes EOL changeAlexander Köplinger
2020-01-13[Winforms] Calculate GroupBox preferred size the same way as Panel (#18429)Karl
GroupBox's GetPreferredSize() is not great. I've simply copied the code from Panel, and used that. It uses LayoutEngine.GetPreferredSize(), which does things a lot better than the code this used.
2020-01-13[Winforms] Always draw at least one line of a Label. (#18422)Karl
Previously, if the Label wasn't quite high enough nothing would be drawn as the line didn't quite fit. It should draw the line anyway, clipped if necessary.
2020-01-13[Winforms] Improve X11 keyboard handling. (#18428)Karl
- Ignore key events with vkey == 0. They won't match a real key code so don't try. Besides, trying can cause segfaults on ChromeOS Linux mode. - Check special-case keys (numpad) before looping to get them. No point leaving them for afterwards...
2020-01-13[Winforms] Don't have non-active controls focused (#18426)Karl
- Make the state of Control.CanSelect depend on whether the control is visible and enabled. - When setting Control.Visible to false, if this control is focused, move the focus to the next control.
2020-01-13[Winforms] Implement correct Control.Region / ClipRegion support on X11 (#18421)Karl
Fixes https://xamarin.github.io/bugzilla-archives/20/20233/bug.html Previously, on Linux, setting Control.Region just set the clipping for painting, but didn't influence the visibility of other controls behind the one it was set on. This implements this correctly via X11 Shape extension.
2020-01-13[Winforms] X11Keyboard LookupString fixes (#18423)Karl
Two small fixes to X11 keyboard handling here: - For Xutf8LookupString, use the actual buffer size rather than the starting buffer size. Using the previous fixed size made the buffer overflow handing code immediately after the change pointless. - For XLookupString, handle similar to Xutf8LookupString, getting a byte array. The old was sometimes causing problems where input on the numeric keypad didn't enter text. I believe using a StringBuilder similar to how it was _should_ work, but for some reason I could not get it to work reliably. So I changed it to this, which seems to work well for me. The only question I have is whether it should be Encoding.ASCII like I used, Encoding.Default, or another specific encoding.
2020-01-13[jit] Fix an assertion in the Thread.VolatileRead () intrinsic. (#18430)Zoltan Varga
Fixes https://github.com/mono/mono/issues/18418.
2020-01-13Only calculate scrollbars once handle createdKarl
2020-01-13Significantly improve DPI caching.Karl
Particularly, don't call CreateGraphics() in TextBoxBase's constructor.