Intermediate merge of debug-spew backout

This commit is contained in:
Chris Jones 2010-01-26 20:08:31 -06:00
Родитель bf6d9ae756 d10ea7de50
Коммит ec5d3ab51e
2 изменённых файлов: 13 добавлений и 42 удалений

Просмотреть файл

@ -81,22 +81,6 @@ IsProcessDead(pid_t process)
return exited;
}
bool
WaitForProcessExitMaxSecs(pid_t process, int maxSecs)
{
bool infiniteWait = (maxSecs < 0);
int status;
int nWaits = 0;
do {
HANDLE_EINTR(waitpid(process, &status, WNOHANG));
} while (!WIFEXITED(status) &&
(infiniteWait || nWaits++ < maxSecs) &&
0 == HANDLE_EINTR(sleep(1)));
return WIFEXITED(status);
}
class ChildReaper : public base::MessagePumpLibevent::SignalEvent,
public base::MessagePumpLibevent::SignalWatcher
@ -142,16 +126,20 @@ protected:
HANDLE_EINTR(waitpid(process_, NULL, 0));
#else
if (WaitForProcessExitMaxSecs(process_, 30)) {
printf("TEST-UNEXPECTED-FAIL | process %d done busy-waiting on | child process %d exited normally\n", getpid(), process_);
return;
const int maxWaits = 30;
int waits = 0;
while (!IsProcessDead(process_) && ++waits < maxWaits)
sleep(1);
if (waits < maxWaits) {
printf("TEST-UNEXPECTED-FAIL | process %d done busy-waiting on | child process %d\n", getpid(), process_);
}
else {
printf("TEST-UNEXPECTED-FAIL | process %d wait on | child process %d timed out!\n", getpid(), process_);
// kill the child in such a way that breakpad is triggered
kill(process_, SIGSEGV);
HANDLE_EINTR(waitpid(process_, NULL, 0));
}
printf("TEST-UNEXPECTED-FAIL | process %d wait on | child process %d timed out!\n", getpid(), process_);
// kill the child in such a way that breakpad is triggered
kill(process_, SIGSEGV);
WaitForProcessExitMaxSecs(process_, -1); // wait "forever"
#endif

Просмотреть файл

@ -1048,15 +1048,6 @@ OnChildProcessDumpRequested(void* aContext,
pid = aClientInfo->pid_;
#endif
#ifdef XP_LINUX
printf("TEST-UNEXPECTED-FAIL | got minidump at | %s\n", aFilePath->c_str());
#endif
// Get an .extra file with the same base name as the .dmp file
nsCOMPtr<nsIFile> extraFile;
nsresult rv = lf->Clone(getter_AddRefs(extraFile));
@ -1077,14 +1068,6 @@ OnChildProcessDumpRequested(void* aContext,
// Now write out the annotations to it
nsCOMPtr<nsIFileOutputStream> stream =
do_CreateInstance("@mozilla.org/network/file-output-stream;1");
if (!stream)
return;
rv = stream->Init(extraFile, -1, 0600, 0);
if (NS_FAILED(rv))
return;