Backed out changeset 026b0b69ca23 (bug 1364068)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 26 May 2017 10:43:12 +0200
changeset 360787 14401e0edf829ac7a12dc71a8ad1d8b01c47483c
parent 360786 757120797ede591897b778d35fc49d0addfd6a1c
child 360788 f40289fb94a73eee4bfdb89744c2e905e4577981
push id31902
push userryanvm@gmail.com
push dateFri, 26 May 2017 19:43:26 +0000
treeherdermozilla-central@ba1a33add29d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1364068
milestone55.0a1
backs out026b0b69ca2310eeca486f6e992760a4fdbecaeb
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
Backed out changeset 026b0b69ca23 (bug 1364068)
build/valgrind/mach_commands.py
toolkit/components/telemetry/pingsender/pingsender.cpp
toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp
--- a/build/valgrind/mach_commands.py
+++ b/build/valgrind/mach_commands.py
@@ -65,24 +65,16 @@ class MachCommands(MachCommandBase):
         with TemporaryDirectory() as profilePath:
             #TODO: refactor this into mozprofile
             prefpath = os.path.join(self.topsrcdir, 'testing', 'profiles', 'prefs_general.js')
             prefs = {}
             prefs.update(Preferences.read_prefs(prefpath))
             interpolation = { 'server': '%s:%d' % httpd.httpd.server_address,
                               'OOP': 'false'}
             prefs = json.loads(json.dumps(prefs) % interpolation)
-            # Don't spawn the 'pingsender' process on Valgrind tests due to the
-            # 'new-profile' ping. Valgrind marks the process as leaky (bug 1364068)
-            # but does not provide enough information to suppress the leak. Running
-            # locally does not reproduce the issue, so disable this until we rewrite
-            # the pingsender in Rust (bug 1339035).
-            # We can't do this in 'prefs_general.js' as we want to retain test coverage
-            # on the other testing platforms.
-            prefs['toolkit.telemetry.newProfilePing.enabled'] = False
             for pref in prefs:
                 prefs[pref] = Preferences.cast(prefs[pref])
 
             quitter = os.path.join(self.topsrcdir, 'tools', 'quitter', 'quitter@mozilla.org.xpi')
 
             locations = ServerLocations()
             locations.add_host(host='127.0.0.1',
                                port=httpd.httpd.server_port,
--- a/toolkit/components/telemetry/pingsender/pingsender.cpp
+++ b/toolkit/components/telemetry/pingsender/pingsender.cpp
@@ -151,41 +151,41 @@ int main(int argc, char* argv[])
   if (argc == 3) {
     url = argv[1];
     pingPath = argv[2];
   } else {
     PINGSENDER_LOG("Usage: pingsender URL PATH\n"
                    "Send the payload stored in PATH to the specified URL using "
                    "an HTTP POST message\n"
                    "then delete the file after a successful send.\n");
-    return EXIT_FAILURE;
+    exit(EXIT_FAILURE);
   }
 
   string ping(ReadPing(pingPath));
 
   if (ping.empty()) {
     PINGSENDER_LOG("ERROR: Ping payload is empty\n");
-    return EXIT_FAILURE;
+    exit(EXIT_FAILURE);
   }
 
   // Compress the ping using gzip.
   string gzipPing(GzipCompress(ping));
 
   // In the unlikely event of failure to gzip-compress the ping, don't
   // attempt to send it uncompressed: Telemetry will pick it up and send
   // it compressed.
   if (gzipPing.empty()) {
     PINGSENDER_LOG("ERROR: Ping compression failed\n");
-    return EXIT_FAILURE;
+    exit(EXIT_FAILURE);
   }
 
   if (!Post(url, gzipPing)) {
-    return EXIT_FAILURE;
+    exit(EXIT_FAILURE);
   }
 
   // If the ping was successfully sent, delete the file.
   if (!pingPath.empty() && std::remove(pingPath.c_str())) {
     // We failed to remove the pending ping file.
-    return EXIT_FAILURE;
+    exit(EXIT_FAILURE);
   }
 
-  return EXIT_SUCCESS;
+  exit(EXIT_SUCCESS);
 }
--- a/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp
+++ b/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp
@@ -36,48 +36,42 @@ public:
   CURL* (*easy_init)(void);
   CURLcode (*easy_setopt)(CURL*, CURLoption, ...);
   CURLcode (*easy_perform)(CURL*);
   CURLcode (*easy_getinfo)(CURL*, CURLINFO, ...);
   curl_slist* (*slist_append)(curl_slist*, const char*);
   void (*slist_free_all)(curl_slist*);
   const char* (*easy_strerror)(CURLcode);
   void (*easy_cleanup)(CURL*);
-  void (*global_cleanup)(void);
 
 private:
   void* mLib;
   void* mCurl;
 };
 
 CurlWrapper::CurlWrapper()
   : easy_init(nullptr)
   , easy_setopt(nullptr)
   , easy_perform(nullptr)
   , easy_getinfo(nullptr)
   , slist_append(nullptr)
   , slist_free_all(nullptr)
   , easy_strerror(nullptr)
   , easy_cleanup(nullptr)
-  , global_cleanup(nullptr)
   , mLib(nullptr)
   , mCurl(nullptr)
 {}
 
 CurlWrapper::~CurlWrapper()
 {
   if(mLib) {
     if(mCurl && easy_cleanup) {
       easy_cleanup(mCurl);
     }
 
-    if (global_cleanup) {
-      global_cleanup();
-    }
-
     dlclose(mLib);
   }
 }
 
 bool
 CurlWrapper::Init()
 {
   // libcurl might show up under different names, try them all until we find it
@@ -117,27 +111,25 @@ CurlWrapper::Init()
   *(void**) (&easy_init) = dlsym(mLib, "curl_easy_init");
   *(void**) (&easy_setopt) = dlsym(mLib, "curl_easy_setopt");
   *(void**) (&easy_perform) = dlsym(mLib, "curl_easy_perform");
   *(void**) (&easy_getinfo) = dlsym(mLib, "curl_easy_getinfo");
   *(void**) (&slist_append) = dlsym(mLib, "curl_slist_append");
   *(void**) (&slist_free_all) = dlsym(mLib, "curl_slist_free_all");
   *(void**) (&easy_strerror) = dlsym(mLib, "curl_easy_strerror");
   *(void**) (&easy_cleanup) = dlsym(mLib, "curl_easy_cleanup");
-  *(void**) (&global_cleanup) = dlsym(mLib, "curl_global_cleanup");
 
   if (!easy_init ||
       !easy_setopt ||
       !easy_perform ||
       !easy_getinfo ||
       !slist_append ||
       !slist_free_all ||
       !easy_strerror ||
-      !easy_cleanup ||
-      !global_cleanup) {
+      !easy_cleanup) {
     PINGSENDER_LOG("ERROR: libcurl is missing one of the required symbols\n");
     return false;
   }
 
   mCurl = easy_init();
 
   if (!mCurl) {
     PINGSENDER_LOG("ERROR: Could not initialize libcurl\n");