How to find out why an app quits after starting?

  1. ‹ Older
  2. 2 weeks ago

    Tim S

    Apr 8 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    This is not a web app that I am currently having trouble with - it is a console app.
    There are no missing decencies either - since the last version worked perfectly, just added a few lines of code, which BTW, I removed to see if that was the issue!

    An old backup copy of the app was just tested, it runs perfectly and stays running.

    I'm going to try compiling on a Linux machine to see if that has any effect, to move on I hope so, but if that cures it, what a PIA!

    I'll try adding a raised event to make sure that the code in the unhandled exceptions gets run. Not sure if the remote debugger really works or not on Windows. I do not like using the Linux machine, it is cumbersome for me - 'cause I don't use it!

    Tim

  3. Tim S

    Apr 8 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    Deleting folders did not help....

  4. Wes W

    Apr 8 Pre-Release Testers, Xojo Pro MD, Columbia USA

    Do you start your console application manually after the raspberry pi boots up or do you have it auto start via Cron or something?

  5. Tim S

    Apr 8 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    In normal operation it starts automatically.
    In these tests I cannot tell if it is stated auto then quits or not. But I do start manually double clicking on the file. Other versions work that way - including a backup which I just resorted to...

    Tim

  6. Wes W

    Apr 8 Pre-Release Testers, Xojo Pro MD, Columbia USA

    Are you daemonizing the application? if not, can you write to stdout at various points in the startup of your code to see where it fails?

  7. Tim S

    Apr 8 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    I am daemonizing, and also am logging all the way up to the loop. All of those checkins are perfect. It just quits....
    Tim

  8. Wes W

    Apr 8 Pre-Release Testers, Xojo Pro MD, Columbia USA

    So it makes it all the way to the loop? Then dies?

    Does it always quit as soon as it hits the loop? Or does it run a while? Any idea how many loop iterations complete before it dies?

  9. Tim S

    Apr 8 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    Seems to quit when it gets to the loop. Hard to tell, runs for maybe a second or two in total.

  10. Derk J

    Apr 8 Pre-Release Testers, Xojo Pro

    @Tim S Seems to quit when it gets to the loop. Hard to tell, runs for maybe a second or two in total.

    Console apps have no main thread. They run trough the “Run” event and then exit. You should have a while loop something like:

    While Not App.Close
    
    App.DoEvents(10)
    
    App.MyMainLoopMethod
    
    Wend
    
    Return 0
    

    Now you should create the App.MyMainLoopMethod as that’s where your main loop code should go (keeps executing that, with yielding 10ms to the system after it.

    Add a property App.Close As Boolean = False
    Whe you set App.Close =True the app should automaticly quit.

    Read more here:
    https://docs.xojo.com/ConsoleApplication

  11. Ivan T

    Apr 9 Pre-Release Testers

    @Tim S There are no missing decencies either - since the last version worked perfectly, just added a few lines of code, which BTW, I removed to see if that was the issue!

    Remember that dependencies change acording the Xojo version used to compile. Try compiling with an older one.

  12. Wes W

    Apr 9 Pre-Release Testers, Xojo Pro MD, Columbia USA
    Edited 2 weeks ago

    Does it run any longer if you don't daemonize the application?

    You haven't said much about what you are doing leading up to the main loop or what you are doing inside the main loop. Are you initializing the GPIO system or opening TCP Sockets in your application?

    Try to get your application to run as a standard console application and then after everything checks out, daemonize it. In my experience, daemonizing is the final thing you want to do after getting the application stable.

  13. Tim S

    Apr 10 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    This one was fixed by compiling on a Linux machine, in 2017R3. None of the 2018 versions worked (either linux or windows) and 2019R1 did not work either on linux or windows!

    There really should be some fix to this. There is no indication of why it crashes in any logs. Since it works in some versions of Xojo, and compiled on Linux Vs Windows there *must* be something that Xojo can do to fix this, and to at least advise to the logs why it crashed!

    Very very frustrating and a huge waste of time!
    Tim

  14. Wayne G

    Apr 10 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    File a feedback report with a sample project.

  15. Greg O

    Apr 11 Xojo Inc

    @Tim S This one was fixed by compiling on a Linux machine, in 2017R3. None of the 2018 versions worked (either linux or windows) and 2019R1 did not work either on linux or windows!

    There really should be some fix to this. There is no indication of why it crashes in any logs. Since it works in some versions of Xojo, and compiled on Linux Vs Windows there *must* be something that Xojo can do to fix this, and to at least advise to the logs why it crashed!

    Very very frustrating and a huge waste of time!
    Tim

    If it’s working when built with 2017r3 and not with 2018r1, make sure you have the libunwind8 dependency (which was new in 2018r1) installed.

  16. Tim S

    Apr 11 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    Hi Greg
    libunwind8 is already installed and is the latest version.

    As it stands right now, of the 3 apps I have in the pi, 2 of them are Console apps requiring compiling on a Linux PC (instead of my standard win10 PC) and will *only* run without quitting unexplainably, without warning or entries to any log including the system/syslog when compiled with 2017R3.

    The third app is a Standalone web app, that also requires it to be compiled on a Linux PC, but appears to run just fine when compiled with the latest Xojo release 2019R1.

    I could send the smallest of the console apps if that would help to get this resolved...

    Also, you stated that a standalone web app will shut down if the port is in use. Does it output anything to the sys log? Since this is done by the framework(?) I would think there would be some type of messaging that would take place.

    Thanks for the help!
    Tim

  17. Greg O

    Apr 12 Xojo Inc

    In a Terminal, try launching one of the console apps using ldd. It may give us more info.

    ldd yourAppName
  18. jim m

    Apr 12 Pre-Release Testers piDog.com

    @Tim S , I wrote a little blog post on my site that gives some very basic ideas to get more info when your app crashes before Xojo can tell you what happened.
    Debugging The Undebuggable
    gdb is a good way to get crash info on Linux. pi should have it installed by default, I think.

  19. Tim S

    Apr 13 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    @ Gregg - have not had time to go an create the non working files upload etc then run as you suggest to get the output. When I get a chance, I will - I need these things fixed as do others I am sure....

    @ Jim - Thank you. When I get a spare moment, I will use your techniques. I did get it figured out in terms of which Xojo version and on WHAT OS it is compiled on to make it work. Wasted SO much time.... But I suppose it is worth it *if* Xojo will review the findings too and make the changes on their end to make the compiled app behave properly on their later releases!

    Again, much appreciated both of you! Will review and advise - probably will have questions too!
    Tim

  20. Tim J

    Apr 14 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    Tim - one more thing to keep in mind - Linux will hold a port for about 30-45 seconds after it is closed as a mechanism to prevent port spamming. Make sure that you are waiting at least a minute before you try to launch the new copy.

or Sign Up to reply!