processing / processing/processing4

Opening `pde://` link on Windows 10 causes unexpected behavior

Open
#998 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
494
Forks
183
Avg merge
4h 39m
Merged PRs (30d)
3

Description

Most appropriate sub-area of Processing 4?

PDE

Processing version

4.4.1

Operating system

Windows 10

Steps to reproduce this
  1. Install Processing 4.4.1 with the .msi installer.
  2. Paste the pde:// link below in Chrome and press Enter.
  3. Click "Open Processing" and wait for Processing to start.
  4. Notice that the PDE shows visual glitches and errors in the console.
snippet
pde://sketch/base64/LyoqCiAqIEFycmF5LiAKICogCiAqIEFuIGFycmF5IGlzIGEgbGlzdCBvZiBkYXRhLiBFYWNoIHBpZWNlIG9mIGRhdGEgaW4gYW4gYXJyYXkgCiAqIGlzIGlkZW50aWZpZWQgYnkgYW4gaW5kZXggbnVtYmVyIHJlcHJlc2VudGluZyBpdHMgcG9zaXRpb24gaW4gCiAqIHRoZSBhcnJheS4gQXJyYXlzIGFyZSB6ZXJvIGJhc2VkLCB3aGljaCBtZWFucyB0aGF0IHRoZSBmaXJzdCAKICogZWxlbWVudCBpbiB0aGUgYXJyYXkgaXMgWzBdLCB0aGUgc2Vjb25kIGVsZW1lbnQgaXMgWzFdLCBhbmQgc28gb24uIAogKiBJbiB0aGlzIGV4YW1wbGUsIGFuIGFycmF5IG5hbWVkICJjb3N3YXZlIiBpcyBjcmVhdGVkIGFuZAogKiBmaWxsZWQgd2l0aCB0aGUgY29zaW5lIHZhbHVlcy4gVGhpcyBkYXRhIGlzIGRpc3BsYXllZCB0aHJlZSAKICogc2VwYXJhdGUgd2F5cyBvbiB0aGUgc2NyZWVuLiAgCiAqLwoKCmZsb2F0W10gY29zd2F2ZTsgCgp2b2lkIHNldHVwKCkgewogIHNpemUoNjQwLCAzNjApOwogIGNvc3dhdmUgPSBuZXcgZmxvYXRbd2lkdGhdOwogIGZvciAoaW50IGkgPSAwOyBpIDwgd2lkdGg7IGkrKykgewogICAgZmxvYXQgYW1vdW50ID0gbWFwKGksIDAsIHdpZHRoLCAwLCBQSSk7CiAgICBjb3N3YXZlW2ldID0gYWJzKGNvcyhhbW91bnQpKTsKICB9CiAgYmFja2dyb3VuZCgyNTUpOwogIG5vTG9vcCgpOwp9Cgp2b2lkIGRyYXcoKSB7CgogIGludCB5MSA9IDA7CiAgaW50IHkyID0gaGVpZ2h0LzM7CiAgZm9yIChpbnQgaSA9IDA7IGkgPCB3aWR0aDsgaSsrKSB7CiAgICBzdHJva2UoY29zd2F2ZVtpXSoyNTUpOwogICAgbGluZShpLCB5MSwgaSwgeTIpOwogIH0KCiAgeTEgPSB5MjsKICB5MiA9IHkxICsgeTE7CiAgZm9yIChpbnQgaSA9IDA7IGkgPCB3aWR0aDsgaSsrKSB7CiAgICBzdHJva2UoY29zd2F2ZVtpXSoyNTUgLyA0KTsKICAgIGxpbmUoaSwgeTEsIGksIHkyKTsKICB9CiAgCiAgeTEgPSB5MjsKICB5MiA9IGhlaWdodDsKICBmb3IgKGludCBpID0gMDsgaSA8IHdpZHRoOyBpKyspIHsKICAgIHN0cm9rZSgyNTUgLSBjb3N3YXZlW2ldKjI1NSk7CiAgICBsaW5lKGksIHkxLCBpLCB5Mik7CiAgfQogIAp9?pde=
Additional context

Image

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0
	at processing.app.ui.EditorHeader.paintComponent(EditorHeader.java:238)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JSplitPane.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintToOffscreen(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent._paintImmediately(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintImmediately(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Would you like to work on the issue?

Maybe, with some guidance. But also happy to leave it to another contributor.

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

Reproduce the Windows 10 flow by opening the provided pde:// link through Chrome after installing Processing 4.4.1 with the .msi installer. Start with processing.app.ui.EditorHeader.java at line 238 and inspect the reported ArrayIndexOutOfBoundsException. Done means the sketch opens without visual glitches or console errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.