-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix memleak and reset option #1
Conversation
Mainly backported from lwthiker/curl-impersonate#221
In order to make MSAN happy: ==2200945==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x596f3b3ed246 in curlx_strtoofft [...]/libcurl/src/lib/strtoofft.c:239:11 #1 0x596f3b402156 in Curl_httpchunk_read [...]/libcurl/src/lib/http_chunks.c:149:12 #2 0x596f3b348550 in readwrite_data [...]/libcurl/src/lib/transfer.c:607:11 [...] ==2202041==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x5a3fab66a72a in Curl_parse_port [...]/libcurl/src/lib/urlapi.c:547:8 #1 0x5a3fab650645 in parse_authority [...]/libcurl/src/lib/urlapi.c:796:12 #2 0x5a3fab6740f6 in parseurl [...]/libcurl/src/lib/urlapi.c:1176:16 #3 0x5a3fab664fc5 in parseurl_and_replace [...]/libcurl/src/lib/urlapi.c:1342:12 [...] ==2202320==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x569076a0d6b0 in ipv4_normalize [...]/libcurl/src/lib/urlapi.c:683:12 #1 0x5690769f2820 in parse_authority [...]/libcurl/src/lib/urlapi.c:803:10 #2 0x569076a160f6 in parseurl [...]/libcurl/src/lib/urlapi.c:1176:16 #3 0x569076a06fc5 in parseurl_and_replace [...]/libcurl/src/lib/urlapi.c:1342:12 [...] Signed-off-by: Louis Solofrizzo <[email protected]> Closes curl#12995
There is no issue section, so I'm starting the conversation here. On this fork, with http2 only, the response is truncated with some server, E.g: https://www.yelp.com/search/snippet?find_desc=SEATOWN%20ELECTRIC&find_loc=MUKILTEO%2C%20WA |
Does it work with the unpatched curl? Also enabled and created an issue for this. |
With the lwthiker version, yes it's working as expected, the response is not truncated. I did some testing, but so far I didn't get which changes affect http2 that way |
It seems that removing the I guess the compressed content-length was used as the uncompressed content-length somehow. BTW, which version were you using? The curl-8.1.1 based 0.6x branch or the 8.5.0 based 0.7x branch? |
Interesting, I'm using patches for curl 8.5.0 so 0.7x |
Wait, it seems that curl itself does not handle this correctly. Can you reporduce this? curl -H 'Accept-Encoding: gzip, deflate, br' \
--compressed \
'https://www.yelp.com/search/snippet?find_desc=SEATOWN%20ELECTRIC&find_loc=MUKILTEO%2C%20WA' |
I get the correct body and I tested on 2 version
EDIT Also tried against latest stable
|
I tried 8.5.0 and it did not work. |
I have tried with a docker version
on the 8.5, 8.6 I'm able to reproduce the issue, from 8.7.1 works 8.7.1
8.5.0
|
Thanks for confirming this, I also tried 8.7.1 and it works as well. I searched the curl issue section, but didn't find the particular issue or fix. Maybe we should simply skip 8.5.0 and use 8.7.1. Actually I have started working on it in the merge-8.7.1 branch yesterday. |
Do you have any blockers or spot something that can be painful to update? if I can help let me know |
AFAIK, it's a regular update from 8.5.0 to 8.7.1. However, I will be on vacation for a week celebrating labor day from tomorrow, if you are in a hurry, feel free to continue work on it. I have pushed my latest changes, it can compile at least, but there are still some problems I want to solve:
I have invited you as a collaborator of this fork, so you can directly work on it. |
Ok I will take a look on 1 & 3 thank you |
Is this dockerfile correct for build https://github.com/yifeikong/curl-impersonate/blob/main/docker/debian.dockerfile ? Because I'm getting errors
While boringssl is correctly patched and configure for the build |
The dockerfile never worked since forked from upstream, you are welcome to fix it :) I mainly used macOS as my development platform. |
The compilation looks correct on docker (I mean, it run as it should), and the boringssl patch is also the latest which include SSL_CTX_set_extension_order. Are you muting those warning/errors at compile time? can you show the command you run to build curl, the equivalent of https://github.com/yifeikong/curl-impersonate/blob/main/docker/debian.dockerfile#L89 The only fix I have implemented to fix the docker build at the moment, it's adding the zstd-dev package |
For macOS, it's basically the INSTALL.md, and export the zstd paths, which was added recently. export LDFLAGS="-L$(brew --prefix zstd)/lib" CPPFLAGS="-I$(brew --prefix zstd)/include"
cd build
../configure
make clean
make chrome-build
sudo gmake chrome-install For Linux, you can take the github workflow as a reference. However, you do not need to build and link libz/zstd etc from source probably.
The most relevant part is: When running locally When running in GitHub actions.
You need to make sure libcurl links to the patched boringssl. |
The |
Mainly backported from lwthiker/curl-impersonate#221