Bug 232736 - x11-wm/plasma5-kwin 5.14.2 hangs during configure phase
Summary: x11-wm/plasma5-kwin 5.14.2 hangs during configure phase
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-27 03:21 UTC by Patrick McMunn
Modified: 2019-10-12 13:01 UTC (History)
7 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
poudriere log of building misc/kf5-purpose (82.04 KB, text/plain)
2019-06-12 17:06 UTC, Matthias Apitz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McMunn 2018-10-27 03:21:09 UTC
I'm using the freebsd-ports-kde plasma5-5.13 branch from Github to upgrade my Plasma 5 installation from the 5.12 series currently in the stable ports tree. top shows the qmlplugindump process pinning one of the CPUs at about 100% during the configure phase, and it just hangs.
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2018-10-27 06:40:27 UTC
Hi there

The plasma5-5.13 tree is my dogfooding and branch, and I and it also contains Qt5 5.12-beta2.
Have you already upgraded your whole Qt or do you have a mix of 5.11.2 and 5.12.0.b2?


Mfg Tobias
Comment 2 Patrick McMunn 2018-10-27 23:24:14 UTC
I'm using "portmaster -a" or "portmaster -ydbga --no-confirm" to upgrade. So unless there is some issue with portmaster's handling of the upgrade process or the ports' dependencies, QT should be already upgraded.
Comment 3 Patrick McMunn 2018-10-28 21:13:57 UTC
I paid closer attention to the process and did notice some things. At least a few parts of the QT libraries were not upgraded to beta 2 yet, such at qt5-qtpaths or qt5-quickcontrols. So I uninstalled anything which was not yet upgraded in hopes that "portsmaster -a" would handle everything. But portmaster still wanted to compile plasma5-kwin first. Following are the last few lines of configure output from plasma5-kwin before it stops and hangs:

-- Could NOT find Libcap (missing: SETCAP_EXECUTABLE Libcap_LIBRARIES) 
-- Found QtQuick-QMLModule: TRUE (found version "")  
-- qmlplugindump failed for QtQuick.Controls.
-- Could NOT find QtQuick.Controls-QMLModule (missing: QtQuick.Controls-QMLModule_FOUND) 
-- Found QtQuick.Layouts-QMLModule: TRUE (found version "")  
-- Found QtQuick.VirtualKeyboard-QMLModule: TRUE (found version "")  
-- Found QtQuick.Window-QMLModule: TRUE (found version "")

I updated the git tree which now has beta 3 of the QT5 libraries, and I manually ran "make install clean" for qt5-qtpaths, qt5-quickcontrols, qt5-quickcontrols2, and qt5-virtualkeyboard since those seem to possible have an issue, per the output. But that didn't solve anything.
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2018-10-28 21:21:51 UTC
Which version of FreeBSD are you using?
Comment 5 Tobias C. Berner freebsd_committer freebsd_triage 2018-10-28 21:24:54 UTC
(In reply to Tobias C. Berner from comment #4)
Do you have qt5-quick-5.12.0.b3 installed? -- qmlplugindump is part of it (x11-toolkits/qt5-quick).


>  pkg which /usr/local/lib/qt5/bin/qmlplugindump     
/usr/local/lib/qt5/bin/qmlplugindump was installed by package qt5-quick-5.12.0.b3
Comment 6 Patrick McMunn 2018-10-29 08:39:44 UTC
I'm running 12.0-BETA2 r339783 GENERIC  amd64 from the stable/12 branch. I do have qt5-quick-5.12.0.b3 installed. And for what it may be worth, I found this old bug from 2014 that may be at least tangentially related. I tried the environment variable to no avail: https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1281237
Comment 7 Patrick McMunn 2018-11-10 07:26:30 UTC
I ran "pkg check -Ba" to look for broken libraries and found none. I ran "portmaster -a" which ran fine until it got to plasma5-kwin. I manually removed and reinstalled QT5 libraries. Nothing worked. I finally just ran "pkg remove -fa" and removed all packages, rebooted, and then compiled x11/kde5 from scratch. Everything -- including plasma5-kwin -- compiled without any problems. This suggests to me that somewhere there was a broken dependency that was missed by the tools I used to troubleshoot. But at this point we may never find out what it was.
Comment 8 Patrick McMunn 2018-11-17 00:09:18 UTC
I finally got this thing figured out. I ran into this bug again after updating the Area 51 ports tree in question and running "portmaster -a". This time I poked around a little and found ../plasma5-kwin/work/.build/gst-plugin-scanner.core. Apparently the configure script for kwin invokes gst-plugin-scanner from the gstreamer1 package, and it had crashed for some reason. qmlplugindump's hanging behavior was a result of gst-plugin-scanner's crash.

As it turns out, there is FreeBSD bug 233100 which describes how gst-plugins-* ports are not updated by portmaster, as they should be, when gstreamer1 is updated. Since the plugins were not updated, the old plugin versions were causing gst-plugin-scanner to crash. So I removed gst-plugins-bad, gst-plugins-good, and gst-plugins-ugly. After that, plasma5-kwin configured, compiled, and installed without any further problem.

I don't know why kwin is invoking gst-plugin-scanner (gstreamer isn't a dependency of kwin, is it?), but gstreamer1 was the cause all along.
Comment 9 Rebecca Cran freebsd_committer freebsd_triage 2018-11-17 01:24:02 UTC
I worked around this problem by stopping webcamd and unloading the cuse module after noticing that qmlplugindump was in a state that appeared to be related to cuse.
Comment 10 Gleb Popov freebsd_committer freebsd_triage 2019-04-07 19:04:59 UTC
It seems I got the same problem on 13-CURRENT.

