Codea 3.3.3 (280)

@Simeon This also causes the problem. So it doesn’t matter where the loop is, setup() or draw(). It seems to be related to a loop and closing the program by sliding right from the left side of the screen.

function setup()
    while true do        
    end
end

Just had the tab-reversion bug happen in another project that does not write to tabs.

This looks like a bug I introduced in handling how to terminate long-running Lua scripts, will try to fix

@Simeon - had two crashes with 280 today. One when I was editing, deleting a variable. The other just randomly. Couldn’t tie in any actions to the crashes.

@Simeon - this is a bit off the wall, it involved using Air Code and a browser.
I set up to use Opera on my Mac and connect to Codea. I opened a Craft project, the Catalogue Cube latest from @dave1707 and tried to paste some of the scene definitions in another project into it to a change the scene colouring. My iPad threw up an error 'Main:9: attempt to index a nil value (global ‘scene’) stack traceback: Main:9: in function ‘setup’ '.

After disconnecting and running the exact same project (unchanged) on my iPad there was no error.

I’m know that you may not be interested in the Aircode issue, but I thought it may give a pointer into current issues with 280.

@Simeon - accidently triggered record video for screen, selected don’t allow from the menu and Codea crashed v280.

@Simeon this seems very strange to me, maybe it’s a clue to something?

Start a new project, do a select all, and then paste this code on top of it, so that there is nothing else at all in the project.

This code runs a loop that you can escape by tapping q on the on screen keyboard, and every time it loops it calls background() with a pink color.

Run it and tap q very quickly, or else there’s a memory overload or something and it crashes.

The screen is all black until you tap q, at which point you’ll see the screen flash pink and black over and over and over. It’s like each background() command got saved up and was trying to execute all at once.

But the weirdest thing of all, to me, is that all this drawing is occurring even though there’s no draw() function in the project.


-- Delayed Drawing Bug

function setup()
    runLoop()
end

function runLoop()
    local buffer = ""
    viewer.mode = OVERLAY
    showKeyboard()
    while buffer ~= "q" do
        background(236, 67, 201)
        buffer = keyboardBuffer()
        bufferLength = string.len(buffer)
        buffer = string.sub(buffer, string.len(buffer))
    end
    hideKeyboard()
end

…it seems like weird behavior to me, maybe it’s a clue to what might be going on with loops?

@UberGoober That’s probably not a bug, but just the screen refreshing. This code below does the same thing. Slide the screen from the left edge to the right to exit the code.

 function setup()
    background(236, 67, 201)
end

@dave1707 huh, right you are, thanks. You do have a talent for cutting right to heart of the matter.

@Simeon - posted several times with a problem crashing 280 when trying to run an old project by @JMV38 which dealt with demonstrating Blend Modes. Crashed after loading and trying to run. Then subsequently crashed whilst trying to save & Run before the Save&Run menu was visible.

link to original thread

link to @JMV38 latest Gist with code

@Bri_G If these 2 lines are commented out, Codea doesn’t crash. I didn’t see if the code actually ran or not, it just didn’t crash.

--back = grid()


--local colorGrid = smallColorPattern()

@dave1707 - thanks for the info. Did you go through the lines one by one to find them? I started trying to block out routines to try to localise the cause but ran out of free time. I’ll dig into that to see if I can find the root cause. Thanks again.

@Bri_G I commented each function and uncommented a few at a time to see when it crashed.

@dave1707 - tidied this up a bit but still an error which doesn’t relate to a tab/line number. Posted here again could you take a look?

@Bri_G Loaded the code and it seems to be running OK. Can go thru all the slider positions OK.

It’s the top slider that causes the problem. Played with the others to good effect but when I used that an error message was given. Also changed some of the colours of the images.

@Bri_G The top slider doesn’t seem to do anything, but I don’t get any problems.

@dave1707 - it flashes up like an error but no line number etc. I’ll see if I can get an image of it and post it.

Tried again after rebooting myiPad and it took a while but here is the error-

@Bri_G I finally got the error. I was constantly sliding the top slider back and forth. Without any line numbers or anything else, there’s probably no way to find the error.

@dave1707 - thanks for checking in out. Must be a particular combination of changes or possibly too rapid change causing an issue. @Simeon may be able to identify the cause from the error reports.