[SERVER-1276] Static destructor ordering problem between DBConnectionPool and Ports Created: 21/Jun/10 Updated: 12/Jul/16 Resolved: 01/Jul/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | 1.5.3 |
| Fix Version/s: | 1.5.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ALL |
||
| Operating System: | ALL |
| Participants: |
| Description |
|
mongo::DBConnectionPool has a static instance, as does the mongo::Ports class. The destructor of a mongo::DBClientConnection requires the existence of the Port static object, and the DBConnectionPool static object destroys DBClientConnections. However, the static instance of the Ports class and the static instance of the DBConnectionPool are defined in separate translation units, and therefore there is no guaranteed ordering among the static destructors. This shows up in valgrind like this: ==26777== Invalid read of size 4 |
| Comments |
| Comment by auto [ 01/Jul/10 ] |
|
Author: {'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: Static destruction order fix |
| Comment by Roman Shtylman [ 01/Jul/10 ] |
|
In 1.5.3 this issue has become more serious and appears to cause an assertion failure when libmongoclient is built as a shared object. The crash happens on shutdown. backtrace: |