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

Side by Side Diff: src/native_client/src/trusted/service_runtime/sel_main_chrome.c

Issue 6798008: Add an assertion to check that Chrome/Breakpad does not install a signal handler (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Use %d; amend Windows comment Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include "native_client/src/include/portability.h" 7 #include "native_client/src/include/portability.h"
8 #include "native_client/src/include/portability_io.h" 8 #include "native_client/src/include/portability_io.h"
9 9
10 #if NACL_OSX 10 #if NACL_OSX
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 * We enable the signal handler to verify properties of the platform such 98 * We enable the signal handler to verify properties of the platform such
99 * as the ability to trap a page on execute. 99 * as the ability to trap a page on execute.
100 */ 100 */
101 NaClSignalHandlerInit(); 101 NaClSignalHandlerInit();
102 errcode = NaClRunSelQualificationTests(); 102 errcode = NaClRunSelQualificationTests();
103 if (LOAD_OK != errcode) { 103 if (LOAD_OK != errcode) {
104 nap->module_load_status = errcode; 104 nap->module_load_status = errcode;
105 fprintf(stderr, "Error while loading in SelMain: %s\n", 105 fprintf(stderr, "Error while loading in SelMain: %s\n",
106 NaClErrorString(errcode)); 106 NaClErrorString(errcode));
107 } 107 }
108 /* Remove the handler that was used for platform qualification tests. */
109 NaClSignalHandlerFini();
108 110
109 /* 111 /*
110 * Remove the handler and let error pass to Chrome's handlers. 112 * Check that Chrome did not register any signal handlers, because
113 * these are not always safe.
111 */ 114 */
112 NaClSignalHandlerFini(); 115 NaClSignalAssertNoHandlers();
113
114 116
115 /* Give debuggers a well known point at which xlate_base is known. */ 117 /* Give debuggers a well known point at which xlate_base is known. */
116 NaClGdbHook(&state); 118 NaClGdbHook(&state);
117 119
118 /* 120 /*
119 * If export_addr_to is set to a non-negative integer, we create a 121 * If export_addr_to is set to a non-negative integer, we create a
120 * bound socket and socket address pair and bind the former to 122 * bound socket and socket address pair and bind the former to
121 * descriptor 3 and the latter to descriptor 4. The socket address 123 * descriptor 3 and the latter to descriptor 4. The socket address
122 * is written out to the export_addr_to descriptor. 124 * is written out to the export_addr_to descriptor.
123 * 125 *
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 */ 194 */
193 return ret_code; 195 return ret_code;
194 196
195 done: 197 done:
196 fflush(stdout); 198 fflush(stdout);
197 199
198 NaClAllModulesFini(); 200 NaClAllModulesFini();
199 201
200 return ret_code; 202 return ret_code;
201 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698