# Error in Processing 4 (freezing with show usage, jump to declaration etc.)

**URL:** https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739
**Category:** Beginners
**Created:** [January 29, 2023, 6:32pm UTC](https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739 "2023-01-29T18:32:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [January 29, 2023, 6:32pm UTC](https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739/1 "2023-01-29T18:32:07Z")

</div>

processing v4 crashes when using

- show usage
- jump to declaration
- etc.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [March 9, 2023, 12:24pm UTC](https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739/2 "2023-03-09T12:24:33Z")

</div>

example code, that freezes

try show usage on variable “words”

```auto

// Weltfrauentag 2023 !

//combinations of two
String[] words = {
  "mother", "daughter", "sister", "wife", "grandma", "girlfriend"
};
String[] words2 = {
  "singer", "doctor", "housewife", "teacher", "programmer", "designer", "architect", "feminist"
};

// their indexes
int currentWordIndex = 0;
int currentWordIndex2 = 0;

// for mouse detection
boolean showMother = false;
boolean showDaughter = false;
boolean showSister = false;

PFont font;

float wordChangeDelay = 0.5;
float wordChangeTimer = 0;

// --------------------------------------------------------------------------------------

void setup() {
  size(600, 600);
  font = createFont("data/RobotoMono-Regular.ttf.ttf", 32); // create the font
}//setup

void draw() {
  //background(150);
  background(255, 10, 150);

  // textFont(font);
  textSize(32);
  fill(#FFFFFF);

  // show 4 lines of text ----

  String motherString = "I am a w(?)man";
  if (showMother) {
    motherString = "I am a w(" + words[currentWordIndex2] + ")man";
    if (wordChangeTimer >= wordChangeDelay) {
      currentWordIndex2++;
      if (currentWordIndex2>= words.length) {
        currentWordIndex2 = 0;
      }
      wordChangeTimer = 0;
    } else {
      wordChangeTimer += 50 / 1000.0;
    }
  }
  text(motherString, 100, 150);

  String daughterString = "I could be a w(?)man";
  if (showDaughter) {
    daughterString = "I could be a w(" + words2[currentWordIndex] + ")man";
    if (wordChangeTimer >= wordChangeDelay) {
      currentWordIndex++;
      if (currentWordIndex >= words2.length) {
        currentWordIndex = 0;
      }
      wordChangeTimer = 0;
    } else {
      wordChangeTimer += 50 / 1000.0;
    }
  }
  text(daughterString, 100, 200);

  text("but most of all", 100, 250);

  String sisterString = "I need to be (wǒ)";
  if (showSister) {
    sisterString = "I need to be w()men ";
  }
  text(sisterString, 100, 300);
  //
}//draw

// --------------------------------------------------------------------------------------

void mouseMoved() {
  // for mouse detection

  // Check if mouse is over the word "mother"
  if (mouseX > 155 && mouseX < 225 &&
    mouseY > 135 && mouseY < 170) {
    showMother = true;
  } else {
    showMother = false;
  }

  // Check if mouse is over the word "daughter"
  if (mouseX > 125 && mouseX < 290 &&
    mouseY > 185 && mouseY < 220) {
    showDaughter = true;
  } else {
    showDaughter = false;
  }

  // Check if mouse is over the word "sister"
  if (mouseX > 155 && mouseX < 275 &&
    mouseY > 285 && mouseY < 320) {
    showSister = false;
  } else {
    showSister = true;
  }
}
//

```

---

<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: [March 9, 2023, 1:10pm UTC](https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739/3 "2023-03-09T13:10:09Z")

</div>

Hello,

With Processing 4.2 on a W10 PC it works if I remove the “odd” character:

Change this:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/1/818543d19d0de8bdb0cd04cef30544fff658bbb9.png)

To this:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/a/c/acdd9667dd73545d091048a2f81cbd88c3313bfb.png)

And it works.

This is what I see in Notepad:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/d/3dc84a4e59acc79a482add54f569d72bd844a178.png)

`:)`

---

<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: [March 10, 2023, 4:54pm UTC](https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739/4 "2023-03-10T16:54:41Z")

</div>

There are related Github issues reported here:

> <https://github.com/processing/processing4/issues/682>
>
> \## Description
> Pressing Ctrl-key and click on a word crashes PDE if character '…ä' is used.
> 
> \## Expected Behavior
> Pressing Ctrl-key and click on a word opens a window 'usage of ...'.
> 
> \## Current Behavior
> Sketch crashes under processing v4.x if you insert character 'ä'
> and press Ctrl-key and click on a word.
> 
> \## Steps to Reproduce
> /\* file: Processing\_v4\_bug.pde   
> Copy this example to PDE.
> Press Ctrl-key and click on word 'text'
> A window 'Usage of height' opens under processing v3.x.
> With processing v4.x the sketch crashes!
> Reason is the usage of character 'ä'.
> If you delete it, all is working fine.
> \*/
> void setup()
> { size(100, 80, P3D); }
> void draw() 
> { background (55);
> text(frameCount,22,22);
> }
> 
> \## Your Environment
> \* Processing version: 4.x
> \* Operating System and OS version: Window-10
> 
> \## Possible Causes / Solutions
> Delete character 'ä' and try again... it works fine

