-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src/hostip.c: Move macOS-specific calls into global init call #11254
Conversation
544f615
to
1d3c869
Compare
@zajdee Could you take a look and see if this IPv6 -> IPv4 mapping still works here? |
d21e2b2
to
0f93c7e
Compare
It does look okay. Unfortunately I won't get to actually trying it sooner than tomorrow evening - would you be okay waiting until then? |
@zajdee Sure, thanks. |
@zajdee Would you mind confirming whether this change still works for the issue you were seeing with IPv6 mappings? |
curl#7121 introduced a macOS system call to `SCDynamicStoreCopyProxies`, which is invoked every time an IP address needs to be resolved. However, this system call is not thread-safe, and macOS will kill the process if the system call is run first in a fork. To make it possible for the parent process to call this once and prevent the crash, only invoke this system call in the global initialization routine. In addition, this change is beneficial because it: 1. Avoids extra macOS system calls for every IP lookup. 2. Consolidates macOS-specific initialization in a separate file. Closes curl#11252
0f93c7e
to
ddae69e
Compare
I have finally managed to find some time to test your branch. Doing the simplest:
results in a missing symbol:
I will be investigating further and let you know. |
Static build works as expected. I will investigate the dynamic build again later today (to rule out potential library conflicts on my side).
(Note the IPv6 address being used instead of the IPv4 one. This is a result of the NAT64/DNS64-enabled environment w/ NAT64 prefix fd00:64::/96 and CopyProxies being correctly called by the code.)
|
Thanks for confirming. I repeated your steps and didn't run into the missing symbol issue. |
@bagder Is there anything I can do to get this merged? Thanks so much for all your work on |
Thanks! |
curl#7121 introduced a macOS system call to `SCDynamicStoreCopyProxies`, which is invoked every time an IP address needs to be resolved. However, this system call is not thread-safe, and macOS will kill the process if the system call is run first in a fork. To make it possible for the parent process to call this once and prevent the crash, only invoke this system call in the global initialization routine. In addition, this change is beneficial because it: 1. Avoids extra macOS system calls for every IP lookup. 2. Consolidates macOS-specific initialization in a separate file. Fixes curl#11252 Closes curl#11254
curl#7121 introduced a macOS system call to `SCDynamicStoreCopyProxies`, which is invoked every time an IP address needs to be resolved. However, this system call is not thread-safe, and macOS will kill the process if the system call is run first in a fork. To make it possible for the parent process to call this once and prevent the crash, only invoke this system call in the global initialization routine. In addition, this change is beneficial because it: 1. Avoids extra macOS system calls for every IP lookup. 2. Consolidates macOS-specific initialization in a separate file. Fixes curl#11252 Closes curl#11254
#7121 introduced a macOS system call to
SCDynamicStoreCopyProxies
, which is invoked every time an IP address needs to be resolved.However, this system call is not thread-safe, and macOS will kill the process if the system call is run first in a fork. To make it possible for the parent process to call this once and prevent the crash, only invoke this system call in the global initialization routine.
In addition, this change is beneficial because it:
Closes #11252