The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
[UWP]Windows 10 app random crashes on startup RRS feed

  • Question

  • I have completed a DirectX / XAML game for Win10 (and 8.1) and am getting reports that some users are experiencing crashes on startup (while the splash screen is up) before the game can actually start. However, this only starts to happen after a few uses of the app. They are able to use the app for a while, then randomly it reaches a point where it crashes on startup and continues to do that indefinitely, even after restart or reinstall. I am not able to reproduce this on my end.

    This does not happen to everyone, but it happens to enough that I'm hearing about it.

    One user provided the following error report after the startup crash:

    Log Name: Application
    Source: Application Error
    Date: 8/25/2015 5:33:38 p.m.
    Event ID: 1000
    Category tasks (100)
    Level: errors
    Keywords: Classic
    User: Not applicable
    Computer: Synapse-3
    Description:
    Name of the application Causing error: darksong.exe, version: 0.0.0.0,
    Time signature: 0x55da97b3
    Name of the module Causing the error: twinapi.appcore.dll, ver:
    10.0.10240.16397, time signature: 0x55af0938
    exception code: 0xc000027b
    exception shift (?): 0x0001cab9
    Id of the process Causing the error: 0x1c2c
    Hour run the application causing the error: 0x01d0df4b66b7ad4f
    The application path causing the problem: C: \ Program
    Files \ WindowsApps \ NateMonsterLLC.TheDarksongChronicles_1.0.5.0_x86__1v1304hp7jwzg \ darksong.exe
    The path of the module causing the error: C: \ Windows \ System32 \ twinapi.appcore.dll
    Report id: a062391b-8411-4e06-babf-ba3b532b77cf
    The full name of the package causing the error:
    NateMonsterLLC.TheDarksongChronicles_1.0.5.0_x86__1v1304hp7jwzg
    The application ID relative to the pack causing the error: App
    The XML event:
    <Event xmlns = http://schemas.microsoft.com/win/2004/08/events/event
    <System>
    <Provider Name = "Application Error" />
    <EventID Qualifiers = "0"> 1000 </ EventID>
    <Level> 2 </ Level>
    <Task> 100 </ Task>
    <Keywords> 0x80000000000000 </ Keywords>
    <TimeCreated SYSTEMTIME = "2015-08-25T15: 33: 38.000000000Z" />
    <EventRecordID> 1943 </ EventRecordID>
    <Channel> Application </ channel>
    <Computer> Synapse-3 </ Computer>
    <Security />
    </ System>
    <EVENTDATA>
    <Date> darksong.exe </ date>
    <Date> 0.0.0.0 </ date>
    <Date> 55da97b3 </ date>
    <Date> twinapi.appcore.dll </ date>
    <Date> 10.0.10240.16397 </ date>
    <Date> 55af0938 </ date>
    <Date> c000027b </ date>
    <Date> 0001cab9 </ date>
    <Date> 1c2c </ date>
    <Date> 01d0df4b66b7ad4f </ date>
    <Date> C: \ Program
    Files\WindowsApps\NateMonsterLLC.TheDarksongChronicles_1.0.5.0_x86__1v1304hp7jwzg\darksong.exe</Data>
    <Date> C: \ Windows \ System32 \ twinapi.appcore.dll </ date>
    <Date> a062391b-8411-4e06-babf-ba3b532b77cf </ date>
    <Date> NateMonsterLLC.TheDarksongChronicles_1.0.5.0_x86__1v1304hp7jwzg </ date>
    <Date> App </ date>
    </ EVENTDATA>
    </ Event>

    The reference to "C:\Windows\System32\twinapi.appcore.dll" is the only specific bit of info I can see.

    So next I've looked at the crash reports in DevCenter to try to find the crash there. I found one with a stack trace that includes a twinapi reference and appears to be happening on startup. Here is the stack trace for that crash:

    Stack trace
    
    Frame
    
    Image
    
    Function
    
    Offset
    
    
     1 ucrtbase _invoke_watson 0x12 
     2 vccorlib140_app __abi_FailFast 0xD 
     3 vccorlib140_app __abi_translateCurrentException 0x56 
     4 darksong  0x46C4 
     5 windows_ui_xaml DirectUI::FrameworkApplicationGenerated::OnLaunchedProtected 0x47 
     6 windows_ui_xaml DirectUI::FrameworkView::OnActivated 0x240 
     7 windows_ui_xaml `Microsoft::WRL::Callback_Windows::Foundation::ITypedEventHandler_Windows::UI::Core::CoreWindow *,IInspectable *_,DirectUI::Page,Windows::UI::Core::ICoreWindow *,IInspectable *_'::`2'::ComObject::Invoke 0x28 
     8 twinapi_appcore Microsoft::WRL::InvokeTraits_-2_::InvokeDelegates__lambda_45dc3980e5a5ff53a9eb289d8a61b7e3_,Windows::Foundation::ITypedEventHandler_Windows::ApplicationModel::Core::CoreApplicationView *,Windows::ApplicationModel::Activation::IActivatedEventAr 0x4F 
     9 twinapi_appcore Microsoft::WRL::EventSource_Windows::Foundation::ITypedEventHandler_Windows::ApplicationModel::Core::CoreApplicationView *,Windows::ApplicationModel::Activation::IActivatedEventArgs *_,Microsoft::WRL::InvokeModeOptions_-2_ _::DoInvoke__lambda_ 0x42 
     10 twinapi_appcore Windows::ApplicationModel::Core::CoreApplicationView::Activate 0x296 
     11 rpcrt4 Invoke 0x34 
     12 rpcrt4 NdrStubCall2 0x2E3 
     13 combase CStdStubBuffer_Invoke 0xDE 
     14 rpcrt4 CStdStubBuffer_Invoke 0x2C 
     15 combase ObjectMethodExceptionHandlingAction__lambda_adf5d6ba83bff890864fd80ca2bbf1eb_ _ 0x7B 
     16 combase DefaultStubInvoke 0x211 
     17 combase ServerCall::ContextInvoke 0x38E 
     18 combase AppInvoke 0xB75 
     19 combase ComInvokeWithLockAndIPID 0x62C 
     20 combase CComApartment::ASTAHandleMessage 0x2C2 
     21 combase ASTAWaitContext::Wait 0x47A 
     22 combase ASTAWaitInNewContext 0x81 
     23 combase ASTAThreadWaitForHandles 0x4E 
     24 combase CoWaitForMultipleHandles 0xAA 
     25 twinapi_appcore _lambda_9b41d69926023e09ea69cf7275f119de_::_helper_func_stdcall_ 0x5D 
     26 shcore _WrapperThreadProc 0xCA 
     27 kernel32 BaseThreadInitThunk 0x24 
     28 ntdll __RtlUserThreadStart 0x2F 
     29 ntdll _RtlUserThreadStart 0x1B 

    Anybody else experience something like this? Anybody have any ideas on the root of this problem?


    Wednesday, August 26, 2015 6:48 PM

