Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 1212613002: Non-SFI mode: Add Linux asynchronous signal support (Closed)

Created:
5 years, 6 months ago by Luis Héctor Chávez
Modified:
5 years, 4 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/src/native_client.git@master
Target Ref:
refs/heads/master
Project:
nacl
Visibility:
Public.

Description

Non-SFI mode: Add Linux asynchronous signal support This change adds a mechanism to both receive and send signals to other threads in the process. A single signal is implemented with no option to mask it, but user code can use this to multiplex multiple signals and implement something that looks more like POSIX. Enabling signals will require allowing the tgkill system call (with the current pid and SIGUSR1 as signum) and adding the CLONE_PARENT_SETTID flag to clone. * Refactored some functions common to both signal and exception handling from src/nonsfi/linux/irt_exception_handling.c to src/nonsfi/linux/irt_signal_handling.c. That way, other code can still call |nonsfi_initialize_signal_handler| and it will install both. * Added a test for user async-signals. * Added documentation for this feature in documentation/nonsfi_mode_async_signals.txt BUG=https://code.google.com/p/nativeclient/issues/detail?id=4065 TEST=./scons run_user_async_signal_test_irt bitcode=1 nonsfi_nacl=1 \ --mode=nacl,dbg-host,nacl_irt_test [platform=arm] TEST=git try Committed: https://chromium.googlesource.com/native_client/src/native_client/+/6a0ce065f481a3eb0bcd63ed62755d82d339c617

Patch Set 1 #

Total comments: 40

Patch Set 2 : Addressed feedback and an almost working ARM implementation #

Patch Set 3 : Made the test much less racy. ARM still has some issues. #

Patch Set 4 : Fixed tests and disabling one test in ARM #

Patch Set 5 : Fixed a small window where signals could corrupt the stack #

Total comments: 28

Patch Set 6 : Addressed feedback #

Patch Set 7 : Disabled the async signal test for glibc #

Total comments: 104

Patch Set 8 : Added SA_RESTART to sigaction and addressed feedback #

Patch Set 9 : Rebased change for trybots #

Total comments: 6

Patch Set 10 : Restored irt_exception_handling.h for clean DEPS roll #

Patch Set 11 : Added a test for FUTEX_WAIT with no timeout #

Total comments: 4

Patch Set 12 : Added a TODO to remove code after roll #

