[SERVER-30777] Darwin & IPv6 segfaults Created: 22/Aug/17 Updated: 30/Oct/23 Resolved: 24/Aug/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 3.5.11 |
| Fix Version/s: | 3.5.13 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | OS X | ||||
| Steps To Reproduce: | mongod --bind_ip localhost,::1 --ipv6 |
||||
| Sprint: | Platforms 2017-09-11 | ||||
| Participants: | |||||
| Description |
|
| Comments |
| Comment by Ramon Fernandez Marina [ 24/Aug/17 ] |
|
Author: {'username': u'acmorrow', 'name': u'Andrew Morrow', 'email': u'acm@mongodb.com'}Message: |
| Comment by Hannes Magnusson [ 23/Aug/17 ] |
|
Thanks! I've updated the drivers tools repo with the fix/workaround |
| Comment by Andrew Morrow (Inactive) [ 23/Aug/17 ] |
|
The backward compatible workaround here is to change your argument to be --bind_ip 127.0.0.1,::1. |
| Comment by Andrew Morrow (Inactive) [ 23/Aug/17 ] |
|
Yes, this is new behavior. Previously, if you gave a DNS name for bind_ip we only used the first returned address that was resolved. Now, we bind them all. Since 'localhost' resolves to both an IPv4 and IPv6 address when --ipv6 is specified, adding in ::1 meant that you were trying to bind the same interface multiple times. |
| Comment by Hannes Magnusson [ 22/Aug/17 ] |
|
Thats a new thing right? I discovered this while debugging the C++ evergreen failure which was caused by mongo-orchestration using https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/orchestration/configs/servers/basic.json which failed. If this is now actually invalid, is there a backwards compatible way of achieving this? |
| Comment by Andrew Morrow (Inactive) [ 22/Aug/17 ] |
|
FYI bjori - you no longer need to say localhost,::1 to bind both localhosts. We now listen on all addresses associated with a symbolic name, so --bind_ip localhost --ipv6 should get you listening on both IPv4 and IPv6. |
| Comment by Andrew Morrow (Inactive) [ 22/Aug/17 ] |
|
This is an order-of-destruction bug inside TransportLayerASIO. The given command line is actually invalid, as it attempts to create two listeners on the same ipv6/port combination. That causes the second listener to fail to construct correctly, and the TransportLayerManager then invokes the destructor for the TL. However, the io_context ownership is declared after the acceptor vector, leading to an invalid destruction order. The fix is to ensure that the io_service is declared before the acceptors. |