Mir

Merge lp:~vanvugt/mir/fix-1237710 into lp:mir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~vanvugt/mir/fix-1237710
Merge into: lp:mir
Diff against target: 28 lines (+2/-6)
1 file modified
src/server/run_mir.cpp (+2/-6)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1237710
Reviewer Review Type Date Requested Status
Robert Carr (community) Abstain
Kevin DuBois (community) Abstain
Alan Griffiths Needs Information
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+191353@code.launchpad.net

Commit message

Fix failing acceptance-test:
ServerShutdown/OnSignal.removes_endpoint_on_signal (LP: #1237710)

Avoid fatal_signal_cleanup getting caught in a loop restoring itself and
then re-entering itself. This could happen in some permutations of
acceptance-tests where run_mir is entered with fatal_signal_cleanup already
set up from previous tests' server instances.

To post a comment you must log in.
lp:~vanvugt/mir/fix-1237710 updated
1140. By Daniel van Vugt

Also remove unused typedef

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

*Needs discussion*

I'm concerned about the implicit assumption that the previous signal handlers are necessarily the default. See an alternative approach at: https://code.launchpad.net/~alan-griffiths/mir/fix-1237710/+merge/191412

review: Needs Information
Revision history for this message
Kevin DuBois (kdub) wrote :

I like restoring the handlers (as in lp:~alan-griffiths/mir/fix-1237710), but I'd be okay with this too

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

I'll switch to abstain (would prefer lp:~alan-griffiths/mir/fix-1237710)

review: Abstain
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

7 + signal(sig, SIG_DFL);

Since we are a library, I don't think we should be resetting signals to default. Other linked code may also need to perform some cleanup.

Revision history for this message
Robert Carr (robertcarr) :
review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The same concern occurred to me last night.

Unmerged revisions

1140. By Daniel van Vugt

Also remove unused typedef

1139. By Daniel van Vugt

Avoid fatal_signal_cleanup getting caught in a loop restoring itself and
then re-entering itself. This could happen in some permutations of
acceptance-tests where run_mir is entered with fatal_signal_cleanup already
set up from previous server instance tests. (LP: #1237710)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/run_mir.cpp'
2--- src/server/run_mir.cpp 2013-10-14 06:33:42 +0000
3+++ src/server/run_mir.cpp 2013-10-16 09:40:57 +0000
4@@ -39,15 +39,11 @@
5 }
6 }
7
8-extern "C" { typedef void (*sig_handler)(int); }
9-
10-volatile sig_handler old_handler[SIGUNUSED] = { nullptr };
11-
12 extern "C" void fatal_signal_cleanup(int sig)
13 {
14 delete_endpoint();
15
16- signal(sig, old_handler[sig]);
17+ signal(sig, SIG_DFL);
18 raise(sig);
19 }
20 }
21@@ -72,7 +68,7 @@
22 weak_connector = config.the_connector();
23
24 for (auto sig : { SIGQUIT, SIGABRT, SIGFPE, SIGSEGV, SIGBUS })
25- old_handler[sig] = signal(sig, fatal_signal_cleanup);
26+ signal(sig, fatal_signal_cleanup);
27
28 std::atexit(&delete_endpoint);
29

Subscribers

People subscribed via source and target branches