Running `qmlplugindump QtQuick 2.3` under `truss` reveals that it hangs on

mmap(0x0, 12884905984, ...)
mmap(0x0, 6291456, ...)

Iteresting thing is that copying this binary to a working system doesn't break it - I can still build plasma5-kwin with that binary.
Comment 11 Tobias C. Berner freebsd_committer freebsd_triage 2019-04-07 19:53:31 UTC
(In reply to Gleb Popov from comment #10)

> qmlplugindump QtQuick 2.3             
import QtQuick.tooling 1.2

// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump QtQuick 2.3'

Module {
    dependencies: ["QtQuick 2.12"]
}
<jemalloc>: /usr/src/contrib/jemalloc/include/jemalloc/internal/extent_inlines.h:63: Failed assertion: "szind < NSIZES"
[1]    84573 abort      qmlplugindump QtQuick 2.3

is what I get on my machine at the moment -- so that might be worth investigating.
Comment 12 Alexander Kabaev freebsd_committer freebsd_triage 2019-04-12 20:26:09 UTC
Allocating 12G is probably an overkill in any case and I wobnder if jemalloc is still built with debug measured turned on in -current, say, causing it to fill the allocated blocks with with filler? That would explain why -current is affected.
Comment 13 Alexander Kabaev freebsd_committer freebsd_triage 2019-04-12 20:35:46 UTC
(In reply to Alexander Kabaev from comment #12)
In reply to myself: 

env MALLOC_CONF=junk:false qmlplugindump QtQuick 2.3

... results in assertion in jemalloc:

import QtQuick.tooling 1.2

// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump QtQuick 2.3'

Module {
    dependencies: ["QtQuick 2.12"]
}
<jemalloc>: jemalloc_arena.c:271: Failed assertion: "bitmap_get(slab_data->bitmap, &bin_info->bitmap_info, regind)"
Abort (core dumped)
Comment 14 Alexander Kabaev freebsd_committer freebsd_triage 2019-04-12 23:43:55 UTC
Full backtrace of the crash. It does appear QT tries to destruct already freed object:

Program terminated with signal SIGBUS, Bus error.
#0  0x00000008023af496 in QHashData::detach_helper (this=0x8038bf230,
    node_duplicate=0x801187640 <QHash<QMetaObject const*, int>::duplicateNode(QHashData::Node*, void*)>, 
    node_delete=0x801186e50 <QHash<QMetaObject const*, int>::deleteNode2(QHashData::Node*)>, nodeSize=32, nodeAlign=8)
    at tools/qhash.cpp:531
531                 Node *oldNode = buckets[i];
(gdb) print *this
$2 = {fakeNext = 0x5a5a5a5a5a5a5a5a, buckets = 0x5a5a5a5a5a5a5a5a, ref = {atomic = {
      _q_value = {<std::__1::__atomic_base<int, true>> = {<std::__1::__atomic_base<int, false>> = {__a_ = 1515870810, 
            static is_always_lock_free = <optimized out>}, <No data fields>}, <No data fields>}}}, size = 1515870810, 
  nodeSize = 1515870810, userNumBits = 23130, numBits = 23130, numBuckets = 1515870810, seed = 1515870810, 
  sharable = 0, strictAlignment = 1, reserved = 378967702, static shared_null = {fakeNext = 0x0, buckets = 0x0, ref = {
      atomic = {_q_value = {<std::__1::__atomic_base<int, true>> = {<std::__1::__atomic_base<int, false>> = {
              __a_ = -1, static is_always_lock_free = <optimized out>}, <No data fields>}, <No data fields>}}}, 
    size = 0, nodeSize = 0, userNumBits = 4, numBits = 0, numBuckets = 0, seed = 0, sharable = 1, strictAlignment = 0, 
    reserved = 0, static shared_null = <same as static member of an already seen type>}}
(gdb) bt
#0  0x00000008023af496 in QHashData::detach_helper (this=0x8038bf230, node_duplicate=
    0x801187640 <QHash<QMetaObject const*, int>::duplicateNode(QHashData::Node*, void*)>, 
    node_delete=0x801186e50 <QHash<QMetaObject const*, int>::deleteNode2(QHashData::Node*)>, nodeSize=32, nodeAlign=8)
    at tools/qhash.cpp:531
