[vtkusers] AppImage packaging: GLEW could not be initialized

Elvis Stansvik elvis.stansvik at orexplore.com
Mon Jul 11 11:34:15 EDT 2016


This is the backtrace from gdb running in Qt Creator, taken after I paused
execution right after the glGetString(GL_VERSION) call in glewContextInit,
which returned 0x0 into the variable "s". So this is the "reason", while
I'm still looking for the cause...

Elvis

Thread 1 (Thread 0x7ffff7f607c0 (LWP 5261)):
#0  glewContextInit () at
/tmp/VTK-7.0.0/ThirdParty/glew/vtkglew/src/glew.c:10191
        s = 0x0
        dot = 0
        major = -13760
        minor = 32767
        extStart = 0x7ffff06bcd58
<vtkTimeStamp::Modified()::GlobalTimeStamp+8> "\252#"
        extEnd = 0x7a4970 "\001"
#1  0x00007ffff19c2096 in glewInit () at
/tmp/VTK-7.0.0/ThirdParty/glew/vtkglew/src/glew.c:14407
        r = 32767
#2  0x00007ffff3cb5e48 in vtkOpenGLRenderWindow::OpenGLInitContext
(this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx:529
        result = 0
        m_valid = false
        lineWidthRange = {0, 0}
#3  0x00007ffff3cb589f in vtkOpenGLRenderWindow::OpenGLInit (this=0x6d3f90)
at /tmp/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx:318
No locals.
#4  0x00007ffff3d48703 in vtkXOpenGLRenderWindow::WindowInitialize
(this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx:971
        ren = 0x0
#5  0x00007ffff3d48749 in vtkXOpenGLRenderWindow::Initialize
(this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx:980
No locals.
#6  0x00007ffff3d48b8f in vtkXOpenGLRenderWindow::Start (this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx:1107
No locals.
#7  0x00007ffff23cc75f in vtkRenderWindow::DoStereoRender (this=0x6d3f90)
at /tmp/VTK-7.0.0/Rendering/Core/vtkRenderWindow.cxx:752
        rsit = 0x7fffffffcc30
#8  0x00007ffff23cc72d in vtkRenderWindow::DoFDRender (this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/Core/vtkRenderWindow.cxx:741
        i = 1751607667
#9  0x00007ffff23cc100 in vtkRenderWindow::DoAARender (this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/Core/vtkRenderWindow.cxx:620
        i = 0
#10 0x00007ffff23cb6e5 in vtkRenderWindow::Render (this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/Core/vtkRenderWindow.cxx:436
        size = 0x6d4010
        x = 0
        y = 6895456
        p1 = 0x6d2ca0
#11 0x00007ffff3cb63aa in vtkOpenGLRenderWindow::Render (this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx:597
No locals.
#12 0x00007ffff3d4b7ab in vtkXOpenGLRenderWindow::Render (this=0x6d3f90) at
/tmp/VTK-7.0.0/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx:1853
        attribs = {x = 0, y = 0, width = -188422787, height = 32767,
border_width = 2, depth = 0, visual = 0x6d2b00, root = 8133696, c_class =
8128160, bit_gravity = 0, win_gravity = 0, backing_store = 0,
backing_planes = 7961424, backing_pixel = 2, save_under = -188524167,
colormap = 1, map_installed = 7154432, map_state = 0, all_event_masks =
42957801120, your_event_mask = 7154720, do_not_propagate_mask =
140737488342640, override_redirect = 7154720, screen = 0x693760}
#13 0x00000000004139e9 in VTKWidget::paintEvent (this=0x6d2c20,
event=0x7fffffffd6a0) at /tmp/insight/src/VTKWidget.cpp:37
No locals.
#14 0x00007ffff59c9439 in QWidget::event(QEvent*) () from
/home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#15 0x00007ffff66c53bb in QVTKWidget::event (this=0x6d2c20,
e=0x7fffffffd6a0) at /tmp/VTK-7.0.0/GUISupport/Qt/QVTKWidget.cxx:396
No locals.
#16 0x00007ffff5980974 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#17 0x00007ffff598633e in QApplication::notify(QObject*, QEvent*) () from
/home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#18 0x00007ffff4c28034 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /home/estan/image/usr/lib/libQt5Core.so.5
No symbol table info available.
#19 0x00007ffff59b43d2 in QWidgetPrivate::sendPaintEvent(QRegion const&) ()
from /home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#20 0x00007ffff59cab8b in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from
/home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#21 0x00007ffff5991075 in QWidgetPrivate::repaint_sys(QRegion const&) ()
from /home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#22 0x00007ffff59e8efb in ?? () from
/home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#23 0x00007ffff5980974 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#24 0x00007ffff598633e in QApplication::notify(QObject*, QEvent*) () from
/home/estan/image/usr/lib/libQt5Widgets.so.5
No symbol table info available.
#25 0x00007ffff4c28034 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /home/estan/image/usr/lib/libQt5Core.so.5
No symbol table info available.
#26 0x00007ffff51b7e2e in
QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*)
() from /home/estan/image/usr/lib/libQt5Gui.so.5
No symbol table info available.
#27 0x00007ffff51be39d in
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
() from /home/estan/image/usr/lib/libQt5Gui.so.5
No symbol table info available.
#28 0x00007ffff519f5db in
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /home/estan/image/usr/lib/libQt5Gui.so.5
No symbol table info available.
#29 0x00007fffe5903650 in ?? () from
/home/estan/image/usr/lib/libQt5XcbQpa.so.5
No symbol table info available.
#30 0x00007fffebce3642 in g_main_context_dispatch () from
/home/estan/image/usr/lib/libglib-2.0.so.0
No symbol table info available.
#31 0x00007fffebce7c98 in ?? () from
/home/estan/image/usr/lib/libglib-2.0.so.0
No symbol table info available.
#32 0x00007fffebce7e4c in g_main_context_iteration () from
/home/estan/image/usr/lib/libglib-2.0.so.0
No symbol table info available.
#33 0x00007ffff4c75afb in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /home/estan/image/usr/lib/libQt5Core.so.5
No symbol table info available.
#34 0x00007ffff4c26eab in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/home/estan/image/usr/lib/libQt5Core.so.5
No symbol table info available.
#35 0x00007ffff4c2b3d0 in QCoreApplication::exec() () from
/home/estan/image/usr/lib/libQt5Core.so.5
No symbol table info available.
#36 0x000000000040f62b in main (argc=1, argv=0x7fffffffe678) at
/tmp/insight/src/main.cpp:18
        app = <incomplete type>
        window = {<QMainWindow> = {<No data fields>}, <Ui::MainWindow> =
{<Ui_MainWindow> = {centralWidget = 0x6d2670, verticalLayout = 0x6d24c0,
sampleWidget = 0x6d2c20, menuBar = 0x6f9520, mainToolBar = 0x6f36f0,
statusBar = 0x6fd320}, <No data fields>}, static staticMetaObject = {d =
{superdata = 0x7ffff60a3ea0 <QMainWindow::staticMetaObject>, stringdata =
0x4153c0 <qt_meta_stringdata_MainWindow>, data = 0x415400
<qt_meta_data_MainWindow>, static_metacall = 0x413fdc
<MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>,
relatedMetaObjects = 0x0, extradata = 0x0}}}

