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

Side by Side Diff: src/trusted/service_runtime/nacl_error_log_hook.c

Issue 997683002: Exit cleanly for the SRPC "log" requests instead of generating crash reports. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: run the hook just in case Created 5 years, 9 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
« no previous file with comments | « src/shared/platform/nacl_log.c ('k') | src/trusted/service_runtime/nacl_secure_service.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 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 <stdio.h> 7 #include <stdio.h>
8 8
9 #include "native_client/src/include/nacl_macros.h" 9 #include "native_client/src/include/nacl_macros.h"
10 #include "native_client/src/shared/platform/nacl_exit.h" 10 #include "native_client/src/shared/platform/nacl_exit.h"
(...skipping 16 matching lines...) Expand all
27 /* 27 /*
28 * Copy the last NACL_ERROR_GIO_MAX_BYTES of log output to the 28 * Copy the last NACL_ERROR_GIO_MAX_BYTES of log output to the
29 * calling thread's stack, so that breakpad will pick it up. 29 * calling thread's stack, so that breakpad will pick it up.
30 */ 30 */
31 log_data_bytes = NaClErrorGioGetOutput(&g_NaCl_log_gio, 31 log_data_bytes = NaClErrorGioGetOutput(&g_NaCl_log_gio,
32 log_data, 32 log_data,
33 NACL_ARRAY_SIZE(log_data)); 33 NACL_ARRAY_SIZE(log_data));
34 (*g_NaCl_log_abort_fn)(g_NaCl_log_abort_state, 34 (*g_NaCl_log_abort_fn)(g_NaCl_log_abort_state,
35 log_data, log_data_bytes); 35 log_data, log_data_bytes);
36 } 36 }
37 NaClAbort();
38 } 37 }
39 38
40 void NaClErrorLogHookInit(void (*hook)(void *state, 39 void NaClErrorLogHookInit(void (*hook)(void *state,
41 char *buf, 40 char *buf,
42 size_t buf_bytes), 41 size_t buf_bytes),
43 void *state) { 42 void *state) {
44 NaClLog(2, "NaClErrorLogHookInit: entered\n"); 43 NaClLog(2, "NaClErrorLogHookInit: entered\n");
45 if (!NaClErrorGioCtor(&g_NaCl_log_gio, NaClLogGetGio())) { 44 if (!NaClErrorGioCtor(&g_NaCl_log_gio, NaClLogGetGio())) {
46 fprintf(stderr, "sel_main_chrome: log reporting setup failed\n"); 45 fprintf(stderr, "sel_main_chrome: log reporting setup failed\n");
47 NaClAbort(); 46 NaClAbort();
48 } 47 }
49 48
50 g_NaCl_log_abort_fn = hook; 49 g_NaCl_log_abort_fn = hook;
51 g_NaCl_log_abort_state = state; 50 g_NaCl_log_abort_state = state;
52 51
53 NaClLogSetGio((struct Gio *) &g_NaCl_log_gio); 52 NaClLogSetGio((struct Gio *) &g_NaCl_log_gio);
54 53
55 NaClLogSetAbortBehavior(NaClReportLogMessages); 54 NaClLogSetAbortBehavior(NaClReportLogMessages);
56 } 55 }
OLDNEW
« no previous file with comments | « src/shared/platform/nacl_log.c ('k') | src/trusted/service_runtime/nacl_secure_service.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698