#1  0x00000008011875ff in QHash<QMetaObject const*, int>::detach_helper (
    this=0x801359558 <QQmlTypePrivate::attachedPropertyIds>) at /usr/local/include/qt5/QtCore/qhash.h:599
#2  0x0000000801187509 in QHash<QMetaObject const*, int>::detach (
    this=0x801359558 <QQmlTypePrivate::attachedPropertyIds>) at /usr/local/include/qt5/QtCore/qhash.h:275
#3  0x0000000801182010 in QHash<QMetaObject const*, int>::find (
    this=0x801359558 <QQmlTypePrivate::attachedPropertyIds>, 
    akey=@0x805ad9518: 0x80134f120 <QQmlComponent::staticMetaObject>) at /usr/local/include/qt5/QtCore/qhash.h:901
#4  0x00000008011778c6 in QQmlType::~QQmlType (this=0x805b35d50) at qml/qqmlmetatype.cpp:576
#5  0x0000000000220bb9 in QHashNode<QQmlType, QHashDummyValue>::~QHashNode (this=0x805b35d40)
    at /usr/local/include/qt5/QtCore/qhash.h:149
#6  0x0000000000220abd in QHash<QQmlType, QHashDummyValue>::deleteNode2 (node=0x805b35d40)
    at /usr/local/include/qt5/QtCore/qhash.h:547
#7  0x00000008023af69a in QHashData::free_helper (this=0x805b32510, 
    node_delete=0x220aa0 <QHash<QQmlType, QHashDummyValue>::deleteNode2(QHashData::Node*)>) at tools/qhash.cpp:572
#8  0x0000000000220b23 in QHash<QQmlType, QHashDummyValue>::freeData (this=0x805b35d38, x=0x805b32510)
    at /usr/local/include/qt5/QtCore/qhash.h:587
#9  0x00000000002214ba in QHash<QQmlType, QHashDummyValue>::~QHash (this=0x805b35d38)
    at /usr/local/include/qt5/QtCore/qhash.h:254
#10 0x000000000021f265 in QSet<QQmlType>::~QSet (this=0x805b35d38) at /usr/local/include/qt5/QtCore/qdatastream.h:60
#11 0x00000000002278c3 in QHashNode<QByteArray, QSet<QQmlType> >::~QHashNode (this=0x805b35d20)
    at /usr/local/include/qt5/QtCore/qhash.h:149
#12 0x000000000022786d in QHash<QByteArray, QSet<QQmlType> >::deleteNode2 (node=0x805b35d20)
    at /usr/local/include/qt5/QtCore/qhash.h:547
#13 0x00000008023af69a in QHashData::free_helper (this=0x8038c0100, 
    node_delete=0x227850 <QHash<QByteArray, QSet<QQmlType> >::deleteNode2(QHashData::Node*)>) at tools/qhash.cpp:572
#14 0x0000000000227843 in QHash<QByteArray, QSet<QQmlType> >::freeData (this=0x230038 <qmlTypesByCppName>, 
    x=0x8038c0100) at /usr/local/include/qt5/QtCore/qhash.h:587
#15 0x000000000021816a in QHash<QByteArray, QSet<QQmlType> >::~QHash (this=0x230038 <qmlTypesByCppName>)
    at /usr/local/include/qt5/QtCore/qhash.h:254
#16 0x00000008028b8571 in __cxa_finalize (dso=0x0)
    at /export/poudriere/jails/pkgbuild/usr/src/lib/libc/stdlib/atexit.c:237
#17 0x00000008028496b1 in exit (status=0) at /export/poudriere/jails/pkgbuild/usr/src/lib/libc/stdlib/exit.c:74
#18 0x0000000000211116 in _start (ap=<optimized out>, cleanup=<optimized out>)
    at /export/poudriere/jails/pkgbuild/usr/src/lib/csu/amd64/crt1.c:76
