Mir

Merge lp:~alan-griffiths/mir/fix-1667645 into lp:mir

Proposed by Alan Griffiths on 2017-02-24
Status: Merged
Approved by: Daniel van Vugt on 2017-02-27
Approved revision: 4053
Merged at revision: 4055
Proposed branch: lp:~alan-griffiths/mir/fix-1667645
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/create-windowspec-for-all-types
Diff against target: 33 lines (+3/-2)
2 files modified
src/server/scene/application_session.cpp (+3/-0)
tests/acceptance-tests/test_client_surfaces.cpp (+0/-2)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1667645
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2017-02-27
Brandon Schaefer (community) Approve on 2017-02-24
Alexandros Frantzis (community) 2017-02-24 Approve on 2017-02-24
Review via email: mp+318216@code.launchpad.net

Commit message

Don't dereference the end iterator in ms::ApplicationSession::surface_after() (LP: #1667645)

Description of the change

The UB manifests a visible problem reliably by:

$ bin/mir_acceptance_tests --gtest_filter=ClientSurfaces.can_be_gloss --gtest_repeat=2

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

FAILED: Continuous integration, rev:4051
https://mir-jenkins.ubuntu.com/job/mir-ci/3057/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4088/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4175/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4165/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4165/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4165/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4115/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4115/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4115/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4115/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4115/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4115/console

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

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4052
https://mir-jenkins.ubuntu.com/job/mir-ci/3058/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4089/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4176
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4166
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4166
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4166
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4116/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4116/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4116/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/4116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4116/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4053
https://mir-jenkins.ubuntu.com/job/mir-ci/3061/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4092/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4179
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4169
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4169
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4169
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4119/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4119/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4119
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4119/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/4119
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4119/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/4119
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4119/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4119
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4119/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Brandon Schaefer (brandontschaefer) wrote :

lgtm

review: Approve
Brandon Schaefer (brandontschaefer) wrote :

15:18:46 21: [ FAILED ] DefaultInputManagerTest.forwards_pause_continue_state_changes_to_platform (65 ms)

Not this branches fault.

Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/1145/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4099/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1208/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4186
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4176
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4176
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4176
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4126/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4126/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4126/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4126/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4126/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/4126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4126/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4126
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4126/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Daniel van Vugt (vanvugt) wrote :
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/scene/application_session.cpp'
2--- src/server/scene/application_session.cpp 2017-02-20 15:25:53 +0000
3+++ src/server/scene/application_session.cpp 2017-02-24 14:53:28 +0000
4@@ -235,6 +235,9 @@
5 if (next == surfaces.end())
6 next = std::find_if(begin(surfaces), current, can_take_focus);
7
8+ if (next == end(surfaces))
9+ return {};
10+
11 return next->second;
12 }
13
14
15=== modified file 'tests/acceptance-tests/test_client_surfaces.cpp'
16--- tests/acceptance-tests/test_client_surfaces.cpp 2017-02-24 14:53:28 +0000
17+++ tests/acceptance-tests/test_client_surfaces.cpp 2017-02-24 14:53:28 +0000
18@@ -250,7 +250,6 @@
19
20 TEST_F(ClientSurfaces, can_be_gloss)
21 {
22- auto parent = mtf::make_any_surface(connection);
23 auto spec = mir_create_gloss_window_spec(connection, 640, 480);
24 ASSERT_THAT(spec, NotNull());
25 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
26@@ -260,7 +259,6 @@
27 EXPECT_EQ(mir_window_get_type(window), mir_window_type_gloss);
28
29 mir_window_release_sync(window);
30- mir_window_release_sync(parent);
31 }
32
33 TEST_F(ClientSurfaces, can_be_satellite)

Subscribers

People subscribed via source and target branches