Possible Issue With Using External Window with X11

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
tp4me
Posts: 2
Joined: Sun Mar 01, 2009 7:50 pm

Possible Issue With Using External Window with X11

Post by tp4me »

Hey I for some reason couldn't post in advanced help so I figured this was the next best forum to use.

First let me explain my situation. I'm running an executable that runs a menu that can launch games as dynamic sos. The menu uses allegro to render simple 2d Graphics and is completely legacy code (which I can't update in the short term). Some new games that I've recently developed can optionally be rendered with irrlicht (instead of allegro) if there is proper hardware. So when a new game is launched from this legacy menu I give irrlicht the current window so that can render with it. Everything is great until the game has expired and I've dropped the irrlicht device. I then get a crash with the following backtrace and log...

note: I've left out the part of the stack that include my code.

Code: Select all

Irrlicht Engine version 1.5
Linux 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686
Creating X window...
Visual chosen: : 53
Using renderer: OpenGL 1.4
GeForce 6200 LE/PCI/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL not available.

X Error: GLXUnsupportedPrivateRequest
From call : unknown
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
[Switching to Thread -1248429552 (LWP 17287)]
0xb7ae5430 in __kernel_vsyscall ()
(gdb) bt 
#0  0xb7ae5430 in __kernel_vsyscall ()
#1  0xb6a34d20 in raise () from /devel/root/lib/libc.so.6
#2  0xb6a36631 in abort () from /devel/root/lib/libc.so.6
#3  0xb6d0b680 in __gnu_cxx::__verbose_terminate_handler () from /devel/root/usr/lib/libstdc++.so.6
#4  0xb6d090e5 in std::set_unexpected () from /devel/root/usr/lib/libstdc++.so.6
#5  0xb6d09122 in std::terminate () from /devel/root/usr/lib/libstdc++.so.6
#6  0xb6d09845 in __cxa_pure_virtual () from /devel/root/usr/lib/libstdc++.so.6
#7  0xafe09525 in irr::CLogger::log (this=0xb929f950, text=0xb93ae380 "X Error: BadLength (poly request too large or internal Xlib length error)", 
    ll=irr::ELL_WARNING) at CLogger.cpp:42
#8  0xafe0937f in irr::CLogger::log (this=0xb929f950, text=0xafed1381 "X Error", 
    hint=0xbfe6c494 "BadLength (poly request too large or internal Xlib length error)", ll=irr::ELL_WARNING) at CLogger.cpp:59
#9  0xafe0a1d1 in irr::os::Printer::log (message=0xafed1381 "X Error", hint=0xbfe6c494 "BadLength (poly request too large or internal Xlib length error)", 
    ll=irr::ELL_WARNING) at os.cpp:179
#10 0xafe0411b in irr::IrrPrintXError (display=0xb9296b90, event=0xbfe6c5c8) at CIrrDeviceLinux.cpp:186
#11 0xb6defe7a in _XError () from /devel/root/usr/lib/libX11.so.6
#12 0xb6df1944 in _XReply () from /devel/root/usr/lib/libX11.so.6
#13 0xb6de877a in XSync () from /devel/root/usr/lib/libX11.so.6
#14 0xb6dc7aaa in XCloseDisplay () from /devel/root/usr/lib/libX11.so.6
#15 0xafe04380 in ~CIrrDeviceLinux (this=0xb9279280) at CIrrDeviceLinux.cpp:158
#16 0xb4d74979 in irr::IReferenceCounted::drop (this=0xb92793c0) at /devel/root/usr/local/include/irrlicht/IReferenceCounted.h:124
I noticed the error with poly count so I then ran my game with just the irrlicht creation and deletion (no allocation of resources or anything) and I got the same log and backtrace.

I've looked into what the CIrrDeviceLinux does and I noticed that it destroys and window and display in it's destructor. I am personally not too familiar with strait X usage, but I tried just commenting out the function that was in my backtrace "XCloseDisplay". This resolved my crash, and the window returned to the proper size and the game's dll got unloaded. The problem I then ran into was that allegro was no longer displaying or getting any messages from the window (input specifically).

what I set the windowID to...

Code: Select all

#include "allegro.h"
#include "xalleg.h"

...

irrProp.WindowID = (void*)(_xwin.window);
I've done some searching on your site before creating this post, but everything I've come across has had to do with having multiple windows or giving irrlicht a window for it to use. The situation I'm in is that I need to give irrlicht a window that It will use then restore to its previous state for me to use after it expires. It seems like what is implemented may not be doing this for me.

When I run this situation on Windows, irrlicht uses my hWnd and when I get rid of irrlicht my hWnd is still usable for the rest of the program's life. This makes me believe that this is not intended functionality.

Let me know if you would like to know any additional information. If you don't, please let me know if this is intended or a known issue etc. and if you guys are looking to resolve it anytime soon. Just want to know if I need to look at patching it myself (which I would like to avoid if you guys plan on doing it yourself) or if I just need to lrn2code.

thanks guys,

Aaron Melcher
Lead Game Developer
Merit Entertainment
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, the external window code under Linux is not that much tested as the Windows version. It could be that some things are not properly removed from the window when dropping the device. All my own tests just make sure the device is properly deleted. I'll move this to the bug forum, just to keep this on the todo list. Maybe you can also submit a bug ticket on our tracking system (https://sourceforge.net/tracker2/?atid= ... unc=browse).
tp4me
Posts: 2
Joined: Sun Mar 01, 2009 7:50 pm

Post by tp4me »

Hey hybrid,

Resolved the issue on my end because I needed to have it working for my job :-). I created a track ticket for you guys and attached the patch that I applied to the latest stable build of irrlicht. Feel free to apply it if you want. If you guys do please inform me as I would love to remove it on my end with your next major release.

http://sourceforge.net/tracker/index.ph ... tid=540676

Thanks,

Aaron
amelcher@meritgames.com
Post Reply