Ubuntu

programs segfault trying to dlopen libQtOpenGL

Reported by Stew Benedict on 2011-05-19
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qt4-x11 (Debian)
Fix Released
Unknown
qt4-x11 (Ubuntu)
Low
Unassigned

Bug Description

This originally surfaced in LSB testing (lsblibchk) and a similar bug was reported against Debian

ref:
http://bugs.linuxbase.org/show_bug.cgi?id=3233
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518131

The test case attached in the Debian bugs illustrates the problem:

stew@ubuntu-latest-32:~$ gcc -o dltest -ldl dltest.c
stew@ubuntu-latest-32:~$ ./dltest /usr/lib/libQtOpenGL.so.4
libQtOpenGL.so.4 libQtOpenGL.so.4.7 libQtOpenGL.so.4.7.2
stew@ubuntu-latest-32:~$ ./dltest /usr/lib/libQtOpenGL.so.4
opening /usr/lib/libQtOpenGL.so.4...
closing /usr/lib/libQtOpenGL.so.4...
Segmentation fault

This appears to be unique to Ubuntu (for libchk anyway), I'm not having issues on other distributions with the same version of Qt.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: libqt4-opengl 4:4.7.2-0ubuntu6
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic i686
Architecture: i386
Date: Thu May 19 13:09:01 2011
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: qt4-x11
UpgradeStatus: No upgrade log present (probably fresh install)

Harald Sitter (apachelogger) wrote :

(gdb) r
Starting program: /home/me/Downloads/dltest /usr/lib/libQtOpenGL.so.4
[Thread debugging using libthread_db enabled]
opening /usr/lib/libQtOpenGL.so.4...
closing /usr/lib/libQtOpenGL.so.4...

Program received signal SIGSEGV, Segmentation fault.
QVariantAnimation::registerInterpolator (func=0, interpolationType=67)
    at animation/qvariantanimation.cpp:437
437 animation/qvariantanimation.cpp: No such file or directory.
        in animation/qvariantanimation.cpp
(gdb) bt
#0 QVariantAnimation::registerInterpolator (func=0, interpolationType=67)
    at animation/qvariantanimation.cpp:437
#1 0x00007ffff684cb4b in qUnregisterGuiGetInterpolator (this=<value optimized out>,
    __in_chrg=<value optimized out>) at animation/qguivariantanimation.cpp:82
#2 qUnregisterGuiGetInterpolator__dest_class__::~qUnregisterGuiGetInterpolator__dest_class__ (
    this=<value optimized out>, __in_chrg=<value optimized out>) at animation/qguivariantanimation.cpp:94
#3 0x00007ffff765fd3d in __cxa_finalize (d=0x7ffff7330e60) at cxa_finalize.c:56
#4 0x00007ffff6842246 in __do_global_dtors_aux () from /usr/lib/libQtGui.so.4
#5 0x0000000000000000 in ?? ()
(gdb)

Changed in qt4-x11 (Ubuntu):
status: New → Confirmed
Harald Sitter (apachelogger) wrote :

Relevant code:
    QInterpolatorVector *interpolators = registeredInterpolators();
    if (int(interpolationType) >= interpolators->count())

GDB:
(gdb) p registeredInterpolators()
$1 = (QInterpolatorVector *) 0x0

Interestingly enough registeredInterpolators is supposed to be a global static:
Q_GLOBAL_STATIC(QInterpolatorVector, registeredInterpolators)

Random guess of the day: registeredInterpolators() gets shot dead before the call in question.

Harald Sitter (apachelogger) wrote :

And so it is.
The global static pod gets destroyed before the unregister is called, hence the nil pointer. Why this happens is unknown to me, but supposedly it could be easily solved by checking the ptr before trying to access it.

Should be report to Qt I guess.

closing /usr/lib/libQtOpenGL.so.4...
Hardware watchpoint 2: this_registeredInterpolators

Old value = {pointer = {_q_value = 0x60e100}, destroyed = false}
New value = {pointer = {_q_value = 0x0}, destroyed = false}
QGlobalStaticDeleter<QVector<QVariant (*)(void const*, void const*, double)> >::~QGlobalStaticDeleter (
    this=0x7ffff6699b28, __in_chrg=<value optimized out>)
    at ../../include/QtCore/../../src/corelib/global/qglobal.h:1824
warning: Source file is more recent than executable.
1824 globalStatic.destroyed = true;
(gdb) bt
#0 QGlobalStaticDeleter<QVector<QVariant (*)(void const*, void const*, double)> >::~QGlobalStaticDeleter (
    this=0x7ffff6699b28, __in_chrg=<value optimized out>)
    at ../../include/QtCore/../../src/corelib/global/qglobal.h:1824
