Skip to content

Curl 8.12 access violation with c-ares when HTTPS-RR enabled #16216

@nono303

Description

@nono303

Hi,
I've just compiled and tested curl 8.12 and have an Access violation related to c-ares.

This issue was not present on 8.11.1

⏩ use case :

curl -v https://www.google.com/
and
<?php curl_exec(curl_init("https://www.google.com/")); ?>

✅ when compiling with -DENABLE_ARES=OFF: all works

🔴 when compiling with -DENABLE_ARES=ON : I have this exception

libcurl!init_resolve_thread+0x2de
libcurl!Curl_resolv+0x9a8
libcurl!resolve_server+0x121
libcurl!create_conn+0xc26
libcurl!state_connect+0x49
libcurl!multi_runsingle+0x42f
libcurl!curl_multi_perform+0x11e
libcurl!easy_perform+0x1d5

FAULTING_SOURCE_FILE:  C:\sdk\src\curl\lib\asyn-thread.c
FAULTING_SOURCE_CODE:  
   387:     struct Curl_easy *data = td->tsd.data;
   388: #endif
   389: 
   390: #ifdef USE_HTTPSRR_ARES
>  391:     ares_destroy(data->state.async.tdata->channel);
   392: #endif
   393:     /*
   394:      * if the thread is still blocking in the resolve syscall, detach it and
   395:      * let the thread do the cleanup...
   396:      */
IMAGE_NAME:  libcurl.dll
FAILURE_BUCKET_ID:  NULL_CLASS_PTR_READ_c0000005_libcurl.dll!init_resolve_thread
OS_VERSION:  10.0.26100.1
BUILDLAB_STR:  ge_release
OSPLATFORM_TYPE:  x64
IMAGE_VERSION:  8.12.0.0
...
-- Found Cares: C:/sdk/release/vs17_x64-avx2/include (found version "1.34.4")
...
-- LTO supported and enabled
-- Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
-- Features: alt-svc asyn-rr AsynchDNS brotli HSTS HTTP2 HTTPS-proxy HTTPSRR IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe TLS-SRP Unicode UnixSockets zstd
-- Enabled SSL backends: OpenSSL v3+ Schannel

I expected the following

No response

curl/libcurl version

8.12.0

operating system

Windows 11 24h2 x64
-- Using CMake version 3.31.5
-- curl version=[8.12.0-DEV]
-- The C compiler identification is MSVC 19.42.34438.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions