lexiforest / curl-impersonate

An active fork of curl-impersonate with more versions and build targets.
MIT License
78 stars 16 forks source link

v0.7.0 crashes on Windows 7 SP1 #72

Open bashonly opened 3 months ago

bashonly commented 3 months ago

curl-impersonate v0.7.0 crashes when making a request (e.g. if the executable is given URL input) on Windows 7 SP1.

It abruptly aborts with an error message of "This application has requested the Runtime to terminate it in an unusual way."

If the executable is run with the --help flag it does not error.

Here is a side-by-side comparison of upstream curl v8.8.0 vs curl-impersonate v0.7.0: curl-crash

I can reproduce the issue with both the curl-impersonate 0.7.0 windows .exe and libcurl-impersonate 0.7.0/curl_cffi 0.7.0. See the linked issue below for an example of the crash with curl_cffi:

I cannot reproduce this issue with curl_cffi 0.5.10 or the upstream libcurl-impersonate. Both work fine with Windows 7.


perklet commented 3 months ago

In 0.7, zstd was added, since Chrome added it in version 123. Otherwise, I can not think of other changes that will introduce at the moment.

I'll setup a Windows 7 VM and try it later.

barkoder commented 1 month ago

@perklet

Hi,

Don't want to rush you but...

The latest yt-dlp version nightly@2024.09.27.232842 has just added the following warning.

Deprecated Feature: Support for Windows 7/Server 2008 R2 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/10086  for details.
You may stop receiving updates on this version at any time!

I am currently using VxKex on yt-dlp to suppress the warning, but soon when yt-dlp upgrades curl_cffi this issue would become moot for non-Win7 users .

Please look into this issue soon as the unofficial yt-dlp python 3.12 builds for Win7 would likely not compile with newer versions of curl_cffi .

And I really need curl_cffi to work with yt-dlp on Win7.

Thanks!

lexiforest commented 1 month ago

Sure, I will take a look at this issue in the following days.

h-a-s-k commented 1 month ago

Would be nice if curl.exe was compiled statically again by the way, it used to be but stopped at some point and it's a pain to use in certain ways since you need all dynamic lib dll's. Now:

+ ldd dist/curl.exe
    ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffe5ba70000)
    KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ffe58e30000)
    KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ffe589f0000)
    bcrypt.dll => /c/Windows/System32/bcrypt.dll (0x7ffe586f0000)
    CRYPT32.dll => /c/Windows/System32/CRYPT32.dll (0x7ffe58740000)
    ucrtbase.dll => /c/Windows/System32/ucrtbase.dll (0x7ffe58320000)
    MSASN1.dll => /c/Windows/System32/MSASN1.dll (0x7ffe57ad0000)
    msvcrt.dll => /c/Windows/System32/msvcrt.dll (0x7ffe5b780000)
    WLDAP32.dll => /c/Windows/System32/WLDAP32.dll (0x7ffe5b6d0000)
    WS2_32.dll => /c/Windows/System32/WS2_32.dll (0x7ffe5adc0000)
    RPCRT4.dll => /c/Windows/System32/RPCRT4.dll (0x7ffe5b0a0000)
    libnghttp2-14.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libnghttp2-14.dll (0x7ffe4dd00000)
    libbrotlidec.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libbrotlidec.dll (0x7ffe4dce0000)
    libpsl-5.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libpsl-5.dll (0x7ffe4dcb0000)
    libzstd.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libzstd.dll (0x7ffe2f9a0000)
    libbrotlicommon.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libbrotlicommon.dll (0x7ffe4a230000)
    libiconv-2.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libiconv-2.dll (0x7ffe2f880000)
    zlib1.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/zlib1.dll (0x7ffe4a260000)
    libunistring-5.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libunistring-5.dll (0x7ffe2e950000)
    libidn2-0.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libidn2-0.dll (0x7ffe31670000)
    libintl-8.dll => /d/a/curl-impersonate/curl-impersonate/build/dist/libintl-8.dll (0x7ffe47ca0000)
    ADVAPI32.dll => /c/Windows/System32/ADVAPI32.dll (0x7ffe5b1c0000)
    sechost.dll => /c/Windows/System32/sechost.dll (0x7ffe5b820000)
lexiforest commented 1 month ago

Would be nice if curl.exe was compiled statically again by the way, it used to be but stopped at some point and it's a pain to use in certain ways since you need all dynamic lib dll's. Now:

That's what I hoped for, too. Unfortunately, my knowledge for the Windows toolchain is very limited.

lexiforest commented 1 month ago

It did work with the extensions provided by vxkex.

Then I tried to put the vxkex dlls inside the curl-impersonate folder as a quick and dirty verification, but it did not work. 😂

A lot of the toolchains have ended their support for Windows 7, so this is harder than I thought. I will try to set up a msys2 environment on my Windows 7 VM and compile inside it. But even if it works, I'm not sure how can I set up the same pipeline on GitHub actions, which only provides Windows 2019 and 2022.

Please let me know if you have more information on how to build or compile on Windows 7.