processing / processing/p5.js-web-editor

Very large number of Error: Multiple infinite loops detected. Stopping execution.

Open
#4,257 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting Maintainer Approval Bug
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

p5.js version

2.3.2 (although it happens to me on many versions)

What is your operating system?

Linux

Web browser and version

151.0.7922.108 (Official Build) (x86_64)

Actual Behavior

This Error: Multiple infinite loops detected. Stopping execution

It has been appearing way too often starting sometime this summer. (I don't remember seeing it in May, but in June I feel it started) Most recently I am using an old linux computer to grade p5.js work and almost any assignments with nested loops is giving this error and not completing.

In addition I see it often on my macbook pro which is a fast computer. I have to imagine this is happening all of the time.

I tried using "// noprotect" at the top of the sketch with the hope that it would turn off loop protection, but it does not seem to do that. (although it is documented to turn off the protection). I also tried changing frameRate(1) but that did not help either (I was testing the idea that maybe the draw loop was causing infitinite loops and if i slowed it down it may help)

Expected Behavior

I expect it to run, but just a little bit slower.

When i use // noprotect I expect it to turn off infinite loop protection and run without errors.

Considering p5.js and the P5 editor are intended to be the most accessible coding platform, it should work reasonably well for older computers. My computer is not that old, but it is kind of slow. The p5 web editor just does not work with this computer.

Steps to reproduce

// noprotect

// Note run this on a slower computer, in my case a Linux laptop and it will give the error

let z = 0;

function setup() {
createCanvas(400, 400);
colorMode(HSB, 360, 100, 100);
noStroke();
}

function draw() {
background(0, 0, 90);
z += 0.01;

for (let x = 0; x < width; x += 5) {
for (let y = 0; y < height; y += 5) {
let n = noise(x / 100, y / 100, z);
fill(n * 360, 75, 95);
square(x, y, 5);
}
}
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the nested-loop sketch in the p5.js web editor on a slower Linux computer, comparing behavior with and without the // noprotect comment and with frameRate(1). Trace the editor's infinite-loop protection entry point and verify that the sketch can complete without the false error while genuine infinite loops remain protected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.