summaryrefslogtreecommitdiffstats
path: root/chrome/nacl
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-20 11:21:57 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-20 11:21:57 +0000
commit9b6edd72097092c5a90cc64f31a91bc2dcbed8c1 (patch)
treef9927b171d019443f4f95d2ccb6a431a274a5cd3 /chrome/nacl
parentac2d29d141977848b58499ea6c3de347e2cad121 (diff)
downloadchromium_src-9b6edd72097092c5a90cc64f31a91bc2dcbed8c1.zip
chromium_src-9b6edd72097092c5a90cc64f31a91bc2dcbed8c1.tar.gz
chromium_src-9b6edd72097092c5a90cc64f31a91bc2dcbed8c1.tar.bz2
Redefine the ASan options for nacl_helper so that ASan does not handle SIGSEGV/SIGBUS
This should allow the platform qualification test to pass and make it possible to launch NaCl programs from an instrumented browser without additional env settings. Review URL: https://chromiumcodereview.appspot.com/10830009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r--chrome/nacl/nacl_helper_linux.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/nacl/nacl_helper_linux.cc b/chrome/nacl/nacl_helper_linux.cc
index 478527f..e102ed0 100644
--- a/chrome/nacl/nacl_helper_linux.cc
+++ b/chrome/nacl/nacl_helper_linux.cc
@@ -198,6 +198,21 @@ static size_t CheckReservedAtZero() {
return prereserved_sandbox_size;
}
+#if defined(ADDRESS_SANITIZER)
+// Do not install the SIGSEGV handler in ASan. This should make the NaCl
+// platform qualification test pass.
+static const char kAsanDefaultOptionsNaCl[] = "handle_segv=0";
+
+// Override the default ASan options for the NaCl helper.
+// __asan_default_options should not be instrumented, because it is called
+// before ASan is initialized.
+extern "C"
+__attribute__((no_address_safety_analysis))
+const char *__asan_default_options() {
+ return kAsanDefaultOptionsNaCl;
+}
+#endif
+
int main(int argc, char *argv[]) {
CommandLine::Init(argc, argv);
base::AtExitManager exit_manager;