views:

41

answers:

1

I have a full dump file from a custom exe crash. When i review the threads, i see System.IO.IOException and print exception gives me the below error. I suspect there is some sort of thread racing leading to this since we are on a vanilla Windows2008 (x64) server that doesn't have any virus scanners or indexing services installed. Any ideas to debug the thread racing with WinDbg?

Exception object: 0000000000ffd230
Exception type: System.IO.IOException
Message: The process cannot access the file 'C:\Logs\20100901.log' because it is being used by another process.
InnerException: <none>
StackTrace (generated):
    SP               IP               Function
    00000000002DD460 000007FEF8E62F18 System.IO.__Error.WinIOError(Int32, System.String)
    00000000002DD4C0 000007FEF8497B25 System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean)
    00000000002DD650 000007FEF84970AB System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean)
    00000000002DD6E0 000007FEF84987F3 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions)
    00000000002DD770 000007FEF84D198C System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean, Int32)
    00000000002DD7F0 000007FEF844F8D2 System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean)
    00000000002DD830 000007FF00196971 Astea.Diagnostics.AsteaLogFileListener.GetFileEncoding(System.String)
    00000000002DD8A0 000007FF00196581 Astea.Diagnostics.AsteaLogFileListener.GetStream()
+1  A: 

Have a bp on System.IO.FileStream..ctor inside the debugger and get the call stack using !clrstack. With this information i think you can figure out which other code is creating a file with exclusive access which is causing the issue.

To be certain the same process is holding to access to the file I would use procmon to identify this.

HTH

Naveen