# Target VM failed to initialize

**URL:** <https://discourse.processing.org/t/target-vm-failed-to-initialize/42448>\
**Category:** Processing\
**Created:** [July 19, 2023, 4:44am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448 "2023-07-19T04:44:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![olliebown](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olliebown/32/10521_2.png) [@olliebown](https://discourse.processing.org/u/olliebown)\
**Post date:** [July 19, 2023, 4:44am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/1 "2023-07-19T04:44:53Z")

</div>

I’m getting an error “Could not run the sketch (Target VM failed to initialize).”  
This error suddenly appeared from one minute to the next. I thought it was to do with my code but after working though every possibility I discovered that _any sketch_ running P2D and P3D causes this error. The error does _not_ occur if you do not use P2D or P3D (e.g., size(200,200,P2D) causes the error but size(200,200) runs normally, on _any_ sketch).

I’m on a Mac M1, Ventura, but using the Intel version of Processing (because I have to in order to use the Syphon library). It was working, until it wasn’t. I have clean-installed Processing and the Processing sketchbook folder. I’ve also tried the Mac M1 version of Processing and I get the same error.

I see many instances of this problem but not for a Mac. There’s one that mentions loading fonts, but I’m not loading fonts.

The full error log is here: [Dropbox - hs\_err\_pid3912.log - Simplify your life](https://www.dropbox.com/scl/fi/r9b997000xsvpid3iwzxd/hs_err_pid3912.log?rlkey=op454gnrc717nfcw5fm4no8cp&dl=0)

The error printed to the output console is here:

```auto
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x00007ff81127ce0f, pid=3912, tid=16131
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.6+10 (17.0.6+10) (build 17.0.6+10)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (17.0.6+10, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C [CoreFoundation+0x1cee0f] CFEqual.cold.1+0xe
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /var/folders/gs/lpyvcbys3nn7xq3n2dpql99c0000gq/T//hs_err_pid3912.log
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Could not run the sketch (Target VM failed to initialize).
For more information, read Help → Troubleshooting.

```

This sounds very much like a corrupt library on my system, or corrupt JRE, but I understand the JRE is bundled with Processing. So I’m stumped. To repeat: this was working fine for weeks, then the error arrived and is now persistent.

---

<div class="post-metadata">

**Author:** ![olliebown](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olliebown/32/10521_2.png) [@olliebown](https://discourse.processing.org/u/olliebown)\
**Post date:** [July 19, 2023, 9:08am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/3 "2023-07-19T09:08:05Z")

</div>

New news. I’ve identified that this happens when connected to a second monitor. Hence the sudden onset of the problem. Everything’s fine when not connected. I don’t have any more detail than that. It’s workable for me for now but sounds like something that could arise again.

---

<div class="post-metadata">

**Author:** ![GSA\_IxD](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gsa_ixd/32/7554_2.png) [@GSA\_IxD](https://discourse.processing.org/u/GSA_IxD)\
**Post date:** [July 20, 2023, 3:40pm UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/4 "2023-07-20T15:40:46Z")

</div>

Perhaps **try mirroring the display** and not extended desktop. I experience this too and it has always mystified me

---

<div class="post-metadata">

**Author:** ![olliebown](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olliebown/32/10521_2.png) [@olliebown](https://discourse.processing.org/u/olliebown)\
**Post date:** [July 21, 2023, 12:23am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/5 "2023-07-21T00:23:56Z")

</div>

Thanks for helping narrow it down! Sounds like ultimately a GStreamer issue.

---

<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:** [July 21, 2023, 11:46am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/6 "2023-07-21T11:46:08Z")

</div>

That’s a bad error message because it doesn’t explain anything

I had this error also when I try to use loadImage before setup or size.

Annoying. Processing should try to make this error message more precise or distinguish between the causes better

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [July 22, 2023, 6:27am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/7 "2023-07-22T06:27:27Z")

</div>

Hi @Chrisir,

> [@Chrisir](#):
>
> Annoying. Processing should try to make this error message more precise or distinguish between the causes better

Those kind of errors can’t really be handled by processing code as it crashes the VM on a deeper level. Mean there is no ie. Exception thrown etc for it which could be catched and log a “better” error message.

Cheers  
— mnse

---

<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:** [July 22, 2023, 8:22am UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/8 "2023-07-22T08:22:59Z")

</div>

Yeah, makes sense…

Thanks for the explanation.

---

<div class="post-metadata">

**Author:** ![olliebown](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olliebown/32/10521_2.png) [@olliebown](https://discourse.processing.org/u/olliebown)\
**Post date:** [July 23, 2023, 11:16pm UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize/42448/9 "2023-07-23T23:16:43Z")

</div>

Yep, nothing Processing can do (except perhaps try to parse the error text and link to this known bug). But we might be able to clarify if this is a GStreamer issue or some other low level library. I guess not GStreamer.
