Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: Curl segfault in curl_multi_perform
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Richard W.M. Jones via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 31 Jul 2023 10:03:00 +0100
On Mon, Jul 31, 2023 at 08:18:30AM +0200, Daniel Stenberg wrote:
> On Sun, 30 Jul 2023, Richard W.M. Jones via curl-library wrote:
>
> >#0 stream_recv (cf=cf_at_entry=0x7fe0542a7260, data=data_at_entry=0x7fdd78001010,
> > buf=buf_at_entry=0x7fe05423ce80 "", len=len_at_entry=16384,
> > err=err_at_entry=0x7fe062a52824) at ../../lib/http2.c:1742
> >#1 0x00007fe0632f58db in cf_h2_recv (cf=0x7fe0542a7260, data=0x7fdd78001010,
> > buf=0x7fe05423ce80 "", len=16384, err=0x7fe062a52824)
> > at ../../lib/http2.c:1844
>
> In this function cf_h2_recv(), is 'stream' NULL by any chance when
> stream_recv() is called?
Looks like it, yes:
(gdb) frame 1
#1 0x00007f7840ab28db in cf_h2_recv (cf=0x7f7830327670, data=0x7f7500000d10,
buf=0x7f78302b42a0 "", len=16384, err=0x7f7840219824)
at ../../lib/http2.c:1844
1844 nread = stream_recv(cf, data, buf, len, err);
(gdb) print *cf
$1 = {cft = 0x7f7840b1e4c0 <Curl_cft_nghttp2>, next = 0x7f78302a1f40,
ctx = 0x7f7830327590, conn = 0x7f78302a1950, sockindex = 0, connected = 1}
(gdb) print stream
$2 = (struct stream_ctx *) 0x0
I've copied and pasted the whole of the 'data' struct below, but the
important bits are:
(gdb) print data->req.p.http
$4 = (struct HTTP *) 0x7f78302b8930
(gdb) print ((struct HTTP *)data->req.p.http)->h2_ctx
$5 = (void *) 0x0
(gdb) print *data->req.p.http
$6 = {sendit = 0x0, postsize = 0, postdata = 0x0, p_pragma = 0x0, form = {
parent = 0x0, nextpart = 0x0, kind = MIMEKIND_NONE, flags = 0, data = 0x0,
readfunc = 0x0, seekfunc = 0x0, freefunc = 0x0, arg = 0x0, fp = 0x0,
curlheaders = 0x0, userheaders = 0x0, mimetype = 0x0, filename = 0x0,
name = 0x0, datasize = 0, state = {state = MIMESTATE_BEGIN, ptr = 0x0,
offset = 0}, encoder = 0x0, encstate = {pos = 0, bufbeg = 0, bufend = 0,
buf = '\000' <repeats 255 times>}, lastreadstatus = 1}, backup = {
fread_func = 0x0, fread_in = 0x0, postdata = 0x0, postsize = 0,
data = 0x0}, sending = HTTPSEND_BODY, h2_ctx = 0x0, h3_ctx = 0x0,
send_buffer = {bufr = 0x0, leng = 0, allc = 0, toobig = 0}}
which seems wrong?
Rich.
======================================================================
(gdb) print *data
$3 = {magic = 3235830701, id = 120, next = 0x7f754c000d10,
prev = 0x7f76d4000d10, conn = 0x7f78302a1950, connect_queue = {ptr = 0x0,
prev = 0x0, next = 0x0}, conn_queue = {ptr = 0x7f7500000d10, prev = 0x0,
next = 0x7f754c000d50}, mstate = MSTATE_PERFORMING, result = CURLE_OK,
msg = {list = {ptr = 0x0, prev = 0x0, next = 0x0}, extmsg = {
msg = CURLMSG_NONE, easy_handle = 0x0, data = {whatever = 0x0,
result = CURLE_OK}}}, sockets = {0, 0, 0, 0, 0},
actions = "\000\000\000\000", numsocks = 0, dns = {
hostcache = 0x560efbd2fe80, hostcachetype = HCACHE_MULTI},
multi = 0x560efbd2fde0, multi_easy = 0x0, share = 0x0, psl = 0x560efbd2feb0,
req = {size = -1, maxdownload = -1, bytecount = 0, writebytecount = 0,
headerbytecount = 0, deductheadercount = 0, pendingheader = 0, start = {
tv_sec = 2969402, tv_usec = 155892}, badheader = HEADER_NORMAL,
headerline = 0, str = 0x0, offset = 0, httpcode = 0, keepon = 1,
start100 = {tv_sec = 0, tv_usec = 0}, exp100 = EXP100_SEND_DATA,
upgr101 = UPGR101_H2, writer_stack = 0x0, timeofdoc = 0, bodywrites = 0,
location = 0x0, newurl = 0x0, upload_present = 0, upload_fromhere = 0x0,
p = {file = 0x7f78302b8930, ftp = 0x7f78302b8930, http = 0x7f78302b8930,
imap = 0x7f78302b8930, ldap = 0x7f78302b8930, mqtt = 0x7f78302b8930,
pop3 = 0x7f78302b8930, rtsp = 0x7f78302b8930, smb = 0x7f78302b8930,
smtp = 0x7f78302b8930, ssh = 0x7f78302b8930, telnet = 0x7f78302b8930},
doh = 0x0, setcookies = 0 '\000', writer_stack_depth = 0 '\000',
header = 1, content_range = 0, upload_done = 1, ignorebody = 0,
http_bodyless = 0, chunk = 0, ignore_cl = 0, upload_chunky = 0,
getheader = 1, forbidchunk = 0, no_body = 0}, set = {
err = 0x7f78412394e0 <_IO_2_1_stderr_>, debugdata = 0x0,
errorbuffer = 0x7f7500000bd8 "", out = 0x7f7500000bd0,
in_set = 0x7f78412388e0 <_IO_2_1_stdin_>, writeheader = 0x0, use_port = 0,
httpauth = 1, proxyauth = 1, maxredirs = -1, postfields = 0x0,
seek_func = 0x0, postfieldsize = -1, localport = 0, localportrange = 0,
fwrite_func = 0x7f78416f3ef0 <write_cb>, fwrite_header = 0x0,
fwrite_rtp = 0x0, fread_func_set = 0x7f7841079bc0 <__GI__IO_fread>,
fprogress = 0x0, fxferinfo = 0x0, fdebug = 0x0, ioctl_func = 0x0,
fsockopt = 0x0, sockopt_client = 0x0, fopensocket = 0x0,
opensocket_client = 0x0, fclosesocket = 0x0, closesocket_client = 0x0,
fprereq = 0x0, prereq_userp = 0x0, seek_client = 0x0, cookielist = 0x0,
hstslist = 0x0, hsts_read = 0x0, hsts_read_userp = 0x0, hsts_write = 0x0,
hsts_write_userp = 0x0, progress_client = 0x0, ioctl_client = 0x0,
timeout = 0, connecttimeout = 0, happy_eyeballs_timeout = 200,
server_response_timeout = 0, maxage_conn = 118, maxlifetime_conn = 0,
tftp_blksize = 0, filesize = -1, low_speed_limit = 0, low_speed_time = 0,
max_send_speed = 0, max_recv_speed = 0, set_resume_from = 0,
headers = 0x0, httppost = 0x0, mimepost = {parent = 0x0, nextpart = 0x0,
kind = MIMEKIND_NONE, flags = 0, data = 0x0, readfunc = 0x0,
seekfunc = 0x0, freefunc = 0x0, arg = 0x0, fp = 0x0, curlheaders = 0x0,
userheaders = 0x0, mimetype = 0x0, filename = 0x0, name = 0x0,
datasize = 0, state = {state = MIMESTATE_BEGIN, ptr = 0x0, offset = 0},
encoder = 0x0, encstate = {pos = 0, bufbeg = 0, bufend = 0,
buf = '\000' <repeats 255 times>}, lastreadstatus = 1},
telnet_options = 0x0, resolve = 0x0, connect_to = 0x0, timevalue = 0,
timecondition = 0 '\000', method = 0 '\000', httpwant = 3 '\003', ssl = {
primary = {CApath = 0x0,
--Type <RET> for more, q to quit, c to continue without paging--c
CAfile = 0x7f7500002240 "/etc/pki/tls/certs/ca-bundle.crt",
issuercert = 0x0, clientcert = 0x0, cipher_list = 0x0,
cipher_list13 = 0x0, pinned_key = 0x0, CRLfile = 0x0, cert_blob = 0x0,
ca_info_blob = 0x0, issuercert_blob = 0x0, username = 0x0,
password = 0x0, curves = 0x0, ssl_options = 0 '\000', version_max = 0,
version = 0 '\000', verifypeer = 1, verifyhost = 1, verifystatus = 0,
sessionid = 1}, certverifyresult = 0, fsslctx = 0x0, fsslctxp = 0x0,
cert_type = 0x0, key = 0x0, key_blob = 0x0, key_type = 0x0,
key_passwd = 0x0, certinfo = 0, falsestart = 0, enable_beast = 0,
no_revoke = 0, no_partialchain = 0, revoke_best_effort = 0,
native_ca_store = 0, auto_client_cert = 0}, proxy_ssl = {primary = {
CApath = 0x0,
CAfile = 0x7f7500002270 "/etc/pki/tls/certs/ca-bundle.crt",
issuercert = 0x0, clientcert = 0x0, cipher_list = 0x0,
cipher_list13 = 0x0, pinned_key = 0x0, CRLfile = 0x0, cert_blob = 0x0,
ca_info_blob = 0x0, issuercert_blob = 0x0, username = 0x0,
password = 0x0, curves = 0x0, ssl_options = 0 '\000', version_max = 0,
version = 0 '\000', verifypeer = 1, verifyhost = 1, verifystatus = 0,
sessionid = 1}, certverifyresult = 0, fsslctx = 0x0, fsslctxp = 0x0,
cert_type = 0x0, key = 0x0, key_blob = 0x0, key_type = 0x0,
key_passwd = 0x0, certinfo = 0, falsestart = 0, enable_beast = 0,
no_revoke = 0, no_partialchain = 0, revoke_best_effort = 0,
native_ca_store = 0, auto_client_cert = 0}, proxyheaders = 0x0,
proxyport = 0, proxytype = 0 '\000', socks5auth = 5 '\005', general_ssl = {
max_ssl_sessions = 5, ca_cache_timeout = 86400}, dns_cache_timeout = 60,
buffer_size = 16384, upload_buffer_size = 65536, private_data = 0x0,
http200aliases = 0x0, ipver = 0 '\000', max_filesize = 0,
ftp_filemethod = 1 '\001', ftpsslauth = 0 '\000', ftp_ccc = 0 '\000',
accepttimeout = 0, quote = 0x0, postquote = 0x0, prequote = 0x0,
ftp_create_missing_dirs = 0 '\000', ssh_keyfunc = 0x0,
ssh_keyfunc_userp = 0x0, ssh_auth_types = -1, new_directory_perms = 493,
use_netrc = 0 '\000', new_file_perms = 420, str = {0x0 <repeats 23 times>,
0x7f7564001cb0 "1343750144-1344012288", 0x0,
0x7f75000022a0 "http://dev3.home.annexia.org/html/fedora-36.qcow2", 0x0,
0x0, 0x7f7500002240 "/etc/pki/tls/certs/ca-bundle.crt",
0x7f7500002270 "/etc/pki/tls/certs/ca-bundle.crt",
0x0 <repeats 50 times>}, blobs = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0}, scope_id = 0, allowed_protocols = 4294967295,
redir_protocols = 15, mime_options = 0, rtp_out = 0x0,
rtspreq = RTSPREQ_OPTIONS, chunk_bgn = 0x0, chunk_end = 0x0,
fnmatch = 0x0, fnmatch_data = 0x0, wildcardptr = 0x0,
gssapi_delegation = 0 '\000', tcp_keepidle = 60, tcp_keepintvl = 60,
maxconnects = 5, expect_100_timeout = 1000, priority = {parent = 0x0,
children = 0x0, weight = 0, exclusive = 0}, resolver_start = 0x0,
resolver_start_client = 0x0, upkeep_interval_ms = 60000, fmultidone = 0x0,
dohfor = 0x0, uh = 0x0, trailer_data = 0x0, trailer_callback = 0x0,
keep_post = 0 '\000', mail_rcpt = 0x0, mail_rcpt_allowfails = 0,
use_ssl = 0 '\000', connect_only = 0 '\000', is_fread_set = 0,
tftp_no_options = 0, sep_headers = 1, cookiesession = 0, crlf = 0,
ssh_compression = 0, quick_exit = 0, get_filetime = 0,
tunnel_thru_httpproxy = 0, prefer_ascii = 0, remote_append = 0,
list_only = 0, ftp_use_port = 0, ftp_use_epsv = 1, ftp_use_eprt = 1,
ftp_use_pret = 0, ftp_skip_ip = 1, wildcard_enabled = 0,
hide_progress = 1, http_fail_on_error = 1, http_keep_sending_on_error = 0,
http_follow_location = 1, http_transfer_encoding = 0,
allow_auth_to_other_hosts = 0, include_header = 0, http_set_referer = 0,
http_auto_referer = 1, opt_no_body = 0, verbose = 0, krb = 0,
reuse_forbid = 0, reuse_fresh = 0, no_signal = 1, tcp_nodelay = 1,
ignorecl = 0, http_te_skip = 0, http_ce_skip = 0, proxy_transfer_mode = 0,
socks5_gssapi_nec = 0, sasl_ir = 0, tcp_keepalive = 0, tcp_fastopen = 0,
ssl_enable_alpn = 1, path_as_is = 0, pipewait = 0,
suppress_connect_headers = 0, dns_shuffle_addresses = 0,
haproxyprotocol = 0, abstract_unix_socket = 0,
disallow_username_in_url = 0, doh = 0, doh_verifypeer = 1,
doh_verifyhost = 1, doh_verifystatus = 0, http09_allowed = 0},
cookies = 0x0, hsts = 0x0, asi = 0x0, progress = {lastshow = 2969402,
size_dl = 0, size_ul = 0, downloaded = 0, uploaded = 0, current_speed = 0,
width = 0, flags = 48, timespent = 1001, dlspeed = 0, ulspeed = 0,
t_nslookup = 0, t_connect = 0, t_appconnect = 0, t_pretransfer = 10,
t_starttransfer = 0, t_redirect = 0, start = {tv_sec = 2969402,
tv_usec = 155886}, t_startsingle = {tv_sec = 2969402, tv_usec = 155887},
t_startop = {tv_sec = 2969402, tv_usec = 155886}, t_acceptdata = {
tv_sec = 0, tv_usec = 0}, ul_limit_start = {tv_sec = 2969402,
tv_usec = 155886}, ul_limit_size = 0, dl_limit_start = {
tv_sec = 2969402, tv_usec = 155886}, dl_limit_size = 0, speeder = {0, 0,
0, 0, 0, 0}, speeder_time = {{tv_sec = 2969402, tv_usec = 155892}, {
tv_sec = 0, tv_usec = 0}, {tv_sec = 0, tv_usec = 0}, {tv_sec = 0,
tv_usec = 0}, {tv_sec = 0, tv_usec = 0}, {tv_sec = 0, tv_usec = 0}},
speeder_c = 1, callback = 0, is_t_startransfer_set = 0}, state = {
conn_cache = 0x560efbd2ff08, keeps_speed = {tv_sec = 0, tv_usec = 0},
lastconnect_id = -1, recent_conn_id = -1, headerb = {bufr = 0x0, leng = 0,
allc = 0, toobig = 102400}, buffer = 0x7f78302b42a0 "", ulbuf = 0x0,
current_speed = -1, first_host = 0x7f783029cde0 "dev3.home.annexia.org",
first_remote_port = 80, first_remote_protocol = 1, retrycount = 0,
session = 0x7f78302b3f00, sessionage = 1, tempwrite = {{b = {bufr = 0x0,
leng = 0, allc = 0, toobig = 0}, type = 0}, {b = {bufr = 0x0,
leng = 0, allc = 0, toobig = 0}, type = 0}, {b = {bufr = 0x0,
leng = 0, allc = 0, toobig = 0}, type = 0}}, tempcount = 0,
os_errno = 0, scratch = 0x0, followlocation = 0, requests = 0,
prev_signal = 0x0, digest = {nonce = 0x0, cnonce = 0x0, realm = 0x0,
opaque = 0x0, qop = 0x0, algorithm = 0x0, nc = 0, algo = 0 '\000',
stale = 0, userhash = 0}, proxydigest = {nonce = 0x0, cnonce = 0x0,
realm = 0x0, opaque = 0x0, qop = 0x0, algorithm = 0x0, nc = 0,
algo = 0 '\000', stale = 0, userhash = 0}, authhost = {want = 1,
picked = 0, avail = 0, done = 1, multipass = 0, iestyle = 0},
authproxy = {want = 1, picked = 0, avail = 0, done = 1, multipass = 0,
iestyle = 0}, async = {hostname = 0x0, dns = 0x0, tdata = 0x0,
resolver = 0x7f7500002220, port = 0, status = 0, done = 0},
engine = 0x0, expiretime = {tv_sec = 0, tv_usec = 0}, timenode = {
smaller = 0x0, larger = 0x7f755c001bc8, samen = 0x7f7500001bc8,
samep = 0x7f7500001bc8, key = {tv_sec = 2969402, tv_usec = 155727},
payload = 0x7f7500000d10}, timeoutlist = {head = 0x0, tail = 0x0,
dtor = 0x0, size = 0}, expires = {{list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 2969402, tv_usec = 155727},
eid = EXPIRE_RUN_NOW}, {list = {ptr = 0x0, prev = 0x0, next = 0x0},
time = {tv_sec = 0, tv_usec = 0}, eid = EXPIRE_100_TIMEOUT}, {list = {
ptr = 0x0, prev = 0x0, next = 0x0}, time = {tv_sec = 0,
tv_usec = 0}, eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0,
prev = 0x0, next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}}, most_recent_ftp_entrypath = 0x0,
prev_block_had_trailing_cr = 0, crlf_conversions = 0,
range = 0x7f783029d120 "1343750144-1344012288", resume_from = 0,
rtsp_next_client_CSeq = 0, rtsp_next_server_CSeq = 0, rtsp_CSeq_recv = 0,
rtp_channel_mask = '\000' <repeats 31 times>, infilesize = 0, priority = {
parent = 0x0, children = 0x0, weight = 0, exclusive = 0},
fread_func = 0x7f7841079bc0 <__GI__IO_fread>,
in = 0x7f78412388e0 <_IO_2_1_stdin_>, uh = 0x7f78302b3e40, up = {
scheme = 0x7f78302b3dd0 "http",
hostname = 0x7f78302a7560 "dev3.home.annexia.org",
port = 0x7f78302b88a0 "80", user = 0x0, password = 0x0, options = 0x0,
path = 0x7f78302b88c0 "/html/fedora-36.qcow2", query = 0x0},
url = 0x7f78302ace20 "http://dev3.home.annexia.org/html/fedora-36.qcow2",
referer = 0x0, resolve = 0x0, trailers_bytes_sent = 0, trailers_buf = {
bufr = 0x0, leng = 0, allc = 0, toobig = 0}, httphdrs = {head = 0x0,
tail = 0x0, dtor = 0x0, size = 0}, headerout = {{name = 0x0,
value = 0x0, amount = 0, index = 0, origin = 0, anchor = 0x0}, {
name = 0x0, value = 0x0, amount = 0, index = 0, origin = 0,
anchor = 0x0}}, prevhead = 0x0, trailers_state = TRAILERS_NONE,
aptr = {proxyuserpwd = 0x0, uagent = 0x0, accept_encoding = 0x0,
userpwd = 0x0,
rangeline = 0x7f78302b8ba0 "Range: bytes=1343750144-1344012288\r\n",
ref = 0x0, host = 0x7f78302b8b70 "Host: dev3.home.annexia.org\r\n",
cookiehost = 0x0, rtsp_transport = 0x0, te = 0x0, user = 0x0,
passwd = 0x0, proxyuser = 0x0, proxypasswd = 0x0}, httpwant = 3 '\003',
httpversion = 0 '\000', httpreq = 0 '\000', dselect_bits = 0 '\000',
multi_owned_by_easy = 0, this_is_a_follow = 0, refused_stream = 0,
errorbuf = 0, allow_port = 1, authproblem = 0, wildcardmatch = 0,
expect100header = 0, disableexpect = 0, use_range = 1,
rangestringalloc = 1, done = 0, previouslypending = 0, cookie_engine = 0,
prefer_ascii = 0, list_only = 0, url_alloc = 1, referer_alloc = 0,
wildcard_resolve = 0, rewindbeforesend = 0, upload = 0}, wildcard = 0x0,
info = {httpcode = 0, httpproxycode = 0, httpversion = 0, filetime = -1,
header_size = 0, request_size = 209, proxyauthavail = 0,
httpauthavail = 0, numconnects = 0, contenttype = 0x0,
wouldredirect = 0x0, retry_after = 0,
conn_primary_ip = "192.168.0.220", '\000' <repeats 32 times>,
conn_primary_port = 80, conn_remote_port = 80,
conn_local_ip = "192.168.0.140", '\000' <repeats 32 times>,
conn_local_port = 53600, conn_scheme = 0x7f7840b04605 "HTTP",
conn_protocol = 1, certs = {num_of_certs = 0, certinfo = 0x0},
pxcode = CURLPX_OK, timecond = 0}, tsi = {backend = CURLSSLBACKEND_NONE,
internals = 0x0}}
Date: Mon, 31 Jul 2023 10:03:00 +0100
On Mon, Jul 31, 2023 at 08:18:30AM +0200, Daniel Stenberg wrote:
> On Sun, 30 Jul 2023, Richard W.M. Jones via curl-library wrote:
>
> >#0 stream_recv (cf=cf_at_entry=0x7fe0542a7260, data=data_at_entry=0x7fdd78001010,
> > buf=buf_at_entry=0x7fe05423ce80 "", len=len_at_entry=16384,
> > err=err_at_entry=0x7fe062a52824) at ../../lib/http2.c:1742
> >#1 0x00007fe0632f58db in cf_h2_recv (cf=0x7fe0542a7260, data=0x7fdd78001010,
> > buf=0x7fe05423ce80 "", len=16384, err=0x7fe062a52824)
> > at ../../lib/http2.c:1844
>
> In this function cf_h2_recv(), is 'stream' NULL by any chance when
> stream_recv() is called?
Looks like it, yes:
(gdb) frame 1
#1 0x00007f7840ab28db in cf_h2_recv (cf=0x7f7830327670, data=0x7f7500000d10,
buf=0x7f78302b42a0 "", len=16384, err=0x7f7840219824)
at ../../lib/http2.c:1844
1844 nread = stream_recv(cf, data, buf, len, err);
(gdb) print *cf
$1 = {cft = 0x7f7840b1e4c0 <Curl_cft_nghttp2>, next = 0x7f78302a1f40,
ctx = 0x7f7830327590, conn = 0x7f78302a1950, sockindex = 0, connected = 1}
(gdb) print stream
$2 = (struct stream_ctx *) 0x0
I've copied and pasted the whole of the 'data' struct below, but the
important bits are:
(gdb) print data->req.p.http
$4 = (struct HTTP *) 0x7f78302b8930
(gdb) print ((struct HTTP *)data->req.p.http)->h2_ctx
$5 = (void *) 0x0
(gdb) print *data->req.p.http
$6 = {sendit = 0x0, postsize = 0, postdata = 0x0, p_pragma = 0x0, form = {
parent = 0x0, nextpart = 0x0, kind = MIMEKIND_NONE, flags = 0, data = 0x0,
readfunc = 0x0, seekfunc = 0x0, freefunc = 0x0, arg = 0x0, fp = 0x0,
curlheaders = 0x0, userheaders = 0x0, mimetype = 0x0, filename = 0x0,
name = 0x0, datasize = 0, state = {state = MIMESTATE_BEGIN, ptr = 0x0,
offset = 0}, encoder = 0x0, encstate = {pos = 0, bufbeg = 0, bufend = 0,
buf = '\000' <repeats 255 times>}, lastreadstatus = 1}, backup = {
fread_func = 0x0, fread_in = 0x0, postdata = 0x0, postsize = 0,
data = 0x0}, sending = HTTPSEND_BODY, h2_ctx = 0x0, h3_ctx = 0x0,
send_buffer = {bufr = 0x0, leng = 0, allc = 0, toobig = 0}}
which seems wrong?
Rich.
======================================================================
(gdb) print *data
$3 = {magic = 3235830701, id = 120, next = 0x7f754c000d10,
prev = 0x7f76d4000d10, conn = 0x7f78302a1950, connect_queue = {ptr = 0x0,
prev = 0x0, next = 0x0}, conn_queue = {ptr = 0x7f7500000d10, prev = 0x0,
next = 0x7f754c000d50}, mstate = MSTATE_PERFORMING, result = CURLE_OK,
msg = {list = {ptr = 0x0, prev = 0x0, next = 0x0}, extmsg = {
msg = CURLMSG_NONE, easy_handle = 0x0, data = {whatever = 0x0,
result = CURLE_OK}}}, sockets = {0, 0, 0, 0, 0},
actions = "\000\000\000\000", numsocks = 0, dns = {
hostcache = 0x560efbd2fe80, hostcachetype = HCACHE_MULTI},
multi = 0x560efbd2fde0, multi_easy = 0x0, share = 0x0, psl = 0x560efbd2feb0,
req = {size = -1, maxdownload = -1, bytecount = 0, writebytecount = 0,
headerbytecount = 0, deductheadercount = 0, pendingheader = 0, start = {
tv_sec = 2969402, tv_usec = 155892}, badheader = HEADER_NORMAL,
headerline = 0, str = 0x0, offset = 0, httpcode = 0, keepon = 1,
start100 = {tv_sec = 0, tv_usec = 0}, exp100 = EXP100_SEND_DATA,
upgr101 = UPGR101_H2, writer_stack = 0x0, timeofdoc = 0, bodywrites = 0,
location = 0x0, newurl = 0x0, upload_present = 0, upload_fromhere = 0x0,
p = {file = 0x7f78302b8930, ftp = 0x7f78302b8930, http = 0x7f78302b8930,
imap = 0x7f78302b8930, ldap = 0x7f78302b8930, mqtt = 0x7f78302b8930,
pop3 = 0x7f78302b8930, rtsp = 0x7f78302b8930, smb = 0x7f78302b8930,
smtp = 0x7f78302b8930, ssh = 0x7f78302b8930, telnet = 0x7f78302b8930},
doh = 0x0, setcookies = 0 '\000', writer_stack_depth = 0 '\000',
header = 1, content_range = 0, upload_done = 1, ignorebody = 0,
http_bodyless = 0, chunk = 0, ignore_cl = 0, upload_chunky = 0,
getheader = 1, forbidchunk = 0, no_body = 0}, set = {
err = 0x7f78412394e0 <_IO_2_1_stderr_>, debugdata = 0x0,
errorbuffer = 0x7f7500000bd8 "", out = 0x7f7500000bd0,
in_set = 0x7f78412388e0 <_IO_2_1_stdin_>, writeheader = 0x0, use_port = 0,
httpauth = 1, proxyauth = 1, maxredirs = -1, postfields = 0x0,
seek_func = 0x0, postfieldsize = -1, localport = 0, localportrange = 0,
fwrite_func = 0x7f78416f3ef0 <write_cb>, fwrite_header = 0x0,
fwrite_rtp = 0x0, fread_func_set = 0x7f7841079bc0 <__GI__IO_fread>,
fprogress = 0x0, fxferinfo = 0x0, fdebug = 0x0, ioctl_func = 0x0,
fsockopt = 0x0, sockopt_client = 0x0, fopensocket = 0x0,
opensocket_client = 0x0, fclosesocket = 0x0, closesocket_client = 0x0,
fprereq = 0x0, prereq_userp = 0x0, seek_client = 0x0, cookielist = 0x0,
hstslist = 0x0, hsts_read = 0x0, hsts_read_userp = 0x0, hsts_write = 0x0,
hsts_write_userp = 0x0, progress_client = 0x0, ioctl_client = 0x0,
timeout = 0, connecttimeout = 0, happy_eyeballs_timeout = 200,
server_response_timeout = 0, maxage_conn = 118, maxlifetime_conn = 0,
tftp_blksize = 0, filesize = -1, low_speed_limit = 0, low_speed_time = 0,
max_send_speed = 0, max_recv_speed = 0, set_resume_from = 0,
headers = 0x0, httppost = 0x0, mimepost = {parent = 0x0, nextpart = 0x0,
kind = MIMEKIND_NONE, flags = 0, data = 0x0, readfunc = 0x0,
seekfunc = 0x0, freefunc = 0x0, arg = 0x0, fp = 0x0, curlheaders = 0x0,
userheaders = 0x0, mimetype = 0x0, filename = 0x0, name = 0x0,
datasize = 0, state = {state = MIMESTATE_BEGIN, ptr = 0x0, offset = 0},
encoder = 0x0, encstate = {pos = 0, bufbeg = 0, bufend = 0,
buf = '\000' <repeats 255 times>}, lastreadstatus = 1},
telnet_options = 0x0, resolve = 0x0, connect_to = 0x0, timevalue = 0,
timecondition = 0 '\000', method = 0 '\000', httpwant = 3 '\003', ssl = {
primary = {CApath = 0x0,
--Type <RET> for more, q to quit, c to continue without paging--c
CAfile = 0x7f7500002240 "/etc/pki/tls/certs/ca-bundle.crt",
issuercert = 0x0, clientcert = 0x0, cipher_list = 0x0,
cipher_list13 = 0x0, pinned_key = 0x0, CRLfile = 0x0, cert_blob = 0x0,
ca_info_blob = 0x0, issuercert_blob = 0x0, username = 0x0,
password = 0x0, curves = 0x0, ssl_options = 0 '\000', version_max = 0,
version = 0 '\000', verifypeer = 1, verifyhost = 1, verifystatus = 0,
sessionid = 1}, certverifyresult = 0, fsslctx = 0x0, fsslctxp = 0x0,
cert_type = 0x0, key = 0x0, key_blob = 0x0, key_type = 0x0,
key_passwd = 0x0, certinfo = 0, falsestart = 0, enable_beast = 0,
no_revoke = 0, no_partialchain = 0, revoke_best_effort = 0,
native_ca_store = 0, auto_client_cert = 0}, proxy_ssl = {primary = {
CApath = 0x0,
CAfile = 0x7f7500002270 "/etc/pki/tls/certs/ca-bundle.crt",
issuercert = 0x0, clientcert = 0x0, cipher_list = 0x0,
cipher_list13 = 0x0, pinned_key = 0x0, CRLfile = 0x0, cert_blob = 0x0,
ca_info_blob = 0x0, issuercert_blob = 0x0, username = 0x0,
password = 0x0, curves = 0x0, ssl_options = 0 '\000', version_max = 0,
version = 0 '\000', verifypeer = 1, verifyhost = 1, verifystatus = 0,
sessionid = 1}, certverifyresult = 0, fsslctx = 0x0, fsslctxp = 0x0,
cert_type = 0x0, key = 0x0, key_blob = 0x0, key_type = 0x0,
key_passwd = 0x0, certinfo = 0, falsestart = 0, enable_beast = 0,
no_revoke = 0, no_partialchain = 0, revoke_best_effort = 0,
native_ca_store = 0, auto_client_cert = 0}, proxyheaders = 0x0,
proxyport = 0, proxytype = 0 '\000', socks5auth = 5 '\005', general_ssl = {
max_ssl_sessions = 5, ca_cache_timeout = 86400}, dns_cache_timeout = 60,
buffer_size = 16384, upload_buffer_size = 65536, private_data = 0x0,
http200aliases = 0x0, ipver = 0 '\000', max_filesize = 0,
ftp_filemethod = 1 '\001', ftpsslauth = 0 '\000', ftp_ccc = 0 '\000',
accepttimeout = 0, quote = 0x0, postquote = 0x0, prequote = 0x0,
ftp_create_missing_dirs = 0 '\000', ssh_keyfunc = 0x0,
ssh_keyfunc_userp = 0x0, ssh_auth_types = -1, new_directory_perms = 493,
use_netrc = 0 '\000', new_file_perms = 420, str = {0x0 <repeats 23 times>,
0x7f7564001cb0 "1343750144-1344012288", 0x0,
0x7f75000022a0 "http://dev3.home.annexia.org/html/fedora-36.qcow2", 0x0,
0x0, 0x7f7500002240 "/etc/pki/tls/certs/ca-bundle.crt",
0x7f7500002270 "/etc/pki/tls/certs/ca-bundle.crt",
0x0 <repeats 50 times>}, blobs = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0}, scope_id = 0, allowed_protocols = 4294967295,
redir_protocols = 15, mime_options = 0, rtp_out = 0x0,
rtspreq = RTSPREQ_OPTIONS, chunk_bgn = 0x0, chunk_end = 0x0,
fnmatch = 0x0, fnmatch_data = 0x0, wildcardptr = 0x0,
gssapi_delegation = 0 '\000', tcp_keepidle = 60, tcp_keepintvl = 60,
maxconnects = 5, expect_100_timeout = 1000, priority = {parent = 0x0,
children = 0x0, weight = 0, exclusive = 0}, resolver_start = 0x0,
resolver_start_client = 0x0, upkeep_interval_ms = 60000, fmultidone = 0x0,
dohfor = 0x0, uh = 0x0, trailer_data = 0x0, trailer_callback = 0x0,
keep_post = 0 '\000', mail_rcpt = 0x0, mail_rcpt_allowfails = 0,
use_ssl = 0 '\000', connect_only = 0 '\000', is_fread_set = 0,
tftp_no_options = 0, sep_headers = 1, cookiesession = 0, crlf = 0,
ssh_compression = 0, quick_exit = 0, get_filetime = 0,
tunnel_thru_httpproxy = 0, prefer_ascii = 0, remote_append = 0,
list_only = 0, ftp_use_port = 0, ftp_use_epsv = 1, ftp_use_eprt = 1,
ftp_use_pret = 0, ftp_skip_ip = 1, wildcard_enabled = 0,
hide_progress = 1, http_fail_on_error = 1, http_keep_sending_on_error = 0,
http_follow_location = 1, http_transfer_encoding = 0,
allow_auth_to_other_hosts = 0, include_header = 0, http_set_referer = 0,
http_auto_referer = 1, opt_no_body = 0, verbose = 0, krb = 0,
reuse_forbid = 0, reuse_fresh = 0, no_signal = 1, tcp_nodelay = 1,
ignorecl = 0, http_te_skip = 0, http_ce_skip = 0, proxy_transfer_mode = 0,
socks5_gssapi_nec = 0, sasl_ir = 0, tcp_keepalive = 0, tcp_fastopen = 0,
ssl_enable_alpn = 1, path_as_is = 0, pipewait = 0,
suppress_connect_headers = 0, dns_shuffle_addresses = 0,
haproxyprotocol = 0, abstract_unix_socket = 0,
disallow_username_in_url = 0, doh = 0, doh_verifypeer = 1,
doh_verifyhost = 1, doh_verifystatus = 0, http09_allowed = 0},
cookies = 0x0, hsts = 0x0, asi = 0x0, progress = {lastshow = 2969402,
size_dl = 0, size_ul = 0, downloaded = 0, uploaded = 0, current_speed = 0,
width = 0, flags = 48, timespent = 1001, dlspeed = 0, ulspeed = 0,
t_nslookup = 0, t_connect = 0, t_appconnect = 0, t_pretransfer = 10,
t_starttransfer = 0, t_redirect = 0, start = {tv_sec = 2969402,
tv_usec = 155886}, t_startsingle = {tv_sec = 2969402, tv_usec = 155887},
t_startop = {tv_sec = 2969402, tv_usec = 155886}, t_acceptdata = {
tv_sec = 0, tv_usec = 0}, ul_limit_start = {tv_sec = 2969402,
tv_usec = 155886}, ul_limit_size = 0, dl_limit_start = {
tv_sec = 2969402, tv_usec = 155886}, dl_limit_size = 0, speeder = {0, 0,
0, 0, 0, 0}, speeder_time = {{tv_sec = 2969402, tv_usec = 155892}, {
tv_sec = 0, tv_usec = 0}, {tv_sec = 0, tv_usec = 0}, {tv_sec = 0,
tv_usec = 0}, {tv_sec = 0, tv_usec = 0}, {tv_sec = 0, tv_usec = 0}},
speeder_c = 1, callback = 0, is_t_startransfer_set = 0}, state = {
conn_cache = 0x560efbd2ff08, keeps_speed = {tv_sec = 0, tv_usec = 0},
lastconnect_id = -1, recent_conn_id = -1, headerb = {bufr = 0x0, leng = 0,
allc = 0, toobig = 102400}, buffer = 0x7f78302b42a0 "", ulbuf = 0x0,
current_speed = -1, first_host = 0x7f783029cde0 "dev3.home.annexia.org",
first_remote_port = 80, first_remote_protocol = 1, retrycount = 0,
session = 0x7f78302b3f00, sessionage = 1, tempwrite = {{b = {bufr = 0x0,
leng = 0, allc = 0, toobig = 0}, type = 0}, {b = {bufr = 0x0,
leng = 0, allc = 0, toobig = 0}, type = 0}, {b = {bufr = 0x0,
leng = 0, allc = 0, toobig = 0}, type = 0}}, tempcount = 0,
os_errno = 0, scratch = 0x0, followlocation = 0, requests = 0,
prev_signal = 0x0, digest = {nonce = 0x0, cnonce = 0x0, realm = 0x0,
opaque = 0x0, qop = 0x0, algorithm = 0x0, nc = 0, algo = 0 '\000',
stale = 0, userhash = 0}, proxydigest = {nonce = 0x0, cnonce = 0x0,
realm = 0x0, opaque = 0x0, qop = 0x0, algorithm = 0x0, nc = 0,
algo = 0 '\000', stale = 0, userhash = 0}, authhost = {want = 1,
picked = 0, avail = 0, done = 1, multipass = 0, iestyle = 0},
authproxy = {want = 1, picked = 0, avail = 0, done = 1, multipass = 0,
iestyle = 0}, async = {hostname = 0x0, dns = 0x0, tdata = 0x0,
resolver = 0x7f7500002220, port = 0, status = 0, done = 0},
engine = 0x0, expiretime = {tv_sec = 0, tv_usec = 0}, timenode = {
smaller = 0x0, larger = 0x7f755c001bc8, samen = 0x7f7500001bc8,
samep = 0x7f7500001bc8, key = {tv_sec = 2969402, tv_usec = 155727},
payload = 0x7f7500000d10}, timeoutlist = {head = 0x0, tail = 0x0,
dtor = 0x0, size = 0}, expires = {{list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 2969402, tv_usec = 155727},
eid = EXPIRE_RUN_NOW}, {list = {ptr = 0x0, prev = 0x0, next = 0x0},
time = {tv_sec = 0, tv_usec = 0}, eid = EXPIRE_100_TIMEOUT}, {list = {
ptr = 0x0, prev = 0x0, next = 0x0}, time = {tv_sec = 0,
tv_usec = 0}, eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0,
prev = 0x0, next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}, {list = {ptr = 0x0, prev = 0x0,
next = 0x0}, time = {tv_sec = 0, tv_usec = 0},
eid = EXPIRE_100_TIMEOUT}}, most_recent_ftp_entrypath = 0x0,
prev_block_had_trailing_cr = 0, crlf_conversions = 0,
range = 0x7f783029d120 "1343750144-1344012288", resume_from = 0,
rtsp_next_client_CSeq = 0, rtsp_next_server_CSeq = 0, rtsp_CSeq_recv = 0,
rtp_channel_mask = '\000' <repeats 31 times>, infilesize = 0, priority = {
parent = 0x0, children = 0x0, weight = 0, exclusive = 0},
fread_func = 0x7f7841079bc0 <__GI__IO_fread>,
in = 0x7f78412388e0 <_IO_2_1_stdin_>, uh = 0x7f78302b3e40, up = {
scheme = 0x7f78302b3dd0 "http",
hostname = 0x7f78302a7560 "dev3.home.annexia.org",
port = 0x7f78302b88a0 "80", user = 0x0, password = 0x0, options = 0x0,
path = 0x7f78302b88c0 "/html/fedora-36.qcow2", query = 0x0},
url = 0x7f78302ace20 "http://dev3.home.annexia.org/html/fedora-36.qcow2",
referer = 0x0, resolve = 0x0, trailers_bytes_sent = 0, trailers_buf = {
bufr = 0x0, leng = 0, allc = 0, toobig = 0}, httphdrs = {head = 0x0,
tail = 0x0, dtor = 0x0, size = 0}, headerout = {{name = 0x0,
value = 0x0, amount = 0, index = 0, origin = 0, anchor = 0x0}, {
name = 0x0, value = 0x0, amount = 0, index = 0, origin = 0,
anchor = 0x0}}, prevhead = 0x0, trailers_state = TRAILERS_NONE,
aptr = {proxyuserpwd = 0x0, uagent = 0x0, accept_encoding = 0x0,
userpwd = 0x0,
rangeline = 0x7f78302b8ba0 "Range: bytes=1343750144-1344012288\r\n",
ref = 0x0, host = 0x7f78302b8b70 "Host: dev3.home.annexia.org\r\n",
cookiehost = 0x0, rtsp_transport = 0x0, te = 0x0, user = 0x0,
passwd = 0x0, proxyuser = 0x0, proxypasswd = 0x0}, httpwant = 3 '\003',
httpversion = 0 '\000', httpreq = 0 '\000', dselect_bits = 0 '\000',
multi_owned_by_easy = 0, this_is_a_follow = 0, refused_stream = 0,
errorbuf = 0, allow_port = 1, authproblem = 0, wildcardmatch = 0,
expect100header = 0, disableexpect = 0, use_range = 1,
rangestringalloc = 1, done = 0, previouslypending = 0, cookie_engine = 0,
prefer_ascii = 0, list_only = 0, url_alloc = 1, referer_alloc = 0,
wildcard_resolve = 0, rewindbeforesend = 0, upload = 0}, wildcard = 0x0,
info = {httpcode = 0, httpproxycode = 0, httpversion = 0, filetime = -1,
header_size = 0, request_size = 209, proxyauthavail = 0,
httpauthavail = 0, numconnects = 0, contenttype = 0x0,
wouldredirect = 0x0, retry_after = 0,
conn_primary_ip = "192.168.0.220", '\000' <repeats 32 times>,
conn_primary_port = 80, conn_remote_port = 80,
conn_local_ip = "192.168.0.140", '\000' <repeats 32 times>,
conn_local_port = 53600, conn_scheme = 0x7f7840b04605 "HTTP",
conn_protocol = 1, certs = {num_of_certs = 0, certinfo = 0x0},
pxcode = CURLPX_OK, timecond = 0}, tsi = {backend = CURLSSLBACKEND_NONE,
internals = 0x0}}
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2023-07-31