Qt app aborts if it cannot connect to Mir - QtMir rejecting the connection
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | qtmir (Ubuntu) |
High
|
Gerry Boland | ||
| | ubuntu-app-launch (Ubuntu) |
Medium
|
Unassigned | ||
Bug Description
When running several camera-app tests in a sequence, randomly we have the application crash.
Tracing the crash leads to a fatal error in qtubuntu when trying to connect to MIR. The stack trace follows below.
According to elopio this might be because the app has not exited yet from the previous tests when running the next one.
I am attaching the AP log as well.
#0 0xb62298e6 in ?? () from /lib/arm-
#1 0xb6237e5e in raise () from /lib/arm-
#2 0xb6238b4e in abort () from /lib/arm-
#3 0xb6bfe7d6 in qt_message_fatal (context=..., message=...) at global/
#4 QMessageLogger:
msg=0xb3f7a02c "UbuntuClientIn
#5 0xb3f67356 in ?? () from /usr/lib/
#6 0xb3f69bc4 in ?? () from /usr/lib/
#7 0xb670620a in loadIntegration (argv=0xbeeed2a4, argc=@0xbeeed12c: 1, parameters=..., key=..., loader=<optimized out>) at kernel/
#8 QPlatformIntegr
#9 0xb670dc34 in init_platform (argv=0xbeeed2a4, argc=@0xbeeed12c: 1, platformThemeNa
#10 QGuiApplication
#11 0xb670e396 in QGuiApplication
#12 0xb6d6df20 in QCoreApplicatio
#13 0xb6d6dfa6 in QCoreApplicatio
#14 0xb670ee06 in QGuiApplication
#15 0x00014480 in CameraApplicati
#16 0x00016c82 in main ()
| Ugo Riboni (uriboni) wrote : | #1 |
| Ugo Riboni (uriboni) wrote : | #2 |
| Ugo Riboni (uriboni) wrote : | #3 |
This is a log from unity8 showing the same problem: http://
Note: it is not from the same test run or same machine as the log attached above, but the symptoms of the crash are the same.
| Changed in autopilot: | |
| importance: | Undecided → High |
| Christopher Lee (veebers) wrote : | #4 |
I'm having trouble reproducing this error locally which is making it hard for me to attempt to debug or get a better picture of what's happening.
In the meantime, Ugo, are you able to provide an autopilot log that uses the -v flag to provide a little more insight to what's happening.
I swear that I've seen something like this before (at least the message "UbuntuClientIn
A couple of interesting lines in the log provided[1] specifically line: 349[2] which I don't see appear in unity8 log when the tests all pass (and the crash doesn't happen) so I'm tempted to say it appears when it does happen (speculation at this point) so maybe there is something happening there in the interaction between Mir and the Shell.
The other line that was pointed out to me is on line 8561[3] of that log.
Another thought, can you confirm which version of Ubuntu you are running as well as the device type you see it on?
It's not immediately obvious to me what might be happening as autopilot is stopping the application in the prescribed manner (not just killing it) and the fact that it doesn't happen reliably would suggest perhaps some sort of race condition.
I'll continue looking into this, but for the moment I don't have any further suggestions as to what might be happening.
[1] http://
[2] "Couldn't find a .desktop file for "com.ubuntu.
[3] "ApplicationManager REJECTED connection from app with pid 16790 as no desktop_file_hint specified"
| Changed in autopilot: | |
| status: | New → Incomplete |
| Changed in unity-mir (Ubuntu): | |
| importance: | Undecided → High |
| no longer affects: | unity-mir (Ubuntu) |
| no longer affects: | mir |
| summary: |
- MIR refuses the app to connect + Mir refuses the app to connect |
| Christopher Lee (veebers) wrote : | #5 |
A quick note as per comment on IRC:
<bfiller> veebers: I believe what is happening is that a test is causing camera-app to crash, and while it is crashing (and apport running) all subsequent tests that are run during that time frame fail
...
<bfiller> veebers: yes, and figuring out why the camera-app is crashing in the first place is something my team needs to look into
<bfiller> veebers: one option would be to have autopilot abort running the rest of the tests when it detects a crash
<bfiller> as currently it's quite hard to tell which test actually crashed
<bfiller> (and the tests run after fail for the reasons mentioned above)
<veebers> bfiller: right makes sense. Autopilot run currently has the --failfast option which might be of help, (-ff, --failfast Stop the test run on the first error or failure.)
| I Ahmad (iahmad) wrote : | #6 |
| I Ahmad (iahmad) wrote : | #7 |
| Christopher Lee (veebers) wrote : | #8 |
Late in the day I was able to check out some logs, here are my (raw) thoughts and observations regarding what happened in case they might be of use.
Logs found here: http://
[camera_
Passes, but there is the message in the log:
"""
06:43:26.599 ERROR _launcher:206 - Timed out waiting for Application with app_id 'com.ubuntu.
"""
[camera_
Happens shortly afterward with the error message:
"""
Traceback (most recent call last):
File "/home/
super(
File "/home/
self.
File "/home/
emulator_
File "/usr/lib/
return launcher.
File "/usr/lib/
return super()
File "/usr/lib/
state.
File "/usr/lib/
raise RuntimeError(': '.join(
RuntimeError: Timed out while waiting for application to launch
"""
Due to there being a screenshot with the camera running either the app is still running from previous test or has been started again.
[camera_
Is the next test to run, it too shows a screenshot that looks the same as the previous test so it's either the still running up or it's been launched again.
It also fails with the message:
"""
Traceback (most recent call last):
File "/home/
super(
File "/home/
self.
File "/home/
emulator_
File "/usr/lib/
return launcher.
File "/usr/lib/
return super()
File "/usr/lib/
state.
File "/usr/lib/
raise RuntimeError(': '.join(
RuntimeError: Timed out while waiting for application to launch
"""
[camera_app....
| Christopher Lee (veebers) wrote : | #9 |
Attaching the 2 logs mentioned in my previous comment
| Christopher Lee (veebers) wrote : | #10 |
| Changed in qtmir (Ubuntu): | |
| status: | New → Invalid |
renamed based on discussion with dobey
can we make Qtmir log a message with qCritical() and exit with QApplication.exit()
| summary: |
- Mir refuses the app to connect + Qtmir aborts if it cannot connect to Mir |
| Changed in qtmir (Ubuntu): | |
| status: | Invalid → New |
| importance: | Undecided → High |
| kevin gunn (kgunn72) wrote : | #12 |
like dobey said, if you just run qmlscene you can see the result
phablet@
[1424984233.100272] Loader: Loading modules from: /usr/lib/
[1424984233.101127] Loader: Loading module: /usr/lib/
[1424984233.102225] Loader: Loading module: /usr/lib/
[1424984233.103658] Loader: Loading module: /usr/lib/
UbuntuClientInt
running, and the correct socket is being used and is accessible. The shell may have
rejected the incoming connection, so check its log file
Aborted (core dumped)
@gerry, is there any reason we shouldn't/couldn't change ?
| no longer affects: | autopilot |
| Gerry Boland (gerboland) wrote : | #13 |
QtMir has strict policy that every app that tries to connect to Mir must:
1. either be launched via upstart-app-launch [unsupported hack: launched with --desktop_
2. be only instance of a process with that appId running
The first point is there to ensure that every process which draws a UI must have metadata associated with it, metadata like name, icon, etc, which the shell requires to have app appear in launcher correctly. Alternative is the current situation, where we have BAMF to heuristically match processes to desktop files - which is undesirable.
The second point can be relaxed for desktop apps, but will probably be maintained for phablet.
I'll try to determine if an app crashing correctly notifies QtMir, so that if a new instance of it appears, QtMir will accept it. That's a guess at the problem however, I'd need to reproduce.
| summary: |
- Qtmir aborts if it cannot connect to Mir + Qt app aborts if it cannot connect to Mir - QtMir rejecting the + connection |
| Changed in qtmir: | |
| importance: | Undecided → High |
| assignee: | nobody → Gerry Boland (gerboland) |
| Gerry Boland (gerboland) wrote : | #14 |
Am update with my findings so far:
I can occasionally reproduce QtMir rejecting the camera app connection.
It does this as it is not expecting the camera process to connect to it/mir. Why not? Upstart/
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
The onProcessStarting print is due to a message "starting" from Ubuntu-app-launch. UAL appears to send 3 starting messages! - but in fact the process has stopped (well disconnected from Mir), due to the next lines of output:
qtmir.mir: SessionListener
qtmir.applications: ApplicationMana
qtmir.applications: ApplicationMana
Watching dbus traffic from Upstart, I noticed this error coincides with these events:
signal sender=:1.0 -> dest=(null destination) serial=1646 path=/com/
string "starting"
array [
string "JOB=applicatio
string "INSTANCE=
string "UBUNTU_
]
signal sender=:1.0 -> dest=(null destination) serial=1655 path=/com/
string "started"
array [
string "JOB=applicatio
string "INSTANCE=
string "UBUNTU_
]
signal sender=:1.0 -> dest=(null destination) serial=1672 path=/com/
string "stopping"
array [
string "JOB=applicatio
string "INSTANCE=
string "RESULT=ok"
string "UBUNTU_
]
**No Stopped!!!**
signal sender=:1.0 -> dest=(null destination) serial=1708 path=/com/
string "starting"
array [
string "JOB=applicatio
string "INSTANCE=
string "UBUNTU_
]
Normally these are the sequence of events: starting, started, s...
| Gerry Boland (gerboland) wrote : | #15 |
Note I generally can reproduce this with a newly flashed device and the first run of the camera-app test suite. Further runs tend to not exhibit the bug.
| Changed in ubuntu-app-launch (Ubuntu): | |
| status: | New → Confirmed |
| importance: | Undecided → Medium |
| Launchpad Janitor (janitor) wrote : | #16 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in qtmir (Ubuntu): | |
| status: | New → Confirmed |
| Gerry Boland (gerboland) wrote : | #17 |
Almost a year later, I've not heard of this issue cropping up recently. I'm marking as invalid, but if anyone discovers this again, please re-open and I'll look again.
| Changed in qtmir: | |
| status: | New → Invalid |
| Changed in qtmir (Ubuntu): | |
| status: | Confirmed → Invalid |
| Changed in ubuntu-app-launch (Ubuntu): | |
| status: | Confirmed → Invalid |
| Changed in qtmir (Ubuntu): | |
| assignee: | nobody → Gerry Boland (gerboland) |
| no longer affects: | qtmir |


Attaching the click I had the crashes with