Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20197] Windows: Phone App crashes after Splash Screen

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-02-05T14:16:58.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.2.0
ComponentsWindows
Labelsapp, crash, windows
ReporterParmeet Singh
AssigneeKota Iguchi
Created2016-01-05T08:28:48.000+0000
Updated2017-03-31T22:09:53.000+0000

Description

I am trying to run my Windows Phone app on my windows device Lumia 535 and Lumia 532 but as I run, it always gets crashed after splash screen and in console it gives error as : "Timed out after 60000 milliseconds waiting to launch the device." on both devices. I am calling multiple API's on my app and same code is working fine with Android and IOS. Please help.

Comments

  1. Christopher Williams 2016-01-05

    Is there any log output shown while it's attempting to launch the app? Have you tried a simple app that just displays a window/view with a label to confirm you can get a basic app launched? Maybe the app is doing lots of work on startup, or needs to delay work until after the app has launched/UI come up?
  2. Parmeet Singh 2016-01-05

    Hi Chris, In console it only gives Timeout error. I have tried simple hello world apps which were working fine, but as I add apps with some functionalities like calling API's it crashes immediately. My Home screen is simple with some text and a Button. How can we delay the work?
  3. Christopher Williams 2016-01-05

    Move the logic that takes a long time into a function that gets called via setTimeout, or on some other event callback mechanism later (after the UI has gotten setup).
  4. Kota Iguchi 2016-01-11

    [~paramsb] Could you paste a simple sample code that reproduces this issue? I'd like to see if it works for my device (Lumia 630).
  5. Kota Iguchi 2016-01-15

    I was able to reproduce this issue. Looking into details...
  6. Kota Iguchi 2016-01-19

    Here's an analysis from my debug dump using [WinDbg.exe](http://blogs.msdn.com/b/stephe/archive/2015/03/30/how-to-make-use-of-crash-dumps-available-on-the-store-dev-portal.aspx). It reports ERROR_CODE: 0xc0000194 - Possible deadlock condition at application startup.
       0:000> !analyze -v
       *******************************************************************************
       *                                                                             *
       *                        Exception Analysis                                   *
       *                                                                             *
       *******************************************************************************
       
       *** WARNING: Unable to verify checksum for Movies.exe
       *** ERROR: Symbol file could not be found.  Defaulted to export symbols for user32.dll - 
       
       ************* Symbol Loading Error Summary **************
       Module name            Error
       user32                 The system cannot find the file specified : srv*c:\symbols*http://msdl.microsoft.com/download/symbols
       
       You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded.
       You should also verify that your symbol search path (.sympath) is correct.
       *** WARNING: Unable to verify checksum for TitaniumWindows.dll
       *** ERROR: Symbol file could not be found.  Defaulted to export symbols for CoreMessaging.dll - 
       *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ShellRuntime.dll - 
       *** ERROR: Symbol file could not be found.  Defaulted to export symbols for xamlpalwp.dll - 
       *** WARNING: Unable to verify checksum for TitaniumWindows_Ti.dll
       
       FAULTING_IP: 
       +f0a3b92370
       00000000 ??       ???
       
       EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
       ExceptionAddress: 00000000
          ExceptionCode: c0000194
         ExceptionFlags: 00000000
       NumberParameters: 0
       
       CONTEXT:  00000000 -- (.cxr 0x0;r)
        r0=00000002  r1=00caf430  r2=00000001  r3=00000000  r4=77b522e9  r5=00000002
        r6=00000000  r7=00caf290  r8=00000101  r9=00000000 r10=00000000 r11=00caf3f8
       r12=0000005a  sp=00caf288  lr=779b6309  pc=77b522ee psr=00000030 ----- Thumb
       ntdll!NtWaitForMultipleObjects+0x6:
       77b522ee 4770     bx          lr {KERNELBASE!WaitForMultipleObjectsEx+0x108 (779b6308)}
       
       BUGCHECK_STR:  c0000194
       
       DEFAULT_BUCKET_ID:  APPLICATION_HANG
       
       PROCESS_NAME:  Movies.exe
       
       ERROR_CODE: (NTSTATUS) 0xc0000194 - {EXCEPTION}  Possible deadlock condition.
       
       EXCEPTION_CODE: (NTSTATUS) 0xc0000194 - {EXCEPTION}  Possible deadlock condition.
       
       CRITICAL_SECTION:  00000000 -- (!cs -s 00000000)
       
       NTGLOBALFLAG:  0
       
       APPLICATION_VERIFIER_FLAGS:  0
       
       APP:  movies.exe
       
       ANALYSIS_VERSION: 6.3.9600.17336 (debuggers(dbg).150226-1500) amd64fre
       
       DERIVED_WAIT_CHAIN:  
       
       Dl Eid Cid     WaitType
       -- --- ------- --------------------------
          0   fa0.a0c Unknown                
       
       WAIT_CHAIN_COMMAND:  ~0s;k;;
       
       BLOCKING_THREAD:  00000a0c
       
       PRIMARY_PROBLEM_CLASS:  APPLICATION_HANG
       
       LAST_CONTROL_TRANSFER:  from 779b6308 to 77b522ee
       
       STACK_TEXT:  
       00caf288 779b6308 : 00000000 00000000 00caf430 00000000 : ntdll!NtWaitForMultipleObjects+0x6
       00caf288 75a242c2 : 00000000 00000000 00caf430 00000000 : KERNELBASE!WaitForMultipleObjectsEx+0x108
       00caf410 75a24abe : 00000000 00000000 00007530 00000000 : twinapi_appcore!Event::WaitWithFreeUnusedLibraries+0x7e
       00caf558 75a23466 : 00000000 00000008 00000000 00000000 : twinapi_appcore!Windows::ApplicationModel::Core::CoreApplicationFactory::RunInternal+0x1de
       00caf6b0 69a4c60c : 00000000 75a23455 00caf6f8 69a4c60d : twinapi_appcore!Windows::ApplicationModel::Core::CoreApplicationFactory::Run+0x12
       00caf6c0 69a4aa0c : 00d98d1c 00d93224 fffffffe fffffffe : Windows_UI_Xaml!RunInActivationMode+0x64
       00caf700 69a4a99c : 00000000 69a4a991 00118949 77c193b0 : Windows_UI_Xaml!DirectUI::ApplicationFactory::StartImpl+0x60
       00caf720 001133b8 : 69a4a991 00118949 00caf738 001133b9 : Windows_UI_Xaml!DirectUI::ApplicationFactory::Start+0xc
       00caf730 00113378 : 00caf798 00113365 00caf798 00113379 : Movies!Windows::UI::Xaml::IApplicationStatics::Start+0x18
       00caf748 001152e0 : 000000b7 00000063 00000075 00000077 : Movies!Windows::UI::Xaml::Application::Start+0x74
       00caf7a8 0011b20c : 00caf7c0 00d90b20 00d90b20 00d90b20 : Movies!main+0xf4
       00caf7e8 001199d0 : cccccccc 00000002 cccccccc 00d904d0 : Movies!_main+0xc4
       00caf878 00118b28 : cccccccc cccccccc 00118949 77c193b0 : Movies!WinMain+0x18
       00caf8a0 00118958 : 00000000 00000000 00d8a125 00000000 : Movies!__tmainCRTStartup+0x1c0
       00caf918 77b96426 : 00000000 00000000 00caf938 77b96427 : Movies!WinMainCRTStartup+0x10
       00caf928 00000000 : 00000000 77b96411 00000000 00000000 : ntdll!RtlUserThreadStart+0x16
       
       
       FOLLOWUP_IP: 
       twinapi_appcore!Event::WaitWithFreeUnusedLibraries+7e
       75a242c2 4605     mov         r5,r0
       
       SYMBOL_STACK_INDEX:  2
       
       SYMBOL_NAME:  twinapi_appcore!Event::WaitWithFreeUnusedLibraries+7e
       
       FOLLOWUP_NAME:  MachineOwner
       
       MODULE_NAME: twinapi_appcore
       
       IMAGE_NAME:  twinapi.appcore.dll
       
       DEBUG_FLR_IMAGE_TIMESTAMP:  54b5ebe1
       
       STACK_COMMAND:  .ecxr ; kb
       
       BUCKET_ID:  ARM_c0000194_twinapi_appcore!Event::WaitWithFreeUnusedLibraries+7e
       
       FAILURE_BUCKET_ID:  APPLICATION_HANG_c0000194_twinapi.appcore.dll!Event::WaitWithFreeUnusedLibraries
       
       ANALYSIS_SOURCE:  UM
       
       FAILURE_ID_HASH_STRING:  um:application_hang_c0000194_twinapi.appcore.dll!event::waitwithfreeunusedlibraries
       
       FAILURE_ID_HASH:  {aaad60c6-0462-78ff-8ed2-50a26258bdfd}
       
       Followup: MachineOwner
       ---------
       
  7. Kota Iguchi 2016-01-20

    Still in progress but I saw that [Application Verifier](https://msdn.microsoft.com/en-us/library/windows/hardware/ff538115%28v=vs.85%29.aspx) for Windows Phone reports heap corruption that causes bad allocation.
  8. Marian Kucharcik 2016-01-22

    Hi guys, any news on this? We'd like to release app for our client asap. I don't need GA update, just updated SDK that can run app on Windows Phone device. Thank you
  9. Kota Iguchi 2016-01-26

    According to the report from the [Application Verifier](https://msdn.microsoft.com/en-us/library/windows/hardware/ff538115%28v=vs.85%29.aspx) , "out of memory" error causes crash. I've been trying to reduce memory consumption (TIMOB-20256) but the crash still happens for my Lumia 630. For me rather bigger app (I tried the [Movies app](https://github.com/appcelerator/movies)) crashes but simpler app doesn't. Interestingly it only occurs on Windows Phone 8.1, it runs well on Windows 10 Mobile phones.
  10. Kota Iguchi 2016-02-03

    I was able to fix this locally. It was a combination of memory consumption and also JavaScriptCore configuration. Still testing but I feel positive about this.
  11. Marian Kucharcik 2016-02-03

    Hi Kota, thank you for your positive updates, I hope that appcelerator release updated SDK asap, so I can release my client's app(my client is kind of nervous...) Is there any time frame when it will be released to public? I install v6.0 SDK on daily basis, so please include this fix as soon as you can and let me know. Thank you
  12. Christopher Williams 2016-02-05

    Merged to master and 5_2_X branches
  13. Marian Kucharcik 2016-02-09

    Hi Chris, I tried to install Ti SDK 6.0.0.v20160208111400(from this link: http://builds.appcelerator.com.s3.amazonaws.com/index.html#master), but app keeps crashing. Can you please advice me how to fix this? Thank you.
  14. Kota Iguchi 2016-02-09

    Hmm. It should have significant memory reduction than before, and I saw it's fixed for me. [~max87], what kind of device are you using, and which version of Windows Phone? It would be awesome if there's simple sample program that reproduce this issue.
  15. Marian Kucharcik 2016-02-09

    Hi Kota, I'm using Nokia Lumia 630, Windows Phone 8.1 v8.10.14219.341 I've tried to create new example app and it worked, so I copied source files from my client's project and run and it crashed. I'm trying to comment all code and uncomment after successfull run to see where the problem is. Strange is, that when I build exactly same code with 5.2.0 SDK, it runs without any problems. Thanks Edit: after many build/crash/comment code/build again my app keeps crashing with message: [INFO] : Waiting for app to connect to log relay When I comment part of code(it's not important which part, mostly createWindow/createView/require) app runs normally(but does nothing because main logic is commented).
  16. Kota Iguchi 2016-02-10

    Interesting...thanks for the information. From what I saw, I also suspect that the _elapsed time_ that's required at startup matters. I mean when it takes time to startup the app, Windows tries to stop it. It's not specific to Titanium but Windows Phone apps generally. I would suggest reducing number of files that's required at startup, try to read the logic "on demand" (For example use require only at the time when it's required), which should reduce loading time at startup.
  17. Marian Kucharcik 2016-02-10

    I rewrite parts of code and move require() to methods on demand. I have new problem - I had problem with JSON parsing, I solved it but now that problem is back. I read list of news fromweb via xhr and another xhr is for detail of news. When server send me detail data app crashes because JSON.parse can't parse that objekt - I tried JSON validator and output from server is valid JSON. I use same API and logic on Android/iOS version of app and there it's working fine. Can you please help me with this? Thank you
  18. Kota Iguchi 2016-02-11

    Would you create new ticket for it with a sample code that reproduces the issue?
  19. Marian Kucharcik 2016-02-11

    Hi Kota, I wrote private email to you about this, please look at it and let me know. Thank you.
  20. Kota Iguchi 2016-02-12

    Why don't you create new JIRA ticket for it other than sending private email? Sounds like a issue in JSON with UTF-8 strings.
  21. Marian Kucharcik 2016-02-15

    Hi Kota, I wrote to you private email, because I wanted to keep private data. I discovered, that when I build against 5.2.0 SDK, everything runs fine, but 6.0 has that problem with JSON. Thanks
  22. Lee Morris 2017-03-31

    Closing ticket as fixed, if there are any problems, please file a new ticket.

JSON Source