2016-07-11 17:27 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:

> Hi all,
>
> In exploring different deployment options, I'm now trying to create an
> AppImage of a VTK+Qt application. For those who don't know, AppImage is a
> packaging format where the application, including (almost) all of its
> dependencies are put into a self-extracting ISO image called an AppImage.
>
> Doing this takes quite a bit of manual work, but if you do things
> correctly and build the image on a good base system (I'm using CentOS 6),
> the image should run on a multitude of distros.
>
> I've had some success: The resulting image runs on e.g. Ubuntu Xenial.
>
> I'm now trying it on my Arch Linux laptop (not a common/easy target for
> AppImages, but I'd like to make it work since I run it personally), and get:
>
> ERROR: In /tmp/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line
> 533
> vtkXOpenGLRenderWindow (0x1e48140): GLEW could not be initialized.
>
> This is due to a glewInit() call failing during initialization of the
> render window, and I've debugged it to the underlying call to
> glGetString(GL_VERSION) in VTK's forked GLEW library returning NULL.
>
> Does anyone have an idea why this might happen? The VTK I'm using here is
> configured as follows:
>
> cmake3 \
>     -DCMAKE_INSTALL_PREFIX=/usr \
>     -DVTK_Group_Qt=ON \
>     -DVTK_QT_VERSION=5 \
>     -DVTK_Group_Imaging=ON \
>     -DVTK_Group_Views=ON \
>     -DVTK_Group_MPI=OFF \
>     -DVTK_Group_Tk=OFF \
>     -DVTK_Group_Web=OFF \
>     -DBUILD_TESTING=OFF \
>     -DVTK_USE_SYSTEM_LIBRARIES=ON \
>     -DVTK_USE_SYSTEM_LIBPROJ4=OFF \
>     -DCMAKE_BUILD_TYPE=Debug \
>     ..
>
> And it uses the OpenGL2 backend.
>
> It was built inside a CentOS 6 Docker container on a Kubuntu 16.04 host
> with HD 4400 Intel graphics adapter. The target system is an older laptop
> with up-to-date Arch Linux and a weaker HD 3000 Intel graphics adapter.
>
> Now, packaging apps that use OpenGL is a bit tricky, because you can't
> bundle e.g. libX11, libGL and some other libraries that are dependant on
> the user's graphics adapter/environment.
>
> The libraries that I've chosen to _not_ bundle are:
>
>     libz.so.1
>     libm.so.6
>     libSM.so.6
>     libICE.so.6
>     libX11.so.6
>     libXext.so.6
>     libXt.so.6
>     libstdc++.so.6
>     libgcc_s.so.1
>     libc.so.6
>     libpthread.so.0
>     librt.so.1
>     libGL.so.1
>     libdl.so.2
>     libuuid.so.1
>     libxcb.so.1
>     libxcb-dri3.so.0
>     libxcb-present.so.0
>     libxcb-randr.so.0
>     libxcb-xfixes.so.0
>     libxcb-render.so.0
>     libxcb-shape.so.0
>     libxcb-sync.so.1
>     libxshmfence.so.1
>     libglapi.so.0
>     libXdamage.so.1
>     libXfixes.so.3
>     libX11-xcb.so.1
>     libxcb-glx.so.0
>     libxcb-dri2.so.0
>     libXxf86vm.so.1
>     libdrm.so.2
>     libXau.so.6
>     libXdmcp.so.6
>
> This may be a little too liberal, and it could be that I should be
> bundling some of these. But it seems to work fine since the AppImage runs
> without problem on Kubuntu 16.04.
>
> The application also runs fine if I build VTK and the application
> "normally" on the Arch host and run it (using OpenGL2 backend), so the
> graphics adapter should be capable enough. It's just when I try to run the
> CentOS 6-built AppImage on the Arch host that it fails.
>
> The application essentially just creates a QVTKWidget and renders a volume
> into its rendering window.
>
> I saw that one (perhaps likely?) reason for glGetString(GL_VERSION)
> returning NULL is that initialization of the GL context failed (or wasn't
> fully done yet). If this is the case, does anyone know where I can debug
> this further in VTK? Where is the OpenGL context in VTK set up when using
> QVTKWidget + OpenGL2 backend?
>
> Finally: Has anyone else tried packaging VTK applications as AppImages?
>
> I know ParaView is provided as a prebuilt Linux binary with VTK bundled,
> so I can imagine the ParaView folks has ran into some issues like this?
>
> Thanks in advance for any advice.
>
> Elvis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160711/b7e6b8f9/attachment.html>


More information about the vtkusers mailing list