Bug 1171687 - Part 2: Fix running xpcshell tests that initialize NSS locally. r=glandium,gbrown draft
authorNick Alexander <nalexander@mozilla.com>
Mon, 19 Jun 2017 11:17:36 -0700
changeset 596982 4c6a9ad508b2c8cbe8babc4985590d64fbb6ca9a
parent 596981 1807e3a90a4f29df1b2666b0c2fed96a79da4f1a
child 634096 26cf1d927008a7506c1b112c4a3bfbcc6132448e
push id64786
push usernalexander@mozilla.com
push dateMon, 19 Jun 2017 22:57:09 +0000
reviewersglandium, gbrown
bugs1171687
milestone56.0a1
Bug 1171687 - Part 2: Fix running xpcshell tests that initialize NSS locally. r=glandium,gbrown MozReview-Commit-ID: 8P1XTi38CtD
testing/xpcshell/remotexpcshelltests.py
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -304,16 +304,20 @@ class XPCShellRemote(xpcshell.XPCShellTe
             'remoteMinidumpDir': self.remoteMinidumpDir,
             'remoteClearDirScript': self.remoteClearDirScript,
         }
         if self.remoteAPK:
             self.mobileArgs['remoteAPK'] = self.remoteAPK
 
     def setLD_LIBRARY_PATH(self):
         self.env["LD_LIBRARY_PATH"] = self.remoteBinDir
+        # Without LD_PRELOAD=/path/to/libmozglue.so, we crash free-ing
+        # memory deep in NSS.
+        self.env["LD_PRELOAD"] = remoteJoin(self.remoteBinDir, 'libmozglue.so')
+
 
     def pushWrapper(self):
         # Rather than executing xpcshell directly, this wrapper script is
         # used. By setting environment variables and the cwd in the script,
         # the length of the per-test command line is shortened. This is
         # often important when using ADB, as there is a limit to the length
         # of the ADB command line.
         localWrapper = tempfile.mktemp()