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

Side by Side Diff: content/zygote/zygote_main_linux.cc

Issue 317503002: AsanCoverage: make the filenames of zygote/gpu coverage files more unique. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« content/gpu/gpu_main.cc ('K') | « content/gpu/gpu_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/zygote/zygote_main.h" 5 #include "content/zygote/zygote_main.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <pthread.h> 9 #include <pthread.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 bool ZygoteMain(const MainFunctionParams& params, 489 bool ZygoteMain(const MainFunctionParams& params,
490 ScopedVector<ZygoteForkDelegate> fork_delegates) { 490 ScopedVector<ZygoteForkDelegate> fork_delegates) {
491 g_am_zygote_or_renderer = true; 491 g_am_zygote_or_renderer = true;
492 sandbox::InitLibcUrandomOverrides(); 492 sandbox::InitLibcUrandomOverrides();
493 493
494 base::Closure *post_fork_parent_callback = NULL; 494 base::Closure *post_fork_parent_callback = NULL;
495 495
496 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance(); 496 LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance();
497 497
498 #if defined(ADDRESS_SANITIZER) 498 #if defined(ADDRESS_SANITIZER)
499 base::ScopedFD sancov_file_fd(__sanitizer_maybe_open_cov_file("zygote")); 499 std::stringstream ss;
jln (very slow on Chromium) 2014/06/03 21:43:40 please do: const std::string sancov_file_name = "
earthdok 2014/06/03 21:49:27 Done.
500 ss << "zygote." << base::RandUint64();
501 std::string sancov_file_name = ss.str();
502 base::ScopedFD sancov_file_fd(
503 __sanitizer_maybe_open_cov_file(sancov_file_name.c_str()));
500 int sancov_socket_fds[2] = {-1, -1}; 504 int sancov_socket_fds[2] = {-1, -1};
501 CreateSanitizerCoverageSocketPair(sancov_socket_fds); 505 CreateSanitizerCoverageSocketPair(sancov_socket_fds);
502 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1; 506 linux_sandbox->sanitizer_args()->coverage_sandboxed = 1;
503 linux_sandbox->sanitizer_args()->coverage_fd = sancov_socket_fds[1]; 507 linux_sandbox->sanitizer_args()->coverage_fd = sancov_socket_fds[1];
504 linux_sandbox->sanitizer_args()->coverage_max_block_size = 508 linux_sandbox->sanitizer_args()->coverage_max_block_size =
505 kSanitizerMaxMessageLength; 509 kSanitizerMaxMessageLength;
506 // Zygote termination will block until the helper process exits, which will 510 // Zygote termination will block until the helper process exits, which will
507 // not happen until the write end of the socket is closed everywhere. Make 511 // not happen until the write end of the socket is closed everywhere. Make
508 // sure the init process does not hold on to it. 512 // sure the init process does not hold on to it.
509 base::Closure close_sancov_socket_fds = 513 base::Closure close_sancov_socket_fds =
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID; 563 bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID;
560 CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged); 564 CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged);
561 565
562 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, 566 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children,
563 extra_fds); 567 extra_fds);
564 // This function call can return multiple times, once per fork(). 568 // This function call can return multiple times, once per fork().
565 return zygote.ProcessRequests(); 569 return zygote.ProcessRequests();
566 } 570 }
567 571
568 } // namespace content 572 } // namespace content
OLDNEW
« content/gpu/gpu_main.cc ('K') | « content/gpu/gpu_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698