Log In  

I wish I knew exactly how to reproduce this; it doesn't happen all the time. But decently often (~4 times in the last ~40 hours of runtime? idk just a ballpark guess) when I open a new tab in the code editor and press ctrl+v to paste in code, pico8.exe immediately exits.

The last 3 or 4 times this has happened, I've relaunched pico8.exe and tried to do exactly the same keypresses etc (ctrl+a to copy all text from one tab, ctrl+t out of muscle memory to create a new tab (does not work in pico8), mouse click to create a new tab for real, ctrl+v to paste code), and it works the second time without crashing. Maybe it only happens when the console has been on for long enough? (>4 hours, generally). Maybe I'm not reproducing my steps exactly? idk

My pico8 version is 29, as shown by print(stat(5))

My OS is windows 7

(Is there some sort of crash logs folder or anything like that that I should attach to this post?)

P#81222 2020-08-26 18:46 ( Edited 2021-12-04 01:23)

I was able to reproduce the crash! Here's what I've figured out: the console crashses iff you paste when there is no block cursor blinking, which can happen because the text cursor position inside each tab is persistent between different cartridges.

In more detail: Your text cursor position is stored per-tab; i.e pico-8 has a global table that says what the last cursor position was in each tab: cursor_position_in_tab={ [0]=13, [1]=4, ... }

However, this table is not reset when you load a new cart! So, if you change the cursor position in tab 1 in an existing cart, then load an empty cart and add a new tab, pico-8 thinks your cursor position is, say, 15, but the current tab 1 is empty! the block cursor doesn't show up, because pico-8 doesn't know where to put it. Then, when you press ctrl-v to paste, pico-8 tries to paste text at position 15 in the 0-length file, gets confused, and crashes.

Reproduction steps: (see video below)

  • Load a blank cartridge: reboot
  • Save the blank cartridge: save empty.p8
  • Add a new tab in the code editor
  • Type any text into tab 1. Be sure to leave the flashing red block cursor at the end of the line
  • Save the cartridge with a different name: save nonempty.p8
  • load empty.p8
  • Add a new tab in the code editor
  • Notice you have no flashing block cursor in tab 1.
  • press ctrl-v; the console crashes

(After further testing, pico-8 seems to reset cursor_position_in_tab[0] to 0, but does not reset the rest of the table! So, these repro steps do require you to do stuff in tab 1; this can't be reproduced using tab 0 only)

P#81269 2020-08-27 23:51

this bug still exists in 0.2.4

P#101407 2021-12-04 01:22 ( Edited 2021-12-04 01:23)

I just ran into this as well on v0.2.4.
I was adding a new tab (cause I didn't want to cmd+c/v all the tabs over by hand) in a text editor and then reloaded, tried to paste the header comment of the tab and crashed.

P#105220 2022-01-17 03:41

0.2.4b fixes this; ty zep!
\o/ \o/ \o/

P#105795 2022-01-28 03:31

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-11-30 11:04:27 | 0.007s | Q:11