summaryrefslogtreecommitdiffstats
path: root/base/process_util_posix.cc
Commit message (Collapse)AuthorAgeFilesLines
* Revert 168239 - Extract SIGPIPE ignoring code to a common place.dmichael@google.com2012-11-161-9/+0
| | | | | | | | | | | | | | | | | | | Failed compile on Linux Clang: http://build.chromium.org/p/chromium.linux/builders/Linux%20Clang%20%28dbg%29/builds/35971/steps/compile/logs/stdio ../../chrome/test/webdriver/webdriver_server.cc:230:8:error: use of undeclared identifier 'IgnoreSigPipe'; did you mean 'base::IgnoreSigPipe'? if (!IgnoreSigPipe()) { ^~~~~~~~~~~~~ base::IgnoreSigPipe ../../base/process_util.h:153:18: note: 'base::IgnoreSigPipe' declared here BUG=none Review URL: https://codereview.chromium.org/11280010 TBR=phajdan.jr@chromium.org Review URL: https://codereview.chromium.org/11308073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168248 0039d316-1c4b-4281-b951-d872f2087c98
* Extract SIGPIPE ignoring code to a common place.phajdan.jr@chromium.org2012-11-161-0/+9
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/11280010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168239 0039d316-1c4b-4281-b951-d872f2087c98
* Move eintr_wrapper.h from base to base/posixbrettw@chromium.org2012-11-141-1/+1
| | | | | | Review URL: https://codereview.chromium.org/11366229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167739 0039d316-1c4b-4281-b951-d872f2087c98
* Move EnableInProcessStackDumping to base/debugphajdan.jr@chromium.org2012-11-011-83/+1
| | | | | | | | | | | | | | This is a preparation to fix async-signal unsafety of the stack dumping signal handler, and I'd like to share code between the handler and stack trace code that wouldn't be useful outside those two. BUG=101155 TEST=if it compiles, it is perfect Review URL: https://codereview.chromium.org/11293021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165514 0039d316-1c4b-4281-b951-d872f2087c98
* Band-aid fix for test hangs:phajdan.jr@chromium.org2012-10-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What happens is after I enabled tcmalloc's debugallocation in http://code.google.com/p/chromium/issues/detail?id=30715 cc_unittests started hanging in StackDumpSignalHandler, triggered by SIGSEGV triggered by: @0 0x00000000019c6c85 in tcmalloc::Abort () at third_party/tcmalloc/chromium/src/base/abort.cc:15 @1 0x00000000019b39c1 in LogPrintf (severity=-4, pat=0x32aeb18 "memory allocation/deallocation mismatch at %p: allocated with %s being deallocated with %s", ap=0x7fff52c379e8) at third_party/tcmalloc/chromium/src/base/logging.h:210 @2 0x00000000019b3a8b in RAW_LOG (lvl=-4, pat=0x32aeb18 "memory allocation/deallocation mismatch at %p: allocated with %s being deallocated with %s") at third_party/tcmalloc/chromium/src/base/logging.h:230 @3 0x00000000019c3fb1 in MallocBlock::CheckLocked (this=0x7fd18f143400, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:461 @4 0x00000000019c3c42 in MallocBlock::CheckAndClear (this=0x7fd18f143400, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:401 @5 0x00000000019c436a in MallocBlock::Deallocate (this=0x7fd18f143400, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:557 @6 0x00000000019c1929 in DebugDeallocate (ptr=0x7fd18f143420, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:998 @7 0x00000000028d1482 in tc_delete (p=0x7fd18f143420) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:1232 @8 0x000000000097dc04 in cc::ResourceProvider::deleteResourceInternal (this=0x7fd191827da0, it=...) at cc/resource_provider.cc:242 @9 0x000000000097daaf in cc::ResourceProvider::deleteResource (this=0x7fd191827da0, id=1) at cc/resource_provider.cc:230 @10 0x00000000006f9824 in (anonymous namespace)::ResourceProviderTest_Basic_Test::TestBody (this=0x7fd18dc5abf0) at cc/resource_provider_unittest.cc:328 @11 0x00000000008ec801 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x7fd18dc5abf0, method=&virtual testing::Test::TestBody(), location=0x29463ab "the test body") at testing/gtest/src/gtest.cc:2071 @12 0x00000000008e9665 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x7fd18dc5abf0, method=&virtual testing::Test::TestBody(), location=0x29463ab "the test body") at testing/gtest/src/gtest.cc:2123 @13 0x00000000008dee0d in testing::Test::Run (this=0x7fd18dc5abf0) at testing/gtest/src/gtest.cc:2143 @14 0x00000000008df3ea in testing::TestInfo::Run (this=0x7fd191823020) at testing/gtest/src/gtest.cc:2319 @15 0x00000000008df8dc in testing::TestCase::Run (this=0x7fd19181f0d0) at testing/gtest/src/gtest.cc:2426 @16 0x00000000008e3eea in testing::internal::UnitTestImpl::RunAllTests (this=0x7fd19829dd60) at testing/gtest/src/gtest.cc:4249 The hang is triggered by calling backtrace() in the signal handler. The problem reported by tcmalloc is "memory allocation/deallocation mismatch at 0xa3af520: allocated with new [] being deallocated with delete". BUG=30715, 101155 TEST=none Review URL: https://codereview.chromium.org/11340054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165067 0039d316-1c4b-4281-b951-d872f2087c98
* Type profiler by intercepting 'new' and 'delete' expressions.dmikurube@chromium.org2012-09-261-0/+11
| | | | | | | | | | | | | | | | | | | | It stores mapping between object's starting addresses and their allocated types when a build option 'clang_type_profiler=1' is specified. It enables information like "an object at 0x37f3c88 is an instance of std::string." Nothing is changed when the option is not specified. It depends on a modified version of the LLVM/Clang compiler introduced at deps/third_party/llvm-allocated-type. BUG=123758 TEST=build with clang_type_profiler=1 and run type_profiler_unittests and type_profiler_map_unittests manually. Review URL: https://chromiumcodereview.appspot.com/10411047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158752 0039d316-1c4b-4281-b951-d872f2087c98
* base: Fix minor warnings reported by cppcheck.tfarina@chromium.org2012-08-061-4/+3
| | | | | | | | | | | | | | Found with: $ cppcheck --enable=all -j4 --force base 2> base-errors R=jar@chromium.org NOTRY=True Review URL: https://chromiumcodereview.appspot.com/10827112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150059 0039d316-1c4b-4281-b951-d872f2087c98
* Fix CleanupProcesses() interface to use TimeDelta.tedvessenes@gmail.com2012-07-311-6/+2
| | | | | | | | | BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10821062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149312 0039d316-1c4b-4281-b951-d872f2087c98
* base: Add missing "virtual" keyword and OVERRIDE to some methods.tfarina@chromium.org2012-07-311-1/+2
| | | | | | | | | | | | | | | Found with: $ ./build/gyp_chromium -Dclang=1 -Dclang_use_chrome_plugins=1 $ ninja -C out/Debug base -k4 -j4 2>&1 | tee errors And a tweak in plugin_flags.sh BUG=115047 R=willchan@chromium.org Review URL: https://chromiumcodereview.appspot.com/10834060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149109 0039d316-1c4b-4281-b951-d872f2087c98
* Remove old test timeout and process waiting function interfaces.tedvessenes@gmail.com2012-07-261-22/+4
| | | | | | | | | BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10808069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148656 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to TimeDelta interface for process waiting functions in base.tedvessenes@gmail.com2012-07-111-2/+4
| | | | | | | | | | R=jar@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10694131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146211 0039d316-1c4b-4281-b951-d872f2087c98
* Add TimeDelta interfaces for WaitForExitCodeWithTimeout() functions.tedvessenes@gmail.com2012-07-081-0/+12
| | | | | | | | | | | | | Adding these interfaces will help update code that uses TestTimeouts::foo_timeout_ms() to use TestTimeouts::foo_timeout() instead. Old interfaces can get removed with the TestTimeouts code. R=jar@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10695117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145640 0039d316-1c4b-4281-b951-d872f2087c98
* Move dir_reader to base/filesbrettw@chromium.org2012-06-291-1/+1
| | | | | | | | | TEST=it compiles BUG=none Review URL: https://chromiumcodereview.appspot.com/10413022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144989 0039d316-1c4b-4281-b951-d872f2087c98
* [cros] Fix udevadm command line for camera presence detection.ivankr@chromium.org2012-04-261-14/+17
| | | | | | | | | | | | Also added an overload of GetAppOutput which takes argv directly instead of CommandLine for launching programs where specific order of argument matters (like udevadm). BUG=124845 TEST=Manual Review URL: http://codereview.chromium.org/10191019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134149 0039d316-1c4b-4281-b951-d872f2087c98
* Add #include <iterator> to files that use std::back_inserter.halyavin@google.com2012-04-051-0/+1
| | | | | | | | | | | See http://code.google.com/p/chromium/source/search?q=back_inserter+-%23include%5C+%5C%3Citerator%5C%3E&origq=back_inserter+-%23include%5C+%5C%3Citerator%5C%3E&btnG=Search+Trunk BUG= none TEST= none Review URL: http://codereview.chromium.org/9958156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130893 0039d316-1c4b-4281-b951-d872f2087c98
* Add additional base::TimeDelta interface for WaitForChildProcess()tedvessenes@gmail.com2012-03-311-9/+16
| | | | | | | | | | | | | It turns out this function also wants a conversion, as it simplifies a bunch of interfaces used by TestTimeouts. R=jar@chromium.org BUG=108171 Review URL: http://codereview.chromium.org/9791052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130063 0039d316-1c4b-4281-b951-d872f2087c98
* Initialize sigaction.sa_restorertbreisacher@chromium.org2012-03-301-1/+1
| | | | | | | | | | CID=102008 BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9863052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129969 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove base::environment_vector and ↵thestig@chromium.org2012-02-241-6/+7
| | | | | | | | | | | base::file_handle_mapping_vector to StudlyCaps. BUG=none TEST=none Review URL: http://codereview.chromium.org/9429039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123438 0039d316-1c4b-4281-b951-d872f2087c98
* [ChromeOS] Add option to set controlling terminal when launching process.tbarzic@chromium.org2012-01-211-1/+19
| | | | | | | | | | | | | This is needed to expose crosh process to hterm (if pseudo terminal used for communication between terminalPrivateApi and crosh process is not controlling, job control in the crosh process won't work, and it won't be able to e.g. process signals). TEST=None BUG=chromium-os:23273 Review URL: https://chromiumcodereview.appspot.com/9176013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118585 0039d316-1c4b-4281-b951-d872f2087c98
* Change code in base (primarily unit tests) to use Sleep(TimeDelta).tedvessenes@gmail.com2011-12-311-3/+2
| | | | | | | | | | BUG=108171 TEST= Review URL: http://codereview.chromium.org/9055001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116065 0039d316-1c4b-4281-b951-d872f2087c98
* use os_bsd and OS_BSD and add some OS_FREEBSD conditionsrobert.nagy@gmail.com2011-12-041-0/+5
| | | | | | | | | | | | this change is the first part of the FreeBSD support BUG= TEST= Review URL: http://codereview.chromium.org/8773051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112936 0039d316-1c4b-4281-b951-d872f2087c98
* Move the ProcessWatcher methods out of content/common/process_watcher into ↵jam@chromium.org2011-11-231-0/+97
| | | | | | | | | | | base/process_util, alongside the other process methods. The only non-trivial move change is to the Windows implementation, where I changed KillProcess to use an exit code of kProcessKilledExitCode instead of content::RESULT_CODE_HUNG. cpu said that the existing code was incorrect, since GetTerminationStatus() should be mapping that result to TERMINATION_STATUS_PROCESS_WAS_KILLED. So I changed the exit code to kProcessKilledExitCode. This might make the UMA stats for killed processes to go up (and crashed to go down), but that will be an accounting change and should be zero-sum. BUG=98716 Review URL: http://codereview.chromium.org/8674003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111371 0039d316-1c4b-4281-b951-d872f2087c98
* Maximize RLIMIT_AS resource limit in nacl_helper child before execmcgrathr@chromium.org2011-11-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | NaCl processes need an unusually large amount of address space, because they do huge PROT_NONE mappings to reserve contiguous regions much larger than the memory that will actually be used. An ambient RLIMIT_AS setting can break this, so we need to raise the soft limit to the hard limit (which is usually unlimited). We cannot rely on doing this inside the nacl_helper child itself, so we must do it in the zygote before it exec's nacl_helper_bootstrap. That exec itself could fail if the limit is too small, because nacl_helper_bootstrap uses ELF program headers to reserve a large region of address space. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2438 TEST= nacl apps work when "ulimit -S -v 5376320" was run before starting chrome R=mark@chromium.org,bsy@google.com,bradchen@google.com Review URL: http://codereview.chromium.org/8528041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110123 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-261-16/+16
| | | | | | | | | | | [ Reland of 107042 http://codereview.chromium.org/8368009 ] I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8341026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107434 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 107042 - Replace most LOG/CHECK statements with DLOG/DCHECK ↵brettw@chromium.org2011-10-251-16/+16
| | | | | | | | | | | | | | statements in base. I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8351025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107051 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-251-16/+16
| | | | | | | | | I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107042 0039d316-1c4b-4281-b951-d872f2087c98
* Synchronize the parent and child processes during launch, ensuring that themark@chromium.org2011-09-011-13/+112
| | | | | | | | | | | | | | | | | | | | | child doesn't try to check in with the Mach broker before the parent is ready. This resolves a race between the browser and its child processes. base::LaunchOptions gets a new member, synchronize, currently Mac-only although there's nothing Mac-specific about the implementation. When set, it allows base::LaunchProcess clients to request that the child process block until released by the new base::LaunchSynchronize call. When creating child processes, the child process launcher now requests this new synchronization behavior to give it a chance to set up the Mach broker to expect the child before the child tries to check in with it. BUG=94295 TEST=Chrome should work. You see fewer of this logged: Unknown process (pid) is sending Mach IPC messages! But you still might see some of these due to bug 94543. Review URL: http://codereview.chromium.org/7740036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99245 0039d316-1c4b-4281-b951-d872f2087c98
* Dump a stack trace when browser tests time out.mihaip@chromium.org2011-08-231-2/+3
| | | | | | | | | | | | To make browser test timeouts easier to debug, install a SIGTERM handler that dumps a stack trace (SIGTERM is sent by out_of_proc_test_runner.cc:RunTest via base::KillProcess). R=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/7696015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97835 0039d316-1c4b-4281-b951-d872f2087c98
* Fix WaitForSingleNonChildProcess. There were three bugs in the loop usage.mark@chromium.org2011-08-221-38/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | There was a bug in the original code in that if the loop executes a second time, kq will have been closed. The existing code was not careful about resetting the timeout in the event that the kevent had to be restarted in the loop. The existing code would continue adding the same "change" to the kqueue on each iteration of the loop. The replacement code has been taken mostly from content/common/process_watcher_mac.cc WaitForChildToDie. I would actually like to align these two functions to use the same backend implementation, but that will require better signalling from the backend about which specific case is causing it to return, because WaitForChildToDie needs to be able to reap or kill-and-reap the process while avoiding the "zombie kernel death race" explained in that function's comments. Since WaitForSingleNonChildProcess is currently only concerned with non-child processes, it doesn't need to worry about any of this reaping business. BUG=none TEST=none Review URL: http://codereview.chromium.org/7708006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97769 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Implement base::EnableTerminationOnHeapCorruption() by overriding ↵rsesek@chromium.org2011-08-181-4/+0
| | | | | | | | | | | | | | | | | malloc_error_break(). This makes malloc_error_break() fatal for all processes in an attempt to get better stack traces when heap corruption may occur. BUG=90884,91068,93191 TEST=See bug 93191 for repro steps. A crash report gets generated with a hopefully more-useful stack. Originally landed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97315 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=97322 Review URL: http://codereview.chromium.org/7670025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97351 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "[Mac] Implement base::EnableTerminationOnHeapCorruption() by ↵rsesek@chromium.org2011-08-181-0/+4
| | | | | | | | | | | | | | overriding malloc_error_break" This reverts commits r97315 and r97319. BUG=none TEST=none TBR=mark Review URL: http://codereview.chromium.org/7631046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97322 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Implement base::EnableTerminationOnHeapCorruption() by overriding ↵rsesek@chromium.org2011-08-181-4/+0
| | | | | | | | | | | | | | malloc_error_break(). This makes malloc_error_break() fatal for all processes in an attempt to get better stack traces when heap corruption may occur. BUG=90884,91068,93191 TEST=See bug 93191 for repro steps. A crash report gets generated with a hopefully more-useful stack. Review URL: http://codereview.chromium.org/7670025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97315 0039d316-1c4b-4281-b951-d872f2087c98
* Update references to the now-gone LaunchApp() from the code.evan@chromium.org2011-07-191-1/+1
| | | | | | | | BUG=88990 Review URL: http://codereview.chromium.org/7423003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93035 0039d316-1c4b-4281-b951-d872f2087c98
* Add a "clone" option to base/process_util.h:LaunchProcess(). Useful inside ↵bradchen@google.com2011-07-151-1/+10
| | | | | | | | | | | | Linux sandbox. BUG=nativeclient:480 TEST=base/process_util_unittest.cc Review URL: http://codereview.chromium.org/7401002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92771 0039d316-1c4b-4281-b951-d872f2087c98
* Change base::LaunchProcess API slightlyevan@chromium.org2011-07-151-5/+7
| | | | | | | | | | | Rather than passing the out param process handle via the options, take it as a function argument. This simplifies many callers. BUG=88990 Review URL: http://codereview.chromium.org/7377012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92701 0039d316-1c4b-4281-b951-d872f2087c98
* Added ability to run a command, getting output and exit status on POSIX.benwells@chromium.org2011-07-061-22/+61
| | | | | | | | | | | | | | | Register protocol handler needs to check the return value of scripts it runs and collects output from. There needs a variant of GetAppOutput which returns the exit code of the application run, not just a success or failure, so this function has been added. BUG=83557 TEST=Unit test added Review URL: http://codereview.chromium.org/7198034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91527 0039d316-1c4b-4281-b951-d872f2087c98
* base: refactor LaunchApp variants into a single functionevan@chromium.org2011-06-301-52/+25
| | | | | | | | | | | | | | | base provides a bunch of process-spawning functions that only differ by one or two arguments; worse, they're all backed by the same implementation anyway. Unify all the functions into one LaunchProcess() function, which takes a struct containing a bunch of optional arguments. For this change, I'm trying to not change the base API. Follow up changes can fix callers. Because of this, I made temporary shims for all of the old API. Review URL: http://codereview.chromium.org/7283019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91220 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use a macro for getting at the process environment.evan@chromium.org2011-06-301-3/+23
| | | | | | | | | I had a struct field named "environ" that was mysteriously not working on OS X until I noticed this code. Review URL: http://codereview.chromium.org/7278004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91184 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream process and thread related code.michaelbai@google.com2011-06-291-1/+10
| | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/7247015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91009 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 90805 - I am submitting this with LGTMs from agl@ and evanm@. I'm ↵fischman@chromium.org2011-06-281-32/+5
| | | | | | | | | | | | | | | | | | | | | | | marking this as TBR=jam@ because he is on vacation. He previously LGTMed the reverted CL (link below) and there are not substantive changes since then. Modify the Chrome Linux zygote to support a nacl_helper executable, facilitating a special address-space layout as required by NaCl on ARM and ATOM CPUs. In passing, simplify some shared elements of launching NaCl modules in Chrome. This is an update to a previously reverted CL. Please see http://codereview.chromium.org/6995121 for the earlier reviews. Patching nacl_helper CL into fresh branch. BUG=nativeclient:480 TEST=nativeclient in-browser tests TBR=jam@chromium.org TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7230057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90813 0039d316-1c4b-4281-b951-d872f2087c98
* I am submitting this with LGTMs from agl@ and evanm@. I'm marking this as ↵bradchen@google.com2011-06-281-5/+32
| | | | | | | | | | | | | | | | | | | | TBR=jam@ because he is on vacation. He previously LGTMed the reverted CL (link below) and there are not substantive changes since then. Modify the Chrome Linux zygote to support a nacl_helper executable, facilitating a special address-space layout as required by NaCl on ARM and ATOM CPUs. In passing, simplify some shared elements of launching NaCl modules in Chrome. This is an update to a previously reverted CL. Please see http://codereview.chromium.org/6995121 for the earlier reviews. Patching nacl_helper CL into fresh branch. BUG=nativeclient:480 TEST=nativeclient in-browser tests TBR=jam@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90805 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 90681 - New NaCl zygote implementation 2, in which Chrome zygote ↵fischman@chromium.org2011-06-281-31/+4
| | | | | | | | | | | | | | | | forks a NaCl helper. This patch can launch earth_c.html with and without the SUID sandbox. It is enabled with the environment variable NACL_NEW_ZYGOTE. BUG=nativeclient:480 TEST=nativeclient in-browser tests on Linux, ChromeOS Review URL: http://codereview.chromium.org/6995121 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7274011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90682 0039d316-1c4b-4281-b951-d872f2087c98
* New NaCl zygote implementation 2, in which Chrome zygote forks a NaCl helper.bradchen@google.com2011-06-271-4/+31
| | | | | | | | | | | This patch can launch earth_c.html with and without the SUID sandbox. It is enabled with the environment variable NACL_NEW_ZYGOTE. BUG=nativeclient:480 TEST=nativeclient in-browser tests on Linux, ChromeOS Review URL: http://codereview.chromium.org/6995121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90681 0039d316-1c4b-4281-b951-d872f2087c98
* Increase the KillProcess timeout when running under Valgrindtimurrrr@chromium.org2011-06-181-0/+8
| | | | | | | BUG=17453 Review URL: http://codereview.chromium.org/7204002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89593 0039d316-1c4b-4281-b951-d872f2087c98
* Break into the debugger if we have a stack dump and are currently debugging.scr@chromium.org2011-06-111-0/+4
| | | | | | | | | | | | While debugging browser tests, I noticed a few stackdumps fly by without catching them. This code snippet breaks into the debugger only when it's being debugged. BUG=None TEST=kill -ABRT your process while debugging and see if you catch in the debugger. Review URL: http://codereview.chromium.org/7003049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88750 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Fix a few cases of very likely broken code between fork() and exec()phajdan.jr@chromium.org2011-04-081-21/+28
| | | | | | | | | | | | | | | | | | I took another look at http://crbug.com/60426, and decided to also review the LaunchApp code in process_util. It turns out that the child code after fork() contained things like "return false", rather not what was intended (I replaced it with _exit(127)). There are some other cases where we possibly retained some signal handlers. The new code also resets them to defaults. I don't expect it to fix the referenced bug, but those "obvious" problems can only make it worse. BUG=60426 Review URL: http://codereview.chromium.org/6801047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80927 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Detect browser crashes on shutdown in UI tests. phajdan.jr@chromium.org2011-04-061-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the automation framework could miss a browser crash during shutdown on POSIX (on Windows there is crash_service.exe that should catch all crashes). This change makes the automation framework avoid losing information about the browser process' exit status (CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout (which on POSIX never reported the process has been signaled). Finally, it makes the automation framework use WaitForExitCodeWithTimeout instead of WaitForSingleProcess. This way we can get the exit status information in an accurate and cross-platform way. To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them. I've tested this change locally on Mac with a UI test that SIGKILLs the browser. Before this change the test passed (it shouldn't), and after this change the test failed with an information that the browser has not exited cleanly. BUG=56644 Review URL: http://codereview.chromium.org/6689014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80608 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 80472 - GTTF: Detect browser crashes on shutdown in UI ↵phajdan.jr@chromium.org2011-04-051-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tests.Previously the automation framework could miss a browsercrash during shutdown on POSIX (on Windows there iscrash_service.exe that should catch all crashes).This change makes the automation framework avoid losinginformation about the browser process' exit status(CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout(which on POSIX never reported the process has been signaled).Finally, it makes the automation framework use WaitForExitCodeWithTimeoutinstead of WaitForSingleProcess. This way we can get the exit statusinformation in an accurate and cross-platform way.To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them.I've tested this change locally on Mac with a UI test that SIGKILLs the browser.Before this change the test passed (it shouldn't), and after this changethe test failed with an information that the browser has not exited cleanly.BUG=56644Review URL: http://codereview.chromium.org/6689014 TBR=phajdan.jr@chromium.org [----------] 1 test from MultipartResponseUITest [ RUN ] MultipartResponseUITest.SingleVisit [3538:3538:0405/104633:11326126024137:ERROR:process_util_posix.cc(108)] Received signal 11 base::debug::StackTrace::StackTrace() [0xcd194a] base::(anonymous namespace)::StackDumpSignalHandler() [0xcb0e5a] 0x2b835e391100 AutomationProxy::GetBrowserWindowCount() [0x2055e86] ProxyLauncher::IsBrowserRunning() [0xc3f1a2] ProxyLauncher::QuitBrowser() [0xc454b3] ProxyLauncher::CloseBrowserAndServer() [0xc472d6] UITestBase::TearDown() [0xc50d54] UITest::TearDown() [0xc51260] testing::TestInfo::Run() [0xe8de78] testing::TestCase::Run() [0xe8df35] testing::internal::UnitTestImpl::RunAllTests() [0xe8f6e7] testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0xe804d5] testing::internal::HandleExceptionsInMethodIfSupported<>() [0xe8ba92] testing::UnitTest::Run() [0xe8badb] base::TestSuite::Run() [0x212c26d] main [0xc48e41] 0x2b835e37d1c4 0x42fec9 Review URL: http://codereview.chromium.org/6794056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80488 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Detect browser crashes on shutdown in UI tests.phajdan.jr@chromium.org2011-04-051-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the automation framework could miss a browser crash during shutdown on POSIX (on Windows there is crash_service.exe that should catch all crashes). This change makes the automation framework avoid losing information about the browser process' exit status (CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout (which on POSIX never reported the process has been signaled). Finally, it makes the automation framework use WaitForExitCodeWithTimeout instead of WaitForSingleProcess. This way we can get the exit status information in an accurate and cross-platform way. To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them. I've tested this change locally on Mac with a UI test that SIGKILLs the browser. Before this change the test passed (it shouldn't), and after this change the test failed with an information that the browser has not exited cleanly. BUG=56644 Review URL: http://codereview.chromium.org/6689014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80472 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98