Answers

  •      Hi Mr Nate Monster,

         I used to suffer a similar problem: On old computers running Windows 10, when launching my 3D game, during startup, when the default splash screen is shown, the game would exit unexpectedly, reporting a 0xc0000005 error (access denied to a particular memory block), thrown by the nvidia graphic adapter driver library. This did not happen on similar systems running Windows 8.0. 

         The problem, however, was my code: When the "App::Run()" method was called, on some rare occasions, not all the game elements had been loaded. In particular, there was this shader that had not been loaded, even though it was set to be the very first resource to load. As a result, the nvidia driver would puke a 0xc0000005 carrot. This did not happen on Windows 8.x. It's like there used to be a "sleep()" call somewhere, and now it's no longer there.

         My advice is to add fail-safe checks to ensure everything is loaded before trying to use it. Also, get a computer old and slow enough to replicate the problem, but at the same time just barely new enough to run Windows 10 and, of course, your game. See if you can replicate the issue there.

         I hope it helps!

         Tarh Ik

    PS: This posting has been posted "AS IS"


    Tarh ik

    Friday, August 28, 2015 7:21 PM

All replies

  • Hi Nate,

    Doing a Bing search on "twinapi.appcore.dll" gets an interesting suggestion to return Async.  https://social.msdn.microsoft.com/Forums/en-US/dc130519-6373-4890-8a10-b2991f7a9d59/app-crashes-for-some-users-exception-code-0xc000027b-from-triagedump?forum=winappswithcsharp . Do you have such a call that you can convert in your start up code?

    This also does not seem to be unique to Windows 10 http://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/certain-modern-ui-apps-crash-on-startup/6ccae6ff-2a98-43c6-8f22-6c1491f44781

    Sincerely,

    IoTGirl 

    Wednesday, August 26, 2015 7:51 PM
  • Thanks, I checked the links. Sadly I don't have any void async calls happening on startup (or anywhere), so no progress there.
    Wednesday, August 26, 2015 8:18 PM
  • Ah! The suggestion is to use async rather than sync calling so I bet this solution will work for you.  Chances are that something your app is requesting is just not available and you should wait for it rather than crash... see https://msdn.microsoft.com/en-us/library/hh191443.aspx?f=255&MSPPError=-2147217396 for how to use async & await.

    Wednesday, August 26, 2015 9:23 PM
  • All of my calls are async. I just meant earlier that none of them were returning void.

    It's strange that this crash doesn't happen for multiple uses, then once it happens its permanent; it won't fix itself.

    Wednesday, August 26, 2015 9:26 PM
  • Hmmm, then they might be hitting this, https://support.microsoft.com/en-us/kb/2798317, from the other link in my original response.
    Wednesday, August 26, 2015 9:29 PM
  • Hi Nate,

    >>I am not able to reproduce this on my end

    Looks like this only happens on part of people, could you try to collect the environment information? For example, Win10 version?

    Have you tried to open your app directly without debugging in VS? If you can reproduce it locally, then you could use VS to debug installed app package: Go to Debug > Other Debug Targets > Debug Installed app package. That way you can create a dump file when exception happens. Go to Debug > Save Dump as


    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.

    Thursday, August 27, 2015 11:26 AM
    Moderator
  • I will ask the users that have this issue about their environment. As for running the app without debugging, I constantly run the app without the debugger / outside VS already on my end and the issue never happens to me.

    Thursday, August 27, 2015 3:06 PM
  •      Hi Mr Nate Monster,

         I used to suffer a similar problem: On old computers running Windows 10, when launching my 3D game, during startup, when the default splash screen is shown, the game would exit unexpectedly, reporting a 0xc0000005 error (access denied to a particular memory block), thrown by the nvidia graphic adapter driver library. This did not happen on similar systems running Windows 8.0. 

         The problem, however, was my code: When the "App::Run()" method was called, on some rare occasions, not all the game elements had been loaded. In particular, there was this shader that had not been loaded, even though it was set to be the very first resource to load. As a result, the nvidia driver would puke a 0xc0000005 carrot. This did not happen on Windows 8.x. It's like there used to be a "sleep()" call somewhere, and now it's no longer there.

         My advice is to add fail-safe checks to ensure everything is loaded before trying to use it. Also, get a computer old and slow enough to replicate the problem, but at the same time just barely new enough to run Windows 10 and, of course, your game. See if you can replicate the issue there.

         I hope it helps!

         Tarh Ik

    PS: This posting has been posted "AS IS"


    Tarh ik

    Friday, August 28, 2015 7:21 PM
  • Thanks, useful info. I've sort of been going down this path of making sure everything is actually loaded and ready before using it. I've removed as much as I can (like cortana support) from the loading process to trim it down to the basics as well. Also, I've moved loading the audio engine out as far as possible to see if that makes a difference. As per your suggestion I've also added check for the audio to make sure it has actually been loaded.

    Friday, August 28, 2015 7:39 PM
  • To clarify, this did not solve the problem, which is why I did not mark an answer yet. However at this point I do think the problem is related to the audio engine loading (or rather taking a very long time to load, which then triggers a hang crash). In the development environment it's allowed to take as long as it wants and sometimes it will take 10 seconds or more to load itself.

    Any ways, I'm still trying to get to the bottom of it.

    Wednesday, September 9, 2015 3:08 PM