Desktop app quits at launch

I have a compiled desktop app (Xojo 2013 r3.3) running on several Mac computers that quits immediately on launch. If I restart the computer, the app launches fine.

This seems to happen related to different scenarios. For example, if I compile a new application and then copy it to a new computer (that already has a copy of the application), some of the computers need to be restarted for the application to run.

On the computer I use for programming, the problem has been happening much more lately. I might go to launch the app and when it suddenly quits on launch. I restart the computer and all is well again. If I quit the app and leave the computer for a while and then try to launch the app again, it won’t. This is the same app. I didn’t compile another one.

I didn’t really change anything. My Mac OS on my programming computer (iMac Retina) is 10.12.6.

This happens a lot on another iMac running 10.9.5.

This was an occasional problem that is now becoming more frustrating since I now have to restart my iMac every time I want to run the application.

I did write something to quit the application after 30 minutes which hasn’t really been a problem. This didn’t change so I can’t imagine that its related.

This never happens when working in Xojo and using a runtime version of the program (ie. clicking the RUN button in Xojo) .

Why would a restart make a difference? What do you think could be going on?

sounds like some resource is being opened, locked or otherwise compromised, and a reboot releases it

[quote=374547:@Dave S]sounds like some resource is being opened, locked or otherwise compromised, and a reboot releases it

[/quote]
Would this be something I coded or something related to Xojo?

What does the app do on start? Have you tried to write logging information to the console too see exactly where the app quits? I agree with Dave that very likely a resource is causing this problem.

technically either, but I doubt it is something Xojo is doing itself, as you would have seen many forum posts related to this issue, and there aren’t…

Open Console and look for crash reports, verify the times are when you tried to launch the application. Then copy the main body of the crash report and post it here, the community might be able to help you narrow it down.

[quote=374562:@Sam Rowlands]Open Console and look for crash reports, verify the times are when you tried to launch the application. Then copy the main body of the crash report and post it here, the community might be able to help you narrow it down.

[/quote]
I will do that. It might take me a couple of days, but I really would like to get to the bottom of this.

There is a routine at startup that reads a remote file to see if there is a new version released. It is the only thing that happens before the login window appears, so it might be related to that. I’m not sure if that method runs in the debug version (I might have disabled that for debugging). Something for me to look into.

I appreciate the support, guys. Sometimes you just need that to think clearly.

[quote=374562:@Sam Rowlands]
Open Console and look for crash reports, verify the times are when you tried to launch the application. Then copy the main body of the crash report and post it here, the community might be able to help you narrow it down.[/quote]
I am checking in the Console and a few entries under System Reports - either cpu_resource.diag or .hang
Nothing under User Reports that says .crash

Since I try to open the app a few times before restarting, I would expect a number of entries in a row (which I am not seeing).

Of course, now the problem is not happening, so I have to wait for it to reappear to see if anything else shows up in the Console.

The app immediately quits - no message or alert. The first window that should appear does not.

In the app.open event, there is a method that downloads a small file to check for current version using HTTPSecureSocket.

There is also this code:

If TargetWin32 then App.AutoQuit = True End if

Add

system.DebugLog currentMethodName + " i was here and did that: xxxx"

to all your open methods. Try with an empty app. Does this work? Move all your open code to a new test app and try this. Recently, there was an interesting case on the dark side where a user had a problem with a graphics chip. Even Xojo wouldn’t start.

Will try that as well. Of course, this issue only appears when I don’t want it to.

Everything else would be boring, wouldn’t it?

We have seen times where an exception in the App.Open event will cause this. Make sure you are coding very defensively.

For instance, if you are writing to a file with a TextOutputStream, make sure that the folderitem is not Nil, is Writable and the containing folder is Writable before you try to open the stream so it doesn’t throw any exceptions.