When building with MSVC, the libevent
dependency package is provided by the vcpkg package manager.
The #27335 pinned the libevent
version to 2.1.12#7
to avoid issues with the changed signature of the evhttp_connection_get_peer
function.
Then, #29774 introduced the fuzz.exe
binary.
It turned out that the newer libevent
version 2.1.12+20230128
leads to failures in the http_request
fuzz target.
To accommodate the newer libevent
version, the following diff can be applied:
0--- a/build_msvc/common.init.vcxproj.in
1+++ b/build_msvc/common.init.vcxproj.in
2@@ -90,12 +90,12 @@
3 <AdditionalOptions>/utf-8 /Zc:preprocessor /Zc:__cplusplus /std:c++20 %(AdditionalOptions)</AdditionalOptions>
4 <DisableSpecificWarnings>4018;4244;4267;4715;4805</DisableSpecificWarnings>
5 <TreatWarningAsError>true</TreatWarningAsError>
6- <PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SECP256K1_STATIC;ZMQ_STATIC;NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;PROVIDE_FUZZ_MAIN_FUNCTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
7+ <PreprocessorDefinitions>HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SECP256K1_STATIC;ZMQ_STATIC;NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;PROVIDE_FUZZ_MAIN_FUNCTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8 <AdditionalIncludeDirectories>..\..\src;..\..\src\minisketch\include;..\..\src\univalue\include;..\..\src\secp256k1\include;..\..\src\leveldb\include;..\..\src\leveldb\helpers\memenv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
9 </ClCompile>
10 <Link>
11 <SubSystem>Console</SubSystem>
12- <AdditionalDependencies>Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
13+ <AdditionalDependencies>bcrypt.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
14 <RandomizedBaseAddress>true</RandomizedBaseAddress>
15 </Link>
16 </ItemDefinitionGroup>
17--- a/build_msvc/vcpkg.json
18+++ b/build_msvc/vcpkg.json
19@@ -15,7 +15,7 @@
20 "overrides": [
21 {
22 "name": "libevent",
23- "version": "2.1.12#7"
24+ "version": "2.1.12+20230128"
25 }
26 ]
27 }
Here is an example of a CI log demonstrating the issue: https://github.com/hebasto/bitcoin/actions/runs/9064987376/job/24904490588:
0Run http_request with args ['D:\\a\\bitcoin\\bitcoin\\src\\fuzz.exe', WindowsPath('D:/a/_temp/qa-assets/fuzz_seed_corpus/http_request')]
1Target ['D:\\a\\bitcoin\\bitcoin\\src\\fuzz.exe', WindowsPath('D:/a/_temp/qa-assets/fuzz_seed_corpus/http_request')] failed with exit code 3221225477