Bug 216726

Summary: multimedia/shotcut 17.02: coredumps
Product: Ports & Packages Reporter: VVD <vvd>
Component: Individual Port(s)Assignee: freebsd-ports-bugs mailing list <ports-bugs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: daeron, ian.trudel, tcberner
Priority: --- Flags: bugzilla: maintainer-feedback? (avilla)
Version: Latest   
Hardware: amd64   
OS: Any   
Bug Depends on: 234804    
Bug Blocks:    

Description VVD 2017-02-02 13:28:08 UTC
multimedia/shotcut 17.02 coredumps possible with installed multimedia/mlt-qt4, but require multimedia/mlt (with qt5?).

But I can't install multimedia/mlt-qt5:
      mlt-qt5-6.4.1 conflicts with installed package(s): 
      mlt-qt4-6.4.1

      They install files into the same place.
      You may want to stop build with Ctrl + C.

And multimedia/mlt-qt4 required by multimedia/kdenlive.

(gdb) bt
#0  0x0000000805dca338 in realloc () from /lib/libc.so.7
#1  0x0000000805dca85e in free () from /lib/libc.so.7
#2  0x000000081fb7b1aa in QTest::compare_string_helper () from /usr/local/lib/qt4/libQtTest.so.4
#3  0x0000000805e42e22 in __cxa_finalize () from /lib/libc.so.7
#4  0x000000081fb76b34 in ?? () from /usr/local/lib/qt4/libQtTest.so.4
#5  0x00007fffffffd030 in ?? ()
#6  0x000000081fb873f1 in _fini () from /usr/local/lib/qt4/libQtTest.so.4
#7  0x00007fffffffd030 in ?? ()
#8  0x00000008008a7de9 in dlclose () from /libexec/ld-elf.so.1
Previous frame inner to this frame (corrupt stack?)

qt4 libs in backteace of qt5 application…
Comment 1 Tobias C. Berner freebsd_committer 2017-02-02 13:59:44 UTC
It seems like multimedia/shotcut should depend on multimedia/mlt-qt5 rather than multimedia/mlt. 
[which of course does nothing to fix the conflict]
Comment 2 Alberto Villa freebsd_committer 2017-02-02 14:20:53 UTC
Shotcut doesn't require mlt-qt5, but fails with mlt-qt4 (as well as Kdenlive fails with mlt-qt5). A solution might be dropping mlt-qt4 completely, and making Kdenlive rely on MLT GTK+ module to replace mlt-qt4 functionality. I'll look into it.

Anyway, kdenlive-kf5 will solve the issue as soon as it comes to the ports.
Comment 3 VVD 2017-02-02 22:15:55 UTC
# pkg delete -yf multimedia/mlt-qt4
# mv /usr/local/lib/qt4 /usr/local/lib/qt4_
# portmaster multimedia/mlt-qt5
# portmaster multimedia/shotcut
$ shotcut
// shotcut run without coredumps.

# mv /usr/local/lib/qt4_ /usr/local/lib/qt4
$ shotcut 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> language "ru_RU" 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> deinterlacer "onefield" 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> external monitor "" 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> GPU processing false 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> interpolation "nearest" 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> video mode "" 
[Debug  ] <static ShotcutSettings &ShotcutSettings::singleton()> realtime true 
[Info   ] <Application::Application(int &, char **)> Starting Shotcut version 17.02.01 
[Info   ] <Application::Application(int &, char **)> Linux version 
[Info   ] <Application::Application(int &, char **)> number of logical cores = 2 
[Info   ] <Application::Application(int &, char **)> locale = QLocale(Russian, Cyrillic, Russia) 
[Info   ] <Application::Application(int &, char **)> install dir = "/usr/local/bin" 
[Info   ] <Application::Application(int &, char **)> device pixel ratio = 1 
[Debug  ] <MainWindow::changeTheme> begin 
[Debug  ] <MainWindow::changeTheme> end 
[Debug  ] <MainWindow::MainWindow()> begin 
[Info   ] <GLTestWidget::GLTestWidget(QWidget *)> OpenGL context version 2 0 
[Debug  ] <Mlt::Controller::Controller()> begin 
Segmentation fault (стек памяти сброшен на диск)

