b75e322
diff -up mozilla-release/storage/src/Makefile.in.938730 mozilla-release/storage/src/Makefile.in
b75e322
--- mozilla-release/storage/src/Makefile.in.938730	2013-12-09 15:15:44.708527295 +0100
b75e322
+++ mozilla-release/storage/src/Makefile.in	2013-12-09 15:17:16.119682503 +0100
b75e322
@@ -6,14 +6,23 @@
b75e322
 # Don't use the jemalloc allocator on Android, because we can't guarantee
b75e322
 # that Gecko will configure sqlite before it is first used (bug 730495).
b75e322
 #
b75e322
+# Don't use the jemalloc allocator when using system NSS. Linked in libraries
b75e322
+# (such as NSS) might trigger an initialization of sqlite and allocation
b75e322
+# of memory using the default allocator, prior to the storage service
b75e322
+# registering its allocator, causing memory management failures (bug 938730).
b75e322
+#
b75e322
 # Note: On Windows our sqlite build assumes we use jemalloc.  If you disable
b75e322
 # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef
b75e322
 # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in.
b75e322
+
b75e322
+ifndef _USE_SYSTEM_NSS
b75e322
 ifdef MOZ_MEMORY
b75e322
 ifneq ($(OS_TARGET), Android)
b75e322
 DEFINES += -DMOZ_STORAGE_MEMORY
b75e322
 endif
b75e322
 endif
b75e322
+endif
b75e322
+
b75e322
 
b75e322
 # For nsDependentJSString
b75e322
 LOCAL_INCLUDES = \