none
Hangs intermittent while writing file to NAS RRS feed

  • Question

  • The managed thread stack as below, the process hangs while writing to a NAS device.

    0:000> ~*e !clrstack -a
    OS Thread Id: 0x1284 (0)
    Child-SP         RetAddr          Call Site
    000000001dfbd6e0 000007fef89186ef DomainNeutralILStubClass.IL_STUB(Microsoft.Win32.SafeHandles.SafeFileHandle, Byte*, Int32, Int32 ByRef, IntPtr)
        PARAMETERS:
            <no data>
            <no data>
            <no data>
            <no data>
            <no data>

    000000001dfbd800 000007fef8918617 System.IO.FileStream.WriteFileNative(Microsoft.Win32.SafeHandles.SafeFileHandle, Byte[], Int32, Int32, System.Threading.NativeOverlapped*, Int32 ByRef)
        PARAMETERS:
            this = <no data>
            handle = <no data>
            bytes = <no data>
            offset = <no data>
            count = <no data>
            overlapped = <no data>
            hr = 0x000000001dfbd8b0
        LOCALS:
            0x000000001dfbd830 = 0x0000000000000000
            <no data>
            <no data>
            <no data>

    000000001dfbd870 000007fef8918466 System.IO.FileStream.WriteCore(Byte[], Int32, Int32)
        PARAMETERS:
            this = <no data>
            buffer = <no data>
            offset = <no data>
            count = <no data>
        LOCALS:
            <no data>
            0x000000001dfbd8b0 = 0x0000000000000000
            <no data>

    000000001dfbd8f0 000007ff0079d011 System.IO.FileStream.Write(Byte[], Int32, Int32)
        PARAMETERS:
            this = <no data>
            array = <no data>
            offset = <no data>
            count = <no data>
        LOCALS:
            <no data>
            <no data>

    ....

    OS Thread Id: 0x13c0 (1)
    Child-SP         RetAddr          Call Site
    000000001e48bd50 000007fef896cd1c DomainNeutralILStubClass.IL_STUB(System.String, Int32, WIN32_FILE_ATTRIBUTE_DATA ByRef)
        PARAMETERS:
            <no data>
            <no data>
            <no data>

    000000001e48bed0 000007fef89760fb System.IO.File.FillAttributeInfo(System.String, WIN32_FILE_ATTRIBUTE_DATA ByRef, Boolean, Boolean)
        PARAMETERS:
            path = 0x0000000023dee700
            data = 0x0000000002f91440
            tryagain = <no data>
            returnErrorOnNotFound = 0x0000000000000000
        LOCALS:
            0x000000001e48bf84 = 0x0000000000000000
            <no data>
            <no data>
            <no data>
            <no data>
            <no data>
            <no data>
            0x000000001e48bfa8 = 0x0000000000000005
            <no data>
            <no data>

    000000001e48c000 000007fef8945406 System.IO.FileSystemInfo.Refresh()
        PARAMETERS:
            this = <no data>

    000000001e48c030 000007ff00937400 System.IO.FileInfo.get_Exists()
        PARAMETERS:
            this = <no data>
        LOCALS:
            0x000000001e48c058 = 0x0000000000000000

    ...

    OS Thread Id: 0x16b0 (2)
    Child-SP         RetAddr          Call Site
    000000001978d3b0 000007fef89186ef DomainNeutralILStubClass.IL_STUB(Microsoft.Win32.SafeHandles.SafeFileHandle, Byte*, Int32, Int32 ByRef, IntPtr)
        PARAMETERS:
            <no data>
            <no data>
            <no data>
            <no data>
            <no data>

    000000001978d4d0 000007fef8918617 System.IO.FileStream.WriteFileNative(Microsoft.Win32.SafeHandles.SafeFileHandle, Byte[], Int32, Int32, System.Threading.NativeOverlapped*, Int32 ByRef)
        PARAMETERS:
            this = <no data>
            handle = <no data>
            bytes = <no data>
            offset = <no data>
            count = <no data>
            overlapped = <no data>
            hr = 0x000000001978d580
        LOCALS:
            0x000000001978d500 = 0x0000000000000000
            <no data>
            <no data>
            <no data>

    000000001978d540 000007fef8918466 System.IO.FileStream.WriteCore(Byte[], Int32, Int32)
        PARAMETERS:
            this = <no data>
            buffer = <no data>
            offset = <no data>
            count = <no data>
        LOCALS:
            <no data>
            0x000000001978d580 = 0x0000000000000000
            <no data>

    000000001978d5c0 000007ff0079d011 System.IO.FileStream.Write(Byte[], Int32, Int32)
        PARAMETERS:
            this = <no data>
            array = <no data>
            offset = <no data>
            count = <no data>
        LOCALS:
            <no data>
            <no data>

    ...

    OS Thread Id: 0x12bc (3)
    Child-SP         RetAddr          Call Site
    0000000019aec730 000007fef896cd1c DomainNeutralILStubClass.IL_STUB(System.String, Int32, WIN32_FILE_ATTRIBUTE_DATA ByRef)
        PARAMETERS:
            <no data>
            <no data>
            <no data>

    0000000019aec8b0 000007fef89760fb System.IO.File.FillAttributeInfo(System.String, WIN32_FILE_ATTRIBUTE_DATA ByRef, Boolean, Boolean)
        PARAMETERS:
            path = 0x0000000023b91048
            data = 0x0000000002fb1950
            tryagain = <no data>
            returnErrorOnNotFound = 0x0000000000000000
        LOCALS:
            0x0000000019aec964 = 0x0000000000000000
            <no data>
            <no data>
            <no data>
            <no data>
            <no data>
            <no data>
            0x0000000019aec988 = 0x0000000000000005
            <no data>
            <no data>

    0000000019aec9e0 000007fef8945406 System.IO.FileSystemInfo.Refresh()
        PARAMETERS:
            this = <no data>

    0000000019aeca10 000007ff00937400 System.IO.FileInfo.get_Exists()
        PARAMETERS:
            this = <no data>
        LOCALS:
            0x0000000019aeca38 = 0x0000000000000000

    ...

    It seems it looks like https://issues.apache.org/jira/browse/LOG4NET-381 , but not log4net issue, just same hangs at operate file.

    Is there any suggest according to the above information and any advice for monitoring or debugging.

    Tuesday, November 12, 2013 5:38 AM

