Log In  

Hi!
I was making tables recklessly and then i think i hit the ram limit. The thing is that it happen when i run the game, and in the first frame, not even where the tables are defined, and it hangs pico8 entirely almost every time.
So, i have one table less and it works, but if i put that last table item without removing another, that happen when i run the game.

I have a menu that doesn't define this vars, and then i hit a button it enters the gameplay when it defines them. It's my undestanding that this would have to happen when i reached the gameplay and the vars are defined, but pico8 hangs when i hit run.

I verified that is not a bug of the game and i'm almost sure that it is the ram limit, but is weird that it happen before the game reaches the segment when it defines this variables.

I'm not asking for more ram XD but i'm pretty sure that something is broken with the exception handling in case of runtime memory, and i don't entirely undestand why it overflows before reach the execution of the code that fills the content of these tables.

Thanks!

P#15671 2015-10-21 03:28 ( Edited 2015-10-21 22:22)

i think i may know what is happening.
i use an unpack function that receives a string and that string is defined from the moment the game runs, so this may be something like "variable memory" that is not the same that the 512k (or is it 256k?) of ram of runtime memory that pico8 have. I have several functions like local s = unpack("longstring.verylongseriously").
anyways, an error message would be fine.

P#15675 2015-10-21 07:19 ( Edited 2015-10-21 11:19)

can you post your code or a test case so we can see what's going on?

you get 512k of ram for lua to use.

P#15678 2015-10-21 08:40 ( Edited 2015-10-21 12:40)

yes i'll do in a couple of hours. i'll post the working one and the bugged one, so anyone can compare them

P#15679 2015-10-21 08:49 ( Edited 2015-10-21 12:49)

bugged version:

Cart #15700 | 2015-10-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

same as bugged, but without the fraction of string that causes the pico8 crash


working with the bugged version, sometimes it crashes pico8 at run, and sometimes it says out of memory and then crash in the first input i do.

P#15702 2015-10-21 14:45 ( Edited 2015-10-22 10:13)

Hey, thanks for the carts for debugging. The short answer is that it's a bug on my end and will be fixed in 0.1.4.

Longer answer, it looks like there are 2 separate things going on (warning: technical details follow!):

  1. The host crash on run was caused by under-allocating a buffer while pre-processing the cart's source code. So having the extra table must have juuust pushed it over the edge, but only because of the extra ascii text -- not because what the pico-8 program was actually doing.

  2. The out of memory crash I haven't been able to reproduce yet, but looking at the memory layout it seems it might have been because of the buffer overwrite clobbering something else. A PICO-8 out of memory error should never cause a host crash if everything is working -- internally when the cart requests memory it always grants the request but then triggers an "OUT OF MEMORY" error a little later on when it's safe.
P#15703 2015-10-21 16:13 ( Edited 2015-10-21 20:13)

Thanks zep!!!
This means that it shouldn't have crash or that when it's fixed i'll have an "out of memory" error when executing the cartridge as it is now ?
did i used all the execution memory? xD

P#15704 2015-10-21 18:22 ( Edited 2015-10-21 22:23)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-16 14:25:46 | 0.011s | Q:24