[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Multithreaded OpenGL problem with unknown source (X11?, gcc4?, qt4?)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

First, I'm not sure whether this is an appropriate message for this
list. Please point me to a better place, if it is not.

Some time ago I wrote a minimal example demonstrating the use of
OpenGL's picking capabilities in combination with a QGLWidget where the
actual rendering was performed in a separate thread (see
http://apsy.gse.uni-magdeburg.de/main/index.php?page=hm_threadedcube
(German language only).

I simply combined an example of multithreaded OpenGL rendering in a
QGLWidget from a Qt Quarterly article and another example for OpenGL
picking.

The source code ist here:
http://apsy.gse.uni-magdeburg.de/main/files/src/threaded_cube.tar.gz

This code worked (and works) great under Debian Sarge (XFree 4.3, Qt
3.3.4, gcc 3.3, i386). No warnings or errors.

Recently I thought about porting this example to Qt 4 and check
compatibility with gcc 4.

So I tried compiling the code again. First on a system with the current
Kubuntu release Breezy (Xorg 6.8.2, qt 3.4, gcc 4, i386). Compilation
went fine (no errors or warnings. But starting the application results
in a segfault.

I tried the same (exactly the same code!) on the current Debian Etch
(Xorg 6.8.2, Qt 3.3.4, gcc 4, AMD64). Linking produced a warning:
- ---
/usr/bin/ld: warning: libstdc++.so.5, needed by
/usr/share/qt3/lib/libqt-mt.so, may conflict with libstdc++.so.6
- ---
When starting the application the window appears (but grey) and then the
app freezes.

I had no idea where to continue. Somehow I believed the problem might be
X11.

Later I tried to port everything to Qt4. The result is here.
http://apsy.gse.uni-magdeburg.de/main/files/src/threaded_cube-gcc4-qt4.tar.gz

Compilation on the Breezy system (see above, but now with Qt 4.0.0) went
fine (no warnings, no errors). But when starting the app it freezes as
soon as the QApplication object is created. The behavior on the
Etch-AMD64 system now with the current Qt4 version is exactly the same.

I read something about freezes related to the XInitThreads() call. When
I removed it (just to test) the app either crashed with segfault or
Xlib: unexpected async reply. I guess that's why I included it. But it
seems to causes problems now.

Is this an X11 (or even Xorg) related problem at all?

If so, is there some workaround for the XInitThreads() issue? Or am I
doing something completely wrong?

Please keep me CC'ed as I'm not subscribed to the list.

Bye,

Michael


- --
GPG key:  1024D/3144BE0F Michael Hanke
http://apsy.gse.uni-magdeburg.de/hanke
ICQ: 48230050
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDYKpK93+NsjFEvg8RAsqlAJ9mX4yIRW5BNXxrwRYSrJ49pAwA7QCfTyX2
oZNA8YOMPbx5N1ob0mMYpFg=
=gM7e
-----END PGP SIGNATURE-----



Reply to: