locked
Windows store app is getting suspended and crashing

    Question

  • Hi Friends,

    I am developing a Windows Store App using c# which provides connectivity to networks.

    While testing I observed that while connection to a network was in progress suddenly app get suspended (it got OnSuspend event) and crashed.

    This issue is not consistent (observed thrice in 6-7 days testing) and specific to a device and a network.

    Event log for that crash is:

    The program <program name> version <version> stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Action Center control panel.
     Process ID: 76c
     Start Time: 01cfbc38047184a5
     Termination Time: 4294967295
     Application Path: C:\Program Files\WindowsApps\<package name>\<program name>
     Report Id: 52cccbea-282b-11e4-9716-0024e8ccd69b
     Faulting package full name: <package name>
     Faulting package-relative application ID: <application ID>

    Since this crash is not consistent, I am not sure whether there is a problem while connecting to the network or not.

    NOTE: I am successfully connecting to so many networks on other devices as well on same device. Also With same network on same device so many times I am connecting successfully.

    Please help me if you can get solution based on above description.

    Thanks

    Sunday, August 24, 2014 7:42 AM

All replies

  • This error message does not provide enough info to help.  I would suggest in the unhandled exception event in the app.xaml.vb or app.xaml.cs file you log the error.  A better error message would help resolve this issue
    Sunday, August 24, 2014 12:42 PM
  • Thanks Ken.

    I am already logging exception in Unhandled Exception event but it is not logging any exception.

    When I am resuming from Suspend then App is hanging for some time after that it is crashing.

    when I have connected to any network then only it is crashing.

    Today I got some more information on this. Below are those:

    Windows Error Reporting Information:

    Fault bucket , type 0
    Event Name: MoAppHang
    Response: Not available
    Cab Id: 0

    Problem signature:
    P1: <App Package>
    P2: praid:<Application ID>
    P3: <Version>
    P4: 53f9baad
    P5: 0000
    P6: 2097408
    P7: 
    P8: 
    P9: 
    P10: 

    Attached files:
    C:\Users\<username>\AppData\Local\Temp\WERD173.tmp.WERInternalMetadata.xml
    C:\Users\<username>\AppData\Local\Temp\WER4888.tmp.xml
    C:\Users<username>\AppData\Local\Microsoft\Windows\WER\ReportQueue\AppHang_<package>_d3551ba1f3105d5c0818b6e14f429739f5c484d_651f513b_cab_0f3149b0\memory.hdmp
    C:\Users<username>\AppData\Local\Microsoft\Windows\WER\ReportQueue\AppHang_<package>_d3551ba1f3105d5c0818b6e14f429739f5c484d_651f513b_cab_0f3149b0\triagedump.dmp

    These files may be available here:
    C:\Users<username>\AppData\Local\Microsoft\Windows\WER\ReportQueue\AppHang_<package>_d3551ba1f3105d5c0818b6e14f429739f5c484d_651f513b_cab_0f3149b0

    Analysis symbol: 
    Rechecking for solution: 0
    Report Id: c553bd88-2b77-11e4-829b-0050b666879d
    Report Status: 100
    Hashed bucket: 

    Below is Report.wer file:

    Version=1
    EventType=MoAppHang
    EventTime=130533490153361808
    ReportType=3
    Consent=1
    UploadTime=130533490153591966
    ReportIdentifier=c553bd87-2b77-11e4-829b-0050b666879d
    IntegratorReportIdentifier=c553bd88-2b77-11e4-829b-0050b666879d
    NsAppName=praid:<App Name>
    Response.type=4
    Sig[0].Name=Package Full Name
    Sig[0].Value=<package name>
    Sig[1].Name=Application Name
    Sig[1].Value=praid:<application name>
    Sig[2].Name=Application Version
    Sig[2].Value=<version>
    Sig[3].Name=Application Timestamp
    Sig[3].Value=53f9baad
    Sig[4].Name=Hang Signature
    Sig[4].Value=0000
    Sig[5].Name=Hang Type
    Sig[5].Value=2097408
    DynamicSig[1].Name=OS Version
    DynamicSig[1].Value=6.3.9600.2.0.0.256.4
    DynamicSig[2].Name=Locale ID
    DynamicSig[2].Value=1033
    DynamicSig[22].Name=Additional Hang Signature 1
    DynamicSig[22].Value=00000000000000000000000000000000
    DynamicSig[23].Name=Additional Hang Signature 2
    DynamicSig[23].Value=0000
    DynamicSig[24].Name=Additional Hang Signature 3
    DynamicSig[24].Value=00000000000000000000000000000000
    DynamicSig[25].Name=Additional Hang Signature 4
    DynamicSig[25].Value=0000
    DynamicSig[26].Name=Additional Hang Signature 5
    DynamicSig[26].Value=00000000000000000000000000000000
    DynamicSig[27].Name=Additional Hang Signature 6
    DynamicSig[27].Value=0000
    DynamicSig[28].Name=Additional Hang Signature 7
    DynamicSig[28].Value=00000000000000000000000000000000
    UI[3]=<App name> is not responding
    UI[4]=If you close the program, you might lose information.
    UI[5]=Close the program
    UI[6]=Close the program
    File[0].CabName=WERInternalMetadata.xml
    File[0].Path=WERD173.tmp.WERInternalMetadata.xml
    File[0].Flags=327682
    File[0].Type=5
    File[0].Original.Path=C:\Users\<username>\AppData\Local\Temp\WERD173.tmp.WERInternalMetadata.xml
    File[1].CabName=<app name>.xml
    File[1].Path=WER4888.tmp.xml
    File[1].Flags=327680
    File[1].Type=5
    File[1].Original.Path=C:\Users\<username>\AppData\Local\Temp\WER4888.tmp.xml
    File[2].CabName=memory.hdmp
    File[2].Path=memory.hdmp
    File[2].Flags=807403520
    File[2].Type=3
    File[3].CabName=triagedump.dmp
    File[3].Path=triagedump.dmp
    File[3].Flags=807731202
    File[3].Type=6
    FriendlyEventName=Stopped responding and was closed
    ConsentKey=AppHangXProcB1
    AppName=<App name>
    AppPath=<app path>
    ReportDescription=A problem caused this program to stop interacting with Windows.
    NsPartner=windows
    NsGroup=windows8
    ApplicationIdentity=F60D6BB0401B59DB0BC6BCF0868191FE

    Below is WER4888.tmp file:

    <?xml version="1.0" encoding="utf-16"?>
    <WAIT_CHAIN_LIST VERSION="1.55">
    <WAIT_CHAIN DEADLOCK="false" CROSS_PROC="false">
    <HUNG_HWND>0</HUNG_HWND>
    <PARAMETERS>
    <APPNAME>Appname</APPNAME>
    <APPVER>version</APPVER>
    <APPSTAMP>53f9baad</APPSTAMP>
    <STACKHASH>
    <ALGORITHM>MODULELIST</ALGORITHM>
    <FULLHASH>00000000000000000000000000000000</FULLHASH>
    <RESTRICTEDHASH>0000</RESTRICTEDHASH>
    </STACKHASH>
    <STACKHASH>
    <ALGORITHM>MODULEOFFSET_SELEXCL</ALGORITHM>
    <FULLHASH>00000000000000000000000000000000</FULLHASH>
    <RESTRICTEDHASH>0000</RESTRICTEDHASH>
    </STACKHASH>
    <UITHREADSTACKHASH>
    <ALGORITHM>MODULELIST</ALGORITHM>
    <FULLHASH>00000000000000000000000000000000</FULLHASH>
    <RESTRICTEDHASH>0000</RESTRICTEDHASH>
    </UITHREADSTACKHASH>
    <UITHREADSTACKHASH>
    <ALGORITHM>MODULEOFFSET_SELEXCL</ALGORITHM>
    <FULLHASH>00000000000000000000000000000000</FULLHASH>
    <RESTRICTEDHASH>0000</RESTRICTEDHASH>
    </UITHREADSTACKHASH>
    <TYPECODE>200100</TYPECODE>
    </PARAMETERS>
    <WAIT_NODE NODE_ID="0">
    <WAIT_THREAD>
    <PID>2db4</PID>
    <TID>1720</TID>
    <PROCESS_NAME>appname</PROCESS_NAME>
    <WAIT_TIME>0</WAIT_TIME>
    <CONTEXT_SWITCHES>34273</CONTEXT_SWITCHES>
    </WAIT_THREAD>
    <WAIT_TYPE>
    <NAME></NAME>
    <ID>Unknown</ID>
    </WAIT_TYPE>
    <WAIT_BLOCKINGTHREAD>
    <PID>0</PID>
    <TID>0</TID>
    <PROCESS_NAME></PROCESS_NAME>
    <NODE_ID>0</NODE_ID>
    </WAIT_BLOCKINGTHREAD>
    <FILE>
    <NAME>memory.hdmp</NAME>
    <TYPE>Dump</TYPE>
    </FILE>
    <FILE>
    <NAME>minidump.mdmp</NAME>
    <TYPE>Dump</TYPE>
    </FILE>
    <FILE>
    <NAME>triagedump.dmp</NAME>
    <TYPE>Dump</TYPE>
    </FILE>
    </WAIT_NODE>
    </WAIT_CHAIN>
    <FILES TRUNCATED="false">
    <FILE>
    <NAME>WERInternalMetadata.xml</NAME>
    <TYPE>Invalid</TYPE>
    </FILE>
    </FILES>
    </WAIT_CHAIN_LIST>

    Below is WERD173.tmp.WERInternalMetadata file:

    <?xml version="1.0" encoding="UTF-16"?>
    <WERReportMetadata>
    <OSVersionInformation>
    <WindowsNTVersion>6.3</WindowsNTVersion>
    <Build>9600 </Build>
    <Product>(0x4): Windows 8.1 Enterprise</Product>
    <Edition>Enterprise</Edition>
    <BuildString>9600.17085.amd64fre.winblue_gdr.140330-1035</BuildString>
    <Revision>Unknown</Revision>
    <Flavor>Multiprocessor Free</Flavor>
    <Architecture>X64</Architecture>
    <LCID>1033</LCID>
    </OSVersionInformation>
    <ProcessInformation>
    <Pid>11700</Pid>
    <ImageName>AppName</ImageName>
    <CmdLineSignature>00000000</CmdLineSignature>
    <Uptime>96999</Uptime>
    <ProcessVmInformation>
    <PeakVirtualSize>1110712320</PeakVirtualSize>
    <VirtualSize>1090928640</VirtualSize>
    <PageFaultCount>116322</PageFaultCount>
    <PeakWorkingSetSize>204951552</PeakWorkingSetSize>
    <WorkingSetSize>171237376</WorkingSetSize>
    <QuotaPeakPagedPoolUsage>878960</QuotaPeakPagedPoolUsage>
    <QuotaPagedPoolUsage>851512</QuotaPagedPoolUsage>
    <QuotaPeakNonPagedPoolUsage>110508</QuotaPeakNonPagedPoolUsage>
    <QuotaNonPagedPoolUsage>99936</QuotaNonPagedPoolUsage>
    <PagefileUsage>131452928</PagefileUsage>
    <PeakPagefileUsage>143958016</PeakPagefileUsage>
    <PrivateUsage>131452928</PrivateUsage>
    </ProcessVmInformation>
    </ProcessInformation>
    <ProblemSignatures>
    <EventType>MoAppHang</EventType>
    <Parameter0>PackageName</Parameter0>
    <Parameter1>praid:AppName</Parameter1>
    <Parameter2>Version</Parameter2>
    <Parameter3>53f9baad</Parameter3>
    <Parameter4>0000</Parameter4>
    <Parameter5>2097408</Parameter5>
    </ProblemSignatures>
    <DynamicSignatures>
    <Parameter1>6.3.9600.2.0.0.256.4</Parameter1>
    <Parameter2>1033</Parameter2>
    <Parameter22>00000000000000000000000000000000</Parameter22>
    <Parameter23>0000</Parameter23>
    <Parameter24>00000000000000000000000000000000</Parameter24>
    <Parameter25>0000</Parameter25>
    <Parameter26>00000000000000000000000000000000</Parameter26>
    <Parameter27>0000</Parameter27>
    <Parameter28>00000000000000000000000000000000</Parameter28>
    </DynamicSignatures>
    <SystemInformation>
    <MID>C39E9366-B1C7-4F61-985B-A9E8A514170F</MID>
    <SystemManufacturer>SAMSUNG ELECTRONICS CO., LTD.</SystemManufacturer>
    <SystemProductName>700T1C</SystemProductName>
    <BIOSVersion>P06AAT.038.130219.dg</BIOSVersion>
    <OSInstallDate>1385755249</OSInstallDate>
    </SystemInformation>
    <DAMInformation>
    </DAMInformation>
    <SecureBootState>
    <UEFISecureBootEnabled>1</UEFISecureBootEnabled>
    <PolicyPublisher>{77fa9abd-0359-4d32-bd60-28f4e78f784b}</PolicyPublisher>
    </SecureBootState>
    <Integrator>
    <HangrepAPI2WERSVC>281</HangrepAPI2WERSVC>
    <HangrepWERSVC2HANGREP>32</HangrepWERSVC2HANGREP>
    </Integrator>
    </WERReportMetadata>


    I think it is causing problem in OnSuspend. Below is the code in case if you need this.

    private async void OnSuspending(object sender, SuspendingEventArgs e)
        {
            SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral();
    		TimeSpan absoluteDeadline = e.SuspendingOperation.Deadline - DateTimeOffset.Now;
            TimeSpan bufferedDeadline = absoluteDeadline - TimeSpan.FromSeconds(0.5);
            if (bufferedDeadline > TimeSpan.Zero)
            {
                try
                {
                    CancellationToken cancelToken = new CancellationTokenSource(bufferedDeadline).Token;
                    await Task.WhenAny(this.SuspendAsync(cancelToken), Task.Delay(absoluteDeadline, cancelToken));
                }
                catch (OperationCanceledException)
                {
                }
            }
            deferral.Complete();
        }
    
    private async Task SuspendAsync(CancellationToken cancelToken)
        {
            Logging("App is going to suspend");
            ClearInternetState();
            cancelToken.ThrowIfCancellationRequested();
            // Unregistering a background Task
            // Registering same background Task which I unregistered above
            cancelToken.ThrowIfCancellationRequested();
            await SuspensionManager.SaveAsync(cancelToken);
        }
    
    public static async Task SaveAsync(CancellationToken cancelToken)
        {
            foreach (var weakFrameReference in _registeredFrames)
            {
                Frame frame;
    			
                if (weakFrameReference.TryGetTarget(out frame))
                {
                    SaveFrameNavigationState(frame);
                }
            }
            cancelToken.ThrowIfCancellationRequested();
            MemoryStream sessionData = new MemoryStream();
            DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
            serializer.WriteObject(sessionData, _sessionState);
    		
            cancelToken.ThrowIfCancellationRequested();
            StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(SessionStateFilename,CreationCollisionOption.ReplaceExisting).AsTask(cancelToken);
    		
            using (StorageStreamTransaction transaction = await file.OpenTransactedWriteAsync().AsTask(cancelToken))
            using (Stream fileStream = transaction.Stream.AsStreamForWrite())
            {
                sessionData.Seek(0, SeekOrigin.Begin);
    			
                cancelToken.ThrowIfCancellationRequested();
                await sessionData.CopyToAsync(fileStream, 4096, cancelToken);
    			
                cancelToken.ThrowIfCancellationRequested();
                await fileStream.FlushAsync(cancelToken);
    			
                cancelToken.ThrowIfCancellationRequested();
                await transaction.CommitAsync();
            }
        }

    Sorry for the long post.

    Thanks

    Sunday, August 24, 2014 3:41 PM
  • are you navigating through pages with complex types (your own classes) as a navigation parameter?

    when using await SuspensionManager.SaveAsync(cancelToken); you only can use simple types like ints / strings etc as navigationparameter


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, August 25, 2014 6:20 AM
  • I don't think there is any issue in OnSuspend/OnResume code. For testing I commented definitions of both the methods then also the App crashed.

    App is crashing only when I have connected to any network. App is not crashing in Offline.

    I have registered network authentication task in the background. Is there any chance that might be causing problem?

    I got the Crash Dumps (memory and triagedump) for this crash at the location C:\Users\<username>\AppData\Local\Microsoft\Windows\WER\ReportQueue\AppHang_<package>_d3551ba1f3105d5c0818b6e14f429739f5c484d_651f513b_cab_0f3149b0.

    I am not able to analyze that Crash Dumps. Which Crash Dump will provide information on this crash, memory  or triagedump. Can you please provide some links which will describe how to analyze Crash Dumps?

    Thanks

    Wednesday, August 27, 2014 5:45 AM