[SERVER-16185] tcmalloc issues with OS X 10.10 Created: 17/Nov/14  Updated: 11/Jul/16  Resolved: 18/Nov/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.8.0-rc0
Fix Version/s: 2.8.0-rc1

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
has to be done before SERVER-27353 Remove --allocator=system from all sc... Closed
Operating System: ALL
Steps To Reproduce:

Running this like so will reproduce the problem (the third fork will fail)
./mongo --nodb test.js

You can even replace the "mongod" binary with "true" and it will still fail.

var name = "mixed_storage_and_version";
var oldVersion = "2.6";
var newVersion = "latest";
 
var nodes = {
    n0: {binVersion: newVersion},
    n1: {binVersion: newVersion},
    n2: {binVersion: newVersion}
};
printjson(nodes);
 
var replTest = new ReplSetTest({nodes: nodes, name: name});
var conns = replTest.startSet();

Participants:

 Description   

The mongodb shell has the ability to fork new processes as part of our testing framework. After upgrading to OS X 10.10, I discovered that the shell now has odd behavior when forking: after forking successfully two times, the third fork fails. After calling the fork() function call, the parent receives a pid but the child never starts running and does not appear in a 'ps' process list.
dtruss never shows the third fork system call completing, although it does show that the child process with the new pid is blocked on an internal semaphore.

Compiling with --allocator=system seems to avoid this issue. Note that MCI builds already build binaries for Mac OS X without tcmalloc.



 Comments   
Comment by Eric Milkie [ 18/Nov/14 ]

I think resolving is the best course of action for now.

Comment by Githook User [ 18/Nov/14 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-16185 Use system allocator by default on OS X
Branch: master
https://github.com/mongodb/mongo/commit/14ca6bfd67d5efb10fc21778246442c2f223dc1e

Comment by Andrew Morrow (Inactive) [ 17/Nov/14 ]

Not really, no.

Comment by Andy Schwerin [ 17/Nov/14 ]

The debugging behavior aside, is there evidence that the OS X system implementation of malloc is inferior to tcmalloc?

Comment by Andrew Morrow (Inactive) [ 17/Nov/14 ]

I think so, but probably only temporarily until this is fixed. I'd prefer that we have the same allocator across systems, long term. Or, someone should dig into the OS X allocator to understand how to achieve the same debugging / performance aspects that tcmalloc brings us on other UNIX-like systems.

Comment by Eliot Horowitz (Inactive) [ 17/Nov/14 ]

Should we just default to system allocator on os x?

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