Running Qt apps inside a 18.04 container crashes

Bug #1774739 reported by Andrew Hayzen
This bug report is a duplicate of:  Bug #1755250: backport statx syscall whitelist fix. Edit Remove
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
qtbase-opensource-src (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

What happened:
1) Install a container system (eg Docker, LXD) - I'm using Docker
2) Create a container which is Ubuntu 18.04
3) Install a Qt app, eg qtcreator, inside the container
4) Run the container so that it shows the hosts X11 socket
5) Notice that the application fails to start

What I expected to happen:
At step 5 for the application to start.

Note that the same steps work fine for Ubuntu 16.04 and 17.10 - and if it matters my host is 17.10.

Here is a stacktrace of the crash https://pastebin.ubuntu.com/p/WKKGmxqqSx/

Here is a Dockerfile that reproduces the issue https://pastebin.ubuntu.com/p/nzmJRfPYVc/ to use this make a Dockerfile in an empty folder with the pastebin contents, then simply run the following commands in that folder

$ sudo apt install docker.io
$ sudo docker build -t qtbug .
$ sudo docker run --rm -ti -e DISPLAY --net=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined qtbug

This should enter you into the gdb session.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Note I have tried using the .run offline installer of Qt 5.6/5.9/5.11, what seems to happen is that they work on Ubuntu 16.04, 17.10 but fail on 18.04 - this is the stacktrace for reference https://pastebin.ubuntu.com/p/Yzj5gsmwQ3/

So it seems possible that it might be some underlying change to the platform (maybe something like dbus? or a new config/dir I need to enable).

Furthermore it looks like this issue may affect Qt applications when they try to run as a snap under the core18 snap. https://github.com/snapcore/core18/issues/4

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Interesting that I cannot reproduce this on Debian sid, which has a newer Docker.io version (18.03.1 vs. 17.12.1).

Can you try starting dbus before running the application, to see if that helps?

$ sudo /etc/init.d/dbus start # Start the system bus
$ dbus-daemon --session --fork # And the session bus

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

@mitya57, Thanks for having a look at this. I have tried starting dbus and dbus-daemon as you have described before running QtCreator - but it still fails in the same way :-/

I have also tried installing dbus-x11 and executing $ export $(dbus-launch) to set the env vars, but this still results in the same :-/

Interesting that Debian sid doesn't appear to be affected.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

https://bugreports.qt.io/browse/QTBUG-70447 notes that a newer Docker fixes it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtbase-opensource-src (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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