#1 0x00007ffff765fd3d in __cxa_finalize (d=0x7ffff6699700) at cxa_finalize.c:56
#2 0x00007ffff62639d6 in __do_global_dtors_aux () from /usr/lib/libQtCore.so.4
#3 0x0000000000000000 in ?? ()
(gdb) c
Continuing.
Hardware watchpoint 2: this_registeredInterpolators

Old value = {pointer = {_q_value = 0x0}, destroyed = false}
New value = {pointer = {_q_value = 0x0}, destroyed = true}
QGlobalStaticDeleter<QVector<QVariant (*)(void const*, void const*, double)> >::~QGlobalStaticDeleter (
    this=0x7ffff6699b28, __in_chrg=<value optimized out>)
    at ../../include/QtCore/../../src/corelib/global/qglobal.h:1825
1825 }
(gdb) c
Continuing.

Breakpoint 1, registeredInterpolators () at animation/qvariantanimation.cpp:401
401 Q_GLOBAL_STATIC(QInterpolatorVector, registeredInterpolators)
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
QVariantAnimation::registerInterpolator (func=0, interpolationType=67)
    at animation/qvariantanimation.cpp:437
437 if (int(interpolationType) >= interpolators->count())
(gdb) bt
#0 QVariantAnimation::registerInterpolator (func=0, interpolationType=67)
    at animation/qvariantanimation.cpp:437
#1 0x00007ffff684cb4b in qUnregisterGuiGetInterpolator (this=<value optimized out>,
    __in_chrg=<value optimized out>) at animation/qguivariantanimation.cpp:82
#2 qUnregisterGuiGetInterpolator__dest_class__::~qUnregisterGuiGetInterpolator__dest_class__ (
    this=<value optimized out>, __in_chrg=<value optimized out>) at animation/qguivariantanimation.cpp:94
#3 0x00007ffff765fd3d in __cxa_finalize (d=0x7ffff7330e60) at cxa_finalize.c:56
#4 0x00007ffff6842246 in __do_global_dtors_aux () from /usr/lib/libQtGui.so.4
#5 0x0000000000000000 in ?? ()

Harald Sitter (apachelogger) wrote :

This is not an issue in Ubuntu generally speaking.
Please report a bug against Qt directly [1], my findings from above should supply sufficient information for them to handle the bug quickly enough.

Thanks.

[1] http://bugreports.qt.nokia.com/secure/Dashboard.jspa

Changed in qt4-x11 (Ubuntu):
status: Confirmed → Invalid
Reinhard Tartler (siretart) wrote :
Changed in qt4-x11 (Ubuntu):
status: Invalid → Confirmed
Reinhard Tartler (siretart) wrote :
Changed in qt4-x11 (Ubuntu):
importance: Undecided → Low
Changed in qt4-x11 (Debian):
status: Unknown → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qt4-x11 - 4:4.7.4-0ubuntu1

---------------
qt4-x11 (4:4.7.4-0ubuntu1) oneiric; urgency=low

  * New upstream release (LP: #839557, #785318)
  * debian/patches/Add_support_for_QT_USE_DRAG_DISTANCE_env_var.patch,
    debian/patches/a11y_qt_and_qml_backport.diff,
    debian/patches/qtdebug_syslog.patch,
    debian/patches/kubuntu_12_fix_stack_protector.diff,
    debian/patches/kubuntu_28_xi2.1.patch:
    - adapt to new upstream version
  * Fix_GL_problems_on_stock_1.4_SGX_drivers.patch,
    Fixed_missing_text_when_using_static_text_items_in_GL_2_engine.patch,
    Prevent_recursion_when_creating_window_surface.patch,
    kubuntu_24_large_qtreeview.diff,
    kubuntu_27_dbus_signal_filter_passes_not_handled.diff:
    - removed, part of the upstream tarball now
  * debian/patches/kubuntu_15_appmenu.diff:
    - updated to take a version closer to the upstreamed 4.8 one. Is compatible
      with incoming appmenu-qt 0.2.2 (LP: #838115)
  * debian/libqt4-declarative.install:
    - libtcpserver.so has been renamed libqmldbg_tcp.so
  * debian/control, debian/libqt4-declarative-shaders.install:
    - add the new shaders package. Use the same suggests/recommends pattern
      than other declarative-* plugins
  * debian/patches/blacklist-diginotar-certs.diff:
    - add DigiNotar securty breach blacklist (LP: #837557)
 -- Didier Roche <email address hidden> Thu, 08 Sep 2011 11:33:52 +0200

Changed in qt4-x11 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.