[SERVER-8684] Driver crashes with boost 1.52 Created: 22/Feb/13  Updated: 11/Jul/16  Resolved: 16/Sep/13

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

boost::threads must be either detach()ed or join()ed prior to destruction on newer versions of boost: https://svn.boost.org/trac/boost/ticket/6266.

Patch:

diff --git a/mongo-cxx-driver/src/mongo/util/background.cpp b/mongo-cxx-driver/src/mongo/util/background.cpp
index 4fca89b..795ef7b 100644
--- a/src/mongo/util/background.cpp
+++ b/src/mongo/util/background.cpp
@@ -82,6 +82,7 @@ namespace mongo {
 
     BackgroundJob& BackgroundJob::go() {
         boost::thread t( boost::bind( &BackgroundJob::jobBody , this, _status ) );
+        t.detach();
         return *this;
     }
 
 



 Comments   
Comment by auto [ 16/Sep/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-8684 added a CCPDEFINE to cause newer system versions of boost to use the thread version we do
Branch: master
https://github.com/mongodb/mongo/commit/3145d2440b9ca1a61871aeb7043865a85f6b76ec

Comment by auto [ 07/Aug/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-8684 make codebase compatible with boost 1.5 and newer
Branch: master
https://github.com/mongodb/mongo/commit/bac3b67d20128e03487680b8d713195a18315d6e

Generated at Thu Feb 08 03:18:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.