curl / Mailing Lists / curl-library / Single Mail
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.

Rare crashes when working with HTTP/2

From: Maksim Dmitrichenko via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 23 Oct 2019 17:09:10 +0300

Hi everyone!

I'm getting rare crashes inside curl but all of them have the same stack
trace. Curl is 7.66. libnghttp2 is 1.31 (from epel on CentOS 7).

As far as I understand this happens when there are multiple outstanding
requests (and appropriate number of curl easy handles) on one HTTP/2
connection (using multi interface). Some error happens on connections (may
be RST received from server), and curl tries to close all of the nghttp2
streams. When doing this, it gets curl easy handle from nghttp2_stream but
it is invalid.

Any thoughts? Below is the stacktrace.

#0 on_stream_close (session=0x7f913b643000, stream_id=1813, error_code=5,
userp=0x7f913b4b8b00) at /srv/buildslave/build/curl-7.66.0/lib/http2.c:848
#1 0x00007f91a12080a2 in nghttp2_session_close_stream
(session=session_at_entry=0x7f913b643000, stream_id=1813, error_code=5) at
nghttp2_session.c:1180
#2 0x00007f91a120b8e9 in nghttp2_session_mem_send_internal
(session=session_at_entry=0x7f913b643000, data_ptr=data_ptr_at_entry=0x7f90bfffc770,
fast_cb=fast_cb_at_entry=0) at nghttp2_session.c:2947
#3 0x00007f91a120c449 in nghttp2_session_send
(session=session_at_entry=0x7f913b643000)
at nghttp2_session.c:3215
#4 0x00007f91a3b461d9 in h2_session_send (data=data_at_entry=0x7f90d281f000,
h2=0x7f913b643000) at /srv/buildslave/build/curl-7.66.0/lib/http2.c:1544
#5 0x00007f91a3b46f6a in h2_process_pending_input
(conn=conn_at_entry=0x7f913b4b8b00,
httpc=httpc_at_entry=0x7f913b4b9018, err=err_at_entry=0x7f90bfffc8bc) at
/srv/buildslave/build/curl-7.66.0/lib/http2.c:1374
#6 0x00007f91a3b4735d in http2_handle_stream_close
(conn=conn_at_entry=0x7f913b4b8b00,
data=data_at_entry=0x7f90d281f000, stream=stream_at_entry=0x7f90a845c300,
err=err_at_entry=0x7f90bfffc8bc)
    at /srv/buildslave/build/curl-7.66.0/lib/http2.c:1441
#7 0x00007f91a3b4819d in http2_recv (conn=0x7f913b4b8b00,
sockindex=<optimized out>, mem=0x7f90d2a65000 "{\"d\027\003\003",
len=16384, err=0x7f90bfffc8bc) at
/srv/buildslave/build/curl-7.66.0/lib/http2.c:1684
#8 0x00007f91a3b2b92d in Curl_read (conn=conn_at_entry=0x7f913b4b8b00,
sockfd=<optimized out>, buf=<optimized out>, sizerequested=<optimized out>,
n=n_at_entry=0x7f90bfffc908) at
/srv/buildslave/build/curl-7.66.0/lib/sendf.c:740
#9 0x00007f91a3b34e39 in readwrite_data (comeback=0x7f90bfffc9a3,
done=0x7f90bfffc9a2, didwhat=<synthetic pointer>, k=0x7f90d281f0d8,
conn=0x7f913b4b8b00, data=0x7f90d281f000)
    at /srv/buildslave/build/curl-7.66.0/lib/transfer.c:589
#10 Curl_readwrite (conn=0x7f913b4b8b00, data=data_at_entry=0x7f90d281f000,
done=done_at_entry=0x7f90bfffc9a2, comeback=comeback_at_entry=0x7f90bfffc9a3) at
/srv/buildslave/build/curl-7.66.0/lib/transfer.c:1237
#11 0x00007f91a3b3c094 in multi_runsingle (multi=multi_at_entry=0x7f916d428300,
now=..., data=data_at_entry=0x7f90d281f000) at
/srv/buildslave/build/curl-7.66.0/lib/multi.c:1963
#12 0x00007f91a3b3ce48 in multi_socket (multi=0x7f916d428300,
checkall=checkall_at_entry=false, s=<optimized out>, ev_bitmask=<optimized
out>, running_handles=0x7f90bfffcb20)
    at /srv/buildslave/build/curl-7.66.0/lib/multi.c:2691
#13 0x00007f91a3b3cfde in curl_multi_socket_action (multi=0x7f916d428300,
s=<optimized out>, ev_bitmask=<optimized out>, running_handles=<optimized
out>) at /srv/buildslave/build/curl-7.66.0/lib/multi.c:2804

-- 
With best regards
  Maksim Dmitrichenko

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-10-23