Unified diffs Side-by-side diffs Delta from patch set Stats (+911 lines, -360 lines) Patch
M SConstruct View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A documentation/nonsfi_mode_async_signals.txt View 1 2 3 4 5 6 7 8 9 1 chunk +55 lines, -0 lines 0 comments Download
M src/nonsfi/irt/irt.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/nonsfi/irt/irt_interfaces.c View 1 2 3 4 5 6 7 8 9 chunks +43 lines, -5 lines 0 comments Download
M src/nonsfi/linux/irt_exception_handling.c View 1 2 3 4 5 6 7 1 chunk +0 lines, -295 lines 0 comments Download
A src/nonsfi/linux/irt_signal_handling.h View 1 2 3 4 5 6 7 1 chunk +23 lines, -0 lines 0 comments Download
A + src/nonsfi/linux/irt_signal_handling.c View 1 2 3 4 5 6 7 8 9 10 8 chunks +255 lines, -37 lines 0 comments Download
M src/nonsfi/linux/linux_pthread_private.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M src/nonsfi/linux/linux_pthread_private.c View 1 2 3 4 5 6 7 4 chunks +23 lines, -6 lines 0 comments Download
M src/nonsfi/linux/linux_sys_private.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/nonsfi/linux/linux_sys_private.c View 1 2 3 4 5 6 7 8 5 chunks +9 lines, -5 lines 0 comments Download
M src/nonsfi/linux/linux_syscall_defines.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/nonsfi/linux/nacl.scons View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/public/linux_syscalls/sys/syscall.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
D src/public/nonsfi/irt_exception_handling.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -8 lines 0 comments Download
A src/public/nonsfi/irt_signal_handling.h View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
M src/untrusted/irt/irt.h View 1 2 3 4 5 6 7 8 3 chunks +72 lines, -0 lines 0 comments Download
M tests/nonsfi/nacl.scons View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 0 comments Download
A tests/nonsfi/user_async_signal_test.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +382 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (4 generated)
Luis Héctor Chávez
Please take a look. The implementation of _nonsfi_restore_context for ARM is not finished, though.
5 years, 6 months ago (2015-06-25 22:11:50 UTC) #2
Mark Seaborn
https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/irt/irt_interfaces.c File src/nonsfi/irt/irt_interfaces.c (right): https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/irt/irt_interfaces.c#newcode42 src/nonsfi/irt/irt_interfaces.c:42: #include "native_client/src/untrusted/pthread/pthread_types.h" Not used? irt_interfaces.c shouldn't depend on src/untrusted/pthread/ ...
5 years, 6 months ago (2015-06-26 18:32:00 UTC) #3
Junichi Uekawa
https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/linux/irt_signal_handling.c File src/nonsfi/linux/irt_signal_handling.c (right): https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/linux/irt_signal_handling.c#newcode119 src/nonsfi/linux/irt_signal_handling.c:119: _nonsfi_restore_context(const linux_mcontext_t *mctx) { this is not python code, ...
5 years, 5 months ago (2015-07-01 02:14:57 UTC) #5
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/irt/irt_interfaces.c File src/nonsfi/irt/irt_interfaces.c (right): https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/irt/irt_interfaces.c#newcode42 src/nonsfi/irt/irt_interfaces.c:42: #include "native_client/src/untrusted/pthread/pthread_types.h" On 2015/06/26 18:31:59, Mark Seaborn wrote: > ...
5 years, 5 months ago (2015-07-06 23:45:00 UTC) #6
Luis Héctor Chávez
All right, everything works reliably now and tests are passing. Please take a look.
5 years, 5 months ago (2015-07-10 19:15:11 UTC) #7
Luis Héctor Chávez
There is one spot in linux_clone_wrapper (linux_sys_private.c) where some elements in the stack above esp ...
5 years, 5 months ago (2015-07-13 18:14:56 UTC) #8
Mark Seaborn
On 13 July 2015 at 11:14, <lhchavez@chromium.org> wrote: > There is one spot in linux_clone_wrapper ...
5 years, 5 months ago (2015-07-13 18:42:27 UTC) #9
Luis Héctor Chávez
On 2015/07/13 18:42:27, Mark Seaborn wrote: > On 13 July 2015 at 11:14, <mailto:lhchavez@chromium.org> wrote: ...
5 years, 5 months ago (2015-07-13 20:43:36 UTC) #10
Mark Seaborn
On 13 July 2015 at 11:42, Mark Seaborn <mseaborn@chromium.org> wrote: > On 13 July 2015 ...
5 years, 5 months ago (2015-07-13 20:46:45 UTC) #11
Junichi Uekawa
Seem to me like the ARM bot has failed a test, did you take a ...
5 years, 5 months ago (2015-07-15 11:35:55 UTC) #12
Junichi Uekawa
On 2015/07/15 11:35:55, Junichi Uekawa wrote: > Seem to me like the ARM bot has ...
5 years, 5 months ago (2015-07-15 22:27:14 UTC) #13
Mark Seaborn
These comments are mostly just about code organisation... https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/linux/irt_exception_handling.c File src/nonsfi/linux/irt_exception_handling.c (left): https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/linux/irt_exception_handling.c#oldcode23 src/nonsfi/linux/irt_exception_handling.c:23: typedef ...
5 years, 5 months ago (2015-07-16 23:21:17 UTC) #14
Mark Seaborn
On 15 July 2015 at 13:49, Luis Hector Chavez <lhchavez@google.com> wrote: > Hi Mark, > ...
5 years, 5 months ago (2015-07-16 23:40:19 UTC) #15
native-client-reviews_googlegroups.com
Yes, please. I just want to make sure this is not breaking anything else. On ...
5 years, 5 months ago (2015-07-16 23:42:41 UTC) #16
Mark Seaborn
On 16 July 2015 at 16:42, Luis Hector Chavez <lhchavez@google.com> wrote: > Yes, please. I ...
5 years, 5 months ago (2015-07-20 16:52:48 UTC) #17
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/linux/irt_exception_handling.c File src/nonsfi/linux/irt_exception_handling.c (left): https://codereview.chromium.org/1212613002/diff/1/src/nonsfi/linux/irt_exception_handling.c#oldcode23 src/nonsfi/linux/irt_exception_handling.c:23: typedef struct compat_sigaltstack { On 2015/07/16 23:21:16, Mark Seaborn ...
5 years, 5 months ago (2015-07-20 18:13:47 UTC) #18
Luis Héctor Chávez
On 2015/07/15 22:27:14, Junichi Uekawa wrote: > On 2015/07/15 11:35:55, Junichi Uekawa wrote: > > ...
5 years, 5 months ago (2015-07-20 20:22:30 UTC) #19
Luis Héctor Chávez
Tests are passing, please take a look. The ARM bot did not fail at the ...
5 years, 5 months ago (2015-07-20 20:24:58 UTC) #20
Junichi Uekawa
https://codereview.chromium.org/1212613002/diff/120001/src/untrusted/irt/irt.h File src/untrusted/irt/irt.h (right): https://codereview.chromium.org/1212613002/diff/120001/src/untrusted/irt/irt.h#newcode253 src/untrusted/irt/irt.h:253: * |parent_tid| argument to the clone() system call. |child_tid| ...
5 years, 5 months ago (2015-07-21 23:36:03 UTC) #21
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/120001/src/untrusted/irt/irt.h File src/untrusted/irt/irt.h (right): https://codereview.chromium.org/1212613002/diff/120001/src/untrusted/irt/irt.h#newcode253 src/untrusted/irt/irt.h:253: * |parent_tid| argument to the clone() system call. |child_tid| ...
5 years, 5 months ago (2015-07-21 23:42:11 UTC) #22
Junichi Uekawa
On 2015/07/21 23:42:11, lhc wrote: > https://codereview.chromium.org/1212613002/diff/120001/src/untrusted/irt/irt.h > File src/untrusted/irt/irt.h (right): > > https://codereview.chromium.org/1212613002/diff/120001/src/untrusted/irt/irt.h#newcode253 > ...
5 years, 5 months ago (2015-07-22 01:30:28 UTC) #23
Luis Héctor Chávez
On 2015/07/20 20:24:58, lhc wrote: > Tests are passing, please take a look. The ARM ...
5 years, 4 months ago (2015-08-06 15:54:24 UTC) #24
Mark Seaborn
This is getting closer. The comments below are mostly minor, except for handling of SSE/FP ...
5 years, 4 months ago (2015-08-12 01:43:08 UTC) #25
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/120001/documentation/nonsfi_mode_async_signals.txt File documentation/nonsfi_mode_async_signals.txt (right): https://codereview.chromium.org/1212613002/diff/120001/documentation/nonsfi_mode_async_signals.txt#newcode6 documentation/nonsfi_mode_async_signals.txt:6: This provides a way to asynchronously send a notification ...
5 years, 4 months ago (2015-08-12 22:14:27 UTC) #26
Mark Seaborn
https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c File src/nonsfi/linux/irt_signal_handling.c (right): https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c#newcode212 src/nonsfi/linux/irt_signal_handling.c:212: "ldmia r14, {r0-r10}\n" On 2015/08/12 22:14:26, Luis Héctor Chávez ...
5 years, 4 months ago (2015-08-13 21:17:50 UTC) #27
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c File src/nonsfi/linux/irt_signal_handling.c (right): https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c#newcode212 src/nonsfi/linux/irt_signal_handling.c:212: "ldmia r14, {r0-r10}\n" On 2015/08/13 21:17:50, Mark Seaborn wrote: ...
5 years, 4 months ago (2015-08-13 22:48:13 UTC) #28
Mark Seaborn
https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c File src/nonsfi/linux/irt_signal_handling.c (right): https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c#newcode212 src/nonsfi/linux/irt_signal_handling.c:212: "ldmia r14, {r0-r10}\n" On 2015/08/13 22:48:12, Luis Héctor Chávez ...
5 years, 4 months ago (2015-08-17 23:55:56 UTC) #29
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c File src/nonsfi/linux/irt_signal_handling.c (right): https://codereview.chromium.org/1212613002/diff/120001/src/nonsfi/linux/irt_signal_handling.c#newcode212 src/nonsfi/linux/irt_signal_handling.c:212: "ldmia r14, {r0-r10}\n" On 2015/08/17 23:55:56, Mark Seaborn wrote: ...
5 years, 4 months ago (2015-08-18 02:53:31 UTC) #30
Mark Seaborn
The commit message refers to "src/nonsfi/linux/nonsfi_signal.h" which doesn't exist now -- can you update it, ...
5 years, 4 months ago (2015-08-18 20:35:47 UTC) #31
Luis Héctor Chávez
https://codereview.chromium.org/1212613002/diff/200001/src/nonsfi/irt/irt_interfaces.c File src/nonsfi/irt/irt_interfaces.c (right): https://codereview.chromium.org/1212613002/diff/200001/src/nonsfi/irt/irt_interfaces.c#newcode6 src/nonsfi/irt/irt_interfaces.c:6: On 2015/08/18 20:35:46, Mark Seaborn wrote: > Since you're ...
5 years, 4 months ago (2015-08-18 22:19:32 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1212613002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1212613002/220001
5 years, 4 months ago (2015-08-19 16:34:19 UTC) #35
commit-bot: I haz the power
Committed patchset #12 (id:220001) as https://chromium.googlesource.com/native_client/src/native_client/+/6a0ce065f481a3eb0bcd63ed62755d82d339c617
5 years, 4 months ago (2015-08-19 16:35:31 UTC) #36
Derek Schuff
On 2015/08/19 16:35:31, commit-bot: I haz the power wrote: > Committed patchset #12 (id:220001) as ...
5 years, 4 months ago (2015-08-19 20:47:00 UTC) #37
Luis Héctor Chávez
5 years, 4 months ago (2015-08-19 22:13:45 UTC) #38
Message was sent while issue was closed.
A revert of this CL (patchset #12 id:220001) has been created in
https://codereview.chromium.org/1300883003/ by lhchavez@chromium.org.

The reason for reverting is: test_async_safe_signal seems to be broken on x86_32
bots, but not reproducible on trybots or local machine..

Powered by Google App Engine
This is Rietveld 408576698