Mir

Merge lp:~alan-griffiths/mir/demo_server-fatal-errors-core-dump into lp:mir

Proposed by Alan Griffiths
Status: Work in progress
Proposed branch: lp:~alan-griffiths/mir/demo_server-fatal-errors-core-dump
Merge into: lp:mir
Diff against target: 27 lines (+4/-1)
1 file modified
examples/server_example.cpp (+4/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/demo_server-fatal-errors-core-dump
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
Daniel van Vugt Needs Information
Cemil Azizoglu (community) Approve
Mir CI Bot continuous-integration Approve
Review via email: mp+293595@code.launchpad.net

Commit message

examples: configure mir_demo_server to core when fatal_errors are encountered.

Description of the change

examples: configure mir_demo_server to core when fatal_errors are encountered.

It is arguable that we should change the default (throw an exception) behaviour, but let's get some experience with this approach first.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3492
https://mir-jenkins.ubuntu.com/job/mir-ci/930/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/988
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1034
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1025
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1025
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/998
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/998/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/998
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/998/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/998
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/998/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/998
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/998/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/998
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/998/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/930/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Ok by me

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If you make it the default for all shells, we could declare bug 1316867 fixed...

But separately, we could also keep using exceptions and just make sure unrecoverable exceptions dump core in the end. I suspect this issue is already hiding a lot of in-the-wild Unity8/USC crashes from us. See bug 1577106.

Revision history for this message
Daniel van Vugt (vanvugt) :
review: Needs Information
Revision history for this message
Chris Halse Rogers (raof) wrote :

Don't mind this; having Mir trigger apport on exceptions that reach server::run()¹ would be a way of getting crash reports without taking down the host process.

¹: https://wiki.ubuntu.com/Apport/DeveloperHowTo

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Don't mind this; having Mir trigger apport on exceptions that reach
> server::run()¹ would be a way of getting crash reports without taking down the
> host process.
>
> ¹: https://wiki.ubuntu.com/Apport/DeveloperHowTo

Two questions:

1. That link seems to be a lot of information about customizing apport, but gives little about the options for triggering it. It seems we need to write a small python script and execute that. I assume that can be coded to grab a stack trace?

2. Is server::run() the right place? Threads have been joined and the stack has unwound by then. Surely we should be capturing information in the fatal_error() handler?

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I've just realized we have --on-fatal-error-abort, so this seems unnecessary.

Revision history for this message
Chris Halse Rogers (raof) wrote :

On 4 May 2016 6:54:42 PM AEST, Alan Griffiths <email address hidden> wrote:
>> Don't mind this; having Mir trigger apport on exceptions that reach
>> server::run()¹ would be a way of getting crash reports without taking
>down the
>> host process.
>>
>> ¹: https://wiki.ubuntu.com/Apport/DeveloperHowTo
>
>Two questions:
>
>1. That link seems to be a lot of information about customizing apport,
>but gives little about the options for triggering it. It seems we need
>to write a small python script and execute that. I assume that can be
>coded to grab a stack trace?
>
>2. Is server::run() the right place? Threads have been joined and the
>stack has unwound by then. Surely we should be capturing information in
>the fatal_error() handler?
>--
>https://code.launchpad.net/~alan-griffiths/mir/demo_server-fatal-errors-core-dump/+merge/293595
>You are reviewing the proposed merge of
>lp:~alan-griffiths/mir/demo_server-fatal-errors-core-dump into lp:mir.

We don't really *want* to be capturing a core, surely; we know where the exception is thrown from, and the exception *should* have more useful information than a core. The call stack is generally uninteresting for these things.

We'd just need to write a little Python script and pump roughly the output of boost_describe_exception into it...

Revision history for this message
Chris Halse Rogers (raof) wrote :

Specifically - apport does not require a core in order to get something on errors.ubuntu.com.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> We don't really *want* to be capturing a core, surely; we know where the
> exception is thrown from, and the exception *should* have more useful
> information than a core. The call stack is generally uninteresting for these
> things.
>
> We'd just need to write a little Python script and pump roughly the output of
> boost_describe_exception into it...

Maybe we could use /usr/share/apport/recoverable_problem?

Unmerged revisions

3492. By Alan Griffiths

Fatal errors should be reported by a core

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/server_example.cpp'
--- examples/server_example.cpp 2016-05-03 04:36:33 +0000
+++ examples/server_example.cpp 2016-05-03 08:46:35 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2012-2015 Canonical Ltd.2 * Copyright © 2012-2016 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -29,6 +29,7 @@
2929
30#include "mir/server.h"30#include "mir/server.h"
31#include "mir/main_loop.h"31#include "mir/main_loop.h"
32#include "mir/fatal.h"
32#include "mir/fd.h"33#include "mir/fd.h"
3334
34#include "mir/report_exception.h"35#include "mir/report_exception.h"
@@ -128,6 +129,8 @@
128 me::ClientContext context;129 me::ClientContext context;
129 me::add_test_client_option_to(server, context);130 me::add_test_client_option_to(server, context);
130131
132 mir::FatalErrorStrategy on_error{mir::fatal_error_abort};
133
131 // Create some input filters (we need to keep them or they deactivate)134 // Create some input filters (we need to keep them or they deactivate)
132 auto const quit_filter = me::make_quit_filter_for(server);135 auto const quit_filter = me::make_quit_filter_for(server);
133 auto const printing_filter = me::make_printing_input_filter_for(server);136 auto const printing_filter = me::make_printing_input_filter_for(server);

Subscribers

People subscribed via source and target branches