Comment 15 Alexander Kabaev freebsd_committer freebsd_triage 2019-04-15 01:49:28 UTC
The ultimate cause for the failure was broken C++ destructor order in FreeBSD. kib@ is going to commit the fix soon-ish.
Comment 16 Alexander Kabaev freebsd_committer freebsd_triage 2019-04-15 14:40:43 UTC
https://svnweb.freebsd.org/changeset/base/346225
Comment 17 mikhail.rokhin 2019-05-11 17:31:42 UTC
(In reply to Alexander Kabaev from comment #16)

The same failure for FBSD-Current (rev 347487) for plasma5-kwin-5.15.5 - qmlplugindump is 12G size & killed during setup simultaneously.
Comment 18 Matthias Apitz 2019-06-11 08:49:51 UTC
I'm facing a similar problem on r342378. I'm build the latest port svn checkout (June 10) on r342378 with poudriere and (after isolating it) see the problem that building x11-wm/plasma5-kwin runs reproducible out of swap during 'configure'
phase.
Comment 19 Matthias Apitz 2019-06-12 06:08:39 UTC
Yes, it's here as well qmlplugindump growing to 12G before the system halts due to out of swap space.
Comment 20 Matthias Apitz 2019-06-12 11:02:36 UTC
(In reply to mikhail.rokhin from comment #17)
Mikhail, does your comment mean that the issue is still there, even after the changes of Alexander in r346225? I was thinking in update my poudriere oven to this version, but ...
Comment 21 Matthias Apitz 2019-06-12 17:03:47 UTC
The same happens when one build the port misc/kf5-purpose and also again qmlplugindump is causing the out of swap (I have 24 GByte of swap). I'm attaching the log of poudriere.
Comment 22 Matthias Apitz 2019-06-12 17:06:02 UTC
Created attachment 205010 [details]
poudriere log of building misc/kf5-purpose
Comment 23 Matthias Apitz 2019-06-12 20:01:53 UTC
Please, can someone change 'Importance: --- Affects Only Me' to something more accurate. Thanks.
Comment 24 Matthias Apitz 2019-06-16 07:49:37 UTC
I updated the host and the poudriere jail to r349041 (Jun 15) and the port builds fine, as well all dependencies of x11/kde5.
Comment 25 Tobias C. Berner freebsd_committer freebsd_triage 2019-06-16 10:19:42 UTC
(In reply to Matthias Apitz from comment #24)
Cool, so it is fixed for you completely now?

mfg Tobias
Comment 26 Matthias Apitz 2019-06-16 10:54:38 UTC
The port builds. There are errors in the log file, like:

-- Found Xwayland: /usr/local/bin/Xwayland
-- Could NOT find Libcap (missing: SETCAP_EXECUTABLE Libcap_LIBRARIES)
-- Found QtQuick-QMLModule: TRUE (found version "")
-- qmlplugindump failed for QtQuick.Controls.
-- Could NOT find QtQuick.Controls-QMLModule (missing: QtQuick.Controls-QMLModule_FOUND)
-- Found QtQuick.Layouts-QMLModule: TRUE (found version "")
-- qmlplugindump failed for QtQuick.VirtualKeyboard.
-- Could NOT find QtQuick.VirtualKeyboard-QMLModule (missing: QtQuick.VirtualKeyboard-QMLModule_FOUND)
-- Found QtQuick.Window-QMLModule: TRUE (found version "")
-- Found QtMultimedia-QMLModule: TRUE (found version "")
-- Found org.kde.kquickcontrolsaddons-QMLModule: TRUE (found version "")
-- qmlplugindump failed for org.kde.plasma.core.
-- Could NOT find org.kde.plasma.core-QMLModule (missing: org.kde.plasma.core-QMLModule_FOUND)
-- qmlplugindump failed for org.kde.plasma.components.
-- Could NOT find org.kde.plasma.components-QMLModule (missing: org.kde.plasma.components-QMLModule_FOUND)
-- Looking for include file unistd.h

...
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- qmlplugindump failed for org.kde.plasma.core.
-- Could NOT find org.kde.plasma.core-QMLModule (missing: org.kde.plasma.core-QMLModule_FOUND)


Don't know, if they're important, But, I think the PR can be closed.
Comment 27 Adriaan de Groot freebsd_committer freebsd_triage 2019-10-12 13:01:29 UTC
Closing based on
 - there was a bug elsewhere causing this problem
 - last comment reports problem fixed.