Re: [Mono-dev] Patches for mono-winforms
Weird. I just tried building WinForms master on Linux, and I get the same result I get on Windows. Not sure what's wrong. But the tests still pass, it's just the displayed controls that are wrong. Steven Boswell II wrote No idea...enclosed is the window generated on my system by the test project, superimposed over your screenshot. As you can see, the layout is the same as the .NET one in your screenshot. Thanks for looking at my patches. Steven Boswell From: Stifu lt;stifu@gt; To: mono-devel-list@.ximian Sent: Sunday, July 22, 2012 2:38 PM Subject: Re: [Mono-dev] Patches for mono-winforms Any ideas why your test case looks different depending on the framework? http://mono.1490590.n4.nabble.com/file/n4650502/mono_patch12.png mono_patch12.png From left to right: Mono unpatched, Mono patched, .NET. Steven Boswell II wrote Here's the first of what I hope will be several submitted patches this weekend. I fixed the bugs a while ago; the really time-consuming part is coming up with unit tests. Before, when TableLayoutPanel got a control whose row-span and column-span were both greater than one, it would only lay out dummy controls along the top row and left column; it wouldn't fill in the rest of the area. (The bug is kinda obvious when you look at the code. :-) Enclosed is a bug-fix patch, a unit-test patch, and a project to verify behavior under .NET. As usual, apply the unit-test patch, watch it fail, then apply the bug-fix patch, and watch it succeed. Steven Boswell ___ Mono-devel-list mailing list Mono-devel-list@.ximian http://lists.ximian.com/mailman/listinfo/mono-devel-list -- View this message in context: http://mono.1490590.n4.nabble.com/Patches-for-mono-winforms-tp4650494p4650509.html Sent from the Mono - Dev mailing list archive at Nabble.com. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Initialization of array of enum - trying to not use RuntimeInternals.InitializeArray
Hello John, There is a known bug in the Microsoft CLR on the x86_64 platform with regards to initializing an array whose members are enum values (http://connect.microsoft.com/VisualStudio/feedback/details/635365/runtimehelpers-initializearray-fails-on-64b-framework). It appears that the Microsoft csc compiler somehow works around this whereas gmcs does not. For example, the following compiled with gmcs does not run on the Microsoft CLR on x86_64 (it throws an exception in InitializeArray) but does when compiled with csc: class Program { enum e { A, B, C, D, E }; static void Main() { e[] array = new e[] { e.A, e.B, e.C, e.D, e.E }; } } I appreciate this is apparently a bug with the Microsoft 64 bit CLR rather than mono, but at the moment Microsoft's csc appears to work around this where mono does not. Is there a way of telling gmcs to not use a call to InitializeArray when instantiating arrays of enums (instead doing something like: e[] array = new e[5]; e[0] = e.A; e[1] = e.B; ... for the above example), or if not would there be any support for adding this (e.g. via an optional command line flag to gmcs)? Expanding the initialization is the easiest option how to workaround this .net bug. Because the scope of the bug is quite limited and easy to workaround I don't think it's work adding special handling for it. Microsoft already fixed the issue but I am not sure whether there is a hotfix available for .NET 2.0 Marek ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Initialization of array of enum - trying to not use RuntimeInternals.InitializeArray
On 7/23/2012 9:53 AM, Marek Safar wrote: Expanding the initialization is the easiest option how to workaround this .net bug. Because the scope of the bug is quite limited and easy to workaround I don't think it's work adding special handling for it. Microsoft already fixed the issue but I am not sure whether there is a hotfix available for .NET 2.0 I've tried it using .NET 2.0 and 4.0. It works fine on 32-bit, but both versions fail with ArgumentException on x64. (All the patches from Windows Update are applied.) It however works with .NET 4.5 RC on x64. (That is indeed the next release after the the date of their comment on connect.) Note that the workaround is simple: Not to use InitializeArray for enum arrays. Kornel ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] ConcurrentStack with value type in 2.10
Hi Yuriy, With how many cores and on what CPU did managed to reproduce this? I'm running this on my 4 cores nehalem mac without any luck. I'll diff ConcurrentStack between 2.8 and 2.10 to see what could be. On Sun, Jul 22, 2012 at 5:10 AM, Yuriy Solodkyy yu...@couldbedone.comwrote: Hi, It looks like the ConcurrentStack does not work with big enough structures anymore. 12 bytes struct is enough to reproduce the problem occasionally, 16 bytes structure to reproduce it immediately. It worked fine in mono 2.8. The following code shows that we may pop inconsistent structure from the stack from time to time. using System; using System.Collections.Concurrent; namespace CocurrentTest { class MainClass { struct Data { public int A; public int B; public int C; public int D; public Data(int v) { A = v; B = -v; C = v; D = -v; } } public static void Main (string[] args) { Console.WriteLine (Hello World!); var data = new byte[1024 * 1024]; var stack = new ConcurrentStackData (); for (var i = 0; i 50; i++) { var thread = new System.Threading.Thread (v = { var rnd = new Random (); while (true) { int pushCount = rnd.Next (50); int popCount = rnd.Next (50); for (var k = 0; k pushCount; k++) { var sample = new Data (rnd.Next(Int32.MaxValue)); CheckSample (sample); stack.Push (sample); } for (var k = 0; k popCount; k++) { Data retrievedSample = new Data(); if (stack.TryPop (out retrievedSample)) { CheckSample (retrievedSample); } } } } ); thread.Start (); } } static void CheckSample (Data sample){ if (sample.A != -sample.B || sample.A != sample.C || sample.B != sample.D) throw new Exception (string.Format (Invalid sample detected)); } } } -- Yuriy Solodkyy ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] ConcurrentStack with value type in 2.10
I cannot reproduce the problem either. What exact version of 2.10 did you test against? It's possible the bug has already been fixed in a newer release of the 2.10 series. Alan On 23 July 2012 13:32, Rodrigo Kumpera kump...@gmail.com wrote: Hi Yuriy, With how many cores and on what CPU did managed to reproduce this? I'm running this on my 4 cores nehalem mac without any luck. I'll diff ConcurrentStack between 2.8 and 2.10 to see what could be. On Sun, Jul 22, 2012 at 5:10 AM, Yuriy Solodkyy yu...@couldbedone.com wrote: Hi, It looks like the ConcurrentStack does not work with big enough structures anymore. 12 bytes struct is enough to reproduce the problem occasionally, 16 bytes structure to reproduce it immediately. It worked fine in mono 2.8. The following code shows that we may pop inconsistent structure from the stack from time to time. using System; using System.Collections.Concurrent; namespace CocurrentTest { class MainClass { struct Data { public int A; public int B; public int C; public int D; public Data(int v) { A = v; B = -v; C = v; D = -v; } } public static void Main (string[] args) { Console.WriteLine (Hello World!); var data = new byte[1024 * 1024]; var stack = new ConcurrentStackData (); for (var i = 0; i 50; i++) { var thread = new System.Threading.Thread (v = { var rnd = new Random (); while (true) { int pushCount = rnd.Next (50); int popCount = rnd.Next (50); for (var k = 0; k pushCount; k++) { var sample = new Data (rnd.Next(Int32.MaxValue)); CheckSample (sample); stack.Push (sample); } for (var k = 0; k popCount; k++) { Data retrievedSample = new Data(); if (stack.TryPop (out retrievedSample)) { CheckSample (retrievedSample); } } } } ); thread.Start (); } } static void CheckSample (Data sample){ if (sample.A != -sample.B || sample.A != sample.C || sample.B != sample.D) throw new Exception (string.Format (Invalid sample detected)); } } } -- Yuriy Solodkyy ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] ConcurrentStack with value type in 2.10
On Mon, 2012-07-23 at 13:45 +0100, Alan wrote: I cannot reproduce the problem either. What exact version of 2.10 did you test against? It's possible the bug has already been fixed in a newer release of the 2.10 series. I could reproduce it on 32-bit machine, only with sgen. -- Regards, Konrad ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list