Answers

  • It looks like the IO request is not returning.  The app's call to WriteFile will simply block until the IO request has completed.  The problem may not be in the storage device, but it's somewhere in the storage stack.  It could be the driver, the adapter (network or HBA), the fabric (network or fabric) or the storage device.

    Davdi


    David http://blogs.msdn.com/b/dbrowne/

    Wednesday, November 13, 2013 1:11 PM

All replies

  • Hi Jairo,

    Firstly, please ensure this NAS drive is compatible with your computer. You could check the device model in Compatibility Center. http://www.microsoft.com/en-us/windows/compatibility/CompatCenter/Home

    Then, test your app in Safe Mode with networking and do a Clean Boot in case of any third-party service conflicts.

    If the above methods don’t solve your issue, I think we should use tools to debug the app hangs. Please see this page to know how to do it. http://msdn.microsoft.com/en-us/library/vstudio/d5zhxt22.aspx.

    Hope could solve your issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 12, 2013 7:33 AM
    Moderator
  • Thank you for your advice, Hetro.

    It should be not the NAS drive issue, we have two environments, only one has the hangs issue.

    We have got the dump file, and got the threads stacks as above, it shows hang at operate file.

    I want to check if is there any tips I have missed from above thread stacks?

    We are testing in safe mode with networking, I will keep update.

    Best,

    Wednesday, November 13, 2013 8:51 AM
  • It looks like the IO request is not returning.  The app's call to WriteFile will simply block until the IO request has completed.  The problem may not be in the storage device, but it's somewhere in the storage stack.  It could be the driver, the adapter (network or HBA), the fabric (network or fabric) or the storage device.

    Davdi


    David http://blogs.msdn.com/b/dbrowne/

    Wednesday, November 13, 2013 1:11 PM