On Tue, 4 Jun 2024, Daniel Stenberg via curl-library wrote:
> Interesting case. I think we should make DoH requests exempt from that
> check/restriciton, as otherwise you can end up in this kind of catch-22
> situation.
kartatz, how about a patch like this?
Thank you for the patch!
I checked out the latest master from GitHub and did a minimal curl build with
CMake (-DHTTP_ONLY=ON) using OpenSSL as SSL backend.
Now the multi interface can resolve using DoH, but the program crashes as soon
as it attempts to connect to the resolved address:
* Found bundle for host: 0x119dc60 [serially]
* Found bundle for host: 0x119dc60 [serially]
* Found bundle for host: 0x119dc60 [serially]
* Found bundle for host: 0x119dc60 [serially]
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Found bundle for host: 0x119dc60 [serially]
* No more connections allowed to host: 5
* No connections available.
* Host example.com:443 was resolved.
* IPv6: 2606:2800:21f:cb07:6820:80da:af6b:8b2c
* IPv4: 93.184.215.14
* Trying 93.184.215.14:443...
* Hostname 'example.com' was found in DNS cache
[1] 15690 segmentation fault ./main
I attached the gdb logs.
Starting program: /home/kartz/main
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.el7_9.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
[34m0x00007ffff7f5bb19[m in [33mstart_connect[m ([36mcf[m=0x457b50, [m
[m[36mdata[m=0x42a9d0, [36mremotehost[m=0x0)[m
[m at [32m/home/kartz/curl/lib/connect.c[m:780
780 ai_family0 [31m=[m remotehost[31m->[maddr[31m?[m
Missing separate debuginfos, use: debuginfo-install
keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-55.el7_9.x86_64
libcom_err-1.42.9-19.el7.x86_64 libselinux-2.5-15.el7.x86_64
openssl-libs-1.0.2k-26.el7_9.x86_64 pcre-8.32-17.el7.x86_64
zlib-1.2.7-21.el7_9.x86_64
#0 [34m0x00007ffff7f5bb19[m in [33mstart_connect[m ([36mcf[m=0x457b50,
[m
[m[36mdata[m=0x42a9d0, [36mremotehost[m=0x0)[m
[m at [32m/home/kartz/curl/lib/connect.c[m:780
[36mctx[m = [34m0x453320[m
[36mconn[m = [34m0x43f770[m
[36mresult[m = CURLE_COULDNT_CONNECT
[36mai_family0[m = 0
[36mai_family1[m = 0
[36mtimeout_ms[m = 294872
[36maddr0[m = [34m0x3004012f0[m
[36maddr1[m = [34m0x7ffff7f5c79b[m
<[33mcf_happy_eyeballs_create[m+149>
#1 [34m0x00007ffff7f5c000[m in [33mcf_he_connect[m ([36mcf[m=0x457b50,
[m
[m[36mdata[m=0x42a9d0, [36mblocking[m=false,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/connect.c[m:898
[36mctx[m = [34m0x453320[m
[36mresult[m = CURLE_OK
#2 [34m0x00007ffff7f57f79[m in [33mCurl_conn_cf_connect[m
([36mcf[m=0x457b50, [m
[m[36mdata[m=0x42a9d0, [36mblocking[m=false,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/cfilters.c[m:307
No locals.
#3 [34m0x00007ffff7f5c9ab[m in [33mcf_setup_connect[m
([36mcf[m=0x457b20, [m
[m[36mdata[m=0x42a9d0, [36mblocking[m=false,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/connect.c[m:1199
[36mctx[m = [34m0x43f390[m
[36mresult[m = CURLE_OK
#4 [34m0x00007ffff7f57f79[m in [33mCurl_conn_cf_connect[m
([36mcf[m=0x457b20, [m
[m[36mdata[m=0x42a9d0, [36mblocking[m=false,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/cfilters.c[m:307
No locals.
#5 [34m0x00007ffff7f52014[m in [33mcf_hc_baller_connect[m
([36mb[m=0x8e6978, [m
[m[36mcf[m=0x8e87d0, [36mdata[m=0x42a9d0,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/cf-https-connect.c[m:135
[36msave[m = [34m0x0[m
#6 [34m0x00007ffff7f52903[m in [33mcf_hc_connect[m ([36mcf[m=0x8e87d0,
[m
[m[36mdata[m=0x42a9d0, [36mblocking[m=false,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/cf-https-connect.c[m:287
[m [36mctx[m = [34m0x8e6920[m
[36mnow[m = {tv_sec = 18162143, tv_usec = 989669}
[36mresult[m = CURLE_OK
#7 [34m0x00007ffff7f5810f[m in [33mCurl_conn_connect[m
([36mdata[m=0x42a9d0, [m
[m[36msockindex[m=0, [36mblocking[m=false,
[36mdone[m=0x7fffffffdb8f)[m
[m at [32m/home/kartz/curl/lib/cfilters.c[m:353
[36mcf[m = [34m0x8e87d0[m
[36mresult[m = CURLE_OK
#8 [34m0x00007ffff7f8882d[m in [33mmulti_runsingle[m
([36mmulti[m=0x428220, [m
[m[36mnowp[m=0x7fffffffdcc0, [36mdata[m=0x42a9d0)[m
[m at [32m/home/kartz/curl/lib/multi.c[m:2144
[36mstream_error[m = false
[36mmsg[m = [34m0x0[m
[36mconnected[m = false
[36masync[m = false
[36mprotocol_connected[m = false
[36mdophase_done[m = false
[36mrc[m = CURLM_OK
[36mresult[m = CURLE_OK
[36mrecv_timeout_ms[m = 4500736
[36msend_timeout_ms[m = 989098
[36mcontrol[m = 32767
#9 [34m0x00007ffff7f89aa8[m in [33mcurl_multi_perform[m ([m
[m[36mmulti[m=0x428220, [36mrunning_handles[m=0x7fffffffdd1c)[m
[m at [32m/home/kartz/curl/lib/multi.c[m:2776
[36mdatanext[m = [34m0x42bcc0[m
[36mresult[m = CURLM_OK
[36mnosig[m = false
[36mpipe_st[m = {old_pipe_act = {__sigaction_handler = {[m
[msa_handler = [34m0x0[m, sa_sigaction = [34m0x0[m}, [m
[msa_mask = {__val = {0, 0, 0, 4491656, 0, [m
[m4199152, 140737488346688, 140737488345888, [m
[m140737349032493, 140737488345872, [m
[m140737353747854, 18162143, 988958, 18162144, [m
[m140733193494429, 140737488345920}}, [m
[msa_flags = 67108864, [m
[msa_restorer = [34m0x7ffff7a43400[m <[33m__restore_rt[m>}, [m
[mno_signal = false}
[m [36mdata[m = [34m0x42a9d0[m
[36mreturncode[m = CURLM_OK
[36mt[m = [34m0x7ffff7f89e89[m <[33mcurl_multi_info_read[m+88>
[36mnow[m = {tv_sec = 18162143, tv_usec = 989098}
#10 [34m0x00000000004015e3[m in [33mmain[m () at
[32m/home/kartz/test.c[m:35
[36mcode[m = 0
[36mindex[m = 15
[36mrunning[m = 23
[36mmsg[m = [34m0x0[m
[36mleft[m = 0
[36mcurl[m = [34m0x426fd0[m
[36mcurl_multi[m = [34m0x428220[m
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html