Unity8 shows black screen with Qt 5.4.0
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | binutils |
Unknown
|
Unknown
|
||
| | binutils (Ubuntu) |
Undecided
|
Unassigned | ||
| | gcc-defaults (Ubuntu) |
Undecided
|
Unassigned | ||
| | qtbase-opensource-src (Ubuntu) |
Undecided
|
Unassigned | ||
| | ubuntu-ui-toolkit (Ubuntu) |
Undecided
|
Unassigned | ||
| | unity8 (Ubuntu) |
High
|
Albert Astals Cid | ||
Bug Description
With bug #1403511 taken care of in Qt, apps do not anymore crash with Qt 5.4 and device does not anymore go into reboot loop. However, nothing is visible on the screen.
It seems unity8, unity8-dash etc are all running. unity8.log attached
Relevant upstream links referring GCC5 as the reason to require -fPIC:
http://
http://
Related branches
- Michael Zanetti (community): Approve on 2015-01-07
- PS Jenkins bot: Approve (continuous-integration) on 2014-12-19
-
Diff: 470 lines (+50/-50)15 files modifiedplugins/LightDM/CMakeLists.txt (+1/-1)
plugins/LightDM/UsersModel.cpp (+1/-1)
plugins/LightDM/UsersModel.h (+2/-2)
plugins/Utils/CMakeLists.txt (+1/-1)
plugins/Utils/plugin.cpp (+2/-2)
plugins/Utils/unitysortfilterproxymodelqml.cpp (+15/-15)
plugins/Utils/unitysortfilterproxymodelqml.h (+5/-5)
qml/Dash/GenericScopeView.qml (+2/-2)
qml/Notifications/Notifications.qml (+1/-1)
qml/Panel/Indicators/VisibleIndicators.qml (+2/-2)
tests/mocks/LightDM/CMakeLists.txt (+1/-1)
tests/plugins/Utils/CMakeLists.txt (+1/-1)
tests/plugins/Utils/unitysortfilterproxymodeltest.cpp (+14/-14)
tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml (+1/-1)
tests/qmltests/tst_Shell.qml (+1/-1)
| Timo Jyrinki (timo-jyrinki) wrote : | #1 |
| Albert Astals Cid (aacid) wrote : | #2 |
| Zsombor Egri (zsombi) wrote : | #3 |
Checking how the type is exported - and all related types to that one - I see a potential bug in UITK. The way is exported to 1.1 version is wrong:
qmlRegisterTyp
And it should be
qmlRegisterTyp
More, as the type is supposed to be used only with version 1.1 and above, all properties/
| Albert Astals Cid (aacid) wrote : | #4 |
Oh, the SDK has a QSortFilterProx
Now I see why are we getting this error now, we have one in Unity8 too and that's why it is getting confused. It is a regression against Qt 5.3 but i'm not sure it's totally QMLs fault to be honest :D
| Albert Astals Cid (aacid) wrote : | #5 |
So second bug is https:/
| Timo Jyrinki (timo-jyrinki) wrote : | #6 |
Long discussions about #qt-labs, mostly between tsdgeos and tronical, about various things. Summarizing:
* <+tronical> tsdgeos: so I think something is wrong with the unit8 binary, my _guess_ is that it isn't built with -fPIC
-> it is built with -fPIC (and -fPIE, also asked about, "ok, that looks good")
* <+tronical> oh wait, there used to be a gcc ARM bug with copy relocations that affected this <+tronical> tsdgeos: could it be that qtbase 5.3 was built with -reduce-relocations and now it isn't anymore?
-> no, both 5.3 and 5.4 built _with_ -reduce-relocations
* binutils has had bugs, Ubuntu has the version with fixes
* -Bsymbolic-
-> "well, it explains where that comes from. it doesn't explain why the relocation in unit8 resolved to the wrong address"
* <+tronical> peppe, Mirv, tsdgeos: I realize that this is unrelated to -Bsymbolic-
* <+tronical> peppe, Mirv, tsdgeos: this particular problem is new and different. QObject:
* <+tronical> tsdgeos: still there? I have an idea how we may be able to find out where that bad pointer is coming from (it may not necessarily by the unity8 binary)
...to be continued.
| Albert Astals Cid (aacid) wrote : | #7 |
Second bug (i.e. not starting in the desktop) should be fixed by https:/
First bug still under investigation as Timo reports ↑↑
| Timo Jyrinki (timo-jyrinki) wrote : | #8 |
Trying to represent the meaningful parts of the rest of the discussion below.
<+tronical> tsdgeos: in QQmlEnginePriva
&QObject:
<+tronical> tsdgeos: if we get the wrong address there, then maybe we have a miscompilation of QtQml somehow
< tsdgeos> tronical: yeah it's wrong there
<+tronical> tsdgeos: ok, that means there's something wrong with libQt5Qml.so
< tsdgeos> removing -O2 didn't help
<+tronical> ok, that dump looks sane though
<+tronical> in particular QObject:
<+tronical> can you paste the output of objdump -TRDC /path/to/unity8 ?
< tsdgeos> yes
< tsdgeos> tronical: http://
<+tronical> aha!!
<+tronical> this one has indeed a copy relocation to QObject:
(... -fPIE is in use ...)
<+tronical> tsdgeos: _some_ source code in the unity8 sources references QObject:
<+tronical> tsdgeos: in that .o file the reference to QObject:
< tsdgeos> builddir/
<+tronical> oh, that's just a test
<+tronical> still, ok, suppose it were valid, then the other question is why when loading the plugin that has QSortFilterProx
<+tronical> tsdgeos: could you try running your app with LD_DEBUG=
< tsdgeos> sent
<+tronical> tsdgeos: the ld output looks ok but I don't understand yet why the one file that has the QSortFilterProx
<+tronical> tsdgeos: that comes from libunity8-
<+tronical> tsdgeos: I have to leave. let's look at this early next year :)
| Changed in unity8 (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → High |
| assignee: | nobody → Albert Astals Cid (aacid) |
| Albert Astals Cid (aacid) wrote : | #9 |
After reverting the patch we have in qtbase that enables Bsymbolic/
So this needs someone that understands compiler/linker stuff to have a look. If we want to keep that patch in. Or remove the use of reduce-relocations in arm
| Changed in qtbase-opensource-src (Ubuntu): | |
| status: | New → Fix Committed |
| Changed in ubuntu-ui-toolkit (Ubuntu): | |
| status: | New → Invalid |
| Changed in unity8 (Ubuntu): | |
| status: | In Progress → Fix Released |
| Changed in qtbase-opensource-src (Ubuntu): | |
| status: | Fix Committed → Confirmed |
| Changed in qtbase-opensource-src (Ubuntu): | |
| status: | Confirmed → Fix Committed |
| Launchpad Janitor (janitor) wrote : | #10 |
This bug was fixed in the package qtbase-
---------------
qtbase-
[ Timo Jyrinki ]
* New upstream release.
* debian/
- Fix PowerPC build (LP: #1400244)
* Remove patches:
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
- debian/
* Include the networkmanager backend changes from 5.4.1
* Bump ABI version to 5.4.0
* debian/
- Fix usage on OpenGL ES2 platforms (LP: #1403511)
* Sync with Debian 5.4.0+dfsg-4
* debian/
- Refresh and enable for 5.4.0 (LP: #1403582)
- Disable the tests for new QStorageInfo class which partially fail
- Disable some widgets tests that fail (desktop only)
- Disable one qlogging test
* Drop reduce-relocations option from configure, since it causes black screen
for Unity8 on armhf because of linking problems. Comment out the related
revert of earlier upstream commit. (LP: #1403758)
* debian/
- Fix tst_qvariant (LP: #1408273)
[ Łukasz 'sil2100' Zemczak ]
* debian/
- Add fix for QObject::connect failing on ARM
qtbase-
* debian/
failure on kfreebsd.
* Update symbols files for mips.
qtbase-
* More debian/copyright updates.
* Do not ship htmlinfo example which contains non-free HTML pages.
* Drop remove_
no longer needed with the above change.
* Update symbols files with buildds’ logs.
* debian/
failure.
qtbase-
* Add a patch to fix qstorageinfo_
* Add a patch to fix qimage_
systems.
* Update symbols files with buildds’ logs.
qtbase-
| Changed in qtbase-opensource-src (Ubuntu): | |
| status: | Fix Committed → Fix Released |
| Timo Jyrinki (timo-jyrinki) wrote : | #11 |
This still happens on current wily. Using the -reduce-relocations option plus opting to use it on arm (upstream still carries a patch that disables symbolic function binding on non-x86) causes the Unity 8 to just show black screen.
| description: | updated |
| Timo Jyrinki (timo-jyrinki) wrote : | #12 |
With some more building, it seems compiling qtbase with GCC5 does not help in enabling the upstream (now default in Qt 5.5 & 5.4.2) patches, bringing back the -Bsymbolic for armhf and using the -reduce-relocations option. The symptoms are similar with this qtbase compiled with GCC5. I've saved the compilation at https:/
| Timo Jyrinki (timo-jyrinki) wrote : | #13 |
Just omitting "-reduce-
| Timo Jyrinki (timo-jyrinki) wrote : | #14 |
This seems resolved for now. We're using fPIC, but not -reduce-relocations (-Bsymbolic) on armhf, and with the latest upstream Qt 5.4.2 defaults backported to 5.4.1 everything seems in order, for now at least. This may need to be revisited with Qt 5.5.0 and/or GCC5.
| description: | updated |
| Changed in gcc-defaults (Ubuntu): | |
| status: | New → Incomplete |
| Changed in binutils (Ubuntu): | |
| status: | New → Incomplete |
| Timo Jyrinki (timo-jyrinki) wrote : | #15 |
Just to collect information in this bug, the fPIC requirement and fPIE banning in Qt now is because of this: https:/
This bug originally however is about a problem that shows up when that related Bsymbolic option is enabled on armhf too. This needed forcing but we forced it at one point since it was believed the toolchain bug was fixed. However, for now it remains disabled on non-x86 (the default of Qt upstream) because of the persisting bug, but it may be re-enabled later if the bug is resolved.
The toolchain bug (fPIC + Bsymbolic misbehaving on arm) is last described at https:/
| affects: | unity8 → binutils |


I've been investigating this today and there's at leat two separate issues:
**Only** on the phone you get the log Timo attaches (or something along the lines). That is caused by QQmlPropertyVal idator: :canCoerce failing. I've talked to Simon Haussmann from Qt Company and the situation we have (two QQmlPropertyCache with different pointer but same QMetaObject pointer) is technically impossible, yet we're having it, if o change that function to do
while (fromMo && toMo) { >metaObject( ) && toMo->metaObject() && fromMo- >metaObject( )->className( ) == toMo->metaObjec t()->className( ))
if (fromMo-
return true;
fromMo = fromMo->parent();
}
instead of the original loop comparing toMo and fromMo i can workaround the bug (but this is just a hacky) and get to the next bug
On the desktop (or on the phone after workarounding the first issue), you will get errors saying yModelQML to QSortFilterProx yModelQML"
"Unable to assign QSortFilterProx
These errors seem to be caused somehow by Ubuntu.Components since if i un-import it, they go away. You can also workaround them by changing the code from Model categories: categoryFilter
property SortFilterProxy
to
property var categories: categoryFilter
Which you could even argue it's better code in some cases, but still we need to investigate why it's happening.
In summary, there's two bugs:
Bug #1 only happen on the phone (probably because of ARM)
Bug #2 is triggered by importing Ubuntu.Components
Both need investigation. I'll continue tomorrow if noone beats me to it :D