$ gdb /usr/local/bin/shotcut shotcut.core
GNU gdb 6.1.1 [FreeBSD]
…
(gdb) bt
#0  0x0000000805dca338 in realloc () from /lib/libc.so.7
#1  0x0000000805dca85e in free () from /lib/libc.so.7
#2  0x000000081fb7b1aa in QTest::compare_string_helper () from /usr/local/lib/qt4/libQtTest.so.4
#3  0x0000000805e42e22 in __cxa_finalize () from /lib/libc.so.7
#4  0x000000081fb76b34 in ?? () from /usr/local/lib/qt4/libQtTest.so.4
#5  0x00007fffffffd010 in ?? ()
#6  0x000000081fb873f1 in _fini () from /usr/local/lib/qt4/libQtTest.so.4
#7  0x00007fffffffd010 in ?? ()
#8  0x00000008008a7de9 in dlclose () from /libexec/ld-elf.so.1
Previous frame inner to this frame (corrupt stack?)
Comment 4 daeron 2017-06-20 01:36:48 UTC
Been affecting me for past four months.
Core dumps irrespective of mlt-qt4 mlt-qt5.
====
 gdb /usr/local/bin/shotcut shotcut.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `shotcut'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libthr.so.3
.. .. ..
.. ..
..
Reading symbols from /usr/lib/libssl.so.7...done.
Loaded symbols for /usr/lib/libssl.so.7
Reading symbols from /usr/local/lib/samba4/private/libheimbase-samba4.so.1...done.
Loaded symbols for /usr/local/lib/samba4/private/libheimbase-samba4.so.1
Reading symbols from /usr/local/lib/samba4/private/libhx509-samba4.so.5...done.
Loaded symbols for /usr/local/lib/samba4/private/libhx509-samba4.so.5
Reading symbols from /usr/local/lib/samba4/private/libhcrypto-samba4.so.5...done.
Loaded symbols for /usr/local/lib/samba4/private/libhcrypto-samba4.so.5
Reading symbols from /usr/local/lib/samba4/private/libroken-samba4.so.19...done.
Loaded symbols for /usr/local/lib/samba4/private/libroken-samba4.so.19
Reading symbols from /usr/local/lib/samba4/private/libwind-samba4.so.0...done.
Loaded symbols for /usr/local/lib/samba4/private/libwind-samba4.so.0
Reading symbols from /usr/local/lib/samba4/private/libauth-sam-reply-samba4.so...done.
Loaded symbols for /usr/local/lib/samba4/private/libauth-sam-reply-samba4.so
Reading symbols from /usr/local/lib/samba4/libndr-krb5pac.so.0...done.
Loaded symbols for /usr/local/lib/samba4/libndr-krb5pac.so.0
Reading symbols from /usr/local/lib/samba4/private/libwinbind-client-samba4.so...done.
Loaded symbols for /usr/local/lib/samba4/private/libwinbind-client-samba4.so
Reading symbols from /usr/local/lib/samba4/private/libflag-mapping-samba4.so...done.
Loaded symbols for /usr/local/lib/samba4/private/libflag-mapping-samba4.so
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000807f001ce in free () from /lib/libc.so.7
[New Thread 810c0c800 (LWP 101502/<unknown>)]
[New Thread 810c0c000 (LWP 101498/<unknown>)]
[New Thread 810c0a800 (LWP 101495/<unknown>)]
[New Thread 810c0a000 (LWP 101458/<unknown>)]
[New Thread 810c08800 (LWP 101457/<unknown>)]
[New Thread 810c07800 (LWP 101402/<unknown>)]
[New Thread 810c07400 (LWP 100760/<unknown>)]
[New Thread 810c06400 (LWP 100094/<unknown>)]
(gdb)
Comment 5 Ian Trudel 2017-09-15 22:36:15 UTC
Same problem occurs here. It seems qt4 and qt5 are conflicting but it only seems to affect Shotcut. Removing qt4 (or more specifically qt4-testlib) will allow Shotcut to run without core dump but qt4 apps (such as kdegames) won't anymore.

ldd reveals that Shotcut is correctly linked to qt5 libraries. qtchooser says it is set to qt5. I attempted to use QT_SELECT without success. I also changed some code to remove some qt4 references (CMake, library check macro).

A little experiment removing qt4-testlib and symlink with qt5 equivalent works for qt4 apps but Shotcut still core dump (while trying to load qt4 libs). This issue has been opened for few months now. Any updates? It's not very realistic to have to uninstall completely qt4.
Comment 6 Ian Trudel 2017-09-16 00:31:32 UTC
Filed an issue on Shotcut github. Perhaps Shotcut people might be able to point us in the right direction.

https://github.com/mltframework/shotcut/issues/450
Comment 7 Ian Trudel 2017-09-16 02:50:09 UTC
I might have found a solution based on feedback from mlt/shotcut people. It's fairly simple, just make sure opencv is disabled in graphics/frei0r-plugins and deinstall of graphics/frei0r-plugins-opencv. That's it.
Comment 8 Ian Trudel 2017-09-17 02:28:42 UTC
Andrew (daeron@) reported that the fix doesn't work when Kdenlive is installed. Investigating the issue down to mlt-qt4 interfering with Shotcut and Shotcut qt5 libraries (i.e. frei0r-plugin, etc) interfering with Kdenlive.

https://bugzilla.novell.com/show_bug.cgi?id=931815

They suggest to build Kdenlive with proper mlt/qt libraries. So Kdenlive should have an option to be built with mlt-qt5 instead of mlt-qt4. Alberto?

The fix I suggested otherwise works when Kdenlive is not installed. Most other qt4 apps should be able to coexist with Shotcut.
Comment 9 Rene Ladan freebsd_committer 2018-10-01 21:43:56 UTC
Maintainer reset.
Comment 10 Tobias C. Berner freebsd_committer 2019-03-09 14:28:22 UTC
mlt-qt4 will be removed soon -- so we can close this one as overcome by events.