Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea 3.5.3 (337)

dave1707dave1707 Mod
in Beta Posts: 10,055

@Simeon Just ran into this bug. Don’t remember if this was reported or not since this version has been out awhile. Run the below code which is an infinite loop. Slide the screen from the left side to the right to show the editor. The editor is locked up because the code is still running in the while loop. You have to swipe Codea off the top of the screen to exit. Codea eventually crashes. I thought sliding the screen to the editor was supposed to stop a running program.

function setup()
    while not a do

    end
end

Comments

  • Posts: 421
    Seen the same issue here.
  • Posts: 324

    i’ve locked up codea many times in many past versions, i don’t think it’s out of the ordinary

  • dave1707dave1707 Mod
    Posts: 10,055

    @skar @Simeon It's not unusual that the code locked up, that's what an infinite loop will do. What I'm questioning is sliding the screen from left to right to get back to the editor and the program is still in the infinite loop. I was under the impression that sliding the screen over to the editor would stop the program. Apparently it does in most cases, but not in this. I don't know if that's a problem to be fixed or an infinite loop can't be stopped that way.

  • Posts: 324

    hmm that’s interesting because most of the time if it locks up me i can’t slide to go back to the editor, i have to force close the app and wait for the “Codea crashed” alert

  • edited May 5 Posts: 2,728
    @dave1707 - does that occur when you are running without buttons in viewer.mode or does it occur with or without buttons?

    I always play with buttons and never exit by sliding the screen.
  • dave1707dave1707 Mod
    Posts: 10,055

    @Bri_G It doesn’t matter what viewer.mode is. The slide screen to the editor doesn’t stop the while loop. I don’t normally stop a program that way, but I thought swiping back to the editor stopped anything running. That’s why I was asking if it was a bug or that Codea can’t stop a tight loop.

  • Posts: 2,728

    @dave1707 - just wondered if there was a routine built into Codea to properly stop Codea project activity that works when the button bar is present and stop activated. If so that routine should be called when the Codea window is dragged offscreen - perhaps it's not?

  • edited May 8 Posts: 1,828
    I’ve been suspecting for a while that certain loops keep running no matter how you exit to the editor.

    It’s nothing I’ve been able to pin down, just that sometimes projects with big or complex loops run fine the first time I run them and then crash Codea entirely the second time.
  • SimeonSimeon Admin Mod
    Posts: 5,782

    @dave1707 I wonder if this is a special case where a loop has no body, like you say. So there are no intermediate instructions into which we can hook to disable the Lua runtime. Good find!

  • Posts: 1,828

    In the latest version I just had the dreaded "suddenly lose all work" bug, which I haven't seen in a long time.

    I had set up an assertion to check dependencies, and to test it I unchecked one of the dependencies and ran the project.

    The assertion failed, as expected, and the error message printed out, but there was also a second error that I didn't really look at.

    It seemed odd that any error would occur after a failed assertion, but I didn't pay any more attention to it than that.

    When I returned to my project, there was another oddity, in that about four words had been deleted from an unrelated line down near the end of the project.

    I assumed I'd made some mistake, so I hit the undo button (this is on the iPhone 8), but nothing happened.

    Then I went to turn back on the dependency that I'd turned off, and was surprised to see that it was already checked on again--which I know for sure it wasn't a second ago, because as you'll recall I'd just failed an assertion regarding including it.

    And when I left the dependencies screen:

    • all my assertion code was gone
    • a bunch of other code adjustments were gone
    • the oddly missing four words of code were back

    ...it was upsetting. OTOH it also made me realize it hasn't happened in a long time, and that's pretty great.

    BTW, in case it has anything to do with it, my phone was at 1% battery.

    The code I was working on is the same code posted here:

    https://codea.io/talk/discussion/13785/why-is-this-rigidbody-jumping-all-the-time#latest

Sign In or Register to comment.