This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 46175 - If the RSA will be used by multiple threads, it has a variety of exceptions.
Summary: If the RSA will be used by multiple threads, it has a variety of exceptions.
Status: VERIFIED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: CORLIB (show other bugs)
Version: 4.8.0 (C9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.8.0 (C9)
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-10-31 02:19 UTC by Ryoji.Ishikawa
Modified: 2016-11-21 11:59 UTC (History)
5 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Ryoji.Ishikawa 2016-10-31 02:19:33 UTC
Sample code
==================================================
using System.Threading;
using System.Threading.Tasks;
using System.Security.Cryptography;

private const string key = "<RSAKeyValue><Modulus>vtnLJ+7rLT96dpDH2J8jXv1EooT/1P71Q6PM30f4ycBWp/SeW9Jdlh26jkfAIH9AscWSPK5gMGJYFKWn3i5bC34fWZEdumyaHPo41TcKd3Yu585eNkJTTqyZ4IUuA0GdW2b/NoqF4thkE2G0ebUBFQ3kqiyprvrJ5lG6ALDX44c=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";

private void test() {
  Parallel.For(0, 10, (val) =>
  {
    using (RSA rsa = RSA.Create())
    {
      rsa.FromXmlString(key);
    }
  });
}
==================================================


Exceptions
-Input string does not contain a valid encoding of the 'RSA' 'Modulus' parameter.
-Input string does not contain a valid encoding of the 'RSA' 'Exponent' parameter.
-Invalid length for a Base-64 char array or string.


Other
-This problem is from around April 2016.
-100% reproducibility.
-This problem occurs in the device and in iOS simulator.
-This problem does not have the .NET Framework.
Comment 1 Marek Safar 2016-10-31 12:02:08 UTC
Fixed in master and Mono 4.8.
Comment 2 Sachin Saini 2016-11-21 11:59:16 UTC
I have checked this issue with latest master and cycle9 builds and observed that this issue has been fixed now.here is the screencast for the same: http://www.screencast.com/t/I21Xqbt9

Master environment info: https://gist.github.com/sachins360/21cc4f09da3b55f343f12d4ea34b22d3
Cycle9 environment info: https://gist.github.com/sachins360/8ab3c8885f387f97ece82f8c8e7f3e91

Hence,I am verifying this issue.

Thanks!

Note You need to log in before you can comment on or make changes to this bug.