There is a simple way to verify the suspected cause:
Create a new script and only put the printf("Hour=%d",hour()); in there and see if it crashes.