Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] GLFW X_SetInputFocus crash
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Tue Jan 10, 2006 2:41 pm    Post subject: [SOLVED] GLFW X_SetInputFocus crash Reply with quote

Hi, I'm not sure this should go in this part of the forum, but I'll give it a shot.

I'm currently programming GLSL, and using glfw to do the drawing and handling of windows. The problem is that when I try to start the program (after succesfully compiling it) it always crashes with this message:

Code:
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  42 (X_SetInputFocus)
  Serial number of failed request:  25
  Current serial number in output stream:  28


The message is probably related to glfw, and I've found a reported bug regarding the problem in bugzilla. But it was reported 2 years ago! Has anybody seen this problem before, and more importantly, does anybody have a clue what's going on?

The program succesfully started a couple of times yesterday (crashing most of the time), so the problem seems a bit random. Today it won't start at all.

Even with the most minimum glfw-code, the program won't start.

I compile it using:
Code:
-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lGLU -lGL -lglfw -lpthread -lXxf86vm


and gdb jsut outputs the same error. The "list" command just shows the first part of the main function.

My emerge --info shows (with some info removed):

Code:
Portage 2.0.53 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -pipe -mmmx -m3dnow"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -pipe -mmmx -m3dnow"
FEATURES="autoconfig distlocks sandbox sfperms strict"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
MAKEOPTS="-j2"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 16bit 3dnow 3dnowex 3dnowext 4kstacks 7zip X aac acpi alsa apache2 apm audiofile avi beepmp berkdb bitmap-fonts bmp bonobo browserplugin bzip2 bzlib cdr cjk crypt cups curl divx4linux doc dri dv dvd eds emboss encode esd exif expat fam fbcon ffmpeg fftw flac foomaticdb fortran ftp gd gdbm gif glut gnome gpm gstreamer gtk gtk2 idn imlib ipv6 jabber java jpeg lcms libg++ libwww mad mikmod mmx mmxext mng motif mozilla mp3 mpeg multitarget ncurses nls nptl ogg oggvorbis openal opengl pam pcre pdflib perl plugin png python quicktime readline sdl slang spell sse ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales utf8 vim vorbis win32codecs wmf xml xml2 xosd xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LINGUAS


and I'm using glfw version 2.5.0

I appreciate any help I can get!
_________________
Weeks of coding can save you hours of planning.


Last edited by azp on Tue Jan 10, 2006 5:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Tue Jan 10, 2006 4:36 pm    Post subject: Reply with quote

I really don't want to have to switch to GLUT/SDL/OpenGLUT/FreeGLUT or any other.. It just feels like a dead end right now. I'm doing this for a school project, and the deadline is closing in on me...

I hate when things work in windows and not linux. I want to be able to develop things for _my_ operating system, not the operating system that my university uses (mainly windows).
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Tue Jan 10, 2006 5:44 pm    Post subject: Fixed Reply with quote

I finally solved the problem. One needs to insert a sleep() after glfwInit().

glfw asks X for a window, the problem is that it then continues drawing in the canvas without checking if it has received a canvas. Simply solve it by waiting for the canvas, and then carry on.
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum