alexcrichton / alexcrichton/curl-rust
POST upload with mesalink and curl-static gets stuck polling with a file bigger than 16KB
- Lenguaje dominante
- Rust
- Estrellas
- 1.1k
- Forks
- 258
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
When performing a multipart POST request with the `static-curl` and `mesalink` features activated, the request gets stuck when it's bigger than 16KB (16358 bytes work, 16414 bytes fails). Both `mesalink` alone and `static-curl` with `ssl` work fine. I've attached a gdb backtrace below.
Minimized snippet:
```rust
let mut easy = Easy::new();
easy.url(®istry.url)?;
easy.verbose(true)?;
let mut form = Form::new();
form.part("content").file(&file_path).add()?;
easy.httppost(form)?;
easy.perform()?;
```
I could reproduce this with both https://test.pypi.org/legacy and https://httpbin.org/post.
curl and curl-sys version: 20162df06dd9becc951926988d8a5da649850b0b
rustc -V: `rustc 1.38.0-nightly (ad7c55e1f 2019-08-07)`
operating system: Ubuntu 18.04
Cargo.toml excerpt:
```toml
[dependencies]
curl = { version = "0.4.22", optional = true, default-features = false, features = ["static-curl", "mesalink"] }
curl-sys = { version = "0.4.20", default-features = false }
[patch.crates-io]
curl = { git = "https://github.com/alexcrichton/curl-rust" }
curl-sys = { git = "https://github.com/alexcrichton/curl-rust" }
```
Verbose log and backtrace:
```
[src/upload.rs:110] "Before transfer.perform()" = "Before transfer.perform()"
[New Thread 0x7ffff5da2700 (LWP 5783)]
* Trying 2a04:4e42:1b::319:443...
[Thread 0x7ffff5da2700 (LWP 5783) exited]
* Connected to test.pypi.org () port 443 (#0)
* SSL connection using TLS1.2 / TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server auth using Basic with user 'konstin'
* WARNING: Using weak random seed
> POST /legacy/ HTTP/1.1
Host: test.pypi.org
Authorization: Basic REDACTED=
Accept: */*
User-Agent: pyo3-pack/0.7.0-beta.11
Content-Length: 113659
Content-Type: multipart/form-data; boundary=------------------------e1b460312d311976
Expect: 100-continue
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
} (65536 bytes of data)
} (48123 bytes of data)
* We are completely uploaded and fine
^C
Thread 1 "pyo3-pack" received signal SIGINT, Interrupt.
0x00007ffff6e4bbf9 in __GI___poll (fds=0x7fffffff51e0, nfds=1, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff6e4bbf9 in __GI___poll (fds=0x7fffffff51e0, nfds=1, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x0000555555f764d0 in Curl_poll (ufds=0x7fffffff51e0, nfds=1, timeout_ms=1000) at curl/lib/select.c:439
#2 0x0000555555f71084 in Curl_multi_wait (multi=0x5555571f8690, extra_fds=0x0, extra_nfds=0, timeout_ms=1000, ret=0x0, gotsocket=0x7fffffff5268) at curl/lib/multi.c:1103
#3 0x0000555555f6756e in easy_transfer (multi=0x5555571f8690) at curl/lib/easy.c:607
#4 0x0000555555f677b0 in easy_perform (data=0x5555571f9200, events=bool_false) at curl/lib/easy.c:718
#5 0x0000555555f677ef in curl_easy_perform (data=0x5555571f9200) at curl/lib/easy.c:737
#6 0x0000555555f4da64 in curl::easy::handler::Easy2::perform (self=0x7fffffff5648)
at /home/konsti/.cargo/git/checkouts/curl-rust-93d3b46505ed0780/20162df/src/easy/handler.rs:2611
#7 0x0000555555f5c9ca in curl::easy::handle::Easy::do_perform (self=0x7fffffff5648)
at /home/konsti/.cargo/git/checkouts/curl-rust-93d3b46505ed0780/20162df/src/easy/handle.rs:1189
#8 0x0000555555f5d956 in curl::easy::handle::Transfer::perform (self=0x7fffffff5f08)
at /home/konsti/.cargo/git/checkouts/curl-rust-93d3b46505ed0780/20162df/src/easy/handle.rs:1460
#9 0x000055555590cecb in pyo3_pack::upload::curl_scoped (registry=0x7fffffff8b80, wheel_path=0x5555571e0e60, joined_metadata=...) at src/upload.rs:113
#10 0x000055555590e352 in pyo3_pack::upload::upload (registry=0x7fffffff8b80, wheel_path=0x5555571e0e60, metadata21=0x7fffffff76a8, supported_version=...)
at src/upload.rs:153
#11 0x00005555556ff093 in pyo3_pack::upload_ui::{{closure}} () at src/main.rs:323
#12 0x00005555556fc736 in as core::iter::traits::iterator::Iterator>::try_fold::{{closure}} (acc=(), elt=0x5555571e9e90)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/adapters/mod.rs:615
#13 0x00005555556f9770 in as core::iter::traits::iterator::Iterator>::try_fold (self=0x7fffffff70e0, init=(), f=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/slice/mod.rs:3187
#14 0x00005555556fc6c3 in as core::iter::traits::iterator::Iterator>::try_fold (self=0x7fffffff70e0, init=(), g=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/adapters/mod.rs:615
#15 0x00005555556fbb6f in as core::iter::traits::iterator::Iterator>::try_fold (self=0x7fffffff70e0, init=(), f=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/adapters/mod.rs:2234
#16 0x00005555556fbeb9 in core::iter::traits::iterator::Iterator::fold (self=..., init=(), f=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/traits/iterator.rs:1783
#17 0x00005555556fc0c2 in core::iter::traits::iterator::Iterator::for_each (self=..., f=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/traits/iterator.rs:602
#18 0x00005555557004af in core::unit:: for ()>::from_iter (iter=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/unit.rs:19
#19 0x00005555556fbf60 in core::iter::traits::iterator::Iterator::collect (self=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/traits/iterator.rs:1464
#20 0x0000555555717f2b in as core::iter::traits::collect::FromIterator>>::from_iter::{{closure}} (i=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/result.rs:1346
#21 0x00005555556fc1a9 in core::iter::adapters::process_results (iter=..., f=...) at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/adapters/mod.rs:2206
#22 0x0000555555717ef4 in as core::iter::traits::collect::FromIterator>>::from_iter (iter=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/result.rs:1346
#23 0x00005555556fbfe8 in core::iter::traits::iterator::Iterator::collect (self=...)
at /rustc/ad7c55e1fc55d9af4787b285cec1c64e3480ae84/src/libcore/iter/traits/iterator.rs:1464
#24 0x0000555555703b96 in pyo3_pack::upload_ui (build=..., publish=0x7fffffffade0, no_sdist=false) at src/main.rs:320
#25 0x0000555555705678 in pyo3_pack::run () at src/main.rs:415
#26 0x00005555557088dc in pyo3_pack::main () at src/main.rs:490
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.