I run example/opengl/hellogl_es2 that comes with qt on imx6, but it keeps reporting segmentation errors. And when I run other non-opengl examples, they can run normally.
I cross-compiled on Linux. The version of qt is 4.8.6. Here are the compilation options:
./configure -prefix /home/mj/work/qt4.8.6/qt-everywhere-opensource-release-4.8.6 -opensource -confirm-license -release -shared -embedded arm -xplatform qws/linux-armv7-g++ -exceptions -depths all -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -host-little-endian -little-endian -no-qt3support -no-libtiff -no-libmng -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-webkit -no-qvfb -no-phonon -no-nis -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -make examples -nomake tools -nomake docs -nomake demos -qt-gfx-linuxfb -qt-gfx-transformed -qt-mouse-tslib -qt-mouse-linuxinput -qt-kbd-linuxinput -plugin-mouse-tslib -I$TSLIB_DIR/include -L$TSLIB_DIR/lib -device-option CROSS_COMPILE=/home/chenyao/toolchain/toolchain_arm_poky_mini/bin/arm-poky-linux-gnueabi- -qtlibinfix E -opengl es2
Here is my debugging command:
root@imx6qsabresd:zbd
(zdb) file /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/examples/opengl/hellogl_es2/hellogl_es2
(zdb) r -qws
Process /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/examples/opengl/hellogl_es2/hellogl_es2 created; pid = 24220
Newly created process id 24220
[New Thread 24220]
0x76f8ed40 in ?? ()
(zdb) c
Continuing.
(zdb)
[New Thread 24232]
*thread : thread 24232 create!
(zdb)
Program received signal SIGSEGV, Segmentation fault.
0x75b3890c in gcoOS_DeinitLocalDisplayInfo (Display=0x0, localDisplay=localDisplay@entry=0x17a760)
at ../user/gc_hal_user_wayland.c:2310
2310 ../user/gc_hal_user_wayland.c: No such file or directory.
(zdb) *thread : thread 24232 exit!
(zdb) bt
#0 0x75b3890c in gcoOS_DeinitLocalDisplayInfo (Display=0x0, localDisplay=localDisplay@entry=0x17a760)
at ../user/gc_hal_user_wayland.c:2310
#1 0x75fe9588 in veglDeinitLocalDisplayInfo (Display=Display@entry=0x17a754) at gc_egl_platform.c:359
#2 0x75fe02f8 in veglTerminateDisplay (Display=0x17a754, Thread=0xa2c3c) at gc_egl_init.c:1329
#3 eglTerminate (Dpy=<optimized out>) at gc_egl_init.c:1497
#4 0x76c9d334 in QEglContext::~QEglContext() ()
from /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/lib/libQtGuiE.so.4
#5 0x76e8ecb8 in QGLContext::chooseContext(QGLContext const*) ()
from /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/lib/libQtOpenGLE.so.4
#6 0x76e4c124 in QGLContext::create(QGLContext const*) ()
from /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/lib/libQtOpenGLE.so.4
#7 0x76e8e75c in QGLWidget::setContext(QGLContext*, QGLContext const*, bool) ()
from /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/lib/libQtOpenGLE.so.4
#8 0x76e4bf48 in ?? () from /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/lib/libQtOpenGLE.so.4
Cannot access memory at address 0x0
#9 0x76e4bf48 in ?? () from /tnetrol_media/qtfs/qt-everywhere-opensource-release-4.8.6/lib/libQtOpenGLE.so.4
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)