> <https://github.com/processing/processing4/issues/527>
>
> \## Description
> 
> 
> 
> Using right-click 'Jump to declaration' menu item causes P…rocessing to lock-up in some sketches.
> 
> When selecting a variable or function name in the UI and clicking on 'Jump to declaration' Processing locks up - No error is shown in the console but the UI becomes unresponsive, menus no longer open and windows cannot be opened or closed. I did wonder if things were just slow, but 10-15 minutes later, Activity Monitor shows Processing as 'not responding' but using between 25-25% CPU.
> 
> I first noticed the problem when working on my own projects, so it's quite possible there's something horrible about my code which is triggering this (my current project has a few thousand lines of code in 28 files, so quite likely I guess). Having said that, the same project didn't trigger this problem using Processing 3.5.4, I only encountered this after opening the project in Processing 4. Different versions of the project compile and run without errors under versions 3 & 4 of Processing.
> 
> While the problem doesn't occur when opening single-tab examples or sketches, it does happen with some of the multi-file example code from the 'Generative Design' book, but doesn't occur when testing a sketch by Marius Watz in 2 tabs.
> 
> In addition to controlP5 (which doesn't trigger the error in other sketches) my current project imports the following libraries:
> 
> \`\`\`
> import java.util.Locale;
> import java.awt.datatransfer.\*;
> import java.awt.Toolkit;
> import java.io.FileInputStream; // File Streams.
> import java.io.FileOutputStream;
> import java.util.UUID;
> import java.util.zip.ZipEntry;
> import java.util.zip.ZipOutputStream;
> \`\`\`
> 
> \## Expected Behavior
> In Processing 3, the 'Jump to declaration' menu item would jump straight to the appropriate variable/function declaration.
> 
> \## Current Behavior
> In version 4, 'Jump to declaration' sometimes causes Processing to become unresponsive.
> 
> \## Steps to Reproduce
> Some of the sketches which trigger the problem import external libraries, but I haven't found a sketch (other than my own) which always triggers the problem.
> 
> \## Your Environment
> 
>  
> 
> \* Processing version: Processing 4.0b8
> \* Operating System and OS version: Mac OS 10.15.7

`:)`

---

<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 2, 2025, 10:06pm UTC](https://discourse.processing.org/t/error-in-processing-4-freezing-with-show-usage-jump-to-declaration-etc/40739/5 "2025-07-02T22:06:10Z")

</div>

Hello,

I got a reminder of this issue today with a degrees symbol ° in my code!

These actions on the the variable test will hang _Processing 4.4.4_ and I must end task with _Task Manager_ in Windows 10:

- _Show Usage…_
- _Jump to decoration_
- _Rename_

This simple code will hang Processing 4.4.4

```auto
int test;

String s = "Yaw (Y axis): 0°";

```

This is what is in my Processing temp folder after running (and hanging):

```auto
// Code removed from start

int test;

String s = "Yaw (Y axis): 0\u00b0";

//Code removed from end

```

This is safe to use the actions on:

```auto
int test;

String s = "Yaw (Y axis): 0\u00b0";

```

Including to be thorough:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/d/f/df2eec3a0cc68441ddfe50349d98cbde3c059fd8.png)

_Adding this to my Notes:_

- Do not use any special characters!
- Substitute them with the `\u` character sequence ( **Unicode escape sequence** ).

> **Other issues \< This need further exploration!**
>
> It also seems to _freeze_ with the _Lamba style_ in this code example and using actions:
> 
> ```auto
> import processing.javafx.*;
> import javafx.application.Platform;
> 
> void setup() {
> size(600, 600, P3D); // Set 3D canvas size
> noLoop();
> }
> 
> // Secondary PApplet used to bootstrap the JavaFX UI
> public class FXBoot extends PApplet {
> 
> public void setup() {
> size(200, 200, FX2D); // Minimal invisible canvas
> 
> Platform.runLater(() -> launchUI()); // Lambda style — active
> }
> 
> // Creates the JavaFX slider UI
> void launchUI() {
> }
> }
> 
> ```
> 
> Not the best example because it requires the JavaFX JAR files and is shared as example only to show what is failing.  
> This was part of much larger code and I reduced it down to this.  
> I will try to find a better example!
> 
> Deleting the line allows me to use actions without _freezing_:
> 
> ```auto
> Platform.runLater(() -> launchUI()); // Lambda style — active
> 
> ```
> 
> This works so it is not just the Lamba style:
> 
> ```auto
> import javax.swing.SwingUtilities;
> 
> void setup() {
> SwingUtilities.invokeLater(() -> launchUI()); // <- Test rename/jump on launchUI
> }
> 
> void launchUI() {
> println("launchUI called");
> }
> 
> ```

`:)`
