Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2814] Debugger crashes the application intermittently, whilst running without debugger is stable

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-08-30T02:09:21.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsdebugger, ios, mobile
ReporterMatthew O'Riordan
AssigneeTony Guntharp
Created2011-08-02T08:11:11.000+0000
Updated2016-03-08T07:47:44.000+0000

Description

I have been getting quite confused by the fact that my application seems to crash at different points every time I run the application in the emulator. However, I recently discovered that if I run the application without the debugger, the application works every time perfectly, yet with the debugger enabled it will crash at different points in the application each time, and on occasion the app runs with the debugger enabled. I have tried all of the following to resolve the issue: * Clean the build folder and even delete the entire build folder * Restart my machine and Titanium Studio * Turn off all breakpoints and watches * Turn on breakpoints and step through. If I step through, I tend to have more success in getting the app to run, but that is not guaranteed. When the emulator crashes, I get one of the following two messages: * "[DEBUG] Session did end with error (null)" * "[DEBUG] Session did end with error Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "The simulated application quit." UserInfo=0x10011f660 {NSLocalizedDescription=The simulated application quit., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}" My application is nothing particularly complex. It uses SQLite, HTTPClient, and a bunch of views & windows which run in sub-contexts. I find that sometimes after the debugger has crashed, there are 5 or so threads running, yet in normal operation I never have more than 3 windows open so I am confused as to why it is showing 5 threads. As you can see from http://developer.appcelerator.com/question/123608/debugger-on-ios-causes-the-app-to-crash-in-the-emulator-frequently#comment-92974, this issue is being experience by other users. I currently have NO workaround solution for this, I am simply without a debugger now which I am paying for. Please can you help. I can happily send you my entire code base, but trying to create a sample bit of code which replicates this issue is unfortunately just not possible. It seems that the debugger is simply struggling with the code base, and erratically falters at different points every time. Matt

Comments

  1. Paul Dowsett 2011-08-02

    Hi Matthew Thanks for this. Would you mind providing the full log, in a wiki markup code block, please? Would you be happy to attach your project to this ticket? Thanks
  2. Javier Rayon 2011-08-02

    I also often found debugger unestable in situations very hard or impossible to reproduce. The same breakpoint works fine for a few times and, after that, debugger stops on breakpoint, the "variables" view remains blank and the app crashes. Clean build folder sometimes helps, but is very annoying and not very productive. A few times I had to reboot the computer to continue working. Also, alternate between run mode and debug mode requires more than one clean build-folder and not always works. may have something to do with closing emulator when debugger is working in some way? I'm sorry I can't send more info. SDK 1.7.2, Mac 10.6, iOS 4.3.2
  3. Matthew O'Riordan 2011-08-02

    Hi Paul You won't believe this, but I've reverted to the code that was failing almost every time I ran the debugger and now it's working. This is what is so frustrating about the whole thing. I spent an hour trying everything to get the debugger to work after I had committed my code, and could not get it to work. I then shifted to another branch, did some work, and now shifted back and it works again. I'm sure some time in the next 24 hours it will start happening again, so when it does I will capture the complete log and post that up. However, in terms of sending you my code, I am happy to do this, but I am unable to post it here unfortunately as this is a public forum. Do you have a better way I can send it to you privately? Matt
  4. Paul Dowsett 2011-08-02

    Matt Thanks for your update. I can appreciate the frustration, certainly. :) I will close this for now, but please post a comment if you are able to obtain a log of it failing, and I will open it again. I am not sure about sending your code privately. If you make an update to this ticket, then we can discuss the best way to do this at that time. Cheers
  5. Matthew O'Riordan 2011-08-04

    Hi Paul, it's back, and doing the usual unexplainable behaviour. Please can you reopen this ticket as this issue is not solved. I'm not sure if you want me to post this into the main thread or not, as arguably the main thread has all the information you need anyway. However, for completeness, I'll add some more info:
       [DEBUG] Analytics is enabled = YES
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/app.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/app_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/redux.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/redux.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/redux_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/global.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/global.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/global_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/underscore.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/underscore.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/underscore_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/joli.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/joli.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/joli_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/pubsub.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/pubsub.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/pubsub_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/utilities.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/utilities.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/utilities_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/safe_http_client.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/safe_http_client.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/safe_http_client_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/location_service.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/location_service.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/location_service_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/json.i18n.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/json.i18n.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/json_i18n_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/model/database.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/model/database.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/model/database_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/model/migrations.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/model/migrations.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/model/migrations_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/model/person.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/model/person.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/model/person_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/references.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/references.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/references_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/base.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/base.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/base_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/view_stack.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/view_stack.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/view_stack_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/application.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/application.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/application_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/startup.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/startup.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/startup_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/stream.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/stream.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/stream_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/dialog.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/dialog.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/dialog_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/menu.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/menu.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/menu_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/controller/location.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/controller/location.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/controller/location_js
       [DEBUG] application booted in 241.320014 ms
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/view/startup/index.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/view/startup/index_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/redux.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/redux.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/redux_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/global.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/global.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/global_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/underscore.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/underscore.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/underscore_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/joli.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/joli.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/vendor/joli_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/pubsub.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/pubsub.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/pubsub_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/utilities.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/utilities.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/utilities_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/safe_http_client.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/safe_http_client.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/safe_http_client_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/location_service.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/location_service.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/location_service_js
       [DEBUG] include url: file://localhost/Users/matthew/Projects/hellogator/appcelerator/Resources/library/json.i18n.js
       [DEBUG] loading: /Users/matthew/Projects/hellogator/appcelerator/Resources/library/json.i18n.js, resource: Users/matthew/Projects/hellogator/appcelerator/Resources/library/json_i18n_js
       [ERROR] Script Error = Result of expression 'file.exists' [undefined] is not a function. at json.i18n.js (line 66).
       [INFO] Auto include view/startup/index.rjss
       [INFO] Location services disabled
       
    The 6th line, starting with if (file && file.exists()) is the line that fails every time I run the application with the debugger enabled. As soon as I turn the debugger off, everything works smoothly.
           try {
             file = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'i18n', localeID + '.json');
           } catch(e) {
             // file does not exist, sometimes an exception is thrown for some odd reason
           }
           
           if (file && file.exists()) {
           ....
       
    Interestingly as well, when I debug and break the execution at that line, and I then inspect the object it says it's a file object, but it does not respond to exists(). As soon as I run the application without debugging enabled, everything works perfectly. As with the last time this happened, I think I'll need to just wait a few hours / days until it starts working again. Very intermittent, and very difficult to diagnose. I can send you the entire application code base if you want, but I cannot put it in the public domain unfortunately.
  6. Matthew O'Riordan 2011-08-09

    Hi Paul I see this ticket is still marked as resolved. Will this be changed? Matt
  7. Paul Dowsett 2011-08-30

    Matt Without a way to reproduce this, I am afraid I cannot accept it. However, what you could do is create some code that proves the following statement: "Interestingly as well, when I debug and break the execution at that line, and I then inspect the object it says it's a file object, but it does not respond to exists()." Thanks btw, I have removed the linked ticket, as this related to Android
  8. Paul Dowsett 2011-10-07

    Closing due to inactivity.

JSON Source