# Error: Multiple infinite loops detected. Stopping execution. at undefined:2:33088 \_ how do I resolve this?

**URL:** <https://discourse.processing.org/t/error-multiple-infinite-loops-detected-stopping-execution-at-undefined33088-how-do-i-resolve-this/48974>\
**Category:** Coding Questions\
**Created:** [July 8, 2026, 1:03pm UTC](https://discourse.processing.org/t/error-multiple-infinite-loops-detected-stopping-execution-at-undefined33088-how-do-i-resolve-this/48974 "2026-07-08T13:03:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 8, 2026, 4:14pm UTC](https://discourse.processing.org/t/error-multiple-infinite-loops-detected-stopping-execution-at-undefined33088-how-do-i-resolve-this/48974/3 "2026-07-08T16:14:05Z")

</div>

Hello @willdknyc,

Welcome to the forum.

Please read:  
_[Welcome to the Processing Foundation Discourse](https://discourse.processing.org/t/welcome-to-the-processing-foundation-discourse/8)_

There is a useful guide in there: [Guidelines - Asking Questions](https://discourse.processing.org/t/guidelines-asking-questions/2147/)

You should also share the version of _p5.js_ that you are using; I got different errors with the latest p5.js 2.x version.

Your code is not runnable as is and I had to simplify it to run _without an image._

Once simplified the canvas was blank (all one color) and this worked to get different colors (replaces image for testing):

```auto
      //let c = get(xPos, yPos);
      let c = color(random(255), random(255), random(255));

```

I had to correct an error with `keyPressed()` first (commented it out entirely for starters) and then I saw this with version _p5.js 1.11.13 (Default)_:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/9/b9f1bf48feddbe853d719ffa4b2d0522fe46b916.png)

And code works with the Loop Protection **Off** :

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/4/643082ebfe95706b87acad997488035eb7441d97.png)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/error-multiple-infinite-loops-detected-stopping-execution-at-undefined33088-how-do-i-resolve-this/48974)._
