> From: [email protected] [mailto:mono-devel-list-
> [email protected]] On Behalf Of Neale Ferguson
> 
> Further to the problem, tt seems to be a threading issue since if a lock
> is put around this method call:
> 
> return ProtectedData.Protect(data, extraEntropy, dataProtectionScope);
> 
> then it would work. This seems to try an access some file in .mono/keypair
> and it seems to be some concurrency issue since we have multiple threads
> all calling this code at the same time and that’s where it get tripped up.

It sounds like you've nailed it. ProtectedData indeed accesses key files in 
~/.config/.mono/keypairs (slightly different from what you said) and if you've 
got multiple threads accessing that concurrently, locking or sharing will be 
necessary. Evidently, that's not working, so it should be a relatively 
straightforward thing to test (or find in source) if mono is / isn't supporting 
locking / sharing for those operations.

Given that you wrapping ProtectedData in a lock() solves the problem, most 
likely this is a mono bug, in which ProtectedData is not threadsafe. Your 
workaround will be to continue using the lock.
_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to