Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When using Guid.Parse() on a string containing a Guid representation the expected format is one of the Formats in https://github.com/mono/mono/blob/master/mcs/class/corlib/System/Guid.cs#L71.
However, I have encountered that Guid.Parse() also accepts the format xxxxxx-xxx-xxx-xxx-xxxxxxxxxxx. So the segment lengths are 7-3-3-3-11.
When using Microsoft's .NET a FormatException is thrown, when using that format, in mono no exception is thrown and the format is accepted.
The resulting Guid when parsing 8888888-444-444-444-12121212121, which uses that format, is 08888888-0444-0444-4404-121212121201. I have found that each segment in the format can have one optional missing character and no FormatException is thrown, if more are missing it is throwing the Exception correctly.
I suppose the parser has a limit error in one of it's loops. I can reproduce this in Xamarin.Android and on MacOS X, which both run Mono 3.
Fixed in master.
I could not confirm your claim that each segment in the format can have one optional missing character. Do you have test case for that?
For a simple test case I ran csharp in the console on the Mac:
csharp> var myguid = Guid.Parse("8888888-444-444-444-12121212121");
If you look at the Guid I am trying to parse it is missing one char in each segment.
I can reproduce with the following strings:
And they can be combined so that i.e. 2 segments are missing a char etc.
Mono JIT compiler version 3.2.1 ((no/f3f789e Tue Jul 30 00:31:23 EDT 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com