My Sketch just randomly stops/disappears without a trace

I’ve got a processing sketch that has been merrily humming along for a few months. (This is not some fancy graphics sketch just something I’m using/learning to monitor my HVAC system.) Recently about once a day it just dies. (Not exactly a technical term perhaps.) As I was developing this I always got a null exception error or some other indication of why it crashed but nothing. The serial output I just print out the change of state of the things I’m monitoring. In the past with a null exception crash or index out of bounds or whatever I’d get a red message in the serial stream telling me what caused the crash. What I’m experiencing now is nothing unusual except my “draw” window is gone. Also I notice in the windows task manager than there is one less Java instance running. Finally the processing code box (or whatever its called) is still there and the “play/start” icon/button is still highlighted. So with that rambling my question is: Is there a way to set a trap that reports what/why my program terminates?

I wouldn’t use println in that scenario at all

Instead collect data and use saveStrings every 10 minutes or so

Also, did you try to make a exe file or are you running the sketch from the ide? I would use an exe file. Like in Export to make the exe.

Anyway, did try to restart you computer and then run the exe file?

I once had a lot of java processes open

(Sorry notification went to spam folder) Yes I run with exe file and do right output to a file. But that doesn’t get me any crash details. (And no crash details from IDE running either.) Just seems odd that IDE is happy to provide crash details (or even warnings as in Map results “infinity”) but not in this case. It’s as if something else is killing it but the only thing I run on this machine is this one process. Well that’s not true for now I also added something called RestartOnCrash.exe which monitors my Process sketch and restarts it when it disappears. I was hoping there would be some general way to trap an exit while running in IDE mode so I can figure out what’s causing it. Thanks.

When it used to work and now it doesn’t anymore

  • the key question is always: what did you change inbetween?

Windows update, new driver, new version, new program…?

There have been several Windows updates over the course of this project. No changes to my program, to my memory, from when it was rock solid to where it daily crashes without warning. I’m assuming, since no one has said otherwise, that there isn’t some setting in the IDE to flip on to do a trace if the program aborts.

I don’t know

I think there is an debugger

Oh thanks. I’ve never used that and totally forgot about it. I’ll play with that.