G4P library crashes with multi-window

edited September 23 in Library Questions

hello #Quark

I have noticed several time instability problems when using the G4P library to generate multiwindows. I'm using G4P builder tool in Processing 3.7. I stripped the code to the bare minimum to narrow down what could generate the error. The code (see below) loads a .obj file, set a .JPG picture as background to main window and rotate the .obj in the main window. It also create an empty window using G4P with P3D randerer.

If the createGUI() line is commented the code runs for hours with no problem. If I uncomment the createGUI() line, the code crash with the error reported below. The behaviour is different depending upon the platform used:

  • Windows 10 / core i5 / NVIdia GEForce 920MX ==> code fails after few minutes
  • Windows 10 / core i5 / Intel 710 ==> code fails after few 10 of second
  • old MAC with OsX mounain lion + NVIDIA ==> code is really slow but never fails.

Same behavior if I export the code as .exe. I'm running on both PC Java8.

I really need to get this stable (not many time left to the end of my project...)... Are you aware about that kind of trouble on Windows10 ? any hint to get it stable ?

Appreciate very much your help,

///////////////////// code////////////////////////////////////////////////////////////

import g4p_controls.*;

PShape Arr,Tip, Gr, Rd, Pt;
PShape s;
float Rx, Ry=80, Rz ,mix=0.0001;
PImage bg;

public void setup(){
  bg = loadImage("Back.JPG");
  size(500, 650, P3D);
  s = loadShape("wingXstrmUs.obj");
  createGUI();                                                            //<<====== this is the problematic line

public void draw() {
  // generate random angles

  // draw the object rotation in the main window
  translate(width/2, height/2);
  rotateX (Rx);
  scale(4, 4, 4);
  shape(s, 0, 0);
////// Below code generated by G4P builder in the GUI tab to generate the empty window

synchronized public void win_draw1(PApplet appc, GWinData data) { //_CODE_:window1:517716:
} //_CODE_:window1:517716:

// Create all the GUI controls. 
// autogenerated do not edit

public void createGUI(){
  surface.setTitle("Sketch Window");
  window1 = GWindow.getWindow(this, "Window title", 0, 0, 500, 650, P3D);
  window1.addDrawHandler(this, "win_draw1");

// Variable declarations 
// autogenerated do not edit
GWindow window1;

////////////////////////////// Error generated by Processing

JRE version: Java(TM) SE Runtime Environment (8.0_162-b12) (build 1.8.0_162-b12)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.162-b12 mixed mode windows-amd64 compressed oops)

Problematic frame:

C [msvcrt.dll+0x7436f]


Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help ? Troubleshooting

Sign In or Register to comment.