[Mono-bugs] [Bug 431039] New: First Run of IsolatedStorageFile is not threadsafe

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 30 15:53:35 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=431039


           Summary: First Run of IsolatedStorageFile is not threadsafe
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: i586
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jaebird at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:

The first time a call is made to IsolatedStorageFile.GetUserStoreForDomain()
mono creates the .isolated_storage etc, etc. This call does not appear to be
threadsafe. If multiple threads call this method simultaneously an IOException
is thrown:

StackTrace:

Unhandled Exception: System.IO.IOException: Sharing violation on path
/home/topaz/.config/.isolated-storage/d.45F5E112B5A2357466D3.45F5E112B5A2357466D3.storage
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions
options) [0x00265] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/System.IO/FileStream.cs:283 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess
access, FileShare share) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/Assembly/AssemblyInfo.cs:1 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor
(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.File.OpenWrite (System.String path) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/System.IO/File.cs:379 
  at System.IO.IsolatedStorage.IsolatedStorageFile.SaveIdentities
(System.String root) [0x00019] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs:659 
  at System.IO.IsolatedStorage.IsolatedStorageFile.PostInit () [0x000ef] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs:391 
  at (wrapper remoting-invoke-with-check)
System.IO.IsolatedStorage.IsolatedStorageFile:PostInit ()
  at System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForDomain ()
[0x0003c] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs:250 
  at MainClass.ThreadMain () [0x00000] in
/home/topaz/Projects/isolated_storage_test/isolated_storage_test/Main.cs:1 


Steps to reproduce the problem:
1. clear .isolated_storage directory
2. run attached sample


Actual Results:
see stack trace above

Expected Results:
MS.NET supports this usage as expected. A successful call without exception
thrown.

How often does this happen? 
Every time the .isolated_storage for the domain is initialized if called via
multiple threads.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list