phpshell
phpshell copied to clipboard
browser crash / endless loop
reproduced on Firefox 135a1 and latest macOS safari on macbook pro m4
repro
- copy this text into clipboard:
for ($i = -5; $i < 5; $i++) {
var_dump($i == null);
}
- open https://3v4l.org/iGoti
- click into the text editor and place the cursor at the very end after
"\n"; - press ENTER
- paste the clipboard contents
- move cursor using the keyboard-arrows just after
==of the pasted text - press backspace
=> browser freezes at this screen
nice, I'm getting reproducible OOMs as well on my x86 machine running firefox-133. It's not the highlighter but the live-preview WASM. There doesn't seem to be an infinite loop either, I'm unable to force my browser debug this without adding additional code
Using the global "Performance" profiler shows nothing useful besides reporting the Parent process reporting Jank - event processing delay
As suggested by https://mastodon.social/@zimzat/113786499072771167:
The instructions in the linked GitHub issue say to press backspace on ==, which turns it into an assignment overwriting the
$iused by theforloop. The wasm runs before the browser draws the change so the input doesn't look like an infinite loop but it is.
I'll look into the ordering - making sure the editor gets updated before the wasm runs and hangs your browser
I am experiencing simillar browser hang.
Repro:
while (true) {}
This causes the "live preview" to never end, which is a situation not hard to get into when coding with live preview.
I would be happy if there can be some limit on time, memory, output data (for live preview).