Ubuntu – Program[Digikam] chooses wrong qt lib and crashes

digikamqtsegmentation fault

I run Ubuntu 14.04 64bit. Digikam used to work but recently stopped working.

I was wondering if someone could help me work a way to resolve this issue.

I've had a response from the Digikam mailing list to say that this is not really a Digikam issue but an issue on my system where there is some conflict with Qt4 and Qt5. The stack trace below shows Digikam crashing on a Qt5 lib, but it is only programmed with Qt4.

Any suggestions?

apt-cache policy digikam
digikam:
  Installed: 4:3.5.0-0ubuntu10
  Candidate: 4:3.5.0-0ubuntu10
  Version table:
 *** 4:3.5.0-0ubuntu10 0
        500 http://au.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status


gdb digikam
Reading symbols from digikam...Reading symbols from /usr/lib/debug/.build-id/89/8c66e5a3a2b8dce7156f7e8c1698e4bd29ef9d.debug...done.
done.
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) run
Starting program: /usr/bin/digikam 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
__strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:286
286 ../sysdeps/x86_64/multiarch/../strcmp.S: No such file or directory.
(gdb) bt
#0  __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:286
#1  0x00007fffdf31609e in QMetaType::registerNormalizedType(QByteArray const&, void (*)(void*), void* (*)(void const*), void (*)(void*), void* (*)(void*, void const*), int, QFlags<QMetaType::TypeFlag>, QMetaObject const*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007fffdeb0b7b7 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#3  0x00007ffff7dea13a in call_init (l=<optimised out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffdf38, env=env@entry=0x7fffffffdf48) at dl-init.c:78
#4  0x00007ffff7dea223 in call_init (env=<optimised out>, argv=<optimised out>, argc=<optimised out>, l=<optimised out>) at dl-init.c:36
#5  _dl_init (main_map=0x7ffff7ffe1c8, argc=1, argv=0x7fffffffdf38, env=0x7fffffffdf48) at dl-init.c:126
#6  0x00007ffff7ddb30a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#7  0x0000000000000001 in ?? ()
#8  0x00007fffffffe29c in ?? ()
#9  0x0000000000000000 in ?? ()
(gdb) quit
A debugging session is active.

    Inferior 1 [process 10315] will be killed.

Quit anyway? (y or n) y

The output of the qtchooser tool

$ qtchooser -l
4
5
default
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5
$ qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt4/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"

I know that there are no libs called Qt4* in /usr/lib/x86_64-linux-gnu even though I've installed (and reinstalled) most of the libqt4 packages from the main repo.

Best Answer

So the problem was that I had opencv installed from source sitting in /usr/local. Uninstalling it and removing the remaining files from /usr/lib and /usr/include fixed the broken link to qt and reinstalling digikam fixed everything.

The hint was check the manually installed things sitting in /usr in case one of them is conflicting.

Related Question