Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gemglutwindow and ggee/shell crashes/freezes #224

Open
kubriel opened this issue Jan 31, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@kubriel
Copy link

commented Jan 31, 2019

im getting crashes of freezes when i send command to ggee/shell, but only if rendering is on, and im using gemglutwindow

(gdb) run -nosound -nrt -lib lib/Gem -lib lib/gemglutwindow -lib lib/gemglxwindow -lib cyclone/coll -lib cyclone/prepend -lib zexy -path lib/Gem/ -path lib/abstractions 00-video_multicontext.pd
Starting program: /usr/bin/pd -nosound -nrt -lib lib/Gem -lib lib/gemglutwindow -lib lib/gemglxwindow -lib cyclone/coll -lib cyclone/prepend -lib zexy -path lib/Gem/ -path lib/abstractions 00-video_multicontext.pd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
open: /etc/pd/gem.conf: No such file or directory
open: /home/kubriel/.config/pure-data/gem.conf: No such file or directory
open: ./gem.conf: No such file or directory
open: ./lib/Gem-meta.pd: No such file or directory
load plugins 'film' in '/home/kubriel/VJ/lib/'
pattern : /home/kubriel/VJ/lib/gem_film*.so
dylib loading file '/home/kubriel/VJ/lib/gem_filmAVIPLAY.so'!
<init> : Avifile RELEASE-0.7.48-170225-04:54-../src/configure
<init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_go
<init> : 2696.83 MHz Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz processor detected
dylib loading file '/home/kubriel/VJ/lib/gem_filmGMERLIN.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_filmQT4L.so'!
load plugins 'image' in '/home/kubriel/VJ/lib/'
pattern : /home/kubriel/VJ/lib/gem_image*.so
dylib loading file '/home/kubriel/VJ/lib/gem_imageJPEG.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageMAGICK.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageSGI.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageSTB.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageTIFF.so'!
not reloading 'image' plugins (already 5 loaded)
load plugins 'image' in '/home/kubriel/VJ/lib/'
pattern : /home/kubriel/VJ/lib/gem_image*.so
dylib loading file '/home/kubriel/VJ/lib/gem_imageJPEG.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageMAGICK.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageSGI.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageSTB.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_imageTIFF.so'!
load plugins 'model' in '/home/kubriel/VJ/lib/'
pattern : /home/kubriel/VJ/lib/gem_model*.so
dylib loading file '/home/kubriel/VJ/lib/gem_modelOBJ.so'!
load plugins 'record' in '/home/kubriel/VJ/lib/'
pattern : /home/kubriel/VJ/lib/gem_record*.so
dylib loading file '/home/kubriel/VJ/lib/gem_recordQT4L.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_recordV4L.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_recordV4L2.so'!
load plugins 'video' in '/home/kubriel/VJ/lib/'
pattern : /home/kubriel/VJ/lib/gem_video*.so
dylib loading file '/home/kubriel/VJ/lib/gem_videoV4L.so'!
dylib loading file '/home/kubriel/VJ/lib/gem_videoV4L2.so'!
not reloading 'film' plugins (already 3 loaded)
not reloading 'image' plugins (already 5 loaded)
not reloading 'model' plugins (already 1 loaded)
not reloading 'film' plugins (already 3 loaded)
not reloading 'image' plugins (already 5 loaded)
not reloading 'image' plugins (already 5 loaded)
[New Thread 0x7fffdb2ab700 (LWP 3323)]
not reloading 'film' plugins (already 3 loaded)
not reloading 'image' plugins (already 5 loaded)
libGL error: failed to create drawable
libGL error: failed to create drawable
X Error of failed request:  0
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
  Serial number of failed request:  4164
  Current serial number in output stream:  4164
libGL error: failed to create drawable
X Error of failed request:  0
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
  Serial number of failed request:  4166
  Current serial number in output stream:  4166
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
      after 4175 requests (4175 known processed) with 4 events remaining.
[Thread 0x7ffff6eb7740 (LWP 3319) exited]
[Inferior 1 (process 3319) exited with code 01]
(gdb) bt
No stack.
@umlaeute

This comment has been minimized.

Copy link
Owner

commented Feb 1, 2019

confirmed.
it has something to do with stdin/stdout.

note that if [shell] was using execvp() instead of system(), then it wouldn't hang but (although the program output would not be returned as soon as you create a window with [gemglutwindow] either). this is already the default on macOS.

@umlaeute

This comment has been minimized.

Copy link
Owner

commented Feb 1, 2019

the lockup might be due to stdin/stdout, but the real problem seems to be with [shell]s call to fork().

e.g. confirm the following minimal program:

/* cc main.c -o main -lglut */
#include <GL/glut.h>
#include <GL/freeglut.h>
#include <unistd.h>
#include <stdio.h>
static void shell_anything(const char*cmd) {
     int pid = 0;
     printf("forking off...\n");
     if (!(pid = fork()))
	  exit(0);
}
int main() {
  int argc=0;
  char*argv=NULL;
  glutInit(&argc,&argv);
  int win = glutCreateWindow("hello");
  glutSetWindow(win);
  glutMainLoopEvent();
  sleep(1);
  shell_anything("pwd"); 
  sleep(1);
  return 0;
}

this will create a new window (using GLUT), but as soon as fork() is being called (after 1 second), the window will be closed.
also, I get errors at shutdown:

XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 72 requests (72 known processed) with 0 events remaining.

...which do not look very promising.

i'm inclined to say that "there's nothing we can do about this issue, at least on Gem's side", so I'm labelling this as wontfix for now.

of course, if somebody can come up with a solution, i'll happily apply it (if possible),

@kubriel

This comment has been minimized.

Copy link
Author

commented Feb 10, 2019

yep
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 68 requests (68 known processed) with 0 events remaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.