[SERVER-63616] Fail early on OSX when > 512 dylibs Created: 14/Feb/22  Updated: 29/Oct/23  Resolved: 23/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Ryan Egesdahl (Inactive) Assignee: Daniel Moody
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-59643 monitor Mac OS dyld limit Closed
is duplicated by SERVER-59643 monitor Mac OS dyld limit Closed
Related
is related to SERVER-30955 dynamically linked mongod fails to st... Closed
is related to SERVER-53417 Reenable macOS dynamical builders Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Platform 2022-05-30, Dev Platform 2022-06-13, Dev Platform 2022-06-27
Participants:

 Description   

We keep getting issues related to SERVER-30955 popping up over and over again, and it's very confusing when it does because we get an unhelpful error message from the dynamic loader during startup:

The problem is due to a hard-coded limit in the MacOS dynamic loader at src/ImageLoader.cpp@87:

	if ( libCount > 512 )
		dyld::throwf("too many dependent dylibs in %s", path);

Since this is a hard-coded limit, we should be able to determine during build that we are about to breach it and fail with a more helpful message. After implementing, re-enable dynamic builds for OSX.



 Comments   
Comment by Githook User [ 24/Jun/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-63616 fix link model check for macos dynamic linking
Branch: master
https://github.com/mongodb/mongo/commit/a9bc1f1a105d9f86544f6bf3899072d7c78af6a6

Comment by Githook User [ 23/Jun/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-63616 added check to make sure macos version supports link-model dynamic
Branch: master
https://github.com/mongodb/mongo/commit/536da1a22b8ca5cc1caaade7328404144bf44be6

Comment by Andrew Morrow (Inactive) [ 01/Mar/22 ]

Thanks for clarifying. I've marked the ticket for rescheduling because I don't want it to get lost on the backlog. I think we should address this sooner rather than later, as the problem only grows when we aren't looking at it.

Comment by Ryan Egesdahl (Inactive) [ 01/Mar/22 ]

acm We're not really trying to go so deep here. This is really just us helping developers identify changes that will likely result in a BF on a specific platform. The number of dylibs that end up on the link line is not directly visible to developers yet unless they are using the libdeps graph tools in the way benety.goh has been. The eventual goal is to drive down the number of dylibs by making it immediately visible as part of the build.

Comment by Andrew Morrow (Inactive) [ 01/Mar/22 ]

This isn't the only dyld limit that we encounter. I'm not sure we should be trying to model the internal implementation details of apple dynamic loader, especially since they can change over time and vary by platform. The answer is to stop having so many dylibs that this is even a possibility.

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