Target VM failed to initialize

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

The error printed to the output console is here:

#
# 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.

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.

1 Like

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

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

1 Like

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

Hi @Chrisir,

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

Yeah, makes sense…

Thanks for the explanation.

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.

1 Like