Skip to content
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

Error in the HTTP2 framing layer #10634

Closed
rwmjones opened this issue Feb 27, 2023 · 2 comments
Closed

Error in the HTTP2 framing layer #10634

rwmjones opened this issue Feb 27, 2023 · 2 comments
Assignees
Labels

Comments

@rwmjones
Copy link

I did this

I set up an Apache 2.4.55 server to serve a file over HTTP/2. When connecting repeatedly to the server using the curl command, I get the following error (usually at random, but below it happened for the first URL):

$ ./src/curl --fail-early --head --http2-prior-knowledge http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img http://localhost/fedora-36.img
HTTP/2 200 
last-modified: Mon, 20 Feb 2023 10:47:51 GMT
etag: "180000000-5f51f6506fa85"
accept-ranges: bytes
content-length: 6442450944
content-type: application/octet-stream
date: Mon, 27 Feb 2023 21:56:39 GMT
server: Apache/2.4.55 (Fedora Linux) SVN/1.14.2

curl: (16) Error in the HTTP2 framing layer

I expected the following

No error.

curl/libcurl version

This happens with curl @ commit 788c6b3

I bisected the problem and it was introduced by commit 6711582

Reverting curl back to commit b7aaf07 (the commit before 6711582) fixes the problem.

$ ./src/curl -V
curl 8.0.0-DEV (x86_64-pc-linux-gnu) libcurl/8.0.0-DEV OpenSSL/3.0.8 zlib/1.2.13 brotli/1.0.9 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) nghttp2/1.52.0
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets

operating system

Fedora Rawhide

kernel 6.2.0-0.rc7.20230206gitd2d11f342b17.50.fc38.x86_64
libnghttp2-1.52.0-1.fc39.x86_64
glibc-2.37.9000-1.fc39.x86_64
@bagder bagder added the HTTP/2 label Feb 27, 2023
icing added a commit to icing/curl that referenced this issue Feb 28, 2023
- refs curl#10634 where errors in the HTTP/2 framing layer are observed.
- the bug was that on connection reuse, the code attempted to switch
  in yet another layer of HTTP/2 handling instead of detecting that
  this was already in place.
- added pytest testcase reproducing the issue.
@icing
Copy link
Contributor

icing commented Feb 28, 2023

Thanks for the report. I made a test case and fix in #10643.

As to my analysis, the error should have always happened on the 2nd URL that used the same connection.

@rwmjones
Copy link
Author

Yes it's possible that is what happened. My actual case is some custom code which is quite a lot more complicated, and so I tried to reduce it down to something that happens with only the curl command.

I have tested your proposed patch and it works fine for me, both with curl and with my actual code.

@bagder bagder closed this as completed in cbe9d82 Feb 28, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
- refs curl#10634 where errors in the HTTP/2 framing layer are observed.
- the bug was that on connection reuse, the code attempted to switch
  in yet another layer of HTTP/2 handling instead of detecting that
  this was already in place.
- added pytest testcase reproducing the issue.

Reported-by: rwmjones on github
Fixes curl#10634
Closes curl#10643
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants