Temporary debug spew for diagnosing Linux mochitest hang.

This commit is contained in:
Chris Jones 2010-01-22 12:53:18 -06:00
parent ad605908e9
commit 7b53db6a22
5 changed files with 74 additions and 1 deletions

View File

@ -281,6 +281,15 @@ PluginModuleChild::ActorDestroy(ActorDestroyReason why)
{
// doesn't matter why we're being destroyed; it's up to us to
// initiate (clean) shutdown
#ifdef OS_LINUX
fprintf(stderr, "TEST-UNEXPECTED-FAIL | plugin process %d | initiating shutdown\n", getpid());
#endif
XRE_ShutdownChildProcess();
}

View File

@ -62,6 +62,12 @@ bool LaunchApp(const std::vector<std::string>& argv,
#endif
exit(127);
} else {
fprintf(stderr, "TEST-UNEXPECTED-FAIL | ==> process %d launched | child process %d\n", GetCurrentProcId(), pid);
gProcessLog.print("==> process %d launched child process %d\n",
GetCurrentProcId(), pid);
if (wait)

View File

@ -54,6 +54,12 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include "base/eintr_wrapper.h"
#include "base/message_loop.h"
#include "base/process_util.h"
@ -189,6 +195,14 @@ public:
ChildReaper::OnSignal(sig);
if (!process_) {
fprintf(stderr, "TEST-UNEXPECTED-FAIL | process %d reaped | child process (got SIGCHLD, exited normally)\n", getpid());
MessageLoop::current()->RemoveDestructionObserver(this);
delete this;
}
@ -200,6 +214,13 @@ public:
DCHECK(process_);
WaitForChildExit();
fprintf(stderr, "TEST-UNEXPECTED-FAIL | process %d reaped | child process (waitpid() on shutdown)\n", getpid());
process_ = 0;
// XXX don't think this is necessary, since destruction can only
@ -239,8 +260,16 @@ ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle process,
DCHECK(process != base::GetCurrentProcId());
DCHECK(process > 0);
if (IsProcessDead(process))
if (IsProcessDead(process)) {
fprintf(stderr, "TEST-UNEXPECTED-FAIL | process %d reaped | child process %d (it was already dead)\n", getpid(), process);
return;
}
MessageLoopForIO* loop = MessageLoopForIO::current();
if (force) {

View File

@ -3592,6 +3592,19 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
XRE_DeinitCommandLine();
#ifdef OS_LINUX
fprintf(stderr, "TEST-UNEXPECTED-FAIL | browser process %d | exiting\n", getpid());
#endif
return NS_FAILED(rv) ? 1 : 0;
}

View File

@ -371,6 +371,13 @@ XRE_InitChildProcess(int aArgc,
sIOMessageLoop = nsnull;
}
#ifdef OS_LINUX
fprintf(stderr, "TEST-UNEXPECTED-FAIL | plugin process %d | IO thread joined XPCOM thread, exiting\n", getpid());
#endif
NS_LogTerm();
return XRE_DeinitCommandLine();
}
@ -503,6 +510,15 @@ XRE_ShutdownChildProcess()
NS_ABORT_IF_FALSE(!!ioLoop, "Bad shutdown order");
ioLoop->PostTask(FROM_HERE, new MessageLoop::QuitTask());
#ifdef OS_LINUX
fprintf(stderr, "TEST-UNEXPECTED-FAIL | plugin process %d | posted quit task to IO thread\n", getpid());
#endif
}
namespace {