-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Crash when configuring with DNS over HTTPS, but without threading or ares #16645
Comments
What does How do you reproduce this crash? I built master with the blocking resolver just now and this works fine:
|
Ah right, you said it needs to find the name in the cache. I need a better command line. |
This works for me, getting the name from the cache in the second transfer:
|
Sorry – I should've mentioned that I am using libcurl. Cannot share the code at the moment and did not find time to write a minimal reproducer. When running with |
CURLRES_ASYNCH - is for when built to use an async name resolver; threaded or c-ares USE_CURL_ASYNC - is for when built to use either an async name resolver OR DoH Reported-by: Lars Karlitski Fixes #16645
I could not reproduce, but by reading code I made #16648 (I suspect there might be some other issues still lurking when using the odd combo of blocking resolver + DoH.) |
Works like a charm. Thank you for the swift fix! |
I did this
I have curl compiled with DNS over HTTPS, but without threads or ares. It crashes while connecting to a name that it found in its DNS cache.
I believe this is due to the easy handle's
conn->dns_entry
field beingNULL
.Curl_once_resolved
sets it fromstate.async.dns
, but only ifCURL_USE_ASYNC
is defined (lib/hostip.c:1439):However,
state_resolving
only setsstate.async.dns
whenCURLRES_ASYNCH
is defined (lib/multi.c:2090):In my configuration,
CURLRES_ASYNCH
is not set, butUSE_CURL_ASYNC
is set. Thus,conn->dns_entry
staysNULL
and curl crashes accessing this field while connecting (in cf_he_connect:973).lib/urldata.h:566 defines
USE_CURL_ASYNC
whenCURLRES_ASYNCH
is defined or whenCURL_DISABLE_DOH
is not defined.I don't know curl well enough to suggest a fix, but changing the
#ifdef CURLRES_ASYNCH
inmulti.c
to#ifdef USE_CURL_ASYNC
works and seems correct from my understanding.I expected the following
No response
curl/libcurl version
I have seen this with curl 8.12.1 and with latest main as of now (
f8e7a4d
).operating system
Linux fedora 6.13.5-200.fc41.aarch64 #1 SMP PREEMPT_DYNAMIC Thu Feb 27 15:30:52 UTC 2025 aarch64 GNU/Linux
The text was updated successfully, but these errors were encountered: