Bug 718629 - report more info about failures of waitpid on the glxtest process - r=joe
authorBenoit Jacob <jacob.benoit.1@gmail.com>
Tue, 17 Jan 2012 14:37:41 -0500
changeset 84767 924d6091bec7b8d8a9974d020cf09d52129487c4
parent 84766 b105fa66bb3707858f9ab67cfbf40e0c41c51fbf
child 84768 2cf8cd8656321a70bef63f9042dfeab9bb660c8c
push id21873
push usermlamouri@mozilla.com
push dateWed, 18 Jan 2012 10:29:07 +0000
treeherdermozilla-central@7538f4d4697c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs718629
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 718629 - report more info about failures of waitpid on the glxtest process - r=joe
widget/xpwidgets/GfxInfoX11.cpp
--- a/widget/xpwidgets/GfxInfoX11.cpp
+++ b/widget/xpwidgets/GfxInfoX11.cpp
@@ -101,20 +101,22 @@ GfxInfo::GetData()
     buf[bytesread] = 0;
 
     // Wait for the glxtest process to finish. This serves 2 purposes:
     // * avoid having a zombie glxtest process laying around
     // * get the glxtest process status info.
     int glxtest_status = 0;
     bool wait_for_glxtest_process = true;
     bool waiting_for_glxtest_process_failed = false;
+    int waitpid_errno = 0;
     while(wait_for_glxtest_process) {
         wait_for_glxtest_process = false;
         if (waitpid(glxtest_pid, &glxtest_status, 0) == -1) {
-            if (errno == EINTR)
+            waitpid_errno = errno;
+            if (waitpid_errno == EINTR)
                 wait_for_glxtest_process = true;
             else
                 waiting_for_glxtest_process_failed = true;
         }
     }
 
     bool exited_with_error_code = !waiting_for_glxtest_process_failed &&
                                   WIFEXITED(glxtest_status) && 
@@ -162,17 +164,17 @@ GfxInfo::GetData()
 
     if (error ||
         mVendor.IsEmpty() ||
         mRenderer.IsEmpty() ||
         mVersion.IsEmpty())
     {
         mAdapterDescription.AppendLiteral("GLXtest process failed");
         if (waiting_for_glxtest_process_failed)
-            mAdapterDescription.AppendLiteral(" (waitpid failed)");
+            mAdapterDescription.AppendPrintf(" (waitpid failed with errno=%d for pid %d)", waitpid_errno, glxtest_pid);
         if (exited_with_error_code)
             mAdapterDescription.AppendPrintf(" (exited with status %d)", WEXITSTATUS(glxtest_status));
         if (received_signal)
             mAdapterDescription.AppendPrintf(" (received signal %d)", WTERMSIG(glxtest_status));
         if (bytesread) {
             mAdapterDescription.AppendLiteral(": ");
             mAdapterDescription.Append(nsDependentCString(buf));
             mAdapterDescription.AppendLiteral("\n");