Hello,

This patch updates MongoDB to 3.2.13 which, among a lot of other things[1], updates the bundled SpiderMonkey release.

It also makes two changes to the sets of patches:
* It REMOVES a patch that worked around siginfo->si_addr not being POSIX-compliant. This has been fixed in OpenBSD-current for about six weeks now. * It ADDS a patch implementing the fix for SERVER-29083[2], which unfortunately will not be backported to the 3.2 branch. This fixes a use-after-free, meaning that the core integration test suite now passes in addition to the unit tests.

As a note: it seems that you have to reboot between building and running the tests, because building MongoDB wires all the pages (systat reports negative wired pages; integer overflow?) preventing mlock(..., 4096) from succeeding. This may be a regression since OpenBSD 6.1.

[1]: https://docs.mongodb.com/manual/release-notes/3.2-changelog/#id1
[2]: https://jira.mongodb.org/browse/SERVER-29083

Thank you,
-- Andrew Aldridge
Index: Makefile
===================================================================
RCS file: /home/andrew/Documents/openbsd/cvs/ports/databases/mongodb/Makefile,v
retrieving revision 1.25
diff -u -p -r1.25 Makefile
--- Makefile	22 May 2017 14:00:21 -0000	1.25
+++ Makefile	23 May 2017 18:03:25 -0000
@@ -9,7 +9,7 @@ DPB_PROPERTIES = parallel
 
 COMMENT =	scalable, high-performance document-oriented database
 
-DISTNAME =	mongodb-src-r3.2.12
+DISTNAME =	mongodb-src-r3.2.13
 PKGNAME =	${DISTNAME:S/src-r//}
 CATEGORIES =	databases
 
Index: distinfo
===================================================================
RCS file: /home/andrew/Documents/openbsd/cvs/ports/databases/mongodb/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo	6 Apr 2017 22:11:23 -0000	1.11
+++ distinfo	23 May 2017 15:45:41 -0000
@@ -1,2 +1,2 @@
-SHA256 (mongodb-src-r3.2.12.tar.gz) = QGzthzqavoo/D5KTm/U3RmO6yGxyGByAvsFErt9s0wY=
-SIZE (mongodb-src-r3.2.12.tar.gz) = 29178424
+SHA256 (mongodb-src-r3.2.13.tar.gz) = MUkrmdEtY2Om68u6Miac6el9re3ajEcMv/jBryJ+l1M=
+SIZE (mongodb-src-r3.2.13.tar.gz) = 29273616
Index: patches/patch-src_mongo_util_processinfo_openbsd_cpp
===================================================================
RCS file: patches/patch-src_mongo_util_processinfo_openbsd_cpp
diff -N patches/patch-src_mongo_util_processinfo_openbsd_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_util_processinfo_openbsd_cpp	23 May 2017 15:50:57 -0000
@@ -0,0 +1,29 @@
+$OpenBSD$
+
+Index: src/mongo/util/processinfo_openbsd.cpp
+--- src/mongo/util/processinfo_openbsd.cpp.orig
++++ src/mongo/util/processinfo_openbsd.cpp
+@@ -110,9 +110,10 @@ int ProcessInfo::getVirtualMemorySize() {
+     }
+ 
+     kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt);
+-    kvm_close(kd);
+-    return ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) /
++    int rss = ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) /
+         1048576;
++    kvm_close(kd);
++    return rss;
+ }
+ 
+ int ProcessInfo::getResidentSize() {
+@@ -124,8 +125,9 @@ int ProcessInfo::getResidentSize() {
+         return -1;
+     }
+     kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt);
++    int rss = (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576;  // convert from pages to MB
+     kvm_close(kd);
+-    return (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576;  // convert from pages to MB
++    return rss;
+ }
+ 
+ double ProcessInfo::getSystemMemoryPressurePercentage() {
Index: patches/patch-src_mongo_util_signal_handlers_synchronous_cpp
===================================================================
RCS file: patches/patch-src_mongo_util_signal_handlers_synchronous_cpp
diff -N patches/patch-src_mongo_util_signal_handlers_synchronous_cpp
--- patches/patch-src_mongo_util_signal_handlers_synchronous_cpp	6 May 2016 15:33:37 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-src_mongo_util_signal_handlers_synchronous_cpp,v 1.1 2016/05/06 15:33:37 sthen Exp $
---- src/mongo/util/signal_handlers_synchronous.cpp.orig	Thu Apr 21 16:21:39 2016
-+++ src/mongo/util/signal_handlers_synchronous.cpp	Sun May  1 23:59:28 2016
-@@ -266,7 +266,7 @@ void abruptQuitWithAddrSignal(int signalNum, siginfo_t
-     MallocFreeOStreamGuard lk{};
- 
-     const char* action = (signalNum == SIGSEGV || signalNum == SIGBUS) ? "access" : "operation";
--    mallocFreeOStream << "Invalid " << action << " at address: " << siginfo->si_addr;
-+    mallocFreeOStream << "Invalid " << action << " at address: " << reinterpret_cast<void*>(siginfo->si_addr);
- 
-     // Writing out message to log separate from the stack trace so at least that much gets
-     // logged. This is important because we may get here by jumping to an invalid address which

Reply via email to