Xorg: BadWindow (invalid Window parameter) on app startup

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Xorg: BadWindow (invalid Window parameter) on app startup

Post by Tanuva »

I was just having a look at some code I once wrote (to continue working on it), but once I try to start this thingy, Xorg complains about some wrong window parameters:

Code: Select all

Irrlicht Engine version 1.4.1
Linux 2.6.25-9.slh.1-sidux-686 #1 SMP PREEMPT Tue Jun 24 23:26:13 UTC 2008 i686
Creating X window...
XErrorEvent: BadValue (integer parameter out of range for operation)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: GLXBadDrawable
Could not make context current.
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
Using renderer: OpenGL
My device initialisation looks like this:

Code: Select all

glob.device = createDevice(video::EDT_OPENGL,
    core::dimension2d<s32>(glob.XRES, glob.YRES), // resolution
    32, // bpp
    false, // fullscreen
    true, // stencil buffer
    false, // vsync
    evrec); // event receiver
Where glob.XRES = 640 and glob.YRES = 480.

Xorg version: 7.3+12 (Debian Sid/Sidux)

What may I do about this?
Tanuva
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, no clue ATM. What's the output from xrandr and glxinfo?
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

xrandr: http://rafb.net/p/XapzUW42.html
glxinfo: http://rafb.net/p/4QlNDT20.html

Although xrandr output is not representative, normally I have a 17" CRT @ 1024*768 here.
Tanuva
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, both the resolution and the depth/stencil combination should be supported. Now it would be intereseting which call does issue the first error. Another question: Do you use compiz or some other 3d extension of Xorg?
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

No compiz, but proprietary nvidia-driver for 3d-acceleration.

How do I find out what is getting called in which way? Let gdb have a look at it?
Tanuva
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, when you steep through you should note at which place it calls the output method.
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

Code: Select all

(gdb) run
Starting program: /home/marcel/code/c++/40tons/40tons
[Thread debugging using libthread_db enabled]
Irrlicht Engine version 1.4.1
Linux 2.6.25-9.slh.1-sidux-686 #1 SMP PREEMPT Tue Jun 24 23:26:13 UTC 2008 i686
Creating X window...
XErrorEvent: BadValue (integer parameter out of range for operation)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: GLXBadDrawable
Could not make context current.
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
[New Thread 0xb69276e0 (LWP 5636)]
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
Using renderer: OpenGL

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb69276e0 (LWP 5636)]
0xb7c7d1e0 in irr::core::fast_atof_move (c=0x0, out=@0xbffe27e4)
    at ../../include/fast_atof.h:62
62      ../../include/fast_atof.h: No such file or directory.
        in ../../include/fast_atof.h
This is what gdb tells me when I run my code in it. Not that it would help me further... It shouldn't need any header files at runtime anymore, should it?
Tanuva
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to single step through the program. Set a breakpoint in the X11 device creation and check at which function call the first error comes up.
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

After ~20800 steps, I get to this output:

Code: Select all

(gdb) step
irr::core::heapsort<irr::CIrrDeviceLinux::SKeyMap> (array_=0x9c70958, size=185)
    at ../../include/heapsort.h:58
58              for (i=size-1; i>=0; --i)
(gdb) step
60                      T t = array_[0];
(gdb) step
61                      array_[0] = array_[i];
(gdb) step
62                      array_[i] = t;
(gdb) step
63                      heapsink(virtualArray, 1, i + 1);
(gdb) step
Creating X window...
XErrorEvent: BadValue (integer parameter out of range for operation)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: GLXBadDrawable
Could not make context current.
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
XErrorEvent: BadWindow (invalid Window parameter)
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
XErrorEvent: BadDrawable (invalid Pixmap or Window parameter)
Using renderer: OpenGL

Program received signal SIGSEGV, Segmentation fault.
0xb7bdc1e0 in irr::core::fast_atof_move (c=0x0, out=@0xbff41744)
    at ../../include/fast_atof.h:62
warning: Source file is more recent than executable.
62              if (*c=='-')
I'm not too experienced with gdb, if you need more precise input, some advice would be useful... :)
Tanuva
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, just a few hints for gdb first. Instead of 'step' which really does everything that is executed in between, you can also call 'next', which skips the details of the next command - you only need to call step when you need to look into the method...
And you can set breakpoints. Something like 'break irr::CIrrDeviceLinux::createWindow()' should work. Then just run the program and it will stop when enetering the method.

Ok, you trace exactly stops at the most important point. Up to now you just created the keymap, which is pretty boring :? But next, the window is created, which is the problem here...
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

Sorry if this sounds stupid, but I don't really get further on this:
I have told gdb to look into the irrlicht source directory (gdb ./40tons -d /home/marcel/code/c++/40tons/Irrlicht), but when I tell it to create a breakpoint at CIrrDeviceLinux.h:createWindow, it says this source file doesn't exist.
How do I tell it to look into this file? [getting frustrated... linux can be damn complex ;)]
Tanuva
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It's not a file name, it's a namespace qualifier. Try google for some tutorial on gdb usage